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...
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. |
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.
RAIN.Core.Kinematic.Kinematic | ( | Kinematic | kcopy | ) |
Copy Constructor.
kcopy | The Kinematic to copy |
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.
acceleration | acceleration to add |
angularAcceleration | angular 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.
acceleration | acceleration to store |
angularAcceleration | angular 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.
deltaTime | timestep in seconds, used to factor calculations |
void RAIN.Core.Kinematic.Zero | ( | ) |
Zero will clear out the Kinematic and reset all values to zero.
Vector3 RAIN.Core.Kinematic.Acceleration [get, set] |
Linear acceleration vector Acceleration is capped by MaxAcceleration.
Vector3 RAIN.Core.Kinematic.AngularAcceleration [get, set] |
Angular acceleration vector Angular acceleration is capped by MaxAngularAcceleration.
float RAIN.Core.Kinematic.MaxAcceleration [get, set] |
MaxAcceleration represents the maximum acceleration that can be applied based on overall magnitude (not per axis)
float RAIN.Core.Kinematic.MaxAngularAcceleration [get, set] |
MaxAngularAcceleration represents the max rotational acceleration that can be applied based on overall magnitude (not per axis)
bool RAIN.Core.Kinematic.MaxAppliesToY [get, set] |
MaxAppliesToY determines whether the Y axis is considered when limiting acceleration and velocity to max values.
float RAIN.Core.Kinematic.MaxRotationRate [get, set] |
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.
float RAIN.Core.Kinematic.Speed [get] |
Speed is the magnitude of the velocity vector.
float RAIN.Core.Kinematic.StepUpHeight [get, set] |
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.