C# Class BEPUphysicsDemos.SampleCode.UprightSpring

Spring that attempts to keep a target entity oriented in a given direction by applying corrective torques.
Inheritance: Updateable, IDuringForcesUpdateable
Show file Open project: karolkuna/Time-Series-Prediction-Using-Neural-Networks

Public Methods

Method Description
UprightSpring ( Entity entity, Vector3 upVector, float minimumAngle, float maximumAngle, float correctionFactor ) : System

Constructs a constraint to keep entities upright.

Private Methods

Method Description
IDuringForcesUpdateable ( float dt ) : void

Updates the upright constraint. Called automatically by its owning space.

Method Details

UprightSpring() public method

Constructs a constraint to keep entities upright.
public UprightSpring ( Entity entity, Vector3 upVector, float minimumAngle, float maximumAngle, float correctionFactor ) : System
entity Entity Entity to try to keep upright.
upVector Vector3 Direction to try to orient the entity with.
minimumAngle float Minimum angle between the car's transformed up vector and the actual up vector /// before the constraint begins to apply forces.
maximumAngle float Maximum angle between the car's transformed up vector and the actual up vector /// past which the constraint 'gives up' and lets the entity tumble.
correctionFactor float Factor of the orientation error to apply in angular velocity each frame.
return System