Gravity Engine 12.0
Unity Asset for Gravity
|
Custom force. Sample code to show how to make a custom force. To use this set the GE force delegate to custom and attach this script to the object holding the GravityEngine. More...
Public Member Functions | |
double | CalcPseudoForce (double r_sep, int i, int j, GravityState.NbodyState[] nbodyStates) |
acceleration = a * ln(b * r) | |
double | CalcPseudoForceDot (double r_sep, int i, int j, GravityState.NbodyState[] nbodyStates) |
double[] | CalcAccelerationIJPerM (double[] rji, int i, int j, GravityState.NbodyState[] nbodyStates) |
Calculate the acceleration between bodies i and j. | |
double[] | CalcAccelerationIPerParticle (double[] rji, int i, GravityState.NbodyState[] nbodyStates) |
double[] | CalcJerkIJPerM (double[] rji, int i, int j, GravityState.NbodyState[] nbodyStates) |
double[] | CalcAccelerationIJPerM (double[] rji, int i, int j, GravityState.NbodyState[] nbodyStates) |
Calculate the acceleration between bodies i and j. | |
double[] | CalcAccelerationIPerParticle (double[] rji, int i, GravityState.NbodyState[] nbodyStates) |
double[] | CalcJerkIJPerM (double[] rji, int i, int j, GravityState.NbodyState[] nbodyStates) |
Public Attributes | |
float | a = 2.0f |
float | b = 1.0f |
Custom force. Sample code to show how to make a custom force. To use this set the GE force delegate to custom and attach this script to the object holding the GravityEngine.
double[] CustomForce.CalcAccelerationIJPerM | ( | double[] | rji, |
int | i, | ||
int | j, | ||
GravityState.NbodyState[] | nbodyStates | ||
) |
Calculate the acceleration between bodies i and j.
Return the aij and aji accelerations because in some case (e.g one is oblate) they will not be equal and opposite!
rji | |
i | |
j | |
nbodyStates |
Implements IForceDelegate.
double[] CustomForce.CalcAccelerationIPerParticle | ( | double[] | rji, |
int | i, | ||
GravityState::NbodyState[] | nbodyStates | ||
) |
Implements IForceDelegate.
double[] CustomForce.CalcJerkIJPerM | ( | double[] | rji, |
int | i, | ||
int | j, | ||
GravityState::NbodyState[] | nbodyStates | ||
) |
Implements IForceDelegate.
double CustomForce.CalcPseudoForce | ( | double | r_sep, |
int | i, | ||
int | j, | ||
GravityState::NbodyState[] | nbodyStates | ||
) |
acceleration = a * ln(b * r)
r_sep | R sep. The distance between the bodies |
i | index of one pair in force (i < j) |
j | index of second pair in force |