Tanoda
Leap.Unity.Examples.Spaceship Class Reference

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...

Inheritance diagram for Leap.Unity.Examples.Spaceship:

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]
 

Detailed Description

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.

Member Function Documentation

◆ AddForce()

void Leap.Unity.Examples.Spaceship.AddForce ( Vector3  force)

Definition at line 123 of file Spaceship.cs.

◆ AddForceAtPosition()

void Leap.Unity.Examples.Spaceship.AddForceAtPosition ( Vector3  force,
Vector3  position 
)

Definition at line 127 of file Spaceship.cs.

◆ AddShipAlignedForce()

void Leap.Unity.Examples.Spaceship.AddShipAlignedForce ( Vector3  shipAlignedForce)

Definition at line 146 of file Spaceship.cs.

◆ AddShipAlignedTorque()

void Leap.Unity.Examples.Spaceship.AddShipAlignedTorque ( Vector3  shipAlignedTorque)

Definition at line 142 of file Spaceship.cs.

Property Documentation

◆ angularVelocity

Vector3 Leap.Unity.Examples.Spaceship.angularVelocity
getset

Definition at line 62 of file Spaceship.cs.

◆ rigidbody

Rigidbody Leap.Unity.Examples.Spaceship.rigidbody
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.

◆ shipAlignedAngularVelocity

Vector3 Leap.Unity.Examples.Spaceship.shipAlignedAngularVelocity
get

Definition at line 67 of file Spaceship.cs.

◆ shipAlignedVelocity

Vector3 Leap.Unity.Examples.Spaceship.shipAlignedVelocity
get

Definition at line 57 of file Spaceship.cs.

◆ velocity

Vector3 Leap.Unity.Examples.Spaceship.velocity
getset

Definition at line 52 of file Spaceship.cs.


The documentation for this class was generated from the following file: