Public Member Functions | Properties
RAIN.Core.Kinematic Class Reference

Kinematic is used to define physical information about an object or about the AI. This includes position and orientation, rotation and velocity, and acceleration. Kinematic is also used to combine and apply forces. More...

List of all members.

Public Member Functions

 Kinematic ()
 Constructor.
 Kinematic (Kinematic kcopy)
 Copy Constructor.
void Zero ()
 Zero will clear out the Kinematic and reset all values to zero.
void SetForces (Vector3 acceleration, Vector3 angularAcceleration)
 SetForces causes the supplied acceleration and angular acceleration to be stored, overriding any previous stored values The forces are applied later during the Update step.
void AddForces (Vector3 acceleration, Vector3 angularAcceleration)
 AddForces adds the supplied acceleration and angular acceleration to any stored values. This is used, for example, to combine steering behaviors. Values are not capped to MaxAcceleration or MaxAngularAcceleration during storage, so interim values can exceed the limits.
void SetVelocity (Vector3 velocity, Vector3 rotation)
void SetLinearVelocity (Vector3 velocity)
void SetAngularVelocity (Vector3 rotation)
Vector3 LerpLinearVelocity (Vector3 velocity, float ratio)
Vector3 LerpAngularVelocity (Vector3 rotation, float ratio)
void AddVelocity (Vector3 velocity, Vector3 rotation, bool reduceExisting)
void Update (float deltaTime)
 Update causes new position, orientation, velocity, and rotation to be updated based on current velocity, rotation, acceleration, and angularacceleration values Stored values recorded by SetForces or AddForces are NOT applied. Acceleration and AngularAcceleration are updated to stored values after the Update is applied.

Properties

Vector3 Position [get, set]
 Position vector.
Vector3 Orientation [get, set]
 Orientation vector - what some others call "Rotation".
Vector3 Velocity [get, set]
 Linear Velocity vector Velocity is capped by MaxSpeed.
float Speed [get]
 Speed is the magnitude of the velocity vector.
Vector3 Rotation [get, set]
 Rotation vector - rotation is angular velocity Rotation is capped by MaxRotationRate.
Vector3 Acceleration [get, set]
 Linear acceleration vector Acceleration is capped by MaxAcceleration.
Vector3 AngularAcceleration [get, set]
 Angular acceleration vector Angular acceleration is capped by MaxAngularAcceleration.
bool MaxAppliesToY [get, set]
 MaxAppliesToY determines whether the Y axis is considered when limiting acceleration and velocity to max values.
float MaxSpeed [get, set]
 MaxSpeed represents the velocity limit (not per axis)
float MaxRotationRate [get, set]
 MaxRotationRate represents the rotation rate limit based on overall magnitude (not per axis)
float MaxAcceleration [get, set]
 MaxAcceleration represents the maximum acceleration that can be applied based on overall magnitude (not per axis)
float MaxAngularAcceleration [get, set]
 MaxAngularAcceleration represents the max rotational acceleration that can be applied based on overall magnitude (not per axis)
float StepUpHeight [get, set]
 StepUpHeight represents the max distance along the positive y axis the AI can move directly.

Detailed Description

Kinematic is used to define physical information about an object or about the AI. This includes position and orientation, rotation and velocity, and acceleration. Kinematic is also used to combine and apply forces.


Constructor & Destructor Documentation

Constructor.

Copy Constructor.

Parameters:
kcopyThe Kinematic to copy

Member Function Documentation

void RAIN.Core.Kinematic.AddForces ( Vector3  acceleration,
Vector3  angularAcceleration 
)

AddForces adds the supplied acceleration and angular acceleration to any stored values. This is used, for example, to combine steering behaviors. Values are not capped to MaxAcceleration or MaxAngularAcceleration during storage, so interim values can exceed the limits.

Parameters:
accelerationacceleration to add
angularAccelerationangular accleration to add
void RAIN.Core.Kinematic.SetForces ( Vector3  acceleration,
Vector3  angularAcceleration 
)

SetForces causes the supplied acceleration and angular acceleration to be stored, overriding any previous stored values The forces are applied later during the Update step.

Parameters:
accelerationacceleration to store
angularAccelerationangular acceleration to store
void RAIN.Core.Kinematic.Update ( float  deltaTime)

Update causes new position, orientation, velocity, and rotation to be updated based on current velocity, rotation, acceleration, and angularacceleration values Stored values recorded by SetForces or AddForces are NOT applied. Acceleration and AngularAcceleration are updated to stored values after the Update is applied.

Parameters:
deltaTimetimestep in seconds, used to factor calculations

Zero will clear out the Kinematic and reset all values to zero.


Property Documentation

Linear acceleration vector Acceleration is capped by MaxAcceleration.

Angular acceleration vector Angular acceleration is capped by MaxAngularAcceleration.

MaxAcceleration represents the maximum acceleration that can be applied based on overall magnitude (not per axis)

MaxAngularAcceleration represents the max rotational acceleration that can be applied based on overall magnitude (not per axis)

MaxAppliesToY determines whether the Y axis is considered when limiting acceleration and velocity to max values.

MaxRotationRate represents the rotation rate limit based on overall magnitude (not per axis)

float RAIN.Core.Kinematic.MaxSpeed [get, set]

MaxSpeed represents the velocity limit (not per axis)

Vector3 RAIN.Core.Kinematic.Orientation [get, set]

Orientation vector - what some others call "Rotation".

Vector3 RAIN.Core.Kinematic.Position [get, set]

Position vector.

Vector3 RAIN.Core.Kinematic.Rotation [get, set]

Rotation vector - rotation is angular velocity Rotation is capped by MaxRotationRate.

Speed is the magnitude of the velocity vector.

StepUpHeight represents the max distance along the positive y axis the AI can move directly.

Vector3 RAIN.Core.Kinematic.Velocity [get, set]

Linear Velocity vector Velocity is capped by MaxSpeed.