grabber derived from ygTransform | Example | Source | Header |
Messages |
toggle | string | toggle the grab/drop state with respect to a node |
grab | node | grab a node and move with repect to that node |
drop | [string] | drop connection with a node or any node grabbed |
Events |
grab | node | |
drop | node |
Comments |
constructor grabber
destructor ~grabber
method reset
1 reset matrix to identity
2 reset node pointer
method message
1 toggle the grab/drop state with respect to a node
2 grab a node and move with repect to that node
3 drop connection with a node or any node grabbed
method grab
1 if the node has been found
1.1Now we calculate the relative matrix between the node and this object We use the following formula to calculate our matrix... -1 matrix = M * M self node
1.2 Set this instance as "grabbed"
method drop
1 if a node is being tracked then drop
method app
0.1If we're still grabbed, move us and our node with the node -1 M = matrix * M * M node parent
0.2 Get the node's transformation matrix
0.3 Get our object's transformation matrix relative to the world
0.4 Set the new transformation and return