Class TCastleScene
Unit
Declaration
type TCastleScene = class(TCastleSceneCore)
Description
Complete loading, processing and rendering of a scene. This is a descendant of TCastleSceneCore that adds efficient rendering.
Source: scene/castlescene.pas (line 123).
Hierarchy
- TObject
- TPersistent
- TComponent
- TCastleComponent
- TCastleTransform
- TX3DEventsEngine
- TCastleSceneCore
- TCastleScene
Overview
Nested Classes and Records
| Protected | TVisibilitySensors = class(specialize TDictionary<TVisibilitySensorNode,TVisibilitySensorInstanceList>) |
Nested Types
| Protected | TVisibilitySensorInstanceList = specialize TObjectList<TVisibilitySensorInstance>; |
Constants
| Public | DefaultMiddleHeight = 0.5; |
| Public | DefaultDirection: array [TOrientationType] of TVector3 = (
(X: 0; Y: 0; Z: -1),
(X: 0; Y: 0; Z: +1),
(X: 0; Y: -1; Z: 0),
(X: 1; Y: 0; Z: 0)
); |
| Public | DefaultUp: array [TOrientationType] of TVector3 = (
(X: 0; Y: 1; Z: 0),
(X: 0; Y: 1; Z: 0),
(X: 0; Y: 0; Z: 1),
(X: 0; Y: 0; Z: 1)
); |
| Public | DefaultCameraOrientation = otUpYDirectionMinusZ; |
| Public | DefaultShadowMapsDefaultSize = 256; |
Fields
| Public | class var DefaultOrientation: TOrientationType; |
| Public | InternalExcludeFromParentBoundingVolume: Boolean; |
| Protected | ScreenEffectNodes: TX3DNodeList; |
| Protected | IsVisibleNow: boolean; |
| Protected | GeneratedTextures: TGeneratedTextureList; |
Methods
| Protected | function GetInternalText: String; virtual; |
| Protected | procedure SetInternalText(const Value: String); virtual; |
| Protected | procedure SetName(const Value: TComponentName); override; |
| Protected | procedure TranslateProperties(const TranslatePropertyEvent: TTranslatePropertyEvent); virtual; |
| Public | procedure SetTransient; |
| Public | procedure AddNonVisualComponent(const NonVisualComponent: TComponent); |
| Public | procedure InsertNonVisualComponent(const Index: Integer; const NonVisualComponent: TComponent); |
| Public | procedure RemoveNonVisualComponent(const NonVisualComponent: TComponent); |
| Public | function NonVisualComponentsIndexOf(const NonVisualComponent: TComponent): Integer; |
| Public | function NonVisualComponentsCount: Integer; |
| Public | function NonVisualComponentsEnumerate: TNonVisualComponentsEnumerator; |
| Public | function ValueIsStreamed: Boolean; virtual; |
| Public | procedure DesignerInfo(const SList: TStrings); virtual; |
| Protected | function GetRenderList(const Params: TRenderParams): TCastleTransformList; virtual; |
| Protected | procedure RegisterGLContextClose; |
| Protected | procedure Notification(AComponent: TComponent; Operation: TOperation); override; |
| Protected | function HeightCollision(const APosition, GravityUp: TVector3; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc; out AboveHeight: Single; out AboveGround: PTriangle): boolean; |
| Protected | function MoveCollision( const OldPos, ProposedNewPos: TVector3; out NewPos: TVector3; const IsRadius: boolean; const Radius: Single; const OldBox, NewBox: TBox3D; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc): boolean; overload; |
| Protected | function MoveCollision( const OldPos, NewPos: TVector3; const IsRadius: boolean; const Radius: Single; const OldBox, NewBox: TBox3D; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc): boolean; overload; |
| Protected | function SegmentCollision(const Pos1, Pos2: TVector3; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc; const ALineOfSight: boolean): boolean; |
| Protected | function SphereCollision(const Pos: TVector3; const Radius: Single; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc): boolean; |
| Protected | function SphereCollision2D(const Pos: TVector2; const Radius: Single; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc; const Details: TCollisionDetails = nil): boolean; |
| Protected | function PointCollision2D(const Point: TVector2; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc): boolean; |
| Protected | function BoxCollision(const Box: TBox3D; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc): boolean; |
| Protected | function RayCollision(const RayOrigin, RayDirection: TVector3; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc): TRayCollision; |
| Protected | function Translation2D: TVector2; deprecated 'use TranslationXY'; |
| Protected | procedure TransformMatricesMult(var M, MInverse: TMatrix4); deprecated 'do not use this directly, instead use Transform and InverseTransform methods'; |
| Protected | procedure TransformMatrices(out M, MInverse: TMatrix4); deprecated 'do not use this directly, instead use Transform and InverseTransform methods'; |
| Protected | function AverageScale: Single; |
| Protected | function AverageScale2D: Single; |
| Protected | procedure Fall(const FallHeight: Single); virtual; |
| Protected | procedure ExistsInRootChanged; virtual; |
| Public | procedure DesignerWarnings(const SList: TStrings); override; |
| Public | function GetEnumerator: TEnumerator; |
| Public | function CheckCollides: Boolean; |
| Public | function GetCollides: boolean; virtual; deprecated 'use CheckCollides'; |
| Public | function CheckPickable: boolean; |
| Public | function GetPickable: boolean; virtual; deprecated 'use CheckPickable'; |
| Public | function CheckVisible: boolean; |
| Public | function GetVisible: boolean; virtual; deprecated 'use CheckVisible'; |
| Public | procedure Add(const Item: TCastleTransform); |
| Public | procedure Insert(const Index: Integer; const Item: TCastleTransform); |
| Public | procedure Remove(const Item: TCastleTransform); |
| Public | procedure RemoveDelayed(const Item: TCastleTransform; const FreeItem: Boolean = false); |
| Public | procedure Delete(const Index: Integer); |
| Public | function Count: Integer; |
| Public | procedure Clear; |
| Public | procedure Exchange(const Index1, Index2: Integer); |
| Public | function BoundingBox: TBox3D; |
| Public | function WorldBoundingBox: TBox3D; |
| Public | procedure Render(const Params: TRenderParams); overload; virtual; |
| Public | procedure Render(const Frustum: TFrustum; const Params: TRenderParams); overload; deprecated 'use Render method without an explicit Frustum parameter, it is in Params.Frustum now'; |
| Public | procedure RenderShadowVolume(const Params: TRenderParams; const ShadowVolumeRenderer: TBaseShadowVolumeRenderer); |
| Public | procedure AddAfterUpdateListener(const UpdateListener: TNotifyEvent); |
| Public | procedure RemoveAfterUpdateListener(const UpdateListener: TNotifyEvent); |
| Public | procedure VisibleChangeHere(const Changes: TVisibleChanges); virtual; |
| Public | function Middle: TVector3; virtual; |
| Public | function WorldMiddle: TVector3; |
| Public | function Sphere(out Radius: Single): boolean; virtual; |
| Public | function Height(const MyPosition: TVector3; out AboveHeight: Single): boolean; overload; |
| Public | function Height(const MyPosition: TVector3; out AboveHeight: Single; out AboveGround: PTriangle): boolean; overload; |
| Public | function LineOfSight(const Pos1, Pos2: TVector3): boolean; |
| Public | function MoveAllowed(const OldPos, ProposedNewPos: TVector3; out NewPos: TVector3; const BecauseOfGravity: boolean): boolean; overload; |
| Public | function MoveAllowed(const OldPos, NewPos: TVector3; const BecauseOfGravity: boolean): boolean; overload; |
| Public | function Ray(const RayOrigin, RayDirection: TVector3): TRayCollision; |
| Public | function RayCast(const RayOrigin, RayDirection: TVector3): TCastleTransform; overload; |
| Public | function RayCast(const RayOrigin, RayDirection: TVector3; out Distance: Single): TCastleTransform; overload; |
| Public | function OutsideToLocal(const Pos: TVector3): TVector3; |
| Public | function LocalToOutside(const Pos: TVector3): TVector3; |
| Public | function WorldToLocal(const Pos: TVector3): TVector3; |
| Public | function LocalToWorld(const Pos: TVector3): TVector3; |
| Public | function WorldToLocalDirection(const Dir: TVector3): TVector3; |
| Public | function LocalToWorldDirection(const Dir: TVector3): TVector3; |
| Public | function LocalToWorldDistance(const Distance: Single): Single; |
| Public | function WorldToLocalDistance(const Distance: Single): Single; |
| Public | function PreferredHeight: Single; virtual; deprecated 'use physics (TCastleRigidBody, TCastleCollider) to make things affected by gravity'; |
| Public | function Transform: TMatrix4; |
| Public | function InverseTransform: TMatrix4; |
| Public | function HasWorldTransform: boolean; |
| Public | function WorldTransform: TMatrix4; |
| Public | function WorldInverseTransform: TMatrix4; |
| Public | procedure Translate(const TranslationChange: TVector3); |
| Public | function Move(const TranslationChange: TVector3; const BecauseOfGravity: boolean; const EnableWallSliding: boolean = true): boolean; |
| Public | procedure Identity; |
| Public | procedure GetView(out APos, ADir, AUp: TVector3); |
| Public | procedure GetWorldView(out APos, ADir, AUp: TVector3); |
| Public | function WorldTranslation: TVector3; |
| Public | procedure SetView(const APos, ADir, AUp: TVector3; const AdjustUp: boolean = true); overload; |
| Public | procedure SetView(const ADir, AUp: TVector3; const AdjustUp: boolean = true); overload; |
| Public | procedure SetWorldView(const APos, ADir, AUp: TVector3; const AdjustUp: boolean = true); |
| Public | procedure UpPrefer(const AUp: TVector3); |
| Public | procedure AddBehavior(const Behavior: TCastleBehavior); |
| Public | procedure InsertBehavior(const Index: Integer; const Behavior: TCastleBehavior); |
| Public | function BehaviorIndex(const Behavior: TCastleBehavior): Integer; |
| Public | procedure RemoveBehavior(const Behavior: TCastleBehavior); |
| Public | function FindBehavior(const BehaviorClass: TCastleBehaviorClass): TCastleBehavior; |
| Public | function FindAllBehaviors(const BehaviorClass: TCastleBehaviorClass): TCastleBehaviorList; |
| Public | function FindRequiredBehavior(const BehaviorClass: TCastleBehaviorClass): TCastleBehavior; |
| Public | function BehaviorsCount: Integer; |
| Public | function BehaviorsEnumerate: TCastleBehaviorEnumerator; |
| Public | procedure AddWorldChangeNotification(const Behavior: TCastleBehavior); |
| Public | procedure RemoveWorldChangeNotification(const Behavior: TCastleBehavior); |
| Public | function InternalBuildNode: TObject; |
| Protected | procedure ExecuteCompiledScript(const HandlerName: string; ReceivedValue: TX3DField); virtual; abstract; |
| Public | procedure InternalChangedField(const Field: TX3DField; const Change: TX3DChange); overload; virtual; abstract; |
| Public | procedure InternalChangedField(const Field: TX3DField); overload; |
| Public | function InternalCastingShadowVolumesNow: Boolean; virtual; abstract; |
| Protected | function InternalBuildNodeInside: TObject; override; |
| Protected | procedure UpdateHeadlightOnFromNavigationInfo; |
| Protected | procedure ChangedTransform; override; |
| Protected | procedure DoPointingDeviceSensorsChange; virtual; |
| Protected | procedure ExecuteCompiledScript(const HandlerName: String; ReceivedValue: TX3DField); override; |
| Protected | function LocalHeightCollision(const APosition, GravityUp: TVector3; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc; out AboveHeight: Single; out AboveGround: PTriangle): boolean; override; |
| Protected | function LocalMoveCollision( const OldPos, ProposedNewPos: TVector3; out NewPos: TVector3; const IsRadius: boolean; const Radius: Single; const OldBox, NewBox: TBox3D; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc): boolean; override; |
| Protected | function LocalMoveCollision( const OldPos, NewPos: TVector3; const IsRadius: boolean; const Radius: Single; const OldBox, NewBox: TBox3D; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc): boolean; override; |
| Protected | function LocalSegmentCollision(const Pos1, Pos2: TVector3; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc; const ALineOfSight: boolean): boolean; override; |
| Protected | function LocalSphereCollision(const Pos: TVector3; const Radius: Single; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc): boolean; override; |
| Protected | function LocalSphereCollision2D(const Pos: TVector2; const Radius: Single; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc; const Details: TCollisionDetails): boolean; override; |
| Protected | function LocalPointCollision2D(const Point: TVector2; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc): boolean; override; |
| Protected | function LocalBoxCollision(const Box: TBox3D; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc): boolean; override; |
| Protected | function LocalRayCollision(const RayOrigin, RayDirection: TVector3; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc): TRayCollision; override; |
| Protected | procedure Loaded; override; |
| Protected | procedure InternalMoveShapeAssociations( const OldNode, NewNode: TX3DNode; const ContainingShapes: TObject); override; |
| Protected | function LocalBoundingBoxNoChildren: TBox3D; |
| Public | procedure CustomSerialization(const SerializationProcess: TSerializationProcess); override; |
| Public | procedure Load(const ARootNode: TX3DRootNode; const AOwnsRootNode: boolean; const AOptions: TSceneLoadOptions = []); overload; |
| Public | procedure Load(const AUrl: String; const AOptions: TSceneLoadOptions = []); overload; |
| Public | procedure Load(const AUrl: String; const AllowStdIn: boolean; const AResetTime: boolean = true); overload; deprecated 'use Load with (AUrl: String, AOptions: TSceneLoadOptions) parameters. AllowStdIn is not implemented anymore.'; |
| Public | procedure Save(const AUrl: String); |
| Public | procedure BeforeDestruction; override; |
| Public | function ShapeBoundingBox(const Node: TAbstractShapeNode): TBox3D; |
| Public | function ShapesActiveCount: Cardinal; |
| Public | function ShapesActiveVisibleCount: Cardinal; |
| Public | function VerticesCount: Cardinal; overload; |
| Public | function TrianglesCount: Cardinal; overload; |
| Public | function ViewpointsCount: Cardinal; |
| Public | function GetViewpointNode(const Idx: integer): TAbstractViewpointNode; |
| Public | function GetViewpointName(const Idx: integer): String; |
| Public | procedure MoveToViewpoint(const Idx: integer; const Animated: boolean = true); |
| Public | procedure AddViewpointFromNavigation(const Navigation: TCastleNavigation; const AName: String); |
| Public | procedure NodeFreeRemovingFromAllParents(Node: TX3DNode); |
| Public | procedure RemoveShape(Shape: TShape); |
| Public | procedure ChangedAll(const OnlyAdditions: Boolean = false); override; |
| Public | procedure DoViewpointsChanged; |
| Public | procedure DoBoundViewpointVectorsChanged; |
| Public | procedure DoBoundNavigationInfoFieldsChanged; virtual; |
| Public | procedure ScheduleChangedAll(const OnlyAdditions: Boolean = false); |
| Public | procedure BeginChangesSchedule; |
| Public | procedure EndChangesSchedule; |
| Public | function Info( ATriangleVerticesCounts, ABoundingBox: boolean; AManifoldAndBorderEdges: boolean): String; deprecated 'do not use this, better to construct a summary string yourself'; |
| Public | function InfoTriangleVerticesCounts: String; deprecated 'better to construct a string yourself, use TrianglesCount, VerticesCount'; |
| Public | function InfoBoundingBox: String; deprecated 'better to construct a string yourself, use BoundingBox.ToString'; |
| Public | function InfoManifoldAndBorderEdges: String; deprecated 'better to construct a string yourself, use EdgesCount'; |
| Public | function InternalDetectedWholeSceneManifold( const ForceRecalculation: Boolean = false): Boolean; |
| Public | procedure EdgesCount(out ManifoldEdges, BorderEdges: Cardinal); |
| Public | function InternalOctreeRendering: TShapeOctree; |
| Public | function InternalOctreeDynamicCollisions: TShapeOctree; |
| Public | function InternalOctreeCollisions: TBaseTrianglesOctree; |
| Public | function UseInternalOctreeCollisions: boolean; |
| Public | function GetViewpoint( out ProjectionType: TProjectionType; out CamPos, CamDir, CamUp, GravityUp: TVector3; const ViewpointDescription: String = ''): TAbstractViewpointNode; |
| Public | function GetPerspectiveViewpoint( out CamPos, CamDir, CamUp, GravityUp: TVector3; const ViewpointDescription: String = ''): TAbstractViewpointNode; |
| Public | procedure UnregisterScene(Node: TX3DNode); deprecated 'use Node.UnregisterScene'; |
| Public | function Press(const Event: TInputPressRelease): boolean; override; |
| Public | function Release(const Event: TInputPressRelease): boolean; override; |
| Public | function PointingDevicePress(const Pick: TRayCollisionNode; const Distance: Single): Boolean; override; |
| Public | function PointingDeviceRelease(const Pick: TRayCollisionNode; const Distance: Single; const CancelAction: Boolean): Boolean; override; |
| Public | function PointingDeviceMove(const Pick: TRayCollisionNode; const Distance: Single): boolean; override; |
| Public | function PointingDeviceSensors: TPointingDeviceSensorList; |
| Public | procedure PointingDeviceClear; |
| Public | function LocalBoundingBox: TBox3D; override; |
| Public | procedure SetTime(const NewValue: TFloatTime); |
| Public | procedure IncreaseTime(const TimeIncrease: TFloatTime); |
| Public | procedure IncreaseTimeTick; deprecated 'it should not be necessary to call this, ever; using TX3DEvent.Send(...) or TX3DEvent.Send(..., NextEventTime) will automatically behave Ok.'; |
| Public | function Time: TFloatTime; override; |
| Public | function NextEventTime: TX3DTime; override; |
| Public | procedure ResetTime(const NewValue: TFloatTime); |
| Public | procedure ResetTimeAtLoad; |
| Public | function GetBackgroundStack: TX3DBindableStackBasic; override; |
| Public | function GetFogStack: TX3DBindableStackBasic; override; |
| Public | function GetNavigationInfoStack: TX3DBindableStackBasic; override; |
| Public | function GetViewpointStack: TX3DBindableStackBasic; override; |
| Public | procedure RegisterCompiledScript(const HandlerName: String; Handler: TCompiledScriptHandler); |
| Public | procedure InternalUpdateNavigation( const Navigation: TCastleNavigation); |
| Public | procedure CameraTransition(const Camera: TCastleCamera; const APosition, ADirection, AUp: TVector3); overload; deprecated 'use Camera.AnimateTo(APosition, ADirection, AUp)'; |
| Public | procedure CameraTransition(const Camera: TCastleCamera; const APosition, ADirection, AUp, GravityUp: TVector3); overload; deprecated 'use Camera.AnimateTo(APosition, ADirection, AUp)'; |
| Public | procedure CameraTransition(const Navigation: TCastleNavigation; const APosition, ADirection, AUp: TVector3); overload; deprecated 'use Camera.AnimateTo(APosition, ADirection, AUp)'; |
| Public | procedure CameraTransition(const Navigation: TCastleNavigation; const APosition, ADirection, AUp, GravityUp: TVector3); overload; deprecated 'use Camera.AnimateTo(APosition, ADirection, AUp)'; |
| Public | function CustomHeadlight: TAbstractLightNode; |
| Public | function Caption: String; |
| Public | function Node(const NodeClass: TX3DNodeClass; const NodeName: String; const Options: TFindNodeOptions = []): TX3DNode; overload; |
| Public | function Node(const NodeName: String): TX3DNode; overload; |
| Public | function Field(const NodeName, FieldName: String): TX3DField; overload; |
| Public | function Event(const NodeName, EventName: String): TX3DEvent; overload; |
| Public | function HasAnimation(const AnimationName: String): boolean; |
| Public | function AnimationTimeSensor(const AnimationName: String): TTimeSensorNode; overload; |
| Public | function AnimationTimeSensor(const Index: Integer): TTimeSensorNode; overload; |
| Public | function ForceAnimationPose(const AnimationName: String; const TimeInAnimation: TFloatTime; const Loop: boolean; const Forward: boolean = true): boolean; overload; |
| Public | function PlayAnimation(const Parameters: TPlayAnimationParameters): boolean; overload; |
| Public | function PlayAnimation(const AnimationName: String; const Loop: boolean; const Forward: boolean = true): boolean; overload; |
| Public | procedure ForceInitialAnimationPose; |
| Public | function AnimationDuration(const AnimationName: String): TFloatTime; |
| Public | procedure StopAnimation(const DisableStopNotification: Boolean = false); |
| Public | procedure ResetAnimationState(const IgnoreAffectedBy: TTimeSensorNode = nil); |
| Public | procedure FontChanged; |
| Public | procedure InternalIncShapesHash; |
| Public | procedure ReloadUrl; |
| Protected | function EffectiveRenderOptions: TCastleRenderOptions; override; |
| Protected | function CreateShape(const AGeometry: TAbstractGeometryNode; const AState: TX3DGraphTraverseState; const ParentInfo: PTraversingInfo): TShape; override; |
| Protected | procedure LocalRender(const Params: TRenderParams); override; |
| Protected | procedure LocalRenderShadowVolume(const Params: TRenderParams; const ShadowVolumeRenderer: TBaseShadowVolumeRenderer); override; |
| Protected | procedure ChangeWorld(const Value: TCastleAbstractRootTransform); override; |
| Public | constructor Create(AOwner: TComponent); override; |
| Public | destructor Destroy; override; |
| Public | procedure Update(const SecondsPassed: Single; var RemoveMe: TRemoveType); override; |
| Public | function PropertySections(const PropertyName: String): TPropertySections; override; |
| Public | procedure GLContextClose; override; |
| Public | procedure PrepareResources(const Options: TPrepareResourcesOptions; const Params: TPrepareParams); override; deprecated 'this is internal; use TCastleViewport.PrepareResources to prepare transformations'; |
| Public | procedure BeforeNodesFree(const InternalChangedAll: boolean = false); override; |
| Public | function HasColliderMesh: Boolean; override; |
| Public | procedure ColliderMesh(const TriangleEvent: TTriangleEvent); override; |
| Public | procedure FreeResources(Resources: TSceneFreeResources); override; |
| Public | function Clone(const AOwner: TComponent): TCastleScene; |
| Public | function WasVisible: Boolean; |
| Public | procedure SetEffects(const Value: array of TEffectNode); |
Properties
| Public | property NonVisualComponents [const Index: Integer]: TComponent read GetNonVisualComponents; |
| Public | property IsLoading: Boolean read FIsLoading; |
| Public | property GetExists: Boolean read FExists; deprecated 'use Exists'; |
| Public | property Items[const I: Integer]: TCastleTransform read GetItem write SetItem; default; |
| Public | property Parent: TCastleTransform read FParent write SetParent; |
| Public | property UniqueParent: TCastleTransform read FParent; deprecated 'use Parent'; |
| Public | property CastShadowVolumes: boolean
read FCastShadows write FCastShadows default true; deprecated 'use CastShadows'; |
| Public | property ListenPressRelease: Boolean
read FListenPressRelease write SetListenPressRelease default false; |
| Public | property World: TCastleAbstractRootTransform read FWorld; |
| Public | property WorldDirection: TVector3 read GetWorldDirection write SetWorldDirection; |
| Public | property CollidesWithMoving: boolean read FCollidesWithMoving write FCollidesWithMoving default false; |
| Public | property Gravity: boolean read FGravity write FGravity default false; deprecated 'use physics (TCastleRigidBody, TCastleCollider) to make things affected by gravity'; |
| Public | property FallSpeed: Single read FFallSpeed write FFallSpeed default 0; deprecated 'use physics (TCastleRigidBody, TCastleCollider) to make things affected by gravity'; |
| Public | property GrowSpeed: Single read FGrowSpeed write FGrowSpeed default 0; deprecated 'use physics (TCastleRigidBody, TCastleCollider) to make things affected by gravity'; |
| Public | property MiddleHeight: Single read FMiddleHeight write FMiddleHeight
default DefaultMiddleHeight; |
| Public | property Translation: TVector3 read FTranslation write SetTranslation; |
| Public | property TranslationXY: TVector2 read GetTranslationXY write SetTranslationXY; |
| Public | property Center: TVector3 read FCenter write SetCenter; |
| Public | property Rotation: TVector4 read FRotation write SetRotation; |
| Public | property Scale: TVector3 read FScale write SetScale; |
| Public | property ScaleOrientation: TVector4 read FScaleOrientation write SetScaleOrientation; |
| Public | property RigidBody: TCastleRigidBody read FCachedRigidBody; |
| Public | property Collider: TCastleCollider read FCachedCollider; |
| Public | property Position: TVector3 read FTranslation write SetTranslation; deprecated 'use Translation'; |
| Public | property Direction: TVector3 read GetDirection write SetDirection; |
| Public | property Up: TVector3 read GetUp write SetUp; |
| Public | property WorldView: TViewVectors
read GetWorldViewRec write SetWorldViewRec; |
| Public | property Orientation: TOrientationType read FOrientation write FOrientation; |
| Public | property List: TCastleTransformList read FList; |
| Public | property Behaviors [const Index: Integer]: TCastleBehavior read GetBehaviors; |
| Public | property ExistsInRoot: Boolean read FExistsInRoot; |
| Published | property Exists: Boolean read FExists write SetExists default true; |
| Published | property Collides: boolean read FCollides write FCollides default true; |
| Published | property Pickable: boolean read FPickable write FPickable default true; |
| Published | property Visible: boolean read FVisible write FVisible default true; |
| Published | property CollisionSphereRadius: Single read FCollisionSphereRadius write FCollisionSphereRadius; |
| Published | property CastShadows: boolean
read FCastShadows write FCastShadows default true; |
| Published | property RenderLayer: TRenderLayer read FRenderLayer write FRenderLayer default rlParent; |
| Published | property CenterPersistent: TCastleVector3Persistent read FCenterPersistent ; |
| Published | property RotationPersistent: TCastleVector4RotationPersistent read FRotationPersistent ; |
| Published | property ScalePersistent: TCastleVector3Persistent read FScalePersistent ; |
| Published | property ScaleOrientationPersistent: TCastleVector4Persistent read FScaleOrientationPersistent ; |
| Published | property TranslationPersistent: TCastleVector3Persistent read FTranslationPersistent ; |
| Published | property DirectionPersistent: TCastleVector3Persistent read FDirectionPersistent stored false; |
| Published | property UpPersistent: TCastleVector3Persistent read FUpPersistent stored false; |
| Protected | property VisibilitySensors: TVisibilitySensors read FVisibilitySensors; |
| Public | property Shapes: TShapeTree read FShapes; |
| Public | property OnGeometryChanged: TSceneGeometryChanged
read FOnGeometryChanged write FOnGeometryChanged; |
| Public | property OnViewpointsChanged: TNotifyEvent
read FOnViewpointsChanged write FOnViewpointsChanged; |
| Public | property OnBoundViewpointVectorsChanged: TNotifyEvent
read FOnBoundViewpointVectorsChanged write FOnBoundViewpointVectorsChanged; |
| Public | property OnBoundNavigationInfoFieldsChanged: TNotifyEvent
read FOnBoundNavigationInfoFieldsChanged write FOnBoundNavigationInfoFieldsChanged; |
| Public | property RootNode: TX3DRootNode read FRootNode write SetRootNode; |
| Public | property OwnsRootNode: boolean read FOwnsRootNode write FOwnsRootNode default true; deprecated 'set OwnsRootNode only at loading, do not depend on this property'; |
| Public | property PointingDeviceOverItem: PTriangle
read FPointingDeviceOverItem write FPointingDeviceOverItem; |
| Public | property PointingDeviceOverPoint: TVector3
read FPointingDeviceOverPoint write FPointingDeviceOverPoint; |
| Public | property PointingDeviceActiveSensors: TX3DNodeList
read FPointingDeviceActiveSensors; |
| Public | property PointingDeviceActive: boolean
read FPointingDeviceActive default false; |
| Public | property OnPointingDeviceSensorsChange: TNotifyEvent
read FOnPointingDeviceSensorsChange
write FOnPointingDeviceSensorsChange; |
| Public | property TimeAtLoad: TFloatTime read FTimeAtLoad; |
| Public | property BackgroundStack: TBackgroundStack read FBackgroundStack; |
| Public | property FogStack: TFogStack read FFogStack; |
| Public | property NavigationInfoStack: TNavigationInfoStack read FNavigationInfoStack; |
| Public | property ViewpointStack: TViewpointStack read FViewpointStack; |
| Public | property CompiledScriptHandlers: TCompiledScriptHandlerInfoList
read FCompiledScriptHandlers; |
| Public | property HeadlightOn: boolean
read FHeadlightOn write SetHeadlightOn; |
| Public | property OnHeadlightOnChanged: TNotifyEvent
read FOnHeadlightOnChanged write FOnHeadlightOnChanged; |
| Public | property InternalGlobalLights: TLightInstancesList read FGlobalLights; |
| Public | property AnimationsList: TStrings read FAnimationsList; |
| Public | property AnimationPrefix: String
read FAnimationPrefix write FAnimationPrefix; deprecated 'this property did not prove to be of much use; report if you need it, otherwise it may be removed one day'; |
| Public | property CurrentAnimation: TTimeSensorNode read FCurrentAnimation; |
| Public | property FileName: String read FUrl write SetUrl; deprecated; |
| Public | property InternalShapesHash: TShapesHash read FShapesHash; |
| Published | property DefaultAnimationTransition: Single
read FDefaultAnimationTransition write FDefaultAnimationTransition default 0.0; |
| Published | property TimePlaying: boolean read FTimePlaying write FTimePlaying default true; |
| Published | property TimePlayingSpeed: Single read FTimePlayingSpeed write FTimePlayingSpeed default 1.0; |
| Published | property PreciseCollisions: Boolean read FPreciseCollisions write SetPreciseCollisions default false; |
| Published | property ProcessEvents: boolean
read FProcessEvents write SetProcessEvents default false; |
| Published | property Url: String read FUrl write SetUrl; |
| Published | property ShadowMaps: boolean read FShadowMaps write SetShadowMaps default true; |
| Published | property ShadowMapsDefaultSize: Cardinal
read FShadowMapsDefaultSize write SetShadowMapsDefaultSize
default DefaultShadowMapsDefaultSize; |
| Published | property InitialViewpointIndex: Cardinal
read FInitialViewpointIndex write FInitialViewpointIndex default 0; |
| Published | property InitialViewpointName: String
read FInitialViewpointName write FInitialViewpointName; |
| Published | property AnimateOnlyWhenVisible: boolean
read FAnimateOnlyWhenVisible write FAnimateOnlyWhenVisible default false; |
| Published | property AnimateSkipTicks: Cardinal read FAnimateSkipTicks write SetAnimateSkipTicks
default 0; |
| Published | property AutoAnimation: String
read FAutoAnimation write SetAutoAnimation; |
| Published | property AutoAnimationLoop: Boolean
read FAutoAnimationLoop write SetAutoAnimationLoop default true; deprecated 'in future engine versions, AutoAnimationLoop may behave as always = true, and AutoAnimation will be renamed to just Animation and changing it will always cause a looping animation. Use PlayAnimation(''my_anim'',false) from code to play animation without looping.'; |
| Published | property ExposeTransforms: TStrings read FExposeTransforms write SetExposeTransforms; |
| Published | property ExposeTransformsPrefix: String read FExposeTransformsPrefix write SetExposeTransformsPrefix; |
| Published | property Cache: Boolean read FCache write FCache default false; |
| Published | property ShapeFrustumCulling: Boolean
read FShapeFrustumCulling write SetShapeFrustumCulling default true; |
| Published | property SceneFrustumCulling: Boolean
read FSceneFrustumCulling write FSceneFrustumCulling default true; |
| Published | property ReceiveShadowVolumes: boolean
read FReceiveShadowVolumes write FReceiveShadowVolumes default true; |
| Published | property DistanceCulling: Single
read FDistanceCulling write SetDistanceCulling default 0; |
| Published | property RenderOptions: TCastleRenderOptions read FRenderOptions; |
| Published | property CastGlobalLights: Boolean
read FCastGlobalLights write SetCastGlobalLights default false; |
| Published | property TransformOptimization: TTransformOptimization
read FTransformOptimization write FTransformOptimization default toAutomatic; |
Description
Nested Types
| Protected | TVisibilitySensorInstanceList = specialize TObjectList<TVisibilitySensorInstance>; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
Constants
| Public | DefaultMiddleHeight = 0.5; |
|
This item is declared in ancestor TCastleTransform. This item has no description. | |
| Public | DefaultDirection: array [TOrientationType] of TVector3 = (
(X: 0; Y: 0; Z: -1),
(X: 0; Y: 0; Z: +1),
(X: 0; Y: -1; Z: 0),
(X: 1; Y: 0; Z: 0)
); |
|
This item is declared in ancestor TCastleTransform. This item has no description. | |
| Public | DefaultUp: array [TOrientationType] of TVector3 = (
(X: 0; Y: 1; Z: 0),
(X: 0; Y: 1; Z: 0),
(X: 0; Y: 0; Z: 1),
(X: 0; Y: 0; Z: 1)
); |
|
This item is declared in ancestor TCastleTransform. This item has no description. | |
| Public | DefaultCameraOrientation = otUpYDirectionMinusZ; |
|
This item is declared in ancestor TCastleTransform. Default TCastleCamera.Orientation. | |
| Public | DefaultShadowMapsDefaultSize = 256; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
Fields
| Public | class var DefaultOrientation: TOrientationType; |
|
This item is declared in ancestor TCastleTransform. Default value of TCastleTransform.Orientation for new TCastleTransform instances, except for cameras (cameras use special DefaultCameraOrientation). This is otUpYDirectionZ by default. This matches glTF orientation (as exported from Blender and other software). | |
| Public | InternalExcludeFromParentBoundingVolume: Boolean; |
|
This item is declared in ancestor TCastleTransform. Exclude this object's bounding volume from parent bounding volume. This should be always | |
| Protected | ScreenEffectNodes: TX3DNodeList; |
|
This item is declared in ancestor TCastleSceneCore. List of TScreenEffectNode nodes, collected by ChangedAll. | |
| Protected | IsVisibleNow: boolean; |
|
This item is declared in ancestor TCastleSceneCore.
Is the scene visible currently. Descendants may set this to | |
| Protected | GeneratedTextures: TGeneratedTextureList; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
Methods
| Protected | function GetInternalText: String; virtual; |
|
This item is declared in ancestor TCastleComponent. This item has no description. | |
| Protected | procedure SetInternalText(const Value: String); virtual; |
|
This item is declared in ancestor TCastleComponent. This item has no description. | |
| Protected | procedure SetName(const Value: TComponentName); override; |
|
This item is declared in ancestor TCastleComponent. This item has no description. | |
| Protected | procedure TranslateProperties(const TranslatePropertyEvent: TTranslatePropertyEvent); virtual; |
|
This item is declared in ancestor TCastleComponent. Enumerate all properties that are possible to translate in this component. E.g. in TCastleLabel it will return TCastleLabel.Caption, in TCastleEdit it will return TCastleEdit.Text and TCastleEdit.Placeholder. Returns only non-empty properties, thus assuming that if current (by convention, English) text is empty, then there is no point in translating it. Moreover descendants may define boolean properties to exclude particular text from translating, e.g. TCastleLabel.CaptionTranslate, TCastleEdit.TextTranslate, TCastleEdit.PlaceholderTranslate. It is not recursive (it doesn't enumerate children properties). Use global TranslateProperties procedure to call this on a hierarchy of TComponent. You usually don't want to call this method (it is called by other engine routines). But you may find it useful to override this, if you define new component. | |
| Public | procedure SetTransient; |
|
This item is declared in ancestor TCastleComponent. Ignore this component when serializing parent's TCastleUserInterface.Controls list or TCastleTransform.List, and do not show this component in CGE editor. This simply sets csTransient flag in ComponentStyle. This is useful for children that are automatically managed by the parent, and should not be modified by user code. For example, TCastleCheckbox is internally composed from TCastleImageControl and TCastleLabel children, but we don't want to serialize or even show these children to user. Note that if you want to prevent this component from serializing as part of TCastleUserInterface.Controls list or TCastleTransform.List, but you still want it to be visible in CGE editor, then make it a "subcomponent" instead, by Note that both csSubComponent and csTransient only disable the component serialization as part of parent's lists enumerated by CustomSerialization (see internal TCastleUserInterface.SerializeChildrenEnumerate , TCastleTransform.SerializeChildrenEnumerate, TCastleTransform.SerializeBehaviorsEnumerate). If you will make the component published in its own property (which is normal for "subcomponents") then it will be serialized anyway, just as part of it's own property (like TCastleScrollView.ScrollArea). So to really avoid serializing a children component make it csSubComponent and/or csTransient, and do not publish it. | |
| Public | procedure AddNonVisualComponent(const NonVisualComponent: TComponent); |
|
This item is declared in ancestor TCastleComponent. Add non-visual component to this component. This is used to organize non-visual components in a tree hierarchy, in CGE designs and editor.
See also
| |
| Public | procedure InsertNonVisualComponent(const Index: Integer; const NonVisualComponent: TComponent); |
|
This item is declared in ancestor TCastleComponent. Insert non-visual component to this component. This is used to organize non-visual components in a tree hierarchy, in CGE designs and editor.
See also
| |
| Public | procedure RemoveNonVisualComponent(const NonVisualComponent: TComponent); |
|
This item is declared in ancestor TCastleComponent. Removes the component previously added by AddNonVisualComponent. | |
| Public | function NonVisualComponentsIndexOf(const NonVisualComponent: TComponent): Integer; |
|
This item is declared in ancestor TCastleComponent. Index of the previously added non-visual component. Returns -1 if the component was not found. | |
| Public | function NonVisualComponentsCount: Integer; |
|
This item is declared in ancestor TCastleComponent. Count of components added by AddNonVisualComponent.
See also
| |
| Public | function NonVisualComponentsEnumerate: TNonVisualComponentsEnumerator; |
|
This item is declared in ancestor TCastleComponent.
You can enumerate current non-visual components using loop like See also
| |
| Public | function ValueIsStreamed: Boolean; virtual; |
|
This item is declared in ancestor TCastleComponent.
Whether the current value of this object should be written to the stream. This should be This is used by CastleComponentSerialize, which is used in Castle Game Engine for all serialization. In simple cases, this just says whether the current value of this object equals to some default value. The default implementation of this class returns Descendants that override this to sometimes return The name of this method is consistent with TPropertyEditor.ValueIsStreamed in LCL. | |
| Public | procedure DesignerInfo(const SList: TStrings); virtual; |
|
This item is declared in ancestor TCastleComponent.
Override to add information that should be visible at design-time. Call | |
| Protected | function GetRenderList(const Params: TRenderParams): TCastleTransformList; virtual; |
|
This item is declared in ancestor TCastleTransform. Returns list of TCastleTransform to render. By default, it just returns List. | |
| Protected | procedure RegisterGLContextClose; |
|
This item is declared in ancestor TCastleTransform. Call this when doing anything that allocates GL resources. This will make sure GLContextClose will get called. | |
| Protected | procedure Notification(AComponent: TComponent; Operation: TOperation); override; |
|
This item is declared in ancestor TCastleTransform. This item has no description. | |
| Protected | function HeightCollision(const APosition, GravityUp: TVector3; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc; out AboveHeight: Single; out AboveGround: PTriangle): boolean; |
|
This item is declared in ancestor TCastleTransform. Height of a point above the 3D model. This checks ray collision, from APosition along the negated GravityUp vector. Measures distance to the nearest scene item (called "ground" here).
Parameters
ReturnsIf the 3D scene is hit. | |
| Protected | function MoveCollision( const OldPos, ProposedNewPos: TVector3; out NewPos: TVector3; const IsRadius: boolean; const Radius: Single; const OldBox, NewBox: TBox3D; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc): boolean; overload; |
|
This item is declared in ancestor TCastleTransform. Can other 3D object (maybe a player) move without colliding with this object. If IsRadius, then you should prefer to perform exact collision with sphere of given radius (must be > 0). At the very least, this checks that the line segment between OldPos and NewPos doesn't collide, and that sphere with given Radius centered around NewPos doesn't collide. If not IsRadius, or if checking for collisions with sphere is not possible for some reasons, then you can check for collisions with boxes. OldBox should usually be ignored (it can be useful when collision-checking has to be approximate in some corner cases, see TCreature.MoveCollision). NewBox plays the same role as "sphere centered around NewPos" in paragraph above. Overloaded version with separate ProposedNewPos and NewPos parameters allows you to accept the move, but for NewPos (that should be some slightly modified version of ProposedNewPos). This allows to implement wall-sliding: when camera tries to walk into the wall, we will change movement to move alongside the wall (instead of just completely blocking the move). When this version returns | |
| Protected | function MoveCollision( const OldPos, NewPos: TVector3; const IsRadius: boolean; const Radius: Single; const OldBox, NewBox: TBox3D; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc): boolean; overload; |
|
This item is declared in ancestor TCastleTransform. This item has no description. | |
| Protected | function SegmentCollision(const Pos1, Pos2: TVector3; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc; const ALineOfSight: boolean): boolean; |
|
This item is declared in ancestor TCastleTransform. Check collision with a line segment, that is: a line between 2 points in 3D. | |
| Protected | function SphereCollision(const Pos: TVector3; const Radius: Single; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc): boolean; |
|
This item is declared in ancestor TCastleTransform. Check collision with a 3D sphere. This works precisely when transformation hierarchy has uniform scaling, i.e. scale is the same in all X, Y, Z axes. In case of non-uniform scaling, this is an approximation. | |
| Protected | function SphereCollision2D(const Pos: TVector2; const Radius: Single; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc; const Details: TCollisionDetails = nil): boolean; |
|
This item is declared in ancestor TCastleTransform. Check collision with a sphere in 2D (a circle, extruded to infinity along the Z axis). Note that PointCollision2D and This works precisely when transformation hierarchy has uniform scaling, i.e. scale is the same in all X, Y, Z axes. In case of non-uniform scaling, this is an approximation. Parameters
| |
| Protected | function PointCollision2D(const Point: TVector2; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc): boolean; |
|
This item is declared in ancestor TCastleTransform. Check collision with a point in 2D (which is an infinite line along the Z axis in 3D). Note that
| |
| Protected | function BoxCollision(const Box: TBox3D; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc): boolean; |
|
This item is declared in ancestor TCastleTransform. Check collision with axis-aligned box in 3D. | |
| Protected | function RayCollision(const RayOrigin, RayDirection: TVector3; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc): TRayCollision; |
|
This item is declared in ancestor TCastleTransform.
First object hit by the ray, as a TRayCollision. Returns a collision as TRayCollision instance, or Contrary to other collision routines, this should ignore the Collides property. The Collides property specifies whether item collides with camera. And this method is used for picking (pointing) 3D stuff — everything visible can be picked, collidable or not. Instead, this looks at Pickable and Exists properties. This always returns the first collision with the world, that is the one with smallest TRayCollision.Distance. For example, when implemented in TCastleTransform, this checks collisions for all list items, and chooses the closest one. | |
| Protected | function Translation2D: TVector2; deprecated 'use TranslationXY'; |
|
This item is declared in ancestor TCastleTransform. Warning: this symbol is deprecated: use TranslationXY Get translation in 2D (uses Translation, ignores Z coord). | |
| Protected | procedure TransformMatricesMult(var M, MInverse: TMatrix4); deprecated 'do not use this directly, instead use Transform and InverseTransform methods'; |
|
This item is declared in ancestor TCastleTransform. Warning: this symbol is deprecated: do not use this directly, instead use Transform and InverseTransform methods Transformation matrices, like Transform and InverseTransform. | |
| Protected | procedure TransformMatrices(out M, MInverse: TMatrix4); deprecated 'do not use this directly, instead use Transform and InverseTransform methods'; |
|
This item is declared in ancestor TCastleTransform. Warning: this symbol is deprecated: do not use this directly, instead use Transform and InverseTransform methods This item has no description. | |
| Protected | function AverageScale: Single; |
|
This item is declared in ancestor TCastleTransform. Average value of 3D scale in Scale. It is not calculated as a simple average, it's a little smarter to prevent from weird results sometimes, see Approximate3DScale. | |
| Protected | function AverageScale2D: Single; |
|
This item is declared in ancestor TCastleTransform. Average value of 2D scale, from XY components of Scale. It is not calculated as a simple average, it's a little smarter to prevent from weird results sometimes, see Approximate2DScale. | |
| Protected | procedure Fall(const FallHeight: Single); virtual; |
|
This item is declared in ancestor TCastleTransform. Called when fall ended. You can use FallHeight to decrease creature life or such. | |
| Protected | procedure ExistsInRootChanged; virtual; |
|
This item is declared in ancestor TCastleTransform. Override to be notified after ExistsInRoot value changed. | |
| Public | procedure DesignerWarnings(const SList: TStrings); override; |
|
This item is declared in ancestor TCastleTransform. This item has no description. Showing description inherited from TCastleComponent.DesignerWarnings.
Override to add warnings that should be visible at design-time. Call | |
| Public | function GetEnumerator: TEnumerator; |
|
This item is declared in ancestor TCastleTransform. This item has no description. | |
| Public | function CheckCollides: Boolean; |
|
This item is declared in ancestor TCastleTransform. Does the item really collide. Trivial shortcut for checking Collides and Exists. | |
| Public | function GetCollides: boolean; virtual; deprecated 'use CheckCollides'; |
|
This item is declared in ancestor TCastleTransform. Warning: this symbol is deprecated: use CheckCollides This item has no description. | |
| Public | function CheckPickable: boolean; |
|
This item is declared in ancestor TCastleTransform. Is the item really pickable. Trivial shortcut for checking Pickable and Exists. | |
| Public | function GetPickable: boolean; virtual; deprecated 'use CheckPickable'; |
|
This item is declared in ancestor TCastleTransform. Warning: this symbol is deprecated: use CheckPickable This item has no description. | |
| Public | function CheckVisible: boolean; |
|
This item is declared in ancestor TCastleTransform. Is the item really visible. Trivial shortcut for checking Visible and Exists. | |
| Public | function GetVisible: boolean; virtual; deprecated 'use CheckVisible'; |
|
This item is declared in ancestor TCastleTransform. Warning: this symbol is deprecated: use CheckVisible This item has no description. | |
| Public | procedure Add(const Item: TCastleTransform); |
|
This item is declared in ancestor TCastleTransform. Add a child. Note that adding the same child multiple times is allowed, in general you can use the same TCastleTransform instance multiple times in one hierarchy of TCastleRootTransform. | |
| Public | procedure Insert(const Index: Integer; const Item: TCastleTransform); |
|
This item is declared in ancestor TCastleTransform. Insert a child at a specific position on the children list. Note: Usually the order of children doesn't matter, so you can as well add children at the end, using Add. In particular, when rendering opaque (3D or 2D) objects, the front/back is decided by the actual translation of the object, i.e. what is closer to the camera. (In a typical 2D setup, larger Z values mean "closer to the camera".) The position on the children list doesn't matter in this case. When rendering with blending, we recommend to use TCastleViewport.BlendingSort to automatically use proper order when rendering partially-transparent objects. This will mean that the order of children really doesn't matter. However, the position matters in case of blending, if you set TCastleViewport.BlendingSort to sortNone. See https://castle-engine.io/blending . For correct blending, when you have multiple partially-transparent scenes, the partially-transparent objects must be sorted from back to front on the list. So you should add them in the proper order, or insert on proper positions. | |
| Public | procedure Remove(const Item: TCastleTransform); |
|
This item is declared in ancestor TCastleTransform. Remove a child. Adding and removing from the TCastleTransform hierarchy is guaranteed to be fast, so you can do it even in the middle of the game. In particular calling Remove doesn't free rendering reasources of the removed scene, So e.g. removing scene only to add it later to another TCastleViewport.Items is fast. Note that removing the child Item does not free the Item. It merely makes the Item no longer be a child of this TCastleTransform, so it will no longer be shown in the viewport. If you want to free the item instance, you have to do it explicitly, by | |
| Public | procedure RemoveDelayed(const Item: TCastleTransform; const FreeItem: Boolean = false); |
|
This item is declared in ancestor TCastleTransform. Use this to remove (and possibly free) the child, but not immediately. The actual removal (and freeing, if FreeItem) will be done at some crucial points:
This allows to use this method safely even in the middle of iteration over TCastleTransform children. For example you can use it from Update method, from any TCastleTransform.Update or TCastleUserInterface.Update (including TCastleView.Update). Note: It is not a problem if the child scheduled to be removed will also be removed (or even freed) directly e.g. by just calling Note: When you want to free the Item (that is, FreeItem parameter is | |
| Public | procedure Delete(const Index: Integer); |
|
This item is declared in ancestor TCastleTransform. Remove a child, by index on the Items list. | |
| Public | function Count: Integer; |
|
This item is declared in ancestor TCastleTransform. Count of current children, to iterate over Items from 0 to Count-1. | |
| Public | procedure Clear; |
|
This item is declared in ancestor TCastleTransform. Remove all children TCastleTransform instances. Note that removing the children using this method, just like using Remove, does not free the children. It merely makes the children no longer be inside this TCastleTransform, so they will no longer be shown in the viewport. If you want to free the children, you have to do it explicitly, calling | |
| Public | procedure Exchange(const Index1, Index2: Integer); |
|
This item is declared in ancestor TCastleTransform. Exchange position of 2 children TCastleTransform instances. | |
| Public | function BoundingBox: TBox3D; |
|
This item is declared in ancestor TCastleTransform. Bounding box of this object, in the coordinate system of the parent transformation. This method takes into account current transformation (like Translation, Rotation) but not parent TCastleTransform transformations. Use WorldBoundingBox instead to know bounding box that accounts for all TCastleTransform transformations. Use LocalBoundingBox instead to know bounding box that does not account for any parent or this TCastleTransform transformations. Takes into account both collidable and visible objects. For example, invisible walls (not visible) and fake walls (not collidable) should all be accounted here. It's a bounding volume, it should be as large as necessary to include the object inside. At the same time, it should be as "tight" as it can, to make various optimizations work best.
See also
| |
| Public | function WorldBoundingBox: TBox3D; |
|
This item is declared in ancestor TCastleTransform. Bounding box of this object, taking into account all transformations of this and parents.
See also
| |
| Public | procedure Render(const Params: TRenderParams); overload; virtual; |
|
This item is declared in ancestor TCastleTransform.
Render given object. Should check and immediately exit when CheckVisible is The rendering transformation, frustum, and filtering is specified inside TRenderParams class. This method should only update | |
| Public | procedure Render(const Frustum: TFrustum; const Params: TRenderParams); overload; deprecated 'use Render method without an explicit Frustum parameter, it is in Params.Frustum now'; |
|
This item is declared in ancestor TCastleTransform. Warning: this symbol is deprecated: use Render method without an explicit Frustum parameter, it is in Params.Frustum now This item has no description. | |
| Public | procedure RenderShadowVolume(const Params: TRenderParams; const ShadowVolumeRenderer: TBaseShadowVolumeRenderer); |
|
This item is declared in ancestor TCastleTransform. Render shadow quads for all the things rendered by Render. This is done only if Exists and CastShadows. It does shadow volumes culling inside (so ShadowVolumeRenderer should have FrustumCullingInit already initialized). Params.Transformation describe the transformation, just like for Render. | |
| Public | procedure AddAfterUpdateListener(const UpdateListener: TNotifyEvent); |
|
This item is declared in ancestor TCastleTransform. Called on update. Update listeners fire after all behaviors have been processed. Source: transform/castletransform_transform.inc (line 1100). | |
| Public | procedure RemoveAfterUpdateListener(const UpdateListener: TNotifyEvent); |
|
This item is declared in ancestor TCastleTransform. This item has no description. Source: transform/castletransform_transform.inc (line 1101). | |
| Public | procedure VisibleChangeHere(const Changes: TVisibleChanges); virtual; |
|
This item is declared in ancestor TCastleTransform. Something visible changed inside this object. This is usually called by implementation of this object, to notify others that it changed. Changes is a set describing what changes occurred. See TVisibleChange docs for more information. It must specify all things that possibly changed. Changes can be [], meaning "something tells us to redraw, but no visible change happened yet, maybe something will happen during a redraw" (this is used when e.g. possibly LOD level changed). We still increase TCastleAbstractRootTransform.InternalVisibleStateId even when Changes=[]. The information about visibility changed is passed to TCastleAbstractRootTransform in World. It increases TCastleAbstractRootTransform.InternalVisibleStateId, TCastleAbstractRootTransform.InternalVisibleGeometryStateId, TCastleAbstractRootTransform.InternalVisibleNonGeometryStateId. If you want to react to visibility changes, you should not override this method, instead watch above "state id" variables and react when they change. Source: transform/castletransform_transform.inc (line 1125). | |
| Public | function Middle: TVector3; virtual; |
|
This item is declared in ancestor TCastleTransform.
Middle point, usually "eye point", of the 3D model. This is used for sphere center (if CollisionSphereRadius is non-zero or Sphere returns In short, it's usually most comfortable to think about this as a position of the eye, or the middle of the creature's head. In an ideal situation, it should not be based on anything dynamic. For example, when this is based on the current bounding box of the animation, there is a risk that a large and sudden change in animation box could make the Middle point to jump to the other side of the wall (breaking collisions, as it changes Middle without a chance to check for collisions by MoveAllowed). Ideally, it should remain constant even when the shape of the object changes, and be possible to change only when MoveAllowed is checked (so only when TCastleTransform.Translation can change). In this class this returns something sensible above the bottom of the box. See TCastleTransform.MiddleHeight. This is expressed in the parent coordinate system (so it is close to the Translation value, but moved up, following GravityUp). So use Source: transform/castletransform_transform.inc (line 1168). | |
| Public | function WorldMiddle: TVector3; |
|
This item is declared in ancestor TCastleTransform. Our Middle, in world coordinates. Source: transform/castletransform_transform.inc (line 1174). | |
| Public | function Sphere(out Radius: Single): boolean; virtual; |
|
This item is declared in ancestor TCastleTransform.
Can the approximate sphere (around Middle point) be used for some collision-detection tasks. If Just like Middle and CollisionSphereRadius, this is expressed in the parent coordinate system. Must return By default, in TCastleTransform class, this returns The advantages of using a sphere, that does not have to be a perfect bounding sphere (it may be smaller than necessary, and only account e.g. for upper body part of the creature), are:
Sphere disadvantage:
Source: transform/castletransform_transform.inc (line 1271). | |
| Public | function Height(const MyPosition: TVector3; out AboveHeight: Single): boolean; overload; |
|
This item is declared in ancestor TCastleTransform. Get height of my point above the rest of the world. The given MyPosition, and returned AboveHeight, are in the parent coordinate system of this TCastleTransform. So for example query like this works naturally: This ignores the geometry of this 3D object (to not accidentally collide with your own geometry), and checks collisions with the rest of the world. Source: transform/castletransform_transform.inc (line 1296). | |
| Public | function Height(const MyPosition: TVector3; out AboveHeight: Single; out AboveGround: PTriangle): boolean; overload; |
|
This item is declared in ancestor TCastleTransform. This item has no description. Source: transform/castletransform_transform.inc (line 1298). | |
| Public | function LineOfSight(const Pos1, Pos2: TVector3): boolean; |
|
This item is declared in ancestor TCastleTransform. Whether there is line of sight (the line segment does not collide with anything opaque) between these 2 points. The given Pos1, Pos2 are in the parent coordinate system of this TCastleTransform. So for example query like this works naturally: This ignores the geometry of this 3D object (to not accidentally collide with your own geometry), and checks collisions with the rest of the world. Source: transform/castletransform_transform.inc (line 1312). | |
| Public | function MoveAllowed(const OldPos, ProposedNewPos: TVector3; out NewPos: TVector3; const BecauseOfGravity: boolean): boolean; overload; |
|
This item is declared in ancestor TCastleTransform. Is the move from OldPos to ProposedNewPos possible for this object. Returns true and sets NewPos if some move is allowed. The NewPos may be different than ProposedNewPos, which allows to perform wall-sliding. Wall sliding will only work if collision sphere is defined, which should be configured by setting CollisionSphereRadius to something non-zero. Otherwise, the move uses only box collisions, and wall sliding doesn't happen. When checking collisions, it avoids colliding with itself, so it only checks collisions with the rest of the world (things outside of this TCastleTransform). The given OldPos, ProposedNewPos, NewPos are in the parent coordinate system of this TCastleTransform. Intuitively, you are asking "Can I change Translation from OldPos to NewPos". So this method is consistent with Move, Translate. Source: transform/castletransform_transform.inc (line 1331). | |
| Public | function MoveAllowed(const OldPos, NewPos: TVector3; const BecauseOfGravity: boolean): boolean; overload; |
|
This item is declared in ancestor TCastleTransform. Is the move from OldPos to NewPos possible for this object. This overloaded version of If this object allows to use sphere for collisions (see CollisionSphereRadius and Sphere) then sphere will be used. Otherwise, it will collide as a bounding box. When checking collisions, it avoids colliding with itself, so it only checks collisions with the rest of the world (things outside of this TCastleTransform). The given OldPos, NewPos are in the parent coordinate system of this TCastleTransform. Intuitively, you are asking "Can I change Translation from OldPos to NewPos". So this method is consistent with Move, Translate. Source: transform/castletransform_transform.inc (line 1352). | |
| Public | function Ray(const RayOrigin, RayDirection: TVector3): TRayCollision; |
|
This item is declared in ancestor TCastleTransform. Cast a ray, see what is hit (checks the whole world, not just this TCastleTransform hierarchy). The given RayOrigin, RayDirection are in the parent coordinate system of this TCastleTransform. So for example query like this works naturally: This ignores the geometry of this object (to not accidentally collide with your own geometry), and checks collisions with the rest of the world. Source: transform/castletransform_transform.inc (line 1368). | |
| Public | function RayCast(const RayOrigin, RayDirection: TVector3): TCastleTransform; overload; |
|
This item is declared in ancestor TCastleTransform. Cast a ray, see what is hit (checks the whole world, not just this TCastleTransform hierarchy). The given RayOrigin, RayDirection are in the parent coordinate system of this TCastleTransform. So for example query like this works naturally: This ignores the geometry of this object (to not accidentally collide with your own geometry), and checks collisions with the rest of the world. This returns the TCastleTransform that is hit (this is the "leaf" TCastleTransform in the TCastleTransform tree that is hit) and a distance from RayOrigin to the hit point. Returns Source: transform/castletransform_transform.inc (line 1388). | |
| Public | function RayCast(const RayOrigin, RayDirection: TVector3; out Distance: Single): TCastleTransform; overload; |
|
This item is declared in ancestor TCastleTransform. This item has no description. Source: transform/castletransform_transform.inc (line 1390). | |
| Public | function OutsideToLocal(const Pos: TVector3): TVector3; |
|
This item is declared in ancestor TCastleTransform.
Convert position between local and outside coordinate system. This is called Source: transform/castletransform_transform.inc (line 1398). | |
| Public | function LocalToOutside(const Pos: TVector3): TVector3; |
|
This item is declared in ancestor TCastleTransform. This item has no description. Source: transform/castletransform_transform.inc (line 1399). | |
| Public | function WorldToLocal(const Pos: TVector3): TVector3; |
|
This item is declared in ancestor TCastleTransform. Convert position between local and world coordinate system. This applies all the transformations on the way to root, so it looks at this object as well as all parents' transformations. Source: transform/castletransform_transform.inc (line 1406). | |
| Public | function LocalToWorld(const Pos: TVector3): TVector3; |
|
This item is declared in ancestor TCastleTransform. This item has no description. Source: transform/castletransform_transform.inc (line 1407). | |
| Public | function WorldToLocalDirection(const Dir: TVector3): TVector3; |
|
This item is declared in ancestor TCastleTransform. Convert direction between local and world coordinate system. This applies all the transformations on the way to root, so it looks at this object as well as all parents' transformations. Source: transform/castletransform_transform.inc (line 1414). | |
| Public | function LocalToWorldDirection(const Dir: TVector3): TVector3; |
|
This item is declared in ancestor TCastleTransform. This item has no description. Source: transform/castletransform_transform.inc (line 1415). | |
| Public | function LocalToWorldDistance(const Distance: Single): Single; |
|
This item is declared in ancestor TCastleTransform. Convert distance, like sphere radius, between local and world coordinate system. This applies all the scaling on the way to root, so it looks at this object as well as all parents' transformations. Source: transform/castletransform_transform.inc (line 1422). | |
| Public | function WorldToLocalDistance(const Distance: Single): Single; |
|
This item is declared in ancestor TCastleTransform. This item has no description. Source: transform/castletransform_transform.inc (line 1423). | |
| Public | function PreferredHeight: Single; virtual; deprecated 'use physics (TCastleRigidBody, TCastleCollider) to make things affected by gravity'; |
|
This item is declared in ancestor TCastleTransform. Warning: this symbol is deprecated: use physics (TCastleRigidBody, TCastleCollider) to make things affected by gravity The preferred height of the object Middle above the ground, when the object is standing on the ground firmly. This is used by objects affected by gravity (like non-flying creatures and items) to know how far they should fall down or grow up. The default implementation in this class looks at MiddleHeight property, see the algorithm described there. This may be dynamic (may change during creature lifetime, so you can make the creature duck or grow if you want). Source: transform/castletransform_transform.inc (line 1467). | |
| Public | function Transform: TMatrix4; |
|
This item is declared in ancestor TCastleTransform. Transformation (from local to outside) as a matrix. This matrix represents a concise version of properties like Translation, Rotation, Scale. It does not take into account the transformation of parent TCastleTransform (for this, use WorldTransform). Source: transform/castletransform_transform.inc (line 1523). | |
| Public | function InverseTransform: TMatrix4; |
|
This item is declared in ancestor TCastleTransform. Inverse transformation as a matrix, thus transforming from outside to local coordinate system. This is an inverse of Transform. Source: transform/castletransform_transform.inc (line 1527). | |
| Public | function HasWorldTransform: boolean; |
|
This item is declared in ancestor TCastleTransform.
All conditions are satisfied to have WorldTransform. When this returns Source: transform/castletransform_transform.inc (line 1532). | |
| Public | function WorldTransform: TMatrix4; |
|
This item is declared in ancestor TCastleTransform. Transformation (from local to world) as a matrix. This accumulates the transformation of this instance (derived from properties like Translation, Rotation, Scale) with the transformation of parent TCastleTransform instances, all the way up to and including the root transformation (TCastleAbstractRootTransform). Thus, this is a transformation to the world known to the TCastleViewport instance. Two conditions are necessary to make this available:
You can check HasWorldTransform before calling this method, to avoid catching an exception. Note that the
Exceptions raised
Source: transform/castletransform_transform.inc (line 1588). | |
| Public | function WorldInverseTransform: TMatrix4; |
|
This item is declared in ancestor TCastleTransform. Inverse transformation of WorldTransform, thus transforming from world to local coordinate system. See WorldTransform for more details how this works.
Exceptions raised
Source: transform/castletransform_transform.inc (line 1605). | |
| Public | procedure Translate(const TranslationChange: TVector3); |
|
This item is declared in ancestor TCastleTransform. Unconditionally move this object by a given vector. To move and check collisions, use Move instead of this method. The provided TranslationChange should be a direction in the parent coordinate system of this TCastleTransform. Using this routine is exactly equivalent to Source: transform/castletransform_transform.inc (line 1615). | |
| Public | function Move(const TranslationChange: TVector3; const BecauseOfGravity: boolean; const EnableWallSliding: boolean = true): boolean; |
|
This item is declared in ancestor TCastleTransform. Move, if possible (checking collisions with other objects in world). This is the simplest way to move an object, and a basic building block for artificial intelligence of creatures. Checks move possibility by MoveAllowed, using Middle point. Actual move is done using Translate. Note that wall sliding will only work if collision sphere is defined, which should be configured by setting CollisionSphereRadius to something non-zero. Otherwise, the move uses only box collisions, and wall sliding doesn't happen. The provided TranslationChange should be a direction in the parent coordinate system of this TCastleTransform, so using this routine is consistent with doing Source: transform/castletransform_transform.inc (line 1633). | |
| Public | procedure Identity; |
|
This item is declared in ancestor TCastleTransform. Make the transform do nothing — zero Translation, zero Rotation, Scale to one. Also resets ScaleOrientation and Center. Source: transform/castletransform_transform.inc (line 1759). | |
| Public | procedure GetView(out APos, ADir, AUp: TVector3); |
|
This item is declared in ancestor TCastleTransform. Get at once vectors: position, direction, up. Just like Translation and Rotation, these vectors reflect the transformation defined locally in this TCastleTransform, disregarding the parent transformations. Use GetWorldView to account for parent transformations. Source: transform/castletransform_transform.inc (line 1896). | |
| Public | procedure GetWorldView(out APos, ADir, AUp: TVector3); |
|
This item is declared in ancestor TCastleTransform. Get position, direction, up. Similar to GetView, but in world coordinates. Returned ADir and AUp are always orthogonal. Returned ADir and AUp are always normalized. Source: transform/castletransform_transform.inc (line 1902). | |
| Public | function WorldTranslation: TVector3; |
|
This item is declared in ancestor TCastleTransform. Get position in world coordinates. The returned position is the same as by GetWorldView. This method just doesn't calculation anything else, thus it is faster than GetWorldView if you don't need direction/up. Source: transform/castletransform_transform.inc (line 1923). | |
| Public | procedure SetView(const APos, ADir, AUp: TVector3; const AdjustUp: boolean = true); overload; |
|
This item is declared in ancestor TCastleTransform. Set at once vectors: position, direction, up. ADir and AUp given here do not have to be normalized (they will be normalized if needed). They will be automatically fixed to be orthogonal, if necessary: when AdjustUp = Just like Translation and Rotation, these vectors reflect the transformation defined locally in this TCastleTransform, disregarding the parent transformations. Use SetWorldView to account for parent transformations. Source: transform/castletransform_transform.inc (line 1938). | |
| Public | procedure SetView(const ADir, AUp: TVector3; const AdjustUp: boolean = true); overload; |
|
This item is declared in ancestor TCastleTransform. This item has no description. Source: transform/castletransform_transform.inc (line 1940). | |
| Public | procedure SetWorldView(const APos, ADir, AUp: TVector3; const AdjustUp: boolean = true); |
|
This item is declared in ancestor TCastleTransform. Set position, direction, up. Similar to SetView, but in world coordinates. Given ADir, AUp do not have to be normalized, we will normalize them internally if necessary. But make sure they are non-zero. We will automatically fix ADir and AUp to be orthogonal, if necessary: when AdjustUp = Source: transform/castletransform_transform.inc (line 1953). | |
| Public | procedure UpPrefer(const AUp: TVector3); |
|
This item is declared in ancestor TCastleTransform. Change up vector, keeping the direction unchanged. If necessary, the up vector provided here will be fixed to be orthogonal to direction. This is similar to assigning Up vector using it's property setter, but different behavior happens when we need to fix vectors to have direction orthogonal to up (which must be always true). In case of assigning Up by property setter, the Direction vector is changed (if necessary, to be orthogonal to up). In case of this method, the up vector is changed (if necessary, to be orthogonal to direction). It's good to use this if you have a preferred up vector for creatures, but still preserving the direction vector has the highest priority. Source: transform/castletransform_transform.inc (line 1970). | |
| Public | procedure AddBehavior(const Behavior: TCastleBehavior); |
|
This item is declared in ancestor TCastleTransform. Add a TCastleBehavior to this TCastleTransform. In effect, the virtual methods of TCastleBehavior, like TCastleBehavior.Update, will be automatically called. Also the TCastleBehavior.Parent gets assigned. If the given Behavior was part of another TCastleTransform, it is removed from it. If the given Behavior was already part of this TCastleTransform, nothing happens (note: we do not move the behavior to the end of the list).
See also
Source: transform/castletransform_transform.inc (line 2016). | |
| Public | procedure InsertBehavior(const Index: Integer; const Behavior: TCastleBehavior); |
|
This item is declared in ancestor TCastleTransform. Insert a TCastleBehavior to this TCastleTransform at a specified index. In effect, the virtual methods of TCastleBehavior, like TCastleBehavior.Update, will be automatically called. Also the TCastleBehavior.Parent gets assigned. If the given Behavior was part of another TCastleTransform, it is removed from it. If the given Behavior was already part of this TCastleTransform, nothing happens (note: we do not move the behavior to the new index).
See also
Source: transform/castletransform_transform.inc (line 2030). | |
| Public | function BehaviorIndex(const Behavior: TCastleBehavior): Integer; |
|
This item is declared in ancestor TCastleTransform. Returns the behavior index, -1 means not found. Source: transform/castletransform_transform.inc (line 2033). | |
| Public | procedure RemoveBehavior(const Behavior: TCastleBehavior); |
|
This item is declared in ancestor TCastleTransform.
Remove TCastleBehavior from this TCastleTransform. In effect, the virtual methods of TCastleBehavior, like TCastleBehavior.Update, will no longer be automatically called. The TCastleBehavior.Parent is set to Source: transform/castletransform_transform.inc (line 2039). | |
| Public | function FindBehavior(const BehaviorClass: TCastleBehaviorClass): TCastleBehavior; |
|
This item is declared in ancestor TCastleTransform.
Find the first behavior of the given class, Source: transform/castletransform_transform.inc (line 2042). | |
| Public | function FindAllBehaviors(const BehaviorClass: TCastleBehaviorClass): TCastleBehaviorList; |
|
This item is declared in ancestor TCastleTransform. Find all behaviors of given class, in this transform and children (up to any depth). The behaviors are added to the list, disregaring the Exists or ExistsInRoot property of parents. Returned class does not own children. The caller is responsible for freeing the returned list. Source: transform/castletransform_transform.inc (line 2048). | |
| Public | function FindRequiredBehavior(const BehaviorClass: TCastleBehaviorClass): TCastleBehavior; |
|
This item is declared in ancestor TCastleTransform.
Find the first behavior of the given class, or create and add a new one if necessary. Never returns Source: transform/castletransform_transform.inc (line 2052). | |
| Public | function BehaviorsCount: Integer; |
|
This item is declared in ancestor TCastleTransform. Count of behaviors. See also
Source: transform/castletransform_transform.inc (line 2057). | |
| Public | function BehaviorsEnumerate: TCastleBehaviorEnumerator; |
|
This item is declared in ancestor TCastleTransform.
You can enumerate current behaviors using loop like Source: transform/castletransform_transform.inc (line 2067). | |
| Public | procedure AddWorldChangeNotification(const Behavior: TCastleBehavior); |
|
This item is declared in ancestor TCastleTransform. Adds a behavior to the list that needs to be informed about the world change. Adding multiple times the same behavior is harmless and has no effect. Source: transform/castletransform_transform.inc (line 2071). | |
| Public | procedure RemoveWorldChangeNotification(const Behavior: TCastleBehavior); |
|
This item is declared in ancestor TCastleTransform. Removes a behavior from the list that needs to be informed about the world change. Source: transform/castletransform_transform.inc (line 2075). | |
| Public | function InternalBuildNode: TObject; |
|
This item is declared in ancestor TCastleTransform. Create X3D nodes graph representing this TCastleTransorm (and its children). This can be used to save to any format supported by the SaveNode, like X3D and STL. See this news post for a summary of available features. This method is internal, because:
That said, this is useful, because:
Result must be TTransformNode but it cannot be declared as such. It exports content for all nodes, even csTransient, and thus it is never Source: transform/castletransform_transform.inc (line 2156). | |
| Protected | procedure ExecuteCompiledScript(const HandlerName: string; ReceivedValue: TX3DField); virtual; abstract; |
|
This item is declared in ancestor TX3DEventsEngine. This item has no description. | |
| Public | procedure InternalChangedField(const Field: TX3DField; const Change: TX3DChange); overload; virtual; abstract; |
|
This item is declared in ancestor TX3DEventsEngine. This item has no description. | |
| Public | procedure InternalChangedField(const Field: TX3DField); overload; |
|
This item is declared in ancestor TX3DEventsEngine. This item has no description. | |
| Public | function InternalCastingShadowVolumesNow: Boolean; virtual; abstract; |
|
This item is declared in ancestor TX3DEventsEngine. This item has no description. | |
| Protected | function InternalBuildNodeInside: TObject; override; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. Showing description inherited from TCastleTransform.InternalBuildNodeInside.
Helper for InternalBuildNode. Result must be TAbstractChildNode or | |
| Protected | procedure UpdateHeadlightOnFromNavigationInfo; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Protected | procedure ChangedTransform; override; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. Showing description inherited from TCastleTransform.ChangedTransform. Override to be notified about every transformation change. By default, this calls VisibleChangeHere, which causes the window to redraw. | |
| Protected | procedure DoPointingDeviceSensorsChange; virtual; |
|
This item is declared in ancestor TCastleSceneCore. Called after PointingDeviceSensors or PointingDeviceActiveSensors lists (possibly) changed. In this class, | |
| Protected | procedure ExecuteCompiledScript(const HandlerName: String; ReceivedValue: TX3DField); override; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Protected | function LocalHeightCollision(const APosition, GravityUp: TVector3; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc; out AboveHeight: Single; out AboveGround: PTriangle): boolean; override; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Protected | function LocalMoveCollision( const OldPos, ProposedNewPos: TVector3; out NewPos: TVector3; const IsRadius: boolean; const Radius: Single; const OldBox, NewBox: TBox3D; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc): boolean; override; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Protected | function LocalMoveCollision( const OldPos, NewPos: TVector3; const IsRadius: boolean; const Radius: Single; const OldBox, NewBox: TBox3D; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc): boolean; override; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Protected | function LocalSegmentCollision(const Pos1, Pos2: TVector3; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc; const ALineOfSight: boolean): boolean; override; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Protected | function LocalSphereCollision(const Pos: TVector3; const Radius: Single; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc): boolean; override; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Protected | function LocalSphereCollision2D(const Pos: TVector2; const Radius: Single; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc; const Details: TCollisionDetails): boolean; override; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Protected | function LocalPointCollision2D(const Point: TVector2; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc): boolean; override; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Protected | function LocalBoxCollision(const Box: TBox3D; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc): boolean; override; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Protected | function LocalRayCollision(const RayOrigin, RayDirection: TVector3; const TrianglesToIgnoreFunc: TTriangleIgnoreFunc): TRayCollision; override; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Protected | procedure Loaded; override; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Protected | procedure InternalMoveShapeAssociations( const OldNode, NewNode: TX3DNode; const ContainingShapes: TObject); override; |
|
This item is declared in ancestor TCastleSceneCore. Called before changing one node into another, when old node may have beeen associated with a shape using TShapeTree.AssociateNode. Both OldNode and NewNode may be It is allowed to call this even when OldNode = NewNode, which means that nothing really changes. | |
| Protected | function LocalBoundingBoxNoChildren: TBox3D; |
|
This item is declared in ancestor TCastleSceneCore. Local (not affected by our Translation, Rotation, Scale) bounding box. Takes into account loaded scene (in Url) but not children TCastleTransform bounding volumes. | |
| Public | procedure CustomSerialization(const SerializationProcess: TSerializationProcess); override; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. Showing description inherited from TCastleComponent.CustomSerialization. Override this method to call various methods of SerializationProcess, which in turn allows to serialize/deserialize things that are not published. This allows to serialize/deserialize with more freedom, e.g. to serialize/deserialize some private field. | |
| Public | procedure Load(const ARootNode: TX3DRootNode; const AOwnsRootNode: boolean; const AOptions: TSceneLoadOptions = []); overload; |
|
This item is declared in ancestor TCastleSceneCore. Load the given model. This replaces RootNode with new value.
Note that you should never load the same TX3DRootNode instance into multiple TCastleScene instances.
// DON'T DO THIS!
Node := LoadNode(Url);
Scene1 := TCastleScene.Create(Application);
Scene1.Load(Node, false);
Scene2 := TCastleScene.Create(Application);
Scene2.Load(Node, false);
If you need to load the same model into multiple scenes, it is best to use the Clone method: SceneTemplate := TCastleScene.Create(Application); SceneTemplate.Load(Url); Scene1 := SceneTemplate.Clone(Application); Scene2 := SceneTemplate.Clone(Application);
Using the Clone makes a copy of the underlying X3D graph, so it is roughly like doing: Node := LoadNode(Url); Scene1 := TCastleScene.Create(Application); Scene1.Load(Node.DeepCopy as TX3DRootNode, false); Scene2 := TCastleScene.Create(Application); Scene2.Load(Node.DeepCopy as TX3DRootNode, false);
Note that sometimes you don't need to create multiple scenes to show the same model many times. You can simply insert the same TCastleScene instance multiple times to TCastleViewport.Items (TCastleRootTransform). See the manual: https://castle-engine.io/manual_scene.php#section_many_instances Parameters
| |
| Public | procedure Load(const AUrl: String; const AOptions: TSceneLoadOptions = []); overload; |
|
This item is declared in ancestor TCastleSceneCore. Load the 3D model from given URL. We load a number of 3D model formats (X3D, VRML, Collada, Wavefront OBJ...) and some 2D model formats (Spine JSON). See https://castle-engine.io/creating_data_model_formats.php for the complete list. URL is downloaded using the CastleDownload unit, so it supports files, http resources and more. See https://castle-engine.io/url about supported URL schemes. If you all you care about is loading normal files, then just pass a normal filename (absolute or relative to the current directory) as the URL parameter. | |
| Public | procedure Load(const AUrl: String; const AllowStdIn: boolean; const AResetTime: boolean = true); overload; deprecated 'use Load with (AUrl: String, AOptions: TSceneLoadOptions) parameters. AllowStdIn is not implemented anymore.'; |
|
This item is declared in ancestor TCastleSceneCore. Warning: this symbol is deprecated: use Load with (AUrl: String, AOptions: TSceneLoadOptions) parameters. AllowStdIn is not implemented anymore. This item has no description. | |
| Public | procedure Save(const AUrl: String); |
|
This item is declared in ancestor TCastleSceneCore. Save the current 3D model (X3D nodes graph) to the given file (URL). The X3D encoding is automatically guessed from the URL extension. By default it is XML, and we suggest using the The file may also be automatically gzip compressed if extension indicates it. Use The Url property is also changed. | |
| Public | procedure BeforeDestruction; override; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Public | function ShapeBoundingBox(const Node: TAbstractShapeNode): TBox3D; |
|
This item is declared in ancestor TCastleSceneCore. Bounding box of the given shape (TAbstractShapeNode). The shape node may be used multiple times in the nodes graph (in RootNode), in which case this method correctly (and fast) sums bounding box of all the occurrences of the given shape node. | |
| Public | function ShapesActiveCount: Cardinal; |
|
This item is declared in ancestor TCastleSceneCore. Number of active shapes in the Shapes tree. This is equivalent to Shapes.ShapesCount(true), except that this is faster (it's cached and reused in this instance, and automatically invalidated only when needed). | |
| Public | function ShapesActiveVisibleCount: Cardinal; |
|
This item is declared in ancestor TCastleSceneCore. Number of active and visible (TShape.Visible) shapes in the Shapes tree. See also
| |
| Public | function VerticesCount: Cardinal; overload; |
|
This item is declared in ancestor TCastleSceneCore. Calculate the number of triangls and vertexes of all shapa states. For detailed specification of what these functions do see appropriate TAbstractGeometryNode methods. Here, we just sum their results for all shapes. | |
| Public | function TrianglesCount: Cardinal; overload; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Public | function ViewpointsCount: Cardinal; |
|
This item is declared in ancestor TCastleSceneCore. Number of viewpoints (named camera position+orientation). -1 if none. | |
| Public | function GetViewpointNode(const Idx: integer): TAbstractViewpointNode; |
|
This item is declared in ancestor TCastleSceneCore. Viewpoint node (TAbstractViewpointNode) from an index between 0 and ViewpointsCount. | |
| Public | function GetViewpointName(const Idx: integer): String; |
|
This item is declared in ancestor TCastleSceneCore. Good name to show user for a viewpoint, defined by an index between 0 and ViewpointsCount. | |
| Public | procedure MoveToViewpoint(const Idx: integer; const Animated: boolean = true); |
|
This item is declared in ancestor TCastleSceneCore. Move current camera of the enclosing TCastleViewport to reflect the given viewpoint. This changes the camera position and orientation. In X3D terminology, the new viewpoint node becomes "bound" (current). Switching the viewpoint that is already bound (current) also has an effect, it will change the camera position and orientation to reflect the viewpoint defined position / orientation. | |
| Public | procedure AddViewpointFromNavigation(const Navigation: TCastleNavigation; const AName: String); |
|
This item is declared in ancestor TCastleSceneCore. Add to scene nodes (graph in RootNode) new viewpoint node reflecting current camera and navigation settings. The new viewpoint increases ViewpointsCount, so it's also immediately available for switching to it. | |
| Public | procedure NodeFreeRemovingFromAllParents(Node: TX3DNode); |
|
This item is declared in ancestor TCastleSceneCore. Call Node.FreeRemovingFromAllParents, making sure that changes to our VRML/X3D node graph are allowed. This makes sure we call BeforeNodesFree befor freeing, and ChangedAll afterwards. This avoids a common pitfall with relying on TShape or such existence between BeforeNodesFree and ChangedAll. BeforeNodesFree may free all our TShape instances, so if you want to free TX3DNode from our graph — you typically want to get this TX3DNode instance *before* calling BeforeNodesFree. Using this method to free the node ensures this. | |
| Public | procedure RemoveShape(Shape: TShape); |
|
This item is declared in ancestor TCastleSceneCore. Remove the shape node from the scene. In case of VRML 1.0 / Inventor, when the Shape doesn't have a node, we remove the geometry node. | |
| Public | procedure ChangedAll(const OnlyAdditions: Boolean = false); override; |
|
This item is declared in ancestor TCastleSceneCore. Notify scene that potentially everything changed in the VRML/X3D graph. This includes adding/removal of some nodes within RootNode graph and changing their fields' values. (Before freeing the nodes, remember to also call BeforeNodesFree earlier.) You usually never need to call this method explicitly. It's called by engine when necesssary. However, you need to call it yourself if you change the X3D graph directly through nodes'
Descendant implementors notes:
| |
| Public | procedure DoViewpointsChanged; |
|
This item is declared in ancestor TCastleSceneCore. Call OnViewpointsChanged, if assigned. | |
| Public | procedure DoBoundViewpointVectorsChanged; |
|
This item is declared in ancestor TCastleSceneCore. Call OnBoundViewpointVectorsChanged, if assigned. | |
| Public | procedure DoBoundNavigationInfoFieldsChanged; virtual; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Public | procedure ScheduleChangedAll(const OnlyAdditions: Boolean = false); |
|
This item is declared in ancestor TCastleSceneCore. Mechanism to schedule ChangedAll calls. Since these calls may be costly (traversing the hierarchy), and their results are often not immediately needed by TCastleSceneCore or TX3DNode hierarchy, it's sometimes not desirable to call them immediately when geometry changed / all changed. So you can use When you're within Begin/EndChangesSchedule, then | |
| Public | procedure BeginChangesSchedule; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Public | procedure EndChangesSchedule; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Public | function Info( ATriangleVerticesCounts, ABoundingBox: boolean; AManifoldAndBorderEdges: boolean): String; deprecated 'do not use this, better to construct a summary string yourself'; |
|
This item is declared in ancestor TCastleSceneCore. Warning: this symbol is deprecated: do not use this, better to construct a summary string yourself Returns short information about the scene. This consists of a few lines, separated by newlines. Last line also ends with CastleUtils.NL. | |
| Public | function InfoTriangleVerticesCounts: String; deprecated 'better to construct a string yourself, use TrianglesCount, VerticesCount'; |
|
This item is declared in ancestor TCastleSceneCore. Warning: this symbol is deprecated: better to construct a string yourself, use TrianglesCount, VerticesCount This item has no description. | |
| Public | function InfoBoundingBox: String; deprecated 'better to construct a string yourself, use BoundingBox.ToString'; |
|
This item is declared in ancestor TCastleSceneCore. Warning: this symbol is deprecated: better to construct a string yourself, use BoundingBox.ToString This item has no description. | |
| Public | function InfoManifoldAndBorderEdges: String; deprecated 'better to construct a string yourself, use EdgesCount'; |
|
This item is declared in ancestor TCastleSceneCore. Warning: this symbol is deprecated: better to construct a string yourself, use EdgesCount This item has no description. | |
| Public | function InternalDetectedWholeSceneManifold( const ForceRecalculation: Boolean = false): Boolean; |
|
This item is declared in ancestor TCastleSceneCore. Is this scene detected as "whole scene is manifold", so some shapes are not 2-manifold but whole scene is 2-manifold. This is independent (doesn't take into account) the value of RenderOptions.WholeSceneManifold. | |
| Public | procedure EdgesCount(out ManifoldEdges, BorderEdges: Cardinal); |
|
This item is declared in ancestor TCastleSceneCore. Edges count in the scene, for information purposes. | |
| Public | function InternalOctreeRendering: TShapeOctree; |
|
This item is declared in ancestor TCastleSceneCore.
A spatial structure containing all visible shapes. Set PreciseCollisions to This is used internally for "frustum culling", it will be automatically used by TCastleScene rendering to speed it up. You should not need to use this directly. This octree will be automatically updated on dynamic scenes (when e.g. animation moves some shape by changing it's transformation). Note that when VRML/X3D scene contains Collision nodes, this octree contains the visible (not necessarily collidable) objects. | |
| Public | function InternalOctreeDynamicCollisions: TShapeOctree; |
|
This item is declared in ancestor TCastleSceneCore.
A spatial structure containing all collidable shapes (and then collidable triangles for a specifc shape). Set PreciseCollisions to This is actually a hierarchy of octrees: scene is partitioned first into Shapes (each instance of VRML/X3D geometry node), and then each Shape has an octree of triangles inside. Thanks to this, merely transforming some Shape means that only one item needs to be moved in the top-level shape tree. So this is the most important structure for collision detection on dynamic scenes. This octree is useful for all kinds of collision detection. This is automatically used by the XxxCollision methods in this class. You should not usually use this directly. Instead use TCastleViewport and then use Note that when VRML/X3D scene contains Collision nodes, this octree contains the collidable (not necessarily rendered) objects. This is kept up-to-date automatically when the scene changes. TODO: Temporarily, this is updated simply by rebuilding. | |
| Public | function InternalOctreeCollisions: TBaseTrianglesOctree; |
|
This item is declared in ancestor TCastleSceneCore. Octree for collisions. This is equal to InternalOctreeDynamicCollisions now as we don't have other ways to check for collisions. Set PreciseCollisions to You should not usually use this directly. Instead use TCastleViewport and then use | |
| Public | function UseInternalOctreeCollisions: boolean; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Public | function GetViewpoint( out ProjectionType: TProjectionType; out CamPos, CamDir, CamUp, GravityUp: TVector3; const ViewpointDescription: String = ''): TAbstractViewpointNode; |
|
This item is declared in ancestor TCastleSceneCore. Viewpoint defined in the 3D file (or some default camera settings if no viewpoint is found).
If ViewpointDescription = '', they return the first found viewpoint node. Otherwise, they look for X3DViewpointNode with description field mathing given string. If camera properties were found in some node, it returns this node. Otherwise it returns nil. This way you can optionally extract some additional info from used viewpoint node, or do something special if default values were used. Often you will just ignore result of this function — after all, the most important feature of this function is that you don't have to care about details of dealing with camera node. Returned CamDir and CamUp and GravityUp are always normalized — reasons the same as for TAbstractViewpointNode.GetView. | |
| Public | function GetPerspectiveViewpoint( out CamPos, CamDir, CamUp, GravityUp: TVector3; const ViewpointDescription: String = ''): TAbstractViewpointNode; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Public | procedure UnregisterScene(Node: TX3DNode); deprecated 'use Node.UnregisterScene'; |
|
This item is declared in ancestor TCastleSceneCore. Warning: this symbol is deprecated: use Node.UnregisterScene Recursively unset node's TX3DNode.Scene. | |
| Public | function Press(const Event: TInputPressRelease): boolean; override; |
|
This item is declared in ancestor TCastleSceneCore. Scene processes X3D key sensor nodes here, https://castle-engine.io/x3d_implementation_keydevicesensor.php . Remember to set ListenPressRelease to process the key sensor nodes. | |
| Public | function Release(const Event: TInputPressRelease): boolean; override; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Public | function PointingDevicePress(const Pick: TRayCollisionNode; const Distance: Single): Boolean; override; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. Showing description inherited from TCastleTransform.PointingDevicePress.
Pointing device (mouse or touch) events, you can override these to handle pointing device events. These methods are automatically called by the TCastleViewport. They are exposed here only to allow overriding them. Return
They receive Pick information (TRayCollisionNode) about what exactly is hit by the 3D ray corresponding to the current pointing device position. It contains the detailed information about the point, triangle and ray (all in local coordinate system of this TCastleTransform) that are indicated by the pointing device. TRayCollisionNode.Triangle is They also receive Distance to the collision point, in world coordinates. See TRayCollision.Distance. The Distance may be MaxSingle when it was not possible to determine. There is a concept of a TCastleTransform that is currently "capturing" the pointing device events. Once TCastleTransform handles After the "capturing" instance, every pointing device event (press, release or move) is send to the leaf in TCastleTransform hierarchy (usually a TCastleScene) that is under the mouse/touch position. If the event is not handled, it is passed to other objects under the mouse/touch position. The PointingDeviceMove event is also always passed to TCastleRootTransform.MainScene at the end (if it wasn't already the "capturing" transform, or under the mouse/touch position). This way TCastleRootTransform.MainScene is always informed about pointing device movement. These methods are called only if the object Exists. There's no need to check this condition inside the method implementation. | |
| Public | function PointingDeviceRelease(const Pick: TRayCollisionNode; const Distance: Single; const CancelAction: Boolean): Boolean; override; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Public | function PointingDeviceMove(const Pick: TRayCollisionNode; const Distance: Single): boolean; override; |
|
This item is declared in ancestor TCastleSceneCore. Called when pointing device moves. This may generate the continuously-generated events like hitPoint_changed, also it updates PointingDeviceOverItem and PointingDeviceOverPoint, thus producing isOver and such events. For pointing device sensors to work, you must have collision structures set up by setting PreciseCollisions to | |
| Public | function PointingDeviceSensors: TPointingDeviceSensorList; |
|
This item is declared in ancestor TCastleSceneCore.
Pointing-device sensors over which the pointing device is. This is just a shortcut for PointingDeviceOverItemˆ.State.PointingDeviceSensors, returning | |
| Public | procedure PointingDeviceClear; |
|
This item is declared in ancestor TCastleSceneCore. Clear any references to PTriangle passed previously in TRayCollisionNode argument to PointingDevicePress, PointingDeviceRelease, PointingDeviceMove. This is internally used in case some of past seen PTriangle may become invalid, so any memory about them should be cleared. This doesn't cause any X3D events (contrary to e.g. calling PointingDeviceMove with Pick.Triangle = This method clears any references to saved PTriangle and PointingDeviceActiveSensors. Note that this still calls DoPointingDeviceSensorsChange (making OnPointingDeviceSensorsChange event), if PointingDeviceActiveSensors / PointingDeviceSensors possibly changed. | |
| Public | function LocalBoundingBox: TBox3D; override; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. Showing description inherited from TCastleTransform.LocalBoundingBox. Bounding box of this object, ignoring the transformations of this scene and parents.
| |
| Public | procedure SetTime(const NewValue: TFloatTime); |
|
This item is declared in ancestor TCastleSceneCore. Change current scene time, setting Time. This causes time to be passed to appropriate time-dependent nodes, events will be called etc. You must call this continuously to have time-dependent features working, like TTimeSensorNode nodes inside the scene (driving all animations) and TMovieTextureNode. See Time for details what is affected by this. This is automatically called if you added this scene to TCastleViewport.Items. Then our TCastleViewport takes care of calling our Update which in turn will call this method (and account for TimePlaying and TimePlayingSpeed).
Following X3D specification, time should only grow. So NewValue should be > Time (or TimeIncrease > 0). Otherwise we ignore this call. For resetting the time (when you don't necessarily want to grow Time) see ResetTime. If a change of Time will produce some visible change in the model (for example, MovieTexture will change, or TimeSensor change will be routed by interpolator to coordinates of some visible node) it will be reported by usual method, that is VisibleChangeHere. | |
| Public | procedure IncreaseTime(const TimeIncrease: TFloatTime); |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Public | procedure IncreaseTimeTick; deprecated 'it should not be necessary to call this, ever; using TX3DEvent.Send(...) or TX3DEvent.Send(..., NextEventTime) will automatically behave Ok.'; |
|
This item is declared in ancestor TCastleSceneCore. Warning: this symbol is deprecated: it should not be necessary to call this, ever; using TX3DEvent.Send(...) or TX3DEvent.Send(..., NextEventTime) will automatically behave Ok. This item has no description. | |
| Public | function Time: TFloatTime; override; |
|
This item is declared in ancestor TCastleSceneCore. Current time within this scene, in seconds. Increasing this "drives" the animations (by increasing time of time-dependent nodes like TTimeSensorNode, which in turn drive the rest of the animation). You can use SetTime or IncreaseTime to move time forward manually. But usually there's no need for it: our Update method takes care of it automatically, you only need to place the scene inside TCastleViewport.Items. You can start/stop time progress by TimePlaying and scale it by TimePlayingSpeed. These properties affect how the time is updated by the Update method (so if you use SetTime or IncreaseTime methods, you're working around these properties). Default time value is 0.0 (zero). However it will be reset at load to a current time (seconds since Unix epoch — that's what X3D standard says to use, although you can change it by TNavigationInfoNode.timeOriginAtLoad, see https://castle-engine.io/x3d_time_origin_considered_uncomfortable ). You can perform this "time reset" yourself by ResetTimeAtLoad or ResetTime. | |
| Public | function NextEventTime: TX3DTime; override; |
|
This item is declared in ancestor TCastleSceneCore. Time that should be used for next event. You usually don't need to call this directly, this is automatically used by TX3DEvent.Send when you don't specify explicit time. | |
| Public | procedure ResetTime(const NewValue: TFloatTime); |
|
This item is declared in ancestor TCastleSceneCore. Set Time to an arbitrary value. You should only use this when you loaded new model. It is automatically called by Load so in practice you don't need to call this yourself. Unlike SetTime and IncreaseTime, this doesn't require that Time grows. It still does some time-dependent events work, although some time-dependent nodes may be just unconditionally reset by this to starting value (as they keep local time, and so require TimeIncrease notion, without it we can only reset them). | |
| Public | procedure ResetTimeAtLoad; |
|
This item is declared in ancestor TCastleSceneCore. Set Time to suitable initial value after loading a world. This honours X3D specification about the time origin, and our extensions too. See https://castle-engine.io/x3d_time_origin_considered_uncomfortable | |
| Public | function GetBackgroundStack: TX3DBindableStackBasic; override; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Public | function GetFogStack: TX3DBindableStackBasic; override; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Public | function GetNavigationInfoStack: TX3DBindableStackBasic; override; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Public | function GetViewpointStack: TX3DBindableStackBasic; override; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Public | procedure RegisterCompiledScript(const HandlerName: String; Handler: TCompiledScriptHandler); |
|
This item is declared in ancestor TCastleSceneCore. Register compiled script handler, for VRML/X3D Script node with "compiled:" protocol. See [https://castle-engine.io/x3d_extensions.php#section_ext_script_compiled]. | |
| Public | procedure InternalUpdateNavigation( const Navigation: TCastleNavigation); |
|
This item is declared in ancestor TCastleSceneCore. Update TCastleNavigation properties based on currently bound TNavigationInfoNode. Bound TNavigationInfoNode is taken from NavigationInfoStack.Top. If no such node is bound (NavigationInfoStack.Top is Note that, since some fields are only in some descendants (e.g. MoveSpeed is only at TCastleWalkNavigation) then some TNavigationInfoNode settings are just not transferred to all Navigation instances like TCastleExamineNavigation | |
| Public | procedure CameraTransition(const Camera: TCastleCamera; const APosition, ADirection, AUp: TVector3); overload; deprecated 'use Camera.AnimateTo(APosition, ADirection, AUp)'; |
|
This item is declared in ancestor TCastleSceneCore. Warning: this symbol is deprecated: use Camera.AnimateTo(APosition, ADirection, AUp) Make Camera go to the view given by (world coordinates) APosition, ADirection, AUp. Honours current NavigationInfo.transitionType and transitionTime. If transitionType indicates instanteneous transition, then jumps by simple Will generate NavigationInfo.transitionComplete when transition ends. | |
| Public | procedure CameraTransition(const Camera: TCastleCamera; const APosition, ADirection, AUp, GravityUp: TVector3); overload; deprecated 'use Camera.AnimateTo(APosition, ADirection, AUp)'; |
|
This item is declared in ancestor TCastleSceneCore. Warning: this symbol is deprecated: use Camera.AnimateTo(APosition, ADirection, AUp) This item has no description. | |
| Public | procedure CameraTransition(const Navigation: TCastleNavigation; const APosition, ADirection, AUp: TVector3); overload; deprecated 'use Camera.AnimateTo(APosition, ADirection, AUp)'; |
|
This item is declared in ancestor TCastleSceneCore. Warning: this symbol is deprecated: use Camera.AnimateTo(APosition, ADirection, AUp) This item has no description. | |
| Public | procedure CameraTransition(const Navigation: TCastleNavigation; const APosition, ADirection, AUp, GravityUp: TVector3); overload; deprecated 'use Camera.AnimateTo(APosition, ADirection, AUp)'; |
|
This item is declared in ancestor TCastleSceneCore. Warning: this symbol is deprecated: use Camera.AnimateTo(APosition, ADirection, AUp) This item has no description. | |
| Public | function CustomHeadlight: TAbstractLightNode; |
|
This item is declared in ancestor TCastleSceneCore.
Light node that should be used for headlight, or This never returns | |
| Public | function Caption: String; |
|
This item is declared in ancestor TCastleSceneCore. Nice scene caption. Uses the "title" of WorldInfo node inside the VRML/X3D scene. If there is no WorldInfo node (or it has empty title) then result is based on loaded URL. | |
| Public | function Node(const NodeClass: TX3DNodeClass; const NodeName: String; const Options: TFindNodeOptions = []): TX3DNode; overload; |
|
This item is declared in ancestor TCastleSceneCore. Find a named X3D node in the current node graph. By default it searches both active and inactive graph parts. Add fnOnlyActive to search only in active parts. It searches only within nodes of given type (NodeClass). Specifying NodeClass helps to make search unambiguous (as name clashes are possible, some authoring tools may write models with duplicate names for materials, meshes etc. and both glTF and X3D allow it). This allows to safely write code like: MyMaterial := Scene.Node(TNodePhysicalMaterial, 'MyMaterial') as TNodePhysicalMaterial;
TODO: An even better version, "MyMaterial := Scene.Node<TNodePhysicalMaterial>('MyMaterial')", may be available in the future, if FPC support for generic methods will improve. Define GENERIC_METHODS to try it out now, but heed the warnings in castleconf.inc . Exceptions raised
| |
| Public | function Node(const NodeName: String): TX3DNode; overload; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Public | function Field(const NodeName, FieldName: String): TX3DField; overload; |
|
This item is declared in ancestor TCastleSceneCore. Find a named field within an X3D node in the current node graph. Like Node, this searches all nodes (in active or not) graph parts. Exceptions raised
| |
| Public | function Event(const NodeName, EventName: String): TX3DEvent; overload; |
|
This item is declared in ancestor TCastleSceneCore. Find a named event within an X3D node in the current node graph. Like Node, this searches all nodes (in active or not) graph parts. Exceptions raised
| |
| Public | function HasAnimation(const AnimationName: String): boolean; |
|
This item is declared in ancestor TCastleSceneCore. Does named animation with given name exist. See also
| |
| Public | function AnimationTimeSensor(const AnimationName: String): TTimeSensorNode; overload; |
|
This item is declared in ancestor TCastleSceneCore.
TimeSensor of this animation. | |
| Public | function AnimationTimeSensor(const Index: Integer): TTimeSensorNode; overload; |
|
This item is declared in ancestor TCastleSceneCore.
TimeSensor of this animation, by animation index (index on AnimationsList). | |
| Public | function ForceAnimationPose(const AnimationName: String; const TimeInAnimation: TFloatTime; const Loop: boolean; const Forward: boolean = true): boolean; overload; |
|
This item is declared in ancestor TCastleSceneCore. Forcefully, immediately, set pose from given animation, with given time in animation. This avoids the normal passage of time in X3D scenes, it ignores the ProcessEvents and AnimateOnlyWhenVisible properties, it ignores the current animation set by PlayAnimation, and forces the current time on TimeSensors by TTimeSensorNode.FakeTime. | |
| Public | function PlayAnimation(const Parameters: TPlayAnimationParameters): boolean; overload; |
|
This item is declared in ancestor TCastleSceneCore. Play an animation specified by name. You can specify the animation name, whether it should loop, and whether to play it forward or backward using parameters to this method. Or you can specify even more parameters using TPlayAnimationParameters instance. TPlayAnimationParameters can additionally specify a stop notification, initial time and more. It is OK to create a short-lived TPlayAnimationParameters instance and destroy it right after calling this method. This method doesn't store the TPlayAnimationParameters instance reference. To get the list of available animations, see AnimationsList. This is one of the simplest way to play animations using Castle Game Engine. Alternative (that calls PlayAnimation under the hood) is to set AutoAnimation. See https://castle-engine.io/viewport_3d#_play_animation . Playing an already-playing animation is guaranteed to restart it from the beginning (more precisely: from TPlayAnimationParameters.InitialTime, if you pass TPlayAnimationParameters). If the given animation name exists, then we stop previously playing animation (if any), calling it's stop notification (see TPlayAnimationParameters.StopNotification), start playing the new animation, and return The change from previous to new animation can be smooth (using animation cross-fading) if you use TPlayAnimationParameters with TPlayAnimationParameters.TransitionDuration or if you set DefaultAnimationTransition to something non-zero. This automatically turns on ProcessEvents, if it wasn't turned on already. Processing events is necessary for playing animations. More details about how this works:
| |
| Public | function PlayAnimation(const AnimationName: String; const Loop: boolean; const Forward: boolean = true): boolean; overload; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Public | procedure ForceInitialAnimationPose; |
|
This item is declared in ancestor TCastleSceneCore. Force the model to look like the initial animation frame now. Use this after calling PlayAnimation. Calling this is simply ignored if no PlayAnimation was called earlier, of if the model already looks following the animation requested by PlayAnimation. If you don't use this method, there may be a 1-frame delay between calling PlayAnimation and actually updating the rendered scene look. If during that time a rendering will happen, the user will see a scene in previous pose (not in the first pose of animation you requested by PlayAnimation). To avoid this, simply call this method right after PlayAnimation. This sets first animation frame, unless you used TPlayAnimationParameters.InitialTime <> 0. | |
| Public | function AnimationDuration(const AnimationName: String): TFloatTime; |
|
This item is declared in ancestor TCastleSceneCore. Duration, in seconds, of the named animation (named animations are detected by AnimationsList method). For a looping animation, this is the duration of a single cycle. 0 if not found. | |
| Public | procedure StopAnimation(const DisableStopNotification: Boolean = false); |
|
This item is declared in ancestor TCastleSceneCore. Stop the CurrentAnimation, started by last PlayAnimation call. Note that this leaves the model in a state in the middle of the last animation. You can use ResetAnimationState to reset the state afterwards. Calling ForceInitialAnimationPose also will do it. Note that it is not necessary to stop the previous animation before starting a new one (by PlayAnimation). PlayAnimation will automatically stop the previous animation. Moreover, PlayAnimation may do animation blending (cross-fade) between old and new animation (if you use TPlayAnimationParameters.TransitionDuration), which only works if you did not call When animation is stopped (by this or any other means), by default it's TPlayAnimationParameters.StopNotification is called. You can use DisableStopNotification to avoid it, which should be used only in exceptional situations. | |
| Public | procedure ResetAnimationState(const IgnoreAffectedBy: TTimeSensorNode = nil); |
|
This item is declared in ancestor TCastleSceneCore. Reset all the fields affected by animations. See TimeSensor.detectAffectedFields documentation (https://castle-engine.io/x3d_implementation_time_extensions.php#section_detect_affected_fields) for details how these fields are detected, and when this is useful. By default this is enabled, for all TimeSensor nodes. If IgnoreAffectedBy <> nil, the fields affected by the given TimeSensor may not be reset. This is an optimization useful in case this TimeSensor will modify the scene very soon, so resetting its affected fields is a waste of time. Do not depend on 100% that the fields affected by given TimeSensor are left untouched (in the current implementation, this field is ignored). | |
| Public | procedure FontChanged; |
|
This item is declared in ancestor TCastleSceneCore. Force recalculating the text shapes when font changed. For now, we don't detect font changes (e.g. when TFontStyleNode.CustomFont changed) automatically. This calls TTextNode.FontChanged and TAsciiTextNode_1.FontChanged on all appropriate nodes. | |
| Public | procedure InternalIncShapesHash; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Public | procedure ReloadUrl; |
|
This item is declared in ancestor TCastleSceneCore. Load again the model from current URL. This makes sense to be used when underlying file on disk changed, and you want to reload it. TODO: If the file is cached using Cache, then it will not reload the version in cache, so effectively it will not load new version from disk. This will be fixed at some point. | |
| Protected | function EffectiveRenderOptions: TCastleRenderOptions; override; |
|
This item has no description. Showing description inherited from TCastleSceneCore.EffectiveRenderOptions.
Render options used to render this scene, | |
| Protected | function CreateShape(const AGeometry: TAbstractGeometryNode; const AState: TX3DGraphTraverseState; const ParentInfo: PTraversingInfo): TShape; override; |
|
This item has no description. Showing description inherited from TCastleSceneCore.CreateShape. Create TShape (or descendant) instance suitable for this TCastleSceneCore descendant. In this class, this simply creates new TShape instance. If you make a descendant of TCastleSceneCore, you may need to store some per-shape information, and then it may be useful to have your own TShape descendant to carry this information. So you can override this to create your own descendant, and then you're sure that all leafs within Shapes tree are created using this. Example: TCastleScene uses this to create TGLShape. | |
| Protected | procedure LocalRender(const Params: TRenderParams); override; |
|
This item has no description. Showing description inherited from TCastleTransform.LocalRender. Collect the things to be rendered now. Override this method if you need to perform custom rendering, by direct OpenGL(ES) calls. Never call this method yourself – the rendering of TCastleViewport will call it when needed. Warning: It is an advanced topic how to make such rendering work, and make it work in a cross-platform way. You will need to understand how OpenGL(ES) works, and you will need to account for how the engine renders things too, to not conflict with the engine – e.g. you will have to use RenderContext for some things. If you're not ready for this, then you're better off not overriding this method, instead just rely on the engine built-in rendering, done by TCastleScene and other components. This method gets parameters (Params) including a full transformation of this scene. In return, it should add the things to be rendered in this frame using Params.AddRenderEvent. Internally: TCastleScene also adds X3D shapes to be rendered to TRenderParams.Collector. But you should not need to deal with TRenderParams.Collector in your own code. TODO: The names | |
| Protected | procedure LocalRenderShadowVolume(const Params: TRenderParams; const ShadowVolumeRenderer: TBaseShadowVolumeRenderer); override; |
|
Render shadow volume (sides and caps) of this scene, for shadow volume algorithm. Uses ShadowVolumeRenderer for rendering, and to detect if rendering is necessary at all. It always uses silhouette optimization. This is the usual, fast method of rendering shadow volumes. All shadow quads are generated from scene triangles transformed by ParentTransform. We must be able to correctly detect front and back facing triangles with respect to light position, so ShadowVolumeRenderer.LightPosition and "this scene transformed by ParentTransform" must be in the same coordinate system. If ParentTransformIsIdentity then ParentTransform value is ignored and everything works like ParentTransform = identity matrix (and is a little faster in this special case). Uses TrianglesListShadowCasters and ManifoldEdges and BorderEdges (so you may prefer to prepare it before, e.g. by calling PrepareResources with prShadowVolume included). We look at some RenderOptions, like RenderOptions.Blending, because transparent triangles have to be handled a little differently, and when RenderOptions.Blending = false then all triangles are forced to be opaque. In other words, this takes RenderOptions into account, to cooperate with our Render method. ShadowVolumeRenderer.LightPosition is the light position. ShadowVolumeRenderer.LightPosition[3] must be 1 (to indicate positional light) or 0 (a directional light). It's expected that ShadowVolumeRenderer is already initialized by ShadowVolumeRenderer.InitFrustumAndLight. Faces (both shadow quads and caps) are rendered such that CCW <=> you're looking at it from outside (i.e. it's considered front face of this shadow volume). | |
| Protected | procedure ChangeWorld(const Value: TCastleAbstractRootTransform); override; |
|
This item has no description. Showing description inherited from TCastleTransform.ChangeWorld. Called when the current World that contains this object changes. In the usual case, World corresponds to a TCastleViewport.Items instance, and when this method is called it means that object is added/removed from a viewport. You can ignore this when called with Value equal to current World. Note that each TCastleTransform instance can only be part of one world (TCastleAbstractRootTransform) at a time. Although we may be present many times within the same world. Always remove the TCastleTransform from previous world before adding it to a new one. | |
| Public | constructor Create(AOwner: TComponent); override; |
|
This item has no description. | |
| Public | destructor Destroy; override; |
|
This item has no description. | |
| Public | procedure Update(const SecondsPassed: Single; var RemoveMe: TRemoveType); override; |
|
This item has no description. Showing description inherited from TCastleTransform.Update. Continuously occuring event, for various tasks. Executed only on instances that have Exists (no need to check this in overridden Update implementation). | |
| Public | 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. | |
| Public | procedure GLContextClose; override; |
|
Destroy any associations of this object with current OpenGL context. For example, release any allocated texture names. Generally speaking, destroys everything that is allocated by PrepareResources call. It's harmless to call this method when there are already no associations with current OpenGL context. This is called automatically from the destructor. | |
| Public | procedure PrepareResources(const Options: TPrepareResourcesOptions; const Params: TPrepareParams); override; deprecated 'this is internal; use TCastleViewport.PrepareResources to prepare transformations'; |
|
Warning: this symbol is deprecated: this is internal; use TCastleViewport.PrepareResources to prepare transformations This item has no description. Showing description inherited from TCastleTransform.PrepareResources. Prepare resources, making various methods (like rendering and such) to execute fast. It is usually simpler to call TCastleViewport.PrepareResources then this method. Calling It is best to call this when the rendering context is initailized, e.g. at Application.OnInitialize or later. Calling this method before the rendering context is initialized (e.g. from initializaton section of some unit) will have to skip some preparations, thus reducing the effectiveness of this method. But it is allowed to call this at any time, regardless of the context being initialized, just like e.g. TCastleContainer.LoadSettings (which may call this, to warmup cache). This makes sure that appropriate methods execute as fast as possible. It's never required to call this method — everything will be prepared "as needed" anyway. But if you allow everything to be prepared "as needed", then e.g. the first Render call may take a long time because it may have to prepare resources that will be reused in next Render calls. This may make your program seem slow at the beginning (when rendering resources are being prepared, so at the first frame, or a couple of first animation frames). To avoid this, call this method, showing the user something like "now we're preparing the resources — please wait".
TODO: It is not possible to call this now without TPrepareParams, and to get params you need to access deprecated TCastleViewport.PrepareParams. We advise to call TCastleViewport.PrepareResources instead. We'd like to get rid of TPrepareParams eventually. | |
| Public | procedure BeforeNodesFree(const InternalChangedAll: boolean = false); override; |
|
This item has no description. Showing description inherited from TCastleSceneCore.BeforeNodesFree. Release all internal associations with your VRML/X3D nodes. In particular, this will release OpenGL resources connected to your nodes. You should always call this before you (may) free some nodes in RootNode. You have to call ChangedAll or Load at sometime after The InternalChangedAll parameter is for internal use. It is set to | |
| Public | function HasColliderMesh: Boolean; override; |
|
Does this transform have a collision mesh that TCastleMeshCollider can use. | |
| Public | procedure ColliderMesh(const TriangleEvent: TTriangleEvent); override; |
|
Enumerate triangles for a collision mesh that TCastleMeshCollider can use. | |
| Public | procedure FreeResources(Resources: TSceneFreeResources); override; |
|
This item has no description. Showing description inherited from TCastleSceneCore.FreeResources. Frees some scene resources, to conserve memory. See TSceneFreeResources documentation. | |
| Public | function Clone(const AOwner: TComponent): TCastleScene; |
|
Create a scene with the same contents (X3D scene graph) as this one. The created scene has exactly the same class as this one (we use ClassType.Create to call a virtual constructor). Note that this does not copy other scene properties, like ProcessEvents or RenderOptions contents. | |
| Public | function WasVisible: Boolean; |
|
Whether the scene was (potentially, at least partially) visible in the last rendering event. The "was visible" means that "some shape was visible", that is: some shape passed frustum culling, distance culling and occlusion culling (see https://castle-engine.io/occlusion_culling ) tests. The result of this method is not affected by:
To summarize and emphasize: for this method, only the visibility of shapes within this scene matters. If this scene instance is used multiple times within some viewport, or when multiple viewports render the same scene, then it is enough that at least one shape in one of the scene instances was visible last frame. TODO: For now, occlusion culling doesn't affect this, i.e. if the scene is not visible because occlusion culling. | |
| Public | procedure SetEffects(const Value: array of TEffectNode); |
|
Add shader effects to configure how is the component rendered. See https://castle-engine.io/shaders for documentation how shader effects work in Castle Game Engine. | |
Properties
| Public | property NonVisualComponents [const Index: Integer]: TComponent read GetNonVisualComponents; |
|
This item is declared in ancestor TCastleComponent. Components added by AddNonVisualComponent. | |
| Public | property IsLoading: Boolean read FIsLoading; |
|
This item is declared in ancestor TCastleComponent. Is the component during deserialization now. Note: We can't use | |
| Public | property GetExists: Boolean read FExists; deprecated 'use Exists'; |
|
This item is declared in ancestor TCastleTransform. Warning: this symbol is deprecated: use Exists This item has no description. | |
| Public | property Items[const I: Integer]: TCastleTransform read GetItem write SetItem; default; |
|
This item is declared in ancestor TCastleTransform. List of current children. | |
| Public | property Parent: TCastleTransform read FParent write SetParent; |
|
This item is declared in ancestor TCastleTransform. Parent TCastleTransform. In most cases, a TCastleTransform is just a child of one other TCastleTransform, and then this property returns this natural parent. Returns Setting this property removes us from old parent, and adds to the new one. The local transformation (translation, rotation, scale) doesn't change, so changing parent may change the effective (world) transformation of the object. In rare cases the child can have multiple parents. The behavior is then:
| |
| Public | property UniqueParent: TCastleTransform read FParent; deprecated 'use Parent'; |
|
This item is declared in ancestor TCastleTransform. Warning: this symbol is deprecated: use Parent This item has no description. | |
| Public | property CastShadowVolumes: boolean
read FCastShadows write FCastShadows default true; deprecated 'use CastShadows'; |
|
This item is declared in ancestor TCastleTransform. Warning: this symbol is deprecated: use CastShadows Does the 3D object cast shadows by shadow volumes. See also TCastleScene.ReceiveShadowVolumes. | |
| Public | property ListenPressRelease: Boolean
read FListenPressRelease write SetListenPressRelease default false; |
|
This item is declared in ancestor TCastleTransform. Are Press and Release virtual methods called. Source: transform/castletransform_transform.inc (line 1011). | |
| Public | property World: TCastleAbstractRootTransform read FWorld; |
|
This item is declared in ancestor TCastleTransform. Reference to the root transformation (typically matching the TCastleViewport.Items value) containing us. May be Source: transform/castletransform_transform.inc (line 1133). | |
| Public | property WorldDirection: TVector3 read GetWorldDirection write SetWorldDirection; |
|
This item is declared in ancestor TCastleTransform. Our Direction, in world coordinates. Source: transform/castletransform_transform.inc (line 1171). | |
| Public | property CollidesWithMoving: boolean read FCollidesWithMoving write FCollidesWithMoving default false; |
|
This item is declared in ancestor TCastleTransform. Can this object be pushed by (or block movement of) doors, elevators and other moving level parts (TCastleMoving instances). Some 3D moving objects may try to avoid crushing this item. Like an automatic door that stops it's closing animation to not crush things standing in the doorway. Some other 3D moving objects may push this object. Like elevators (vertical, or horizontal moving platforms). We may use sphere (see CollisionSphereRadius and Sphere) for checking collisions, or bounding box (TCastleTransform.BoundingBox), depending on need. Source: transform/castletransform_transform.inc (line 1284). | |
| Public | property Gravity: boolean read FGravity write FGravity default false; deprecated 'use physics (TCastleRigidBody, TCastleCollider) to make things affected by gravity'; |
|
This item is declared in ancestor TCastleTransform. Warning: this symbol is deprecated: use physics (TCastleRigidBody, TCastleCollider) to make things affected by gravity Gravity may make this object fall down (see FallSpeed) or grow up (see GrowSpeed). See also PreferredHeight. Special notes for TPlayer: player doesn't use this (TPlayer.Gravity should remain Source: transform/castletransform_transform.inc (line 1436). | |
| Public | property FallSpeed: Single read FFallSpeed write FFallSpeed default 0; deprecated 'use physics (TCastleRigidBody, TCastleCollider) to make things affected by gravity'; |
|
This item is declared in ancestor TCastleTransform. Warning: this symbol is deprecated: use physics (TCastleRigidBody, TCastleCollider) to make things affected by gravity Falling speed, in units per second, for Gravity. This is relevant only if Gravity and PreferredHeight <> 0. 0 means no falling. Source: transform/castletransform_transform.inc (line 1443). | |
| Public | property GrowSpeed: Single read FGrowSpeed write FGrowSpeed default 0; deprecated 'use physics (TCastleRigidBody, TCastleCollider) to make things affected by gravity'; |
|
This item is declared in ancestor TCastleTransform. Warning: this symbol is deprecated: use physics (TCastleRigidBody, TCastleCollider) to make things affected by gravity Growing (raising from crouching to normal standing position) speed, in units per second. This is used by non-flying creatures when climbing up stairs, in which case Translation ("legs positon") may be sometimes under the ground while Middle ("eyes position") will be always above the ground and will try to grow to be at PreferredHeight above the ground. This is relevant only if Gravity and PreferredHeight <> 0. 0 means no growing. Source: transform/castletransform_transform.inc (line 1455). | |
| Public | property MiddleHeight: Single read FMiddleHeight write FMiddleHeight
default DefaultMiddleHeight; |
|
This item is declared in ancestor TCastleTransform. How high are creature eyes in the model. Value 0 means that eyes are at the bottom of the model, 0.5 means the middle, 1 means top. The top is always considered to be at the top of the bounding box. Definition of bottom depends on Gravity:
This property determines how the TCastleTransform handles the Middle implementation (this is the point used for various collision detection routines) and PreferredHeight (this is the preferred height of Middle above the ground). You can override these two methods to use a different approach, and then ignore Source: transform/castletransform_transform.inc (line 1516). | |
| Public | property Translation: TVector3 read FTranslation write SetTranslation; |
|
This item is declared in ancestor TCastleTransform. Translation (move) the children. Zero by default. Set it like this: Scene.Translation := Vector3(1, 2, 3); Scene.Translation := Scene.Translation + Vector3(4, 5, 6); Source: transform/castletransform_transform.inc (line 1644). | |
| Public | property TranslationXY: TVector2 read GetTranslationXY write SetTranslationXY; |
|
This item is declared in ancestor TCastleTransform. Get or set the XY components of the translation. Useful for 2D games. Source: transform/castletransform_transform.inc (line 1648). | |
| Public | property Center: TVector3 read FCenter write SetCenter; |
|
This item is declared in ancestor TCastleTransform. Center point around which the Rotation and Scale is performed. Source: transform/castletransform_transform.inc (line 1651). | |
| Public | property Rotation: TVector4 read FRotation write SetRotation; |
|
This item is declared in ancestor TCastleTransform. Rotation in 3D, around a specified axis. Rotation is expressed as a 4D vector, in which the first 3 components specify the rotation axis (does not need to be normalized, but must be non-zero) and the last component is the rotation angle in radians. Note: the Rotation axis (first 3 components) must not be a zero vector, however as a special case the rotation value Rotation is done around Center (which is by default zero, so it doesn't matter). Set the rotation like this: Scene.Rotation := Vector4(0, 0, 1, Pi / 2); Scene.Rotation := Vector4(0, 0, 1, Deg(90)); // Deg is a useful shortcut for DegToRad Scene.Rotation := Scene.Rotation + Vector4(0, 0, 0, Pi / 2);
To combine multiple rotations, you can use quaternion multiplication. For example to combine a rotation around Y axis with rotation around Z axis, you can do this: var Q, Q1, Q2: TQuaternion; begin Q1 := QuatFromAxisAngle(Vector3(0, 1, 0), Deg(30)); Q2 := QuatFromAxisAngle(Vector3(0, 0, 1), Deg(45)); Q := Q1 * Q2; MyTransform.Rotation := Q.ToAxisAngle; end;
Combining rotations using quaternions is very flexible. You can combine as many rotations as you want, and it is clear (you define it yourself) in which order each rotation is applied. Note that you can also just nest one TCastleTransform within another TCastleTransform, and set different rotations on each of them, to also effectively combine the rotations. Source: transform/castletransform_transform.inc (line 1693). | |
| Public | property Scale: TVector3 read FScale write SetScale; |
|
This item is declared in ancestor TCastleTransform. Scale in 3D. Scaling is done around Center and with orientation given by ScaleOrientation. We do the best we can to work with any scale value, even negative or zero. But usually, it's best to keep the scale positive. More information:
Set it like this: Scene.Scale := Vector3(5, 5, 5); Scene.Scale := Scene.Scale * 1.5; Source: transform/castletransform_transform.inc (line 1752). | |
| Public | property ScaleOrientation: TVector4 read FScaleOrientation write SetScaleOrientation; |
|
This item is declared in ancestor TCastleTransform. Orientation in which 3D Scale is performed. Source: transform/castletransform_transform.inc (line 1755). | |
| Public | property RigidBody: TCastleRigidBody read FCachedRigidBody; |
|
This item is declared in ancestor TCastleTransform. Current TCastleRigidBody behavior that determines do we participate in the physics simulation. This property is always exactly equivalent to using See physics manual for an overview of using physics. You need to add both TCastleRigidBody and TCastleCollider to make physics work. Then this object is collidable with other rigid bodies, it can move and rotate because of gravity or because of collisions with other objects (if TCastleRigidBody.Dynamic is It is not possible to set this property. Instead use AddBehavior to add an instance of TCastleRigidBody to the behaviors list. If there was a previous TCastleRigidBody instance, you can decide what to do with it, e.g. you can remove it using RemoveBehavior. Note that an object can only be present once in the World to be a rigid body. Breaking this rule will cause the EMultipleReferencesInWorld exception at an undefined time. Source: transform/castletransform_transform.inc (line 1786). | |
| Public | property Collider: TCastleCollider read FCachedCollider; |
|
This item is declared in ancestor TCastleTransform. Current TCastleCollider behavior that determines what is the shape of this object when it participates in the physics simulation. This property is always exactly equivalent to using See physics manual for an overview of using physics. You need to add both TCastleRigidBody and TCastleCollider to make physics work. Then this object is collidable with other rigid bodies, it can move and rotate because of gravity or because of collisions with other objects (if TCastleRigidBody.Dynamic is It is not possible to set this property. Instead use AddBehavior to add an instance of TCastleCollider to the behaviors list. If there was a previous TCastleCollider instance, you can decide what to do with it, e.g. you can remove it using RemoveBehavior. Note that an object can only be present once in the World to be a rigid body. Breaking this rule will cause the EMultipleReferencesInWorld exception at an undefined time. Source: transform/castletransform_transform.inc (line 1813). | |
| Public | property Position: TVector3 read FTranslation write SetTranslation; deprecated 'use Translation'; |
|
This item is declared in ancestor TCastleTransform. Warning: this symbol is deprecated: use Translation Deprecated name for Translation. Source: transform/castletransform_transform.inc (line 1816). | |
| Public | property Direction: TVector3 read GetDirection write SetDirection; |
|
This item is declared in ancestor TCastleTransform. Direction that this transformation (like creature, space ship, missile, a camera...) is facing. The property Up contains an associated up vector. Together, the Direction and Up properties provide an alternative way to get and set the Rotation of the transformation. Thinking in terms of "direction" and "up" is more natural than thinking about Rotation for various game objects. For example, you can move a missile forward by this simple operation: MyMissile.Translation := MyMissile.Translation + MyMissile.Direction * SecondsPassed * MissileMoveSpeed;
The Orientation determines what is the direction and up you get when the Rotation is zero. For example Orientation = otUpYDirectionZ (default now) means that:
Note that changing Orientation property does not perform any transformation of the model, it will look the same as it was, no matter what Orientation you set. Only changing the Direction or Up actually change the Rotation, which in turn actually change how the model looks. This also implies that Orientation value completely doesn't matter if you never get or set Direction or Up. All engine rendering and processing just looks at Rotation. See Orientation for documentation of its default value. The Direction and Up vectors should always be normalized (have length 1). But when setting them by these properties, we will normalize them automatically, so you don't need to worry about that. The direction and up vectors must always be orthogonal. When setting Direction, Up will always be automatically adjusted to be orthogonal to Direction. And vice versa — when setting Up, Direction will be adjusted. Source: transform/castletransform_transform.inc (line 1886). | |
| Public | property Up: TVector3 read GetUp write SetUp; |
|
This item is declared in ancestor TCastleTransform. This item has no description. Source: transform/castletransform_transform.inc (line 1887). | |
| Public | property WorldView: TViewVectors
read GetWorldViewRec write SetWorldViewRec; |
|
This item is declared in ancestor TCastleTransform. Position, direction and up in world coordinates. Returned TViewVectors.Direction and TViewVectors.Up are always orthogonal. Returned TViewVectors.Dir and TViewVectors.Up are always normalized. When setting, TViewVectors.Direction and TViewVectors.Up do not need to be normalized. We will internally normalize them if necessary. When setting, we will also automatically fix TViewVectors.Direction and TViewVectors.Up to be orthogonal, if necessary: we will adjust the up vector (preserving the given direction value). Source: transform/castletransform_transform.inc (line 1915). | |
| Public | property Orientation: TOrientationType read FOrientation write FOrientation; |
|
This item is declared in ancestor TCastleTransform. How the direction and up vectors determine transformation. See TOrientationType for values documentation. The default value of this is:
This value determines how you should model your 3D models, like the creatures, the items, and the player weapons. Source: transform/castletransform_transform.inc (line 1998). | |
| Public | property List: TCastleTransformList read FList; |
|
This item is declared in ancestor TCastleTransform. Transformation objects inside. Freeing these items automatically removes them from this list. Source: transform/castletransform_transform.inc (line 2002). | |
| Public | property Behaviors [const Index: Integer]: TCastleBehavior read GetBehaviors; |
|
This item is declared in ancestor TCastleTransform. Enumerate current behaviors. See also
Source: transform/castletransform_transform.inc (line 2062). | |
| Public | property ExistsInRoot: Boolean read FExistsInRoot; |
|
This item is declared in ancestor TCastleTransform. Does this object, and all it's parents up to the root, exist. This has undefined value in case you place this TCastleTransform instance (or any parent) many times within the viewport root, and some parents exist while some not. This property doesn't check whether this TCastleTransform is actually part of some World. So it will be Source: transform/castletransform_transform.inc (line 2088). | |
| Published | property Exists: Boolean read FExists write SetExists default true; |
|
This item is declared in ancestor TCastleTransform.
Is this object (and all children) visible and colliding. Setting this to Non-existing object implies also that all children are non-existing. Behaviors on non-existing objects should also stop working, e.g. physics engine should ignore bodies / colliders attached to non-existing objects, and (TODO) TCastleSoundsource should not play when attached to non-existing object. Source: transform/castletransform_transform.inc (line 2169). | |
| Published | property Collides: boolean read FCollides write FCollides default true; |
|
This item is declared in ancestor TCastleTransform. Should this collide when simple physics is used. This setting is honored e.g. by current collisions done by FPS walk/fly navigation using TCastleWalkNavigation. This setting is ignored by the physics engine (for physics, control if something collides just by adding / removing a TCastleCollider component). You can turn this off, useful to make e.g. "fake" walls (to some secret places on level). This describes collision resolution with almost everything — camera, player (in third-person perspective, camera may differ from player), other creatures. That is because everything resolves collisions through our methods MoveCollision and HeightCollision (high-level) or SegmentCollision, SphereCollision, SphereCollision2D, PointCollision2D, BoxCollision (low-level). (Note that RayCollision is excluded from this, it exceptionally ignores Collides value, as it's primarily used for picking. Same for SegmentCollision with LineOfSight=true.) The only exception are the collisions with TCastleMoving instances (movable world parts like elevators and doors) that have their own detection routines and look at CollidesWithMoving property of other objects. That is, the TCastleMoving instance itself must still have Collides = Note that if not Exists then this doesn't matter (non-existing objects never participate in collision detection). Source: transform/castletransform_transform.inc (line 2205). | |
| Published | property Pickable: boolean read FPickable write FPickable default true; |
|
This item is declared in ancestor TCastleTransform. Is item pickable by RayCollision method. Note that if not Exists then this doesn't matter (non-existing objects are never pickable). This affects ray collisions only for some methods that are part of old simple physics. This setting is ignored by the physics engine. This is independent from Collides, as RayCollision does not look at Collides, it only looks at Pickable. Source: transform/castletransform_transform.inc (line 2218). | |
| Published | property Visible: boolean read FVisible write FVisible default true; |
|
This item is declared in ancestor TCastleTransform. Is this object (and all children) visible. Note that if not Exists then this doesn't matter (non-existing objects are never visible). Just like most TCastleTransform properties, this affects both this TCastleTransform instance (which may be a TCastleScene instance) and all children, recursively. In other words, setting this to This is independent from Collides or Pickable. Source: transform/castletransform_transform.inc (line 2231). | |
| Published | property CollisionSphereRadius: Single read FCollisionSphereRadius write FCollisionSphereRadius; |
|
This item is declared in ancestor TCastleTransform. When non-zero, we can approximate collisions with this object using a sphere in certain situations (MoveAllowed, Gravity). This usually makes dynamic objects, like player and creatures, collide better. Just like Middle, this is expressed in the parent coordinate system. Source: transform/castletransform_transform.inc (line 2239). | |
| Published | property CastShadows: boolean
read FCastShadows write FCastShadows default true; |
|
This item is declared in ancestor TCastleTransform. Does this object (and children) cast shadows. Just like most TCastleTransform properties, this affects both this TCastleTransform instance (which may be a TCastleScene instance) and all children, recursively. In other words, setting this to TODO: Right now this only affects casting shadows by shadow volumes. It will be extended to account for shadow maps. Source: transform/castletransform_transform.inc (line 2250). | |
| Published | property RenderLayer: TRenderLayer read FRenderLayer write FRenderLayer default rlParent; |
|
This item is declared in ancestor TCastleTransform. Objects on front render layer are rendered in front of objects on back render layer, regardless of their actual position (depth) relative to camera. rlParent means that object follows the parent layer, which is by default back. The typical use-case is to force some object to be in front, by setting rlFront. Source: transform/castletransform_transform.inc (line 2259). | |
| Published | property CenterPersistent: TCastleVector3Persistent read FCenterPersistent ; |
|
This item is declared in ancestor TCastleTransform. Center 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 Center directly. See also | |
| Published | property RotationPersistent: TCastleVector4RotationPersistent read FRotationPersistent ; |
|
This item is declared in ancestor TCastleTransform. Rotation 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 Rotation directly. See also
| |
| Published | property ScalePersistent: TCastleVector3Persistent read FScalePersistent ; |
|
This item is declared in ancestor TCastleTransform. Scale 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 Scale directly. See also
| |
| Published | property ScaleOrientationPersistent: TCastleVector4Persistent read FScaleOrientationPersistent ; |
|
This item is declared in ancestor TCastleTransform. ScaleOrientation 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 ScaleOrientation directly. See also
| |
| Published | property TranslationPersistent: TCastleVector3Persistent read FTranslationPersistent ; |
|
This item is declared in ancestor TCastleTransform. Translation 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 Translation directly. See also
| |
| Published | property DirectionPersistent: TCastleVector3Persistent read FDirectionPersistent stored false; |
|
This item is declared in ancestor TCastleTransform. Direction 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 Direction directly. See also
| |
| Published | property UpPersistent: TCastleVector3Persistent read FUpPersistent stored false; |
|
This item is declared in ancestor TCastleTransform. Up 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 Up directly. See also | |
| Protected | property VisibilitySensors: TVisibilitySensors read FVisibilitySensors; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Public | property Shapes: TShapeTree read FShapes; |
|
This item is declared in ancestor TCastleSceneCore. Tree of shapes in the scene, acting as a simplified version of the X3D node graph. Contents of this tree are read-only from outside. | |
| Public | property OnGeometryChanged: TSceneGeometryChanged
read FOnGeometryChanged write FOnGeometryChanged; |
|
This item is declared in ancestor TCastleSceneCore. Notification when geometry changed. "Geometry changed" means that the positions of triangles changed. This is not send when merely things like material changed. It is not guaranteed that octrees are already recalculated when this is called. (They may be recalculated only on-demand, that is when you actually access them.) However, it is guaranteed that shape's transformation (like TShape.State.Transform) are already updated. | |
| Public | property OnViewpointsChanged: TNotifyEvent
read FOnViewpointsChanged write FOnViewpointsChanged; |
|
This item is declared in ancestor TCastleSceneCore. Notification when the list of viewpoints in the scene possibly changed. Note that this doesn't necessarily mean that the current, bound viewpoint changed (although it could). If you only want to get notified when currently bound viewpoint changes, then what you seek is rather ViewpointStack.OnBoundChanged. | |
| Public | property OnBoundViewpointVectorsChanged: TNotifyEvent
read FOnBoundViewpointVectorsChanged write FOnBoundViewpointVectorsChanged; |
|
This item is declared in ancestor TCastleSceneCore. Notification when the currently bound viewpoint's vectors (position/orientation and such) changed. More precisely, this is called whenever values generated by ViewpointStack.Top.GetView changed. It cannot be called when ViewpointStack.Top = | |
| Public | property OnBoundNavigationInfoFieldsChanged: TNotifyEvent
read FOnBoundNavigationInfoFieldsChanged write FOnBoundNavigationInfoFieldsChanged; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Public | property RootNode: TX3DRootNode read FRootNode write SetRootNode; |
|
This item is declared in ancestor TCastleSceneCore. Actual VRML/X3D graph defining this scene. It is allowed to change contents of It is also allowed to change the value of | |
| Public | property OwnsRootNode: boolean read FOwnsRootNode write FOwnsRootNode default true; deprecated 'set OwnsRootNode only at loading, do not depend on this property'; |
|
This item is declared in ancestor TCastleSceneCore. Warning: this symbol is deprecated: set OwnsRootNode only at loading, do not depend on this property
If | |
| Public | property PointingDeviceOverItem: PTriangle
read FPointingDeviceOverItem write FPointingDeviceOverItem; |
|
This item is declared in ancestor TCastleSceneCore.
Current item over which the pointing device is. | |
| Public | property PointingDeviceOverPoint: TVector3
read FPointingDeviceOverPoint write FPointingDeviceOverPoint; |
|
This item is declared in ancestor TCastleSceneCore. Current 3D point under the pointing device. Only meaningful when PointingDeviceOverItem <> nil, otherwise undefined. | |
| Public | property PointingDeviceActiveSensors: TX3DNodeList
read FPointingDeviceActiveSensors; |
|
This item is declared in ancestor TCastleSceneCore.
Currently active pointing-device sensors. Only TAbstractPointingDeviceSensorNode instances. Always empty when PointingDeviceActive = Note that sensor specified here doesn't have to be one of the sensors of PointingDeviceOverItem. When some sensor is activated, it grabs further events until it's deactivated (e.g. when you set PointingDeviceActive := false, which means that user released mouse button). This means that when user moves the mouse while given sensors are active, he can move mouse over other items, even the ones where the active sensors aren't listed — but the sensors remain active. | |
| Public | property PointingDeviceActive: boolean
read FPointingDeviceActive default false; |
|
This item is declared in ancestor TCastleSceneCore. Is pointing device currently active (for example, mouse button is pressed down). | |
| Public | property OnPointingDeviceSensorsChange: TNotifyEvent
read FOnPointingDeviceSensorsChange
write FOnPointingDeviceSensorsChange; |
|
This item is declared in ancestor TCastleSceneCore. Event called PointingDeviceSensors or PointingDeviceActiveSensors lists (possibly) changed. | |
| Public | property TimeAtLoad: TFloatTime read FTimeAtLoad; |
|
This item is declared in ancestor TCastleSceneCore. Initial world time, set by the last ResetTimeAtLoad call. | |
| Public | property BackgroundStack: TBackgroundStack read FBackgroundStack; |
|
This item is declared in ancestor TCastleSceneCore. Stack of background nodes. The node at the top is the current background, which is displayed if this is the TCastleRootTransform.MainScene. All nodes on this stack must descend from TAbstractBackgroundNode class. We don't recommend using this to influence the resulting background, as designating the scene as "main" using TCastleRootTransform.MainScene makes using various features "entangled" through this scene (so it's not flexible), and designing background using X3D nodes is not comfortable. We recommend instead to leave TCastleRootTransform.MainScene as | |
| Public | property FogStack: TFogStack read FFogStack; |
|
This item is declared in ancestor TCastleSceneCore. Stack of fog nodes. The node at the top is the current fog, which is displayed if this is the TCastleRootTransform.MainScene. All nodes on this stack must descend from TFogNode class. We don't recommend using this to influence the resulting fog, as designating the scene as "main" using TCastleRootTransform.MainScene makes using various features "entangled" through this scene (so it's not flexible), and designing background using X3D nodes is not comfortable. We recommend instead to leave TCastleRootTransform.MainScene as | |
| Public | property NavigationInfoStack: TNavigationInfoStack read FNavigationInfoStack; |
|
This item is declared in ancestor TCastleSceneCore. Stack of NavigatinInfo nodes. The node at the top is the current NavigatinInfo. All nodes on this stack must descend from TNavigationInfoNode class. | |
| Public | property ViewpointStack: TViewpointStack read FViewpointStack; |
|
This item is declared in ancestor TCastleSceneCore. Stack of viewpoint nodes. The node at the top is the current Viewpoint. All nodes on this stack must descend from TAbstractViewpointNode. Note that this includes also VRML 1.0/Inventor nodes. | |
| Public | property CompiledScriptHandlers: TCompiledScriptHandlerInfoList
read FCompiledScriptHandlers; |
|
This item is declared in ancestor TCastleSceneCore. List of handlers for VRML/X3D Script node with "compiled:" protocol. This is read-only, change this only by RegisterCompiledScript. | |
| Public | property HeadlightOn: boolean
read FHeadlightOn write SetHeadlightOn; |
|
This item is declared in ancestor TCastleSceneCore. Should we use headlight for this scene. Controls if containing TCastleViewport will use a headlight, if this is the main scene. When you load a new model, this is always updated based on this model's NavigationInfo.headlight. (If no NavigationInfo node, then default is to use the headlight.) When you bind a new NavigationInfo node, this is also updated to follow NavigationInfo.headlight. You can change the value of this property. If we have a NavigationInfo node, then NavigationInfo.headlight field will be always updated to correspond to this value. (It will be even updated using events mechanism if ProcessEvents, so scripts inside the VRML/X3D "know" when you turn on/off the headlight and may react to it, e.g. spawn a zombie monster when you turn on the flashlight.) | |
| Public | property OnHeadlightOnChanged: TNotifyEvent
read FOnHeadlightOnChanged write FOnHeadlightOnChanged; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Public | property InternalGlobalLights: TLightInstancesList read FGlobalLights; |
|
This item is declared in ancestor TCastleSceneCore. Global lights of this scene. Read-only. Useful to shine these lights on other scenes, if TCastleScene.CastGlobalLights. | |
| Public | property AnimationsList: TStrings read FAnimationsList; |
|
This item is declared in ancestor TCastleSceneCore. List the names of available animations in current scene. Animations are detected looking for TimeSensor nodes. See https://castle-engine.io/x3d_implementation_interpolation.php for an overview how nodes are used to create animations. Note that if you set AnimationPrefix property, we additionally filter TimeSensor nodes to show only the names starting with given prefix. In this case, not all TTimeSensorNode are reflected in this list. You can get the corresponding TTimeSensorNode by AnimationTimeSensor. Note that the same TTimeSensorNode may occur multiple times on this list, in case X3D IMPORT mechanism was used to rename the imported animation. The resulting TStringList instance is owned by this object, do not free it. Note that the list of animations may change if you rebuild the underlying X3D nodes graph, for example if you start to delete / add some TimeSensor nodes. | |
| Public | property AnimationPrefix: String
read FAnimationPrefix write FAnimationPrefix; deprecated 'this property did not prove to be of much use; report if you need it, otherwise it may be removed one day'; |
|
This item is declared in ancestor TCastleSceneCore. Warning: this symbol is deprecated: this property did not prove to be of much use; report if you need it, otherwise it may be removed one day The prefix of an X3D TimeSensor node name to treat it as a "named animation". Named animation are used by methods AnimationsList, PlayAnimation, and AnimationDuration, HasAnimation. By default this is empty, which means we consider all TimeSensor nodes a "named animation". You can set this to something like 'Anim_' or 'Animation_' or whatever your 3D export software produces. Only the TimeSensor nodes with names starting with this prefix will be available on AnimationsList, and this prefix will be stripped from the names you use with methods like PlayAnimation. | |
| Public | property CurrentAnimation: TTimeSensorNode read FCurrentAnimation; |
|
This item is declared in ancestor TCastleSceneCore.
Currently played animation by PlayAnimation, or Note that, in a general case, you can have multiple active animations (multiple TimeSensor X3D nodes may be active) at the same time. Calling TTimeSensorNode.Start directly on multiple nodes is one way to make it happen. This property simply describes the animation controlled by the last PlayAnimation method. Note that the animation may be started by PlayAnimation with a 1-frame delay, but this property hides it from you, it is changed immediately by the PlayAnimation call. | |
| Public | property FileName: String read FUrl write SetUrl; deprecated; |
|
This item is declared in ancestor TCastleSceneCore. Warning: this symbol is deprecated. Deprecated name for Url. | |
| Public | property InternalShapesHash: TShapesHash read FShapesHash; |
|
This item is declared in ancestor TCastleSceneCore. This item has no description. | |
| Published | property DefaultAnimationTransition: Single
read FDefaultAnimationTransition write FDefaultAnimationTransition default 0.0; |
|
This item is declared in ancestor TCastleSceneCore. When using PlayAnimation without TPlayAnimationParameters, this value is used as the duration (in seconds) of animation cross-fade (blending of animations). Zero (default value) disables the smooth transition, animations will change without any transition by default. This default transition is only used if some previous animation was playing. Otherwise, it would be applied even when starting the initial animation. | |
| Published | property TimePlaying: boolean read FTimePlaying write FTimePlaying default true; |
|
This item is declared in ancestor TCastleSceneCore.
When | |
| Published | property TimePlayingSpeed: Single read FTimePlayingSpeed write FTimePlayingSpeed default 1.0; |
|
This item is declared in ancestor TCastleSceneCore.
Controls the time speed (if TimePlaying is | |
| Published | property PreciseCollisions: Boolean read FPreciseCollisions write SetPreciseCollisions default false; |
|
This item is declared in ancestor TCastleSceneCore. Resolve collisions precisely with the scene triangles. When this is More details: Setting this creates two spatial structures (octrees):
| |
| Published | property ProcessEvents: boolean
read FProcessEvents write SetProcessEvents default false; |
|
This item is declared in ancestor TCastleSceneCore. Should the event mechanism (a basic of animations and interactions) work. If In other words, this makes the scene fully animated and interacting with the user. If | |
| Published | property Url: String read FUrl write SetUrl; |
|
This item is declared in ancestor TCastleSceneCore. Currently loaded scene URL. Change this property to load a scene from the given URL. We support many 3D and 2D scene formats, like X3D and glTF, see https://castle-engine.io/creating_data_model_formats.php . Setting this property works just like using the Load method with a new URL. In fact, using directly the Load method will also change this URL property. The only difference between Pass Url = '' to load an empty scene, this sets RootNode to | |
| Published | property ShadowMaps: boolean read FShadowMaps write SetShadowMaps default true; |
|
This item is declared in ancestor TCastleSceneCore. At loading, process the scene to support shadow maps. This happens at the Load method call, and it makes "receiveShadows" field automatically handled. Note that this is not the only way to make shadow maps. VRML/X3D author can always make shadow maps by using lower-level nodes, see [https://castle-engine.io/x3d_extensions.php#section_ext_shadow_maps]. When using these lower-level nodes, this property does not matter This property (and related ones like ShadowMapsDefaultSize) is relevant only for handling shadows by the "receiveShadows" field. | |
| Published | property ShadowMapsDefaultSize: Cardinal
read FShadowMapsDefaultSize write SetShadowMapsDefaultSize
default DefaultShadowMapsDefaultSize; |
|
This item is declared in ancestor TCastleSceneCore. Default shadow map texture size. Affects how shadow maps are handled for the "receiveShadows" field. This is taken into account at the scene Load time, and only if ShadowMaps is VRML/X3D author can always override this by placing a | |
| Published | property InitialViewpointIndex: Cardinal
read FInitialViewpointIndex write FInitialViewpointIndex default 0; |
|
This item is declared in ancestor TCastleSceneCore. When loading new model, use this viewpoint index to initialize camera. VRML/X3D specification says to use the first (index = 0) viewpoint, you can change this property to bind 2nd, 3rd and so on viewpoints. This is applied only at loading (actually, at ChangedAll). If you later want to bind another viewpoint, just send set_bind := true to it. | |
| Published | property InitialViewpointName: String
read FInitialViewpointName write FInitialViewpointName; |
|
This item is declared in ancestor TCastleSceneCore. When loading new model and looking for initial viewpoint, consider only viewpoints with this node name. Relevant only if non-empty. This may cooperate with InitialViewpointIndex: InitialViewpointIndex specifies the index of viewpoint node that satisfies also
| |
| Published | property AnimateOnlyWhenVisible: boolean
read FAnimateOnlyWhenVisible write FAnimateOnlyWhenVisible default false; |
|
This item is declared in ancestor TCastleSceneCore.
When See examples/animations/optimize_animations_test for a demo of this. | |
| Published | property AnimateSkipTicks: Cardinal read FAnimateSkipTicks write SetAnimateSkipTicks
default 0; |
|
This item is declared in ancestor TCastleSceneCore.
Non-zero values optimize the animation processing, by not updating the animation every frame. After updating the animation in one Update call, the next This is an effective optimization if the scene is usually not large on the screen.
See examples/animations/optimize_animations_test for a demo of this. | |
| Published | property AutoAnimation: String
read FAutoAnimation write SetAutoAnimation; |
|
This item is declared in ancestor TCastleSceneCore.
If Note: Using AutoAnimation will under the hood call methods like PlayAnimation, StopAnimation and update CurrentAnimation. The reverse is not true: calling PlayAnimation doesn't change AutoAnimation. So you can think of AutoAnimation as "an initial animation, activated each time we load the model, even if later we can change it to something else using PlayAnimation". | |
| Published | property AutoAnimationLoop: Boolean
read FAutoAnimationLoop write SetAutoAnimationLoop default true; deprecated 'in future engine versions, AutoAnimationLoop may behave as always = true, and AutoAnimation will be renamed to just Animation and changing it will always cause a looping animation. Use PlayAnimation(''my_anim'',false) from code to play animation without looping.'; |
|
This item is declared in ancestor TCastleSceneCore. Warning: this symbol is deprecated: in future engine versions, AutoAnimationLoop may behave as always = true, and AutoAnimation will be renamed to just Animation and changing it will always cause a looping animation. Use PlayAnimation('my_anim',false) from code to play animation without looping. Does the animation indicated by AutoAnimation loops. | |
| Published | property ExposeTransforms: TStrings read FExposeTransforms write SetExposeTransforms; |
|
This item is declared in ancestor TCastleSceneCore. Transformation nodes inside the model that are synchronized with automatically-created children TCastleTransform. This allows to expose transformation nodes from glTF, X3D and other model formats as TCastleTransform. These transformation nodes include animated bones from skeletons (armatures). Such "exposed transformation" results in a creation of TCastleTransform child, with the same name and synchronized transformation (translation, rotation, scale). This allows to expose e.g. "hand that may hold a weapon", or "slot of a vehicle where to attach a camera", as TCastleTransform. And this allows, in turn, to attach various things to (possibly animated) transformations, e.g. attach model of a weapon to a hand, or attach TCastleCamera to some bone. The attached things will be automatically animated when the scene skeleton animates. Setting this property merely copies the contents using TStrings.Assign, as is usual for published TStrings properties. In CGE editor, there's a nice GUI editor to pick the transfomation nodes, click on "..." at this property. Note: the owner of auto-created children is equal to this scene's Owner. This is most natural when you edit this in CGE editor, or load using TransformLoad. See the engine example in: examples/animations/expose_transformations_to_animate_children/ . See also
| |
| Published | property ExposeTransformsPrefix: String read FExposeTransformsPrefix write SetExposeTransformsPrefix; |
|
This item is declared in ancestor TCastleSceneCore. Name prefix for all children created by ExposeTransforms. Useful to keep names unique in the scene. | |
| Published | property Cache: Boolean read FCache write FCache default false; |
|
This item is declared in ancestor TCastleSceneCore.
Use cache to load given scene. This makes sense when you have multiple TCastleScene instances using the same URL, loading them will be much faster if they share the cache, so set If you have only one scene using given URL, using cache is not necessary and in fact it will result in a bit of wasted memory. So better to keep | |
| Published | property ShapeFrustumCulling: Boolean
read FShapeFrustumCulling write SetShapeFrustumCulling default true; |
|
Improve performance of rendering by checking for each shape whether it is inside frustum (camera pyramid of view) before rendering. This is almost always a good idea. Exception may be when, in the most common scene position, all the shapes are inside the frustum, or all the shapes are outside the frustum. In this case this check is wasting time, and it matters if you have a lot of shapes. In such case, SceneFrustumCulling will be enough. | |
| Published | property SceneFrustumCulling: Boolean
read FSceneFrustumCulling write FSceneFrustumCulling default true; |
|
Improve performance of rendering by checking for the whole scene whether it is inside frustum (camera pyramid of view) before rendering. This is almost always a good idea. Exception may be when the scene is almost always within the frustum, and you have a lot of scenes. In such case, this check may be a waste of time. | |
| Published | property ReceiveShadowVolumes: boolean
read FReceiveShadowVolumes write FReceiveShadowVolumes default true; |
|
Does this scene receive shadows by shadow volumes. | |
| Published | property DistanceCulling: Single
read FDistanceCulling write SetDistanceCulling default 0; |
|
Cull shapes farther than this distance. Ignored if <= 0. | |
| Published | property RenderOptions: TCastleRenderOptions read FRenderOptions; |
|
Rendering options. You are free to change them at any time. | |
| Published | property CastGlobalLights: Boolean
read FCastGlobalLights write SetCastGlobalLights default false; |
|
Lights defines by given scene shine on everything in the viewport, including all other TCastleScene. | |
| Published | property TransformOptimization: TTransformOptimization
read FTransformOptimization write FTransformOptimization default toAutomatic; |
|
Optimization hint, determines which optimizations to use for this scene. Some optimizations are beneficial for scenes whose world transformation (translation, rotation, scale of this and all parents) never changes, or rarely changes, or changes only by a small amount. Some optimizations are the reverse: they make sense for scenes whose world transformation changes often and by large values. See TTransformOptimization for possible values and more information. The default value is toAutomatic, which means that we auto-detect the optimal approach. For now, this only determines whether generated shaders...
An unofficial way (we don't guarantee it will always be exposed this way) to test how often shaders are recreated is by setting | |
Generated by PasDoc 0.17.0.snapshot.