Class TCastleMeshCollider
Unit
Declaration
type TCastleMeshCollider = class(TCastleCollider)
Description
Collide as a set of triangles determined by Mesh. Add this collider to TCastleTransform behaviors, along with a TCastleRigidBody, to make the given TCastleTransform be affected by physics and collide with other physics bodies.
Make sure to set the Mesh property.
In the current implementation, this collider supports only static rigid bodies. The associated TCastleRigidBody instance (with the same TCastleTransform parent) will behave as if TCastleRigidBody.Dynamic and TCastleRigidBody.Animated are False
.
Hierarchy
- TObject
- TPersistent
- TComponent
- TCastleComponent
- TCastleBehavior
- TCastleCollider
- TCastleMeshCollider
Overview
Methods
function CreateKraftShape(const APhysics: TKraft; const ARigidBody: TKraftRigidBody): TKraftShape; override; |
|
procedure DeinitializePhysicsEngineObjects; override; |
|
function PropertySections(const PropertyName: String): TPropertySections; override; |
|
procedure DesignerWarnings(const SList: TStrings); override; |
|
procedure InternalTransformChanged(const TransformChanged: TCastleTransform); override; |
|
procedure MeshChanged; |
Properties
property Mesh: TCastleTransform read FMesh write SetMesh; |
|
property DoubleSided: Boolean read FDoubleSided write SetDoubleSided default false; |
Description
Methods
function CreateKraftShape(const APhysics: TKraft; const ARigidBody: TKraftRigidBody): TKraftShape; override; |
|
This item has no description. |
procedure DeinitializePhysicsEngineObjects; override; |
|
This item has no description. |
function PropertySections(const PropertyName: String): TPropertySections; override; |
|
This item has no description. Showing description inherited from TCastleComponent.PropertySections. Section where to show property in the editor. |
procedure DesignerWarnings(const SList: TStrings); override; |
|
This item has no description. Showing description inherited from TCastleComponent.DesignerWarnings.
Override to add warnings that should be visible at design-time. Call |
procedure InternalTransformChanged(const TransformChanged: TCastleTransform); override; |
|
This item has no description. Showing description inherited from TCastleCollider.InternalTransformChanged. Notify this collider that given TCastleTransform changed. It can provoke AutoSize recalculation (if Parent changed) or other reactions (e.g. mesh update, if TransformChanged corresponds to Mesh). |
procedure MeshChanged; |
|
Update the collider triangles to reflect current Mesh shape. This is necessary for physics engine to reflect the Mesh. We do it automatically in some circumstances (like when you change collider properties, like Mesh or DoubleSided, or when you change TCastleSceneCore.Url) but we don't try to keep the physics mesh follow the triangles every frame (as you really shouldn't change physics mesh so often, it's supposed to be a static collider). |
Properties
property Mesh: TCastleTransform read FMesh write SetMesh; |
|
It does not have to be convex. Note: The values of Mesh.Collides and Mesh.GetCollides of the assigned instance do not matter. Note: Using the TCollisionNode X3D nodes inside the assigned instance is still useful. This way the scene may collide as something different than it's visible, see https://castle-engine.io/x3d_implementation_navigation.php . |
property DoubleSided: Boolean read FDoubleSided write SetDoubleSided default false; |
|
Treat both faces sides as collidable. When this is |
Generated by PasDoc 0.16.0-snapshot.