Tanoda
|
The spaceship in this example is a kinematic rigidbody with a force API, but having a rigidbody on your Interaction Manager's reference frame is entirely optional. Any moving transform can provide a frame of reference for the Interaction Manager and encompassing interfaces. More...
Public Member Functions | |
void | AddForce (Vector3 force) |
void | AddForceAtPosition (Vector3 force, Vector3 position) |
void | AddShipAlignedTorque (Vector3 shipAlignedTorque) |
void | AddShipAlignedForce (Vector3 shipAlignedForce) |
Properties | |
Rigidbody | rigidbody [get] |
The ship contains Colliders, so it is given a kinematic Rigidbody to prevent the overhead of moving Colliders every frame. More... | |
Vector3 | velocity [get, set] |
Vector3 | shipAlignedVelocity [get] |
Vector3 | angularVelocity [get, set] |
Vector3 | shipAlignedAngularVelocity [get] |
The spaceship in this example is a kinematic rigidbody with a force API, but having a rigidbody on your Interaction Manager's reference frame is entirely optional. Any moving transform can provide a frame of reference for the Interaction Manager and encompassing interfaces.
This script provides a "velocity" and "angular velocity" abstraction for the AutopilotSystem in the example, and moves the ship's transform appropriately.
The important thing when using a moving reference frame is that you move the Interaction Manager's transform before its FixedUpdate runs. This script uses the manager's OnPrePhysicalUpdate to ensure this, which it calls at the beginning of its FixedUpdate.
Definition at line 33 of file Spaceship.cs.
void Leap.Unity.Examples.Spaceship.AddForce | ( | Vector3 | force | ) |
Definition at line 123 of file Spaceship.cs.
void Leap.Unity.Examples.Spaceship.AddForceAtPosition | ( | Vector3 | force, |
Vector3 | position | ||
) |
Definition at line 127 of file Spaceship.cs.
void Leap.Unity.Examples.Spaceship.AddShipAlignedForce | ( | Vector3 | shipAlignedForce | ) |
Definition at line 146 of file Spaceship.cs.
void Leap.Unity.Examples.Spaceship.AddShipAlignedTorque | ( | Vector3 | shipAlignedTorque | ) |
Definition at line 142 of file Spaceship.cs.
|
getset |
Definition at line 62 of file Spaceship.cs.
|
get |
The ship contains Colliders, so it is given a kinematic Rigidbody to prevent the overhead of moving Colliders every frame.
Setting the rigidbody's position is not important for the Interaction Manager; only the transform's positional movement establishes a moving reference frame!
Definition at line 47 of file Spaceship.cs.
|
get |
Definition at line 67 of file Spaceship.cs.
|
get |
Definition at line 57 of file Spaceship.cs.
|
getset |
Definition at line 52 of file Spaceship.cs.