Gravity Engine 12.0
Unity Asset for Gravity
Loading...
Searching...
No Matches
SelectiveForceBase Class Referenceabstract

Base class for a selective (per-object) force that allows the force to be changed depending on which two objects are interacting. More...

Inheritance diagram for SelectiveForceBase:
IForceDelegate SelectiveNewton

Classes

class  ShowForceCommand
 

Public Member Functions

abstract double[] CalcAccelerationIJPerM (double[] rji, int i, int j, GravityState.NbodyState[] nbodyStates)
 Calculate the acceleration between bodies i and j.
 
abstract double[] CalcAccelerationIPerParticle (double[] rji, int i, GravityState.NbodyState[] nbodyStates)
 
abstract double[] CalcJerkIJPerM (double[] rji, int i, int j, GravityState.NbodyState[] nbodyStates)
 
void ForceSelection (NBody body1, NBody body2, bool useForce)
 Configure force selection between body1 and body2. If body 2 is NULL this indicates that the useForce value should be applied to body1's interaction with all other bodies (massive and massless).
 
void Init (int numMassive)
 
void RemoveBody (int index)
 
void IncreaseToSize (int newSize)
 
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)
 

Protected Attributes

bool[,] excludeForce
 

Detailed Description

Base class for a selective (per-object) force that allows the force to be changed depending on which two objects are interacting.

Can be used e.g. to exclude some objects from the influnce of others or to allow some objects to have a different force than others.

Selective forces only operate on massive forces. If massless objects are present the GE must be configured with "Optimize Massless" set to false.

Member Function Documentation

◆ CalcAccelerationIJPerM()

abstract double[] SelectiveForceBase.CalcAccelerationIJPerM ( double[]  rji,
int  i,
int  j,
GravityState.NbodyState[]  nbodyStates 
)
pure virtual

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!

Parameters
rji
i
j
nbodyStates
Returns

Implements IForceDelegate.

Implemented in SelectiveNewton.

◆ CalcAccelerationIPerParticle()

abstract double[] SelectiveForceBase.CalcAccelerationIPerParticle ( double[]  rji,
int  i,
GravityState.NbodyState[]  nbodyStates 
)
pure virtual

Implements IForceDelegate.

◆ CalcJerkIJPerM()

abstract double[] SelectiveForceBase.CalcJerkIJPerM ( double[]  rji,
int  i,
int  j,
GravityState.NbodyState[]  nbodyStates 
)
pure virtual

Implements IForceDelegate.

◆ ForceSelection()

void SelectiveForceBase.ForceSelection ( NBody  body1,
NBody  body2,
bool  useForce 
)

Configure force selection between body1 and body2. If body 2 is NULL this indicates that the useForce value should be applied to body1's interaction with all other bodies (massive and massless).

Body1 must be massive.

Parameters
body1
body2
useForce

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