Gravity Engine  1.5
Unity Asset for Gravity
CustomForce Class Reference

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

Inheritance diagram for CustomForce:
IForceDelegate

Public Member Functions

double CalcF (double r_sep)
 acceleration = a * ln(b * r) More...
 
double CalcFdot (double r_sep)
 Calculates the time derivitive of the force law This function is required only by the Hermite algorithm. If Leapfrog is used it can be stubbed out. More...
 

Public Attributes

float a = 2.0f
 
float b = 1.0f
 

Detailed Description

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

Member Function Documentation

double CustomForce.CalcF ( double  r_sep)

acceleration = a * ln(b * r)

Returns
The accel.
Parameters
m2M2.
r_sepR sep. The distance between the bodies

Implements IForceDelegate.

double CustomForce.CalcFdot ( double  r_sep)

Calculates the time derivitive of the force law This function is required only by the Hermite algorithm. If Leapfrog is used it can be stubbed out.

e.g. for Newtonian (1/R^2) gravity

Returns
The jerk.
Parameters
m2M2.
r_sepR sep.

Implements IForceDelegate.


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