grabNavigator derived from ygCAVENavigator Example Source Header

Description: a navigator that can grab and move with respect to another node

notes:
Category: User
Author: Alex Hill
11/01/01
Revision: 07/01/06 Alex Hill - reworked to allow overiding and locked speed to navigator speed

    Messages
toggle string toggle the grab/drop state with respect to a node
grab string, [grab | teleport | move] grab a node and move with repect to that node
drop [string] drop connection with a node or any node grabbed
mode [grab | move | teleport] switch modes or reset to grab mode
distanceEasin float distance at which easin begins
headingEasin float degrees at which easin begins
headingDistance float distance at which heading changes begin
override [bool] set override of user control flag
    Events
grab node
drop node
arrived node
    Comments

constructor grabNavigator

destructor ~grabNavigator

method reset

1 reset node pointer
2 set mode to grab
3 set the distance easin to 1.0ft
4 set the heading easin to 5.0deg
5 set the heading distance to 5.0ft
6 set control override to true

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
4 switch modes or reset to grab mode
5 distance at which easin begins
6 degrees at which easin begins
7 distance at which heading changes begin
8 set override of user control flag

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 calculate the relative matrix

method drop

1 if a node is being tracked then drop

method app

0.0.1 if mode is teleport
0.0.1.1 get node matrix
0.0.1.2 get node position
0.0.1.3 get node heading
0.0.1.4 set new position and heading
0.0.1.1 get node matrix
0.0.1.2 get node position
0.0.1.3 get node heading
0.0.1.4 get delta position
0.0.1.5 calculate the new move based on navigation speed
0.0.1.6 calculate the new heading based on rotation speed
0.0.1.7 set new position and heading
0.0.1.1 get node matrix
0.0.1.2 get new navigation matrix
0.0.1.3 get new position
0.0.1.4 get new heading
0.0.1.5 set new position and heading