Class TPhysicsProperties

Unit

Declaration

type TPhysicsProperties = class(TComponent)

Description

Configure physics simulation calculation.

Hierarchy

  • TObject
  • TPersistent
  • TComponent
  • TPhysicsProperties

Overview

Fields

Public nested const DefaultAngularVelocityRK4Integration = false;
Public nested const DefaultLinearVelocityRK4Integration = false;
Public nested const DefaultFrequency = 60.0;
Public nested const DefaultMaxPhysicsTicksPerUpdate = 5;
Public nested const DefaultGravityStrength = 9.81;
Public nested const DefaultContinuousCollisionDetection = true;

Methods

Public constructor Create(AOwner: TComponent); override;
Public destructor Destroy; override;

Properties

Published property AngularVelocityRK4Integration: Boolean read FAngularVelocityRK4Integration write SetAngularVelocityRK4Integration default DefaultAngularVelocityRK4Integration;
Published property LinearVelocityRK4Integration: Boolean read FLinearVelocityRK4Integration write SetLinearVelocityRK4Integration default DefaultLinearVelocityRK4Integration;
Published property Frequency: Single read FFrequency write SetFrequency default DefaultFrequency;
Published property GravityStrength: Single read FGravityStrength write FGravityStrength default DefaultGravityStrength;
Published property MaxPhysicsTicksPerUpdate: Cardinal read FMaxPhysicsTicksPerUpdate write FMaxPhysicsTicksPerUpdate default DefaultMaxPhysicsTicksPerUpdate;
Published property ContinuousCollisionDetection: Boolean read FContinuousCollisionDetection write SetContinuousCollisionDetection default DefaultContinuousCollisionDetection;
Published property LayerCollisions: TCastleLayerCollisions read FLayerCollisions write FLayerCollisions;
Published property LayerNames: TCastleLayerNames read FLayerNames write FLayerNames;

Description

Fields

Public nested const DefaultAngularVelocityRK4Integration = false;

This item has no description.

Public nested const DefaultLinearVelocityRK4Integration = false;

This item has no description.

Public nested const DefaultFrequency = 60.0;

This item has no description.

Public nested const DefaultMaxPhysicsTicksPerUpdate = 5;

This item has no description.

Public nested const DefaultGravityStrength = 9.81;

This item has no description.

Public nested const DefaultContinuousCollisionDetection = true;

This item has no description.

Methods

Public constructor Create(AOwner: TComponent); override;

This item has no description.

Public destructor Destroy; override;

This item has no description.

Properties

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

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

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

Published property GravityStrength: Single read FGravityStrength write FGravityStrength default DefaultGravityStrength;

Physics gravity is set using the -GravityUp vector (from main camera) multiplied with GravityStrength.

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

Published property ContinuousCollisionDetection: Boolean read FContinuousCollisionDetection write SetContinuousCollisionDetection default DefaultContinuousCollisionDetection;

Should engine use continous collision detection (CCD).

Published property LayerCollisions: TCastleLayerCollisions read FLayerCollisions write FLayerCollisions;

Which layers collide with each other.

Published property LayerNames: TCastleLayerNames read FLayerNames write FLayerNames;

Name and a descriptions of layers.


Generated by PasDoc 0.16.0-snapshot.