grabber derived from ygTransform Example Source Header

Description: a transform that moves with respect to a wand or other transformed node

notes:
Category: Transformation
Author: Alex Hill
Revision: 11/01/01

    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.1
Now 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.1
If 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