Gravity Engine  1.5
Unity Asset for Gravity
NBody Class Reference

N body. More...

Inheritance diagram for NBody:

Public Member Functions

void Awake ()
 
float CalculateSize ()
 
void UpdateVelocity ()
 Updates the velocity. The Gravity Engine does not copy back velocity updates during evolution. Calling this method causes an update to the scaled velocity. More...
 
void ApplyScale (float lengthScale, float velocityScale)
 Rescale with specified lengthScale. More...
 

Static Public Member Functions

static bool IsIndependent (NBody nbody)
 

Public Attributes

float mass
 mass of object (mass scale in GravityEngine will be applied to get value used in simulation)
 
Vector3 vel
 Velocity - as set in the inspector.
 
Vector3 vel_scaled
 Velocity adjusted for the units/scale chosen by Gravity Engine.
 
Vector3 initialPos
 The initial position/velocity This indicates the position in the active units used by the Gravity engine (m or AU). If the units are DIMENSIONLESS, then this field is not active and the transform position is not affected by scaling. More...
 
bool automaticParticleCapture = true
 Automatically detect particle capture size from a child with a mesh.
 
double size = 0.1
 Particle capture radius. Particles closer than this will be inactivated.
 
GravityEngine.EngineRef engineRef
 Opaque data maintained by the GravityEngine. Do not modify.
 

Detailed Description

N body.

Specifies the information required for NBody physics evolution of the associated game object.

Member Function Documentation

void NBody.ApplyScale ( float  lengthScale,
float  velocityScale 
)

Rescale with specified lengthScale.

Parameters
lengthScaleLength scale.
velocityScaleLength scale.
void NBody.UpdateVelocity ( )

Updates the velocity. The Gravity Engine does not copy back velocity updates during evolution. Calling this method causes an update to the scaled velocity.

Member Data Documentation

Vector3 NBody.initialPos

The initial position/velocity This indicates the position in the active units used by the Gravity engine (m or AU). If the units are DIMENSIONLESS, then this field is not active and the transform position is not affected by scaling.

When m or AU are active, a change in the scale factor of the gravity engine in the editor will change all the associated transform positions and velocities but the initialPos/initialVel will not be changed.

Positions are affected by changes in the lengthScale Velocities are affected by changes in both the length scale and the timeScale. (See ApplyScale() )


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