MoveLookTarget is a class that supports multiple representations of a possible target position, including a Transform (GameObject), Kinematic (like those used by Agents), or simple Vector3. More...
Public Types | |
enum | MoveLookTargetType { NONE, TRANSFORM, KINEMATIC, VECTOR } |
An enumeration of supported representations. More... | |
Public Member Functions | |
Kinematic | GetMoveTarget (float deltaTime) |
Returns the move target as a RAIN Kinematic. This includes position at a minimum. If SaveLastPosition has been called, then GetMoveTarget will calculate a velocity for TRANSFORM and VECTOR targets based on the deltaTime passed in. For KINEMATIC targets, the information stored in the Kinematic is used directly. | |
void | SaveLastPosition () |
Saves the current target position as the last position. This is used for calculating velocities in GetMoveTarget. Example: Call SaveLastPosition to store the current position. On the next timestep, call GetMoveTarget(deltaTime). Velocity will be calculated as the difference in positions between current and last divided by timestep. | |
Properties | |
MoveLookTargetType | TargetType [get, set] |
Target type property accessor. | |
Transform | TransformTarget [get, set] |
Transform target accessor. If setting the value, the TargetType will be set to TRANSFORM. | |
Kinematic | KinematicTarget [get, set] |
Kinematic target accessor. If setting the value, the TargetType will be set to KINEMATIC. | |
Vector3 | VectorTarget [get, set] |
Vector target accessor. If setting the value, the TargetType will be set to VECTOR. |
MoveLookTarget is a class that supports multiple representations of a possible target position, including a Transform (GameObject), Kinematic (like those used by Agents), or simple Vector3.
An enumeration of supported representations.
Kinematic RAIN.Path.MoveLookTarget.GetMoveTarget | ( | float | deltaTime | ) |
Returns the move target as a RAIN Kinematic. This includes position at a minimum. If SaveLastPosition has been called, then GetMoveTarget will calculate a velocity for TRANSFORM and VECTOR targets based on the deltaTime passed in. For KINEMATIC targets, the information stored in the Kinematic is used directly.
deltaTime | The time elapsed (in seconds) since the last SaveLastPosition call. Used to calculate velocity. |
void RAIN.Path.MoveLookTarget.SaveLastPosition | ( | ) |
Saves the current target position as the last position. This is used for calculating velocities in GetMoveTarget. Example: Call SaveLastPosition to store the current position. On the next timestep, call GetMoveTarget(deltaTime). Velocity will be calculated as the difference in positions between current and last divided by timestep.
Kinematic RAIN.Path.MoveLookTarget.KinematicTarget [get, set] |
Kinematic target accessor. If setting the value, the TargetType will be set to KINEMATIC.
MoveLookTargetType RAIN.Path.MoveLookTarget.TargetType [get, set] |
Target type property accessor.
Transform RAIN.Path.MoveLookTarget.TransformTarget [get, set] |
Transform target accessor. If setting the value, the TargetType will be set to TRANSFORM.
Vector3 RAIN.Path.MoveLookTarget.VectorTarget [get, set] |
Vector target accessor. If setting the value, the TargetType will be set to VECTOR.