- 1 Force
- 1.1 Item Type
- 1.2 Interface
Forces describe how elements in a dynamic simulation are affected by outside influences. A force item derives from a common item type, and writes a force object to one of its channels. Simulations can then access the force interface and use it to compute the forces on its elements.
Force items all derive from a common type, a type of locator. Being a locator type means all forces have a location, which seems fairly reasonable. All forces implicitly support enable/disable, strength and inversion.
(1) SDK: LXsITYPE_FORCE, etc. defines
An item inheriting from this type writes a basic force object to the 'forceObj' channel. This is then overridden by the core implementation for the default behaviors. This includes a falloff on the force effect which can be set with a graph link.
(2) SDK: LXsGRAPH_FORCEFALLOFF define
#define LXsGRAPH_FORCEFALLOFF "forceFalloff"
The force interface allows clients to compute forces from positions and other element features.
(3) SDK: LXu_FORCE define
#define LXu_FORCE "A712DF74-0DD4-4D8C-87B7-CDF66D4E6848"
Get flag bits describing the force. A force can require velocity or mass as an input, and can optionally generate angular forces.
(4) SDK: Force::Flags
(5) SDK: LXfFORCE_VELOCITY, etc. defines
These single point methods are optimized for computing a force for a single element. Any given force only needs to implement one of these based on the flags above. The client is required to call the right API.
(6) SDK: Force::Force, etc.
LXxMETHOD( LxResult, Force) ( LXtObjectID self, const LXtFVector pos, LXtFVector force); LXxMETHOD( LxResult, ForceV) ( LXtObjectID self, const LXtFVector pos, const LXtFVector velocity, LXtFVector force); LXxMETHOD( LxResult, ForceM) ( LXtObjectID self, const LXtFVector pos, float mass, LXtFVector force); LXxMETHOD( LxResult, ForceVM) ( LXtObjectID self, const LXtFVector pos, const LXtFVector velocity, float mass, LXtFVector force);
Computing forces over multiple elements is more efficiently done using runs which are arrays of floats. Anything not requested by the flags will be unset. Angular forces can only be computed in runs.
(7) SDK: Force::ForceRun, etc.
LXxMETHOD( LxResult, ForceRun) ( LXtObjectID self, const float **pos, const float **velocity, const float *mass, float **force, unsigned num); LXxMETHOD( LxResult, ForceRunAng) ( LXtObjectID self, const float **pos, const float **velocity, const float **angVel, const float *mass, float **force, float **torque, unsigned num);
(8) SDK: empty Force User Class
Empty Force Python user class.
(9) PY: empty Force user class