Component List - JohnMcCaffery/NuiLib GitHub Wiki
All the components currently implemented. Divided into Scalars, Vectors and Conditions.
Scalars - back to top | |||
Name | Access | Description | Arguments |
Sum | op1 + op2 | Arithmetic Sum | op1(Scalar/float), op2(Scalar/float) |
Difference | op1 - op2 | Arithmetic Difference | op1(Scalar/float), op2(Scalar/float) |
Product | op1 * op2 | Arithmetic Product | op1(Scalar/float), op2(Scalar/float) |
Quotient | op1 / op2 | Arithmetic Quotient | op1(Scalar/float), op2(Scalar/float) |
Sum equals | op1 += op2 | Arithmetic Sum then Store in op1 | op1(Scalar/float), op2(Scalar/float) |
Difference equals | op1 -= op2 | Arithmetic Difference then Store in op1 | op1(Scalar/float), op2(Scalar/float) |
Product equals | op1 *= op2 | Arithmetic Product then Store in op1 | op1(Scalar/float), op2(Scalar/float) |
Quotient equals | op1 /= op2 | Arithmetic Quotient then Store in op1 | op1(Scalar/float), op2(Scalar/float) |
X component | x(vector) | The x component of a Vector | vector(Vector) |
Y component | y(vector) | The y component of a Vector | vector(Vector) |
Z component | z(vector) | The z component of a Vector | vector(Vector) |
Magnitude | magnitude(vector) | The magnitude of a Vector | vector(Vector) |
Dot | dot(a, b) | The dot product of two Vectors. | a(Vector), b(Vector) |
Normalize Max | normalize(input) | Normalize a scalar against the maximum value it has ever been | input(Scalar) |
Constrain | constrain(input, deadzone, range, grace, mirror) | Constrain an input to between 0 and 1. Constraining is done based on a specific range between deadzone and deadzone + range. Less than deadzone = 0. Deadzone to Deadzone + Range = 0 to 1. Deadzone+Range to Deadzone+Range+Grace = 1. More than Deadzone+Range+Grace = 0. Input can be mirrored (absolute values used so that negative values are constrained in an inverse of positive values) or not. | input(Scalar), deadzone(Scalar/float), range(Scalar/float), grace(Scalar/float), mirror(bool) |
Absolute Value | abs(input) | Take the absolute value of a scalar. | input(Scalar) |
Invert | invert(condition) | Invert based on a condition. If the condition is true, value is -1, otherwise value is 1. | condition(Condition) |
Delta | delta(input) | The change in a scalar between the last value and the current value. | input(Scalar) |
Project | project(a, b) | The scalar projection of vector a onto vector b onto another. | a(Vector), b(Vector) |
If | ifscalar(condition, t, f) | Value = condition ? t : f. | condition(Condition), t(Scalar/float), f(Scalar/float) |
Tracker | tracker(title, max, scale, shift, value) | Display a window with a tracker bar whose position translates into the value of the scalar. Raw tracker values are between 0 and max. Final value is (raw * scale) + shift. Initial value is value. | title(string), max(int), scale(float), shift(float), value(int) |
Vectors - back to top | |||
Name | Access | Description | Arguments |
Sum | op1 + op2 | Arithmetic Sum. Value = (op1.x + op2.x, op1.y + op2.y, op1.z + op2.z) | op1(Vector/Point3f/float), op2(Vector/Point3f/float) |
Difference | op1 - op2 | Arithmetic Sum. Value = (op1.x - op2.x, op1.y - op2.y, op1.z - op2.z) | op1(Vector/Point3f/float), op2(Vector/Point3f/float) |
Product | op1 * op2 | Arithmetic Sum. Value = (op1.x * op2.x, op1.y * op2.y, op1.z * op2.z) | op1(Vector/Point3f/float), op2(Vector/Point3f/float) |
Quotient | op1 / op2 | Arithmetic Sum. Value = (op1.x / op2.x, op1.y / op2.y, op1.z / op2.z) | op1(Vector/Point3f/float), op2(Vector/Point3f/float) |
Sum equals | op1 += op2 | Arithmetic Sum then Store in op1. Value = (op1.x + op2.x, op1.y + op2.y, op1.z + op2.z) | op1(Vector), op2(Vector/Point3f/float) |
Difference equals | op1 -= op2 | Arithmetic Sum then Store in op1. Value = (op1.x - op2.x, op1.y - op2.y, op1.z - op2.z) | op1(Vector), op2(Vector/Point3f/float) |
Product equals | op1 *= op2 | Arithmetic Sum then Store in op1. Value = (op1.x * op2.x, op1.y * op2.y, op1.z * op2.z) | op1(Vector), op2(Vector/Point3f/float) |
Quotient equals | op1 /= op2 | Arithmetic Sum then Store in op1. Value = (op1.x / op2.x, op1.y / op2.y, op1.z / op2.z) | op1(Vector), op2(Vector/Point3f/float) |
Normalize Max | normalize(input) | Normalize a vector so its magnitude is 1. | input(Vector) |
Cross Product | cross(a, b) | The cross product of two vectors. | a(Vector), b(Vector) |
Limit | limit(vector, x, y, z) | Limit a vector to only chosen axes. Non-chosen axes are 0. Set x, y or z true to select that axis. | vector(Vector), x(bool), y(bool), z(bool) |
Delta | delta(input) | The change in each component of a vector between the last value and the current value. | input(Vector) |
Snapshot | snapshot(vector, condition) | Take a snapshot of a vector every time a condition becomes true. | vector(Vector), condition(Condition) |
Momentum | momentum(vector, condition, decrement, threshold) | As long as condition is true value is vector. As soon as the condition becomes false the final delta is used to calculate momentum. It is shifted so that it's magnitude reduces by decrement each threshold until it is less than threshold. | vector(Vector), condition(Condition), decrement(float), threshold(float) |
Scale | scale(vector, scale) | Scale a vector so it's magnitude is scale. | vectori>(Vector), scale(Scalar/float) |
Intersect | intersect(pPlane, normalPlane, pLine, dirLine) | Calculate the intersection of a point and a plane. Pplane is a point on the plane. NormalPlane is the normal to the plane. Pline is a point on the line. DirLine is the direction of the line. | pPlane(Vector), normalPlane(Vector), pLine(Vector), dirLine(Vector) |
Joint | joint(joint) | Get the 3D cartesian coordinates of a skeleton point in space. | joint(int) |
<td>Fist</td>
<td>fist(<i>rightHand</i>)</td>
<td>True if the specified hand is in a fist. Righthand = true: specify right hand. Righthand = false. Specify left hand. The algorithm used to track fists is described in <a href="http://iss.bu.edu/data/jkonrad/reports/HDTT11-04buece.pdf">this</a> paper. The implementation is loosely based on <a href="https://github.com/bmwesting/Kinect-Hand-Processing">this</a> code which is demonstrated in <a href="http://www.youtube.com/watch?v=NeHX5jzHFM4">this</a> video.</td>
<td><i>rightHand</i>(bool)</td>
</tr>
Conditions - back to top | |||
Name | Access | Description | Arguments |
Greater | op1 > op2 | True if op1 is greater than op2 | op1(Scalar/float), op2(Scalar/float) |
Less | op1 < op2 | True if op1 is less than op2 | op1(Scalar/float), op2(Scalar/float) |
Greater Equal | op1 ≥ op2 | True if op1 is greater or equal to op2 | op1(Scalar/float), op2(Scalar/float) |
Less Equal | op1 ≤ op2 | True if op1 is less or equal to op2 | op1(Scalar/float), op2(Scalar/float) |
Equal To | op1 == op2 | True if op1 is equal to op2 | op1(Scalar/float), op2(Scalar/float) |
Not Equal To | op1 != op2 | True if op1 is not equal to op2 | op1(Scalar/Point3f/float), op2(Scalar/Point3f/float) |
And | op1 && op2 | True if op1 and op2 are true | op1(Condition/bool), op2(Condition/bool) |
Or | op1 || op2 | True if op1 or op2 is true | op1(Condition/bool), op2(Condition/bool) |