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
constructor Create(AOwner: TComponent); override; |
|
destructor Destroy; override; |
|
function PropertySections(const PropertyName: String): TPropertySections; 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
constructor Create(AOwner: TComponent); override; |
|
destructor Destroy; override; |
|
function PropertySections(const PropertyName: String): TPropertySections; override; |
|
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 PreciseCollisions: Boolean read FPreciseCollisions write SetPreciseCollisions default false; |
|
Resolve collisions precisely with the primitive geometry. When this is |
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.