Class TPhysicsProperties
Unit
CastleTransform
Declaration
type TPhysicsProperties = class(TComponent)
Description
Configure physics simulation calculation.
Hierarchy
- TObject
- TPersistent
- TComponent
- TPhysicsProperties
Overview
Fields
Methods
|
constructor Create(AOwner: TComponent); override; |
Properties
Description
Fields
|
nested const DefaultAngularVelocityRK4Integration = false; |
|
|
nested const DefaultLinearVelocityRK4Integration = false; |
|
|
nested const DefaultFrequency = 60.0; |
|
|
nested const DefaultMaxPhysicsTicksPerUpdate = 5; |
|
|
nested const DefaultGravityStrength = 9.81; |
|
Methods
|
constructor Create(AOwner: TComponent); override; |
|
Properties
|
property AngularVelocityRK4Integration: Boolean read FAngularVelocityRK4Integration write SetAngularVelocityRK4Integration default DefaultAngularVelocityRK4Integration; |
Use a more precise (but also more expensive) method for simulating angular velocity. The "RK4" refers to Runge–Kutta method.
|
|
property LinearVelocityRK4Integration: Boolean read FLinearVelocityRK4Integration write SetLinearVelocityRK4Integration default DefaultLinearVelocityRK4Integration; |
Use a more precise (but also more expensive) method for simulating linear velocity. The "RK4" refers to Runge–Kutta method.
|
|
property Frequency: Single read FFrequency write SetFrequency default DefaultFrequency; |
How often should the physics simulation run in a second. Larger values increase accuracy (up to a certain point), but also increase the CPU overhead.
|
|
property GravityStrength: Single read FGravityStrength write FGravityStrength default DefaultGravityStrength; |
Physics gravity is set using the -GravityUp vector (from main camera) multiplied with GravityStrength .
|
|
property MaxPhysicsTicksPerUpdate: Cardinal read FMaxPhysicsTicksPerUpdate write FMaxPhysicsTicksPerUpdate default DefaultMaxPhysicsTicksPerUpdate; |
Non-zero value avoids the "spiral of death" when the physics takes a long time to calculate.
When the value is zero, physics makes always as many steps as necessary, to advance the time by 1 / Frequency steps. This means that if physics takes a long time to calculate, next time it will take even longer time to calculate (it will need more steps), thus we have a "spiral of death" that leads to lower and lower FPS.
|
Generated by PasDoc 0.16.0.