ygTransform derived from ygNode Example Source Header

Description: creates a transformation matrix with position, orientation, and scale

notes:
Category: Transformation
Author: Dave Pape
11/01/01
09/01/04 Alex Hill - merged with ygSimpleTransform and added "coordinates" debug
06/28/05 Alex Hill - fixed orientation update problem in setMatrix
02/01/06 Alex Hill - added logic to prevent zero size matrices and added debug display code
Revision: 07/01/06 Alex Hill - added logic to switch to unreliable messages when possible

    Messages
position three floats set the translational component
orientation three floats set the rotational component applied before translation
size three floats set the scaling component
updateInterval float set the time interval to update remote users
    Events
changed the transform has changed
    Comments

constructor ygTransform

1 create new pfDCS and set as pfnode
2 create a simple unreliable coordinate network key
3 dont include in documentation
4 dont include in documentation
5 register changed event

destructor ~ygTransform

method reset

1 if net master then set matrix to identity
1.1 reset update interval
1.2 reset last update timer

method message

1 set the translational component
2 set the rotational component applied before translation
3 set the scaling component
4 set the time interval to update remote users

method getMatrix

method getPosition

method getOrientation

method getSize

method setMatrix

method setPosition

method setOrientation

method setSize

method setSize

method app

1 adjust debug display
1.1 if bounding sphere or size has changed then update debug
2 if net master
2.1 if update interval has passed then
2.1.1 if network coord has changed then
2.1.1.1 indicate message changed
2.1.1.2 if unchanged counter is positive then
2.1.1.2.1 if counter is over threshold then set unreliable
2.1.1.2.2 set counter to zero
2.1.1.3 else initialize counter over threshold
2.1.2 else if counter is under threshold then increment
2.1.3 else if counter is at threshold then set reliable
2.1.4 if network size has changed then
2.1.4.1 indicate message changed
2.1.4.2 if unchanged counter is positive then
2.1.4.2.1 if counter is over threshold then set unreliable
2.1.4.2.2 set counter to zero
2.1.4.3 else initialize counter over threshold
2.1.5 else if counter is under threshold then increment
2.1.6 else if counter is at threshold then set reliable
2.1.1 the transform has changed

method setTransform

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