Class TCastleAbstractPrimitive
Unit
Declaration
type TCastleAbstractPrimitive = class(TCastleTransform)
Description
Base class to express primitives that can be easily added and adjusted inside TCastleViewport.
Such primitives can be anything visible that can be expressed using X3D nodes (like boxes or spheres). Particular descendants of this class, like TCastleBox or TCastleSphere, define a particular primitive. Note: for things not directly visible (like lights) descending from this class is not useful. Instead descend from TCastleTransform.
Using this class is somewhat similar to using TCastleScene, and loading (using TCastleSceneCore.Load) an X3D nodes graph with appropriate primitives. In fact, that is exactly what happens internally. But using this class is simpler (it hides X3D nodes from you, although it also hides some possibilities) and you can customize such primitives using the CGE editor.
Hierarchy
- TObject
- TPersistent
- TComponent
- TCastleComponent
- TCastleTransform
- TCastleAbstractPrimitive
Overview
Methods
procedure UpdateCollider; |
|
function InternalBuildNodeInside: TObject; override; |
|
constructor Create(AOwner: TComponent); override; |
|
destructor Destroy; override; |
|
function PropertySections(const PropertyName: String): TPropertySections; override; |
|
function HasColliderMesh: Boolean; override; |
|
procedure ColliderMesh(const TriangleEvent: TTriangleEvent); override; |
Properties
property ShapeNode: TShapeNode read FShapeNode; |
|
property Color: TCastleColor read FColor write SetColor; |
|
property Material: TPrimitiveMaterial read FMaterial write SetMaterial default pmPhysical; |
|
property Texture: String read FTexture write SetTexture; |
|
property TextureNormalMap: String read FTextureNormalMap write SetTextureNormalMap; |
|
property PreciseCollisions: Boolean read FPreciseCollisions write SetPreciseCollisions default false; |
|
property RenderOptions: TCastleRenderOptions read GetRenderOptions; |
|
property ColorPersistent: TCastleColorPersistent read FColorPersistent ; |
Description
Methods
procedure UpdateCollider; |
|
Update collider, notifying it that we changed. This updates TCastleCollider with TCastleCollider.AutoSize. This also updates TCastleMeshCollider mesh, if it referred to us. |
function InternalBuildNodeInside: TObject; override; |
|
This item has no description. Showing description inherited from TCastleTransform.InternalBuildNodeInside.
Helper for InternalBuildNode. Result must be TAbstractChildNode or |
constructor Create(AOwner: TComponent); override; |
|
This item has no description. |
destructor Destroy; 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. |
function HasColliderMesh: Boolean; override; |
|
This item has no description. Showing description inherited from TCastleTransform.HasColliderMesh.
Does this transform have a collision mesh that TCastleMeshCollider can use. Default implementation returns |
procedure ColliderMesh(const TriangleEvent: TTriangleEvent); override; |
|
This item has no description. Showing description inherited from TCastleTransform.ColliderMesh.
Enumerate triangles for a collision mesh that TCastleMeshCollider can use. Always the front side of triangles is CCW (this matters for TCastleMeshCollider with TCastleMeshCollider.DoubleSided = |
Properties
property ShapeNode: TShapeNode read FShapeNode; |
|
Descendants should add primitive X3D geometry node here. |
property Color: TCastleColor read FColor write SetColor; |
|
Color of the text. Opaque white by default. What exactly it means, depends on Material:
|
property Material: TPrimitiveMaterial read FMaterial write SetMaterial default pmPhysical; |
|
Material type (which determines lighting calculation) for this primitive. |
property Texture: String read FTexture write SetTexture; |
|
Texture URL. The way texture interacts with lighting depends on the Material type:
The texture mapping is done automatically, following a reasonable algorithm for the given primitive described in the X3D specification. See https://castle-engine.io/x3d_implementation_geometry3d.php for links to X3D specification. For example, https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-CD/Part01/components/geometry3D.html#Box describes how texture is applied to the 6 sides of the box. |
property TextureNormalMap: String read FTextureNormalMap write SetTextureNormalMap; |
|
Normal map texture URL. Providing normal enhances the details visible on the surface because of lighting. The normalmap texture mapping is the same as Texture mapping. |
property RenderOptions: TCastleRenderOptions read GetRenderOptions; |
|
Rendering options of the scene. |
property ColorPersistent: TCastleColorPersistent read FColorPersistent ; |
|
Color that can be visually edited in Castle Game Engine Editor, Lazarus and Delphi. Normal user code does not need to deal with this, instead read or write Color directly. See also
|
Generated by PasDoc 0.16.0-snapshot.