pathRandom derived from ygTransform

Description: a transform that will move an object throught a random path inside a volume

notes:
Category: Transformation
Author: Javier I. Girado, Brenda Lopez
Revision: 11/10/01

#define DEBUG

Static functions


standard Yg template functions

    Messages
start begin random movement
stop stop random movement
speed float set the speed of the random movement between 0 and 1
box three floats, three floats set absolute box coordinates
allrot three floats, three floats, three floats
    Events
pathRandomPos str
    Comments

constructor pathRandom

destructor ~pathRandom

method reset

1 /////////////////////////
2 Defaults values //
3 /////////////////////////
4 Define box
5
6 How many points in the random path?
7
8 index and speed in indexing
9
10 First, determine initial position based on box dimensions
11 Add to that initial position a series of
12 Defualt random rotation
13
14 Define rotation angle range
15
16 set roll_min to -180, pitch_min to -180, head_min to -180
17 set roll_max to 180, pitch_max to 180, head_max to 180
18 set roll_speed, pitch_speed, head_speed to 0.1

method message

1 begin random movement
2 stop random movement
3 set the speed of the random movement between 0 and 1
4 set absolute box coordinates
4.1 get minimun
4.2 get maximun
4.3 get rot speed

method app

0.0.1 invert increment
0.0.2 return inside limits
0.1 Now the random rotation stuff
0.2
0.2.0.1 invert increment
0.2.0.2 return inside limits
0.2.0.1 invert increment
0.2.0.2 return inside limits
0.2.0.1 invert increment
0.2.0.2 return inside limits
0.3 Calculate new position and orientation
0.4 send an event with this new
0.5 position information

method setInitPos

method loadPath

1 First point is the initial position
2 Then, generate random points and add them
2.1 get a random number between minX and maxX

method interpolate

constructor pathRandomCatmullRomCurve

method setControlPoints

method value

method tangent

method computeCoefficients