valuator derived from interpolate Example Source Header

Description: an interpolate node with transformed position and orientation values

notes:
Category: Math
Author: Alex Hill
06/01/02
Revision: 07/01/06 Alex Hill - added logic to switch to unreliable messages when possible

#include #include "ygUtil.h"
    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
position three floats set the translational component
orientation three floats set the orientation component
updateInterval float set the Message update interval for remote users
    Events
grab node
grab node
    Comments

constructor valuator

1 create a simple coordinate network Message
2 dont include in documentation

destructor ~valuator

method reset

1 if net master then
1.1 reset matrix to identity
1.2 reset node pointer
1.3 reset grab flag
1.4 set position to (0,0,0)
1.5 set orientation to (0,0,0)
1.6 set matrix to identity
1.7 set update interval to 0.0
1.8 set last update time to 0.0

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 set the translational component
5 set the orientation component
6 set the Message update interval for remote users

method app

1 if net master
2 adjust debug display
2.1 if bounding sphere has changed then update debug

method calculateTransform

1 if the node has been found
1.0.1
calculate the relative matrix between the node and this object
              using the following formula:
                                      -1
              delatMatrix = M      * M
                             self     node
            

1.0.2 Set this instance as "grabbed".
1.1
move this matrix with respect to the node
                                      -1
           M = deltaMatrix * M     * M
                              node    parent
        

1.2 get the node's transformation matrix
1.3 get our object's transformation matrix relative to the world
1.4 set the new transformation and return
1.5 calculate interpolated array values

method updateTransform

1 if update interval has passed then
1.1 if network coord has changed then
1.1.1 indicate message changed
1.1.2 if unchanged counter is positive then
1.1.2.1 if counter is over threshold then set unreliable
1.1.2.2 set counter to zero
1.1.3 else initialize counter over threshold
1.2 else if counter is under threshold then increment
1.3 else if counter is at threshold then set reliable

method getMatrix

method setMatrix

method setPosition

method setOrientation

method createDebugNode

1 create cone geoset
2 create axis geoset

method setDebugCoords

1 CONE_LENGTH = sqrt(CONE_RADIUS^2 + CONE_RADIUS^2)/2
2 cone vertices
3 axis vertices