Gorilla.Physics.Types Unit Reference

Overview

The Gorilla.Physics.Types unit defines all types, enumerations, and records used by the Gorilla3D physics system: driver types, body types, collider kinds, collider settings, joint types, motor types, and joint prefabs.

Enumerations

TGorillaPhysicsDriverType

Value Description
Q3Physics Q3 Physics Engine (default)
JOLTPhysics JOLT Physics Engine
CustomPhysics Custom physics driver

TGorillaPhysicsColliderKind

Value Description
ckBox Box collider
ckSphere Sphere collider
ckCapsule Capsule collider
ckParticle Particle collider
ckMesh Mesh collider
ckTerrain Terrain collider
ckCylinder Cylinder collider (JOLT only)
ckCone Cone collider (JOLT only)
ckConvexHull Convex hull collider (JOLT only)

TGorillaPhysicsBodyType

Value Description
eStaticBody Immovable body. Use for floors, walls
eKinematicBody Moved by code, not affected by forces. Use for platforms, character controllers
eDynamicBody Fully simulated by physics. Use for most interactive objects

TGorillaPhysicsBodyState

Set type (TGorillaPhysicsBodyStates) with flags:

Value Description
eAwake Body is awake
eActive Body is active
eAllowSleep Body can sleep
eIsland Body is in an island
eStatic Static body
eDynamic Dynamic body
eKinematic Kinematic body
eLockRotAxisX/Y/Z Lock rotation on X/Y/Z axis
eLockMoveAxisX/Y/Z Lock translation on X/Y/Z axis

TGorillaPhysicsJointType

Value Description Notes
Fixed Constrains two bodies together
BallAndSocket Free rotation on all axes (shoulder/hip)
Hinge Free rotation on one axis (wheel, carousel)
LimitedHinge Limited rotation on one axis (finger, knee)
Prismatic Sliding motion on one axis (sliding door)
StiffSpring Fixed distance between two bodies
Magnet Magnetic attraction based on mass
Buoyancy Floating body simulation
Point Point constraint JOLT only
SixDOF Six degrees of freedom JOLT only
SwingTwist Swing and twist constraint JOLT only
Distance Distance constraint JOLT only
Cone Cone constraint JOLT only
RackAndPinion Rack and pinion JOLT only
Gear Gear constraint JOLT only
Pulley Pulley constraint JOLT only

TGorillaPhysicsMotorType

Value Description
NoMotor Motor deactivated
RotationMotor Constant rotation via quaternion
AngularVelocityMotor Increasing angular velocity
PositionMotor Drive toward a position
LinearVelocityMotor Drive at constant velocity
VelocityMotor Combined angular + linear velocity (wheels, paddlewheels)

Records

TGorillaPhysicsColliderData

Field Type Description
Friction Single Surface friction coefficient
Restitution Single Bounciness (0 = no bounce, 1 = full)
Density Single Mass density
Sensor Boolean If True, detects collisions but does not react physically

TGorillaColliderSettings

Main configuration record for creating colliders.

Field Type Description
_Type TGorillaPhysicsBodyType Body type (static/dynamic/kinematic)
LockRotAxisX/Y/Z Boolean Lock rotation per axis
LockMoveAxisX/Y/Z Boolean Lock translation per axis
LinearDamping Single Linear velocity damping
AngularDamping Single Angular velocity damping
Radius Single Override radius for capsule/sphere colliders
Size TPoint3D Override size (non-zero overrides auto-detection)
MinLinearVelocity TPoint3D Minimum linear velocity limit
MaxLinearVelocity TPoint3D Maximum linear velocity limit
MinAngularVelocity TPoint3D Minimum angular velocity limit
MaxAngularVelocity TPoint3D Maximum angular velocity limit
Slop Single Penetration depth slop
Layers Integer Collision layer mask (max 8 layers)
AllowSubColliders Boolean Allow sub-colliders
AllowSleep Boolean Allow body to sleep
Active Boolean Enable for physics computation
Data TGorillaPhysicsColliderData Friction, restitution, density, sensor
OnBeginContact TOnGorillaPhysicsCollisionEvent Per-collider begin contact event
OnEndContact TOnGorillaPhysicsCollisionEvent Per-collider end contact event

Class Methods

class function Create(AType: TGorillaPhysicsBodyType): TGorillaColliderSettings; static;
class function AutoDetectSize(APrefab, AControl, ACollType, ASize): TPoint3D; static;
class function AutoDetectRadius(APrefab, AControl, ACollType, ARadius): Single; static;
class function AutoDetectHeight(APrefab, AControl, ACollType, AHeight): Single; static;

TGorillaPhysicsJointPrefab

Design-time joint configuration (collection item).

Published Properties

Property Type Description
DisplayName String Joint name
Enabled Boolean Enable/disable the joint
LocalSpace Boolean Use local space coordinates
JointType TGorillaPhysicsJointType Joint type
ControlA TControl3D First body
ControlB TControl3D Second body
AnchorA TPosition3D Anchor on body A
AnchorB TPosition3D Anchor on body B
AxisA TPosition3D Axis for body A
AxisB TPosition3D Axis for body B
NormalA TPosition3D Normal for body A
NormalB TPosition3D Normal for body B
AntiGravity Boolean Negate gravity on joint
MinValue TPosition3D Minimum limits (LimitedHinge/Prismatic)
MaxValue TPosition3D Maximum limits (LimitedHinge/Prismatic)
BreakForce TPosition3D Force threshold for breaking
BreakTorque TPosition3D Torque threshold for breaking
Motor TGorillaPhysicsMotorType Motor type
MotorForce TPosition3D Motor force value
Stiffness Single Spring stiffness
Damping Single Spring damping
RestLength Single Spring rest length

Callback Types

TOnGorillaPhysicsCollisionEvent = procedure(ASender: TObject;
  const AOffset, ANormal: TPoint3D;
  ABody1, ABody2: TGorillaPhysicsBody) of object;

See Also