Conversation
| return Angle(tonumber(p),tonumber(y),tonumber(r)) | ||
| end | ||
| end | ||
| function parsers.QUATERNION( val ) |
There was a problem hiding this comment.
perhaps this match function should be made slightly different from the 4d vector one? maybe 1, 1i, 1j, 1k should parse as a quat? - open to better solutions, it would just be nice to have something that parses as a quat and doesnt change to 4d vector every time you change it
There was a problem hiding this comment.
don't sure would it be comfortable to use then since every type doesn't user chars to determine axis
| }, | ||
| } | ||
|
|
||
| WireLib.Quaternion = {} |
lua/wire/gates/quaternion.lua
Outdated
| } | ||
|
|
||
| GateActions["quaternion_qmod"] = { | ||
| name = "qMod", |
There was a problem hiding this comment.
is there a reason this is called qMod rather than just Mod?
| } | ||
|
|
||
| GateActions["quaternion_nlerp"] = { | ||
| name = "Nlerp", |
There was a problem hiding this comment.
maybe descriptions on slerp and nlerp to describe the difference? we have comments for every function in the wirelib quaternion "library", we could copy those in as gate descriptions
lua/wire/gates/quaternion.lua
Outdated
| } | ||
|
|
||
| GateActions["quaternion_qrotation"] = { | ||
| name = "qRotation (Axis + Angle)", |
There was a problem hiding this comment.
again, why qRotation rather than rotation?
lua/wire/gates/quaternion.lua
Outdated
| GateActions["quaternion_qi"] = { | ||
| name = "qi()", | ||
| inputs = {}, | ||
| inputtypes = {}, | ||
| outputtypes = { "QUATERNION" }, | ||
| output = function(gate) | ||
| local Q = getQ() | ||
| return Q and Q.New(0, 1, 0, 0) or { 0, 1, 0, 0 } | ||
| end, | ||
| label = function(Out) | ||
| return "qi() = " .. qfmt(Out) | ||
| end | ||
| } | ||
|
|
||
| GateActions["quaternion_qi_num"] = { | ||
| name = "qi(n)", | ||
| inputs = { "N" }, | ||
| inputtypes = { "NORMAL" }, | ||
| outputtypes = { "QUATERNION" }, | ||
| output = function(gate, N) | ||
| local Q = getQ() | ||
| return Q and Q.New(0, N or 0, 0, 0) or { 0, N or 0, 0, 0 } | ||
| end, | ||
| label = function(Out, N) | ||
| return "qi(" .. nfmt(N or 0) .. ") = " .. qfmt(Out) | ||
| end | ||
| } | ||
|
|
||
| GateActions["quaternion_qj"] = { | ||
| name = "qj()", | ||
| inputs = {}, | ||
| inputtypes = {}, | ||
| outputtypes = { "QUATERNION" }, | ||
| output = function(gate) | ||
| local Q = getQ() | ||
| return Q and Q.New(0, 0, 1, 0) or { 0, 0, 1, 0 } | ||
| end, | ||
| label = function(Out) | ||
| return "qj() = " .. qfmt(Out) | ||
| end | ||
| } | ||
|
|
||
| GateActions["quaternion_qj_num"] = { | ||
| name = "qj(n)", | ||
| inputs = { "N" }, | ||
| inputtypes = { "NORMAL" }, | ||
| outputtypes = { "QUATERNION" }, | ||
| output = function(gate, N) | ||
| local Q = getQ() | ||
| return Q and Q.New(0, 0, N or 0, 0) or { 0, 0, N or 0, 0 } | ||
| end, | ||
| label = function(Out, N) | ||
| return "qj(" .. nfmt(N or 0) .. ") = " .. qfmt(Out) | ||
| end | ||
| } | ||
|
|
||
| GateActions["quaternion_qk"] = { | ||
| name = "qk()", | ||
| inputs = {}, | ||
| inputtypes = {}, | ||
| outputtypes = { "QUATERNION" }, | ||
| output = function(gate) | ||
| local Q = getQ() | ||
| return Q and Q.New(0, 0, 0, 1) or { 0, 0, 0, 1 } | ||
| end, | ||
| label = function(Out) | ||
| return "qk() = " .. qfmt(Out) | ||
| end | ||
| } | ||
|
|
||
| GateActions["quaternion_qk_num"] = { | ||
| name = "qk(n)", | ||
| inputs = { "N" }, | ||
| inputtypes = { "NORMAL" }, | ||
| outputtypes = { "QUATERNION" }, | ||
| output = function(gate, N) | ||
| local Q = getQ() | ||
| return Q and Q.New(0, 0, 0, N or 0) or { 0, 0, 0, N or 0 } | ||
| end, | ||
| label = function(Out, N) | ||
| return "qk(" .. nfmt(N or 0) .. ") = " .. qfmt(Out) | ||
| end |
There was a problem hiding this comment.
is there a reason we have these gates? couldnt you get the same experience by just using a constant value?
full list of gates i think could be trimmed as theyre replaceable by constant value:
quat() - quaternion_quat0
qi() - quaternion_qi
qj() - quaternion_qj
qk() - quaternion_qk
and some im not so sure about,, i dont see the usage - but im not super versed with quaternions
Identity - quaternion_ident
qi(n) - quaternion_qi_num
qj(n) - quaternion_qj_num
qk(n) - quaternion_qk_num
There was a problem hiding this comment.
well, every gate category has identity, mb I'll leave it, the rest goes to void
35f60b0 to
e71f36d
Compare
- remove some gates


No description provided.