Gravity Engine  1.5
Unity Asset for Gravity
Spaceship Class Reference

Spaceship. A simple example of an object that is subject to the gravitational field and makes changes in own motion based on user input. More...

Inheritance diagram for Spaceship:

Public Attributes

float thrustPerKeypress = 1f
 Thrust scale.
 
float spinRate = 1f
 Rate of spin when arrow keys pressed (degress/update cycle)
 
Vector3 axis = Vector3.forward
 Forward direction of the ship model. Thrust us applies in opposite direction to this vector.
 
GameObject thrustCone
 Axis of thrust w.r.t. model.
 

Detailed Description

Spaceship. A simple example of an object that is subject to the gravitational field and makes changes in own motion based on user input.

Controls: Arrow Keys: spacecraft pitch and yaw Space: Pause/Resume F: Fire engine

When paused the -/= keys can be used to set a course correction that will be applied when resume is pressed.

This script is to be attached to a model that is the child of an NBody object. The GravityEngine will perform the physical updates to position and velocity.

Changes to the spaceship motion are via impulse changes to the velocity.


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