Index

BounceTerrainCollision

BounceTerrainCollision(<-currentPosition <-lastPosition <-includePseudoTerrain <-includeShield <-terrainStandoff <-reflectionScale) ->newLastPosition ->newPosition

Description

Calculates a bounce off of terrain. Given two positions that represent the current and previous positions of a moving object, this call will calculate a new position and previous position for the moving object. The new positions will calculate a colllision with any terrain and generate a reflection so that the moving object will appear to have bounced off of the terrain.

Note that if there is no terrain collision then the 'w' (the last) position in the resulting vectors will be 0 (false). It will be 1 if there was a collision. Also note that if there is no terrain collision then the resulting newPostion and newLastPosition will have x,y and z values that are equal to minFloat.

Examples

BounceTerrainCollision(<-position, <-lastPosition, false, true, 0.5, 1) ->nlp ->np
if (<-np.w)
   <-np ->position
   <-nlp ->lastPosition
endif

Index