trTypes (again)


(fretn) #1

ok, I’ve got some questions about the trTypes:

1- BG_EvaluateTrajectory & BG_EvaluateTrajectoryDelta , what’s the difference between these, and when are they exactly used ?
2- deltaTime ?
3- atTime ?
4- tr->trTime ?
5- tr->trBase ?
6- tr->trDelta ?
7- can you switch from one trType to another during the movement of an entity ?
8- some weeks ago I talked about a trType that makes an entity move down and after a time moves it up (in a parabolic movement => like a plane dat dives and goes up after a certain time), how do I start with making a trType for this ?

thanks :smile:

fretn


(digibob) #2

On 2002-08-18 12:40, fretn wrote:
ok, I’ve got some questions about the trTypes:

1- BG_EvaluateTrajectory & BG_EvaluateTrajectoryDelta , what’s the difference between these, and when are they exactly used ?
2- deltaTime ?
3- atTime ?
4- tr->trTime ?
5- tr->trBase ?
6- tr->trDelta ?
7- can you switch from one trType to another during the movement of an entity ?
8- some weeks ago I talked about a trType that makes an entity move down and after a time moves it up (in a parabolic movement => like a plane dat dives and goes up after a certain time), how do I start with making a trType for this ?

thanks :smile:

fretn

BG_EvaluateTrajectory takes a trajectory, and calculates it’s position at the time passed to the function.

BG_EvaluateTrajectoryDelta calculates the velocity of the object at a given time.

deltaTime is a fraction from 0 -> 1 stating how much of this trajectory has been completed, 0 = start 1 = end.

atTime, is the time for which you want to calculate the position/velocity

tr->trTime is the start time for the trajectory.

tr->trBase is normally the starting position for the trajectory, but basically it’s just a vector for storing some information about the trajectory

tr->trDelta is probably the amount the object would move per frame, would need to check, but again, just a vector for storing stuff

if you are going to change trajectory, you should evaluate the current trajectory first, and save that off to the ent->s.origin, and most likely, ent->s.pos.trBase

basiclaly, all you need to do to create a new trajectory, is first create a new enumeration, define it’s behaviour in BG_EvaluateTrajectory, and if needs be BG_EvaluateTrajectoryDelta, then have somewhere that sets up this trajectory for an object to test it


(fretn) #3

danka again :grin: