Class TCastlePrecalculatedAnimation

Unit

Declaration

type TCastlePrecalculatedAnimation = class(T3D)

Description

Warning: this symbol is deprecated: instead of TCastlePrecalculatedAnimation, use TCastleScene to load animations in any format (X3D, castle-anim-frames...) and run them using methods like PlayAnimation

A "precalculated" animation done by interpolating between a number of 3D model states.

After constructing an object of this class, you must actually load it's animation by calling Load or LoadFromFile or LoadFromEvents etc.

When loading you must provide one or more X3D models with their associated times. Animation will show a transition from the first model to the last. If models are "structurally equal" then the transition between two successive models will be smooth, otherwise a sudden change will be shown. "Structurally equal" means the same nodes hierarchy, the same names of nodes, the same values of all fields (with the exception of fields that are floating-point based and so can be interpolated, for example SFFloat, SFVec3f and equivalent MFXxx fields). For multi-valued fields (MFXxx) that can be interpolated: note that values of items may differ, but still the counts of items must be equal.

This creates a list of Scenes such that

  • the first scene on the list is exactly the 1st object

  • the last scene on the list is exactly the last object

  • intermediate scenes are accordingly interpolated between the two surrounding "predefined" by you scenes

For example, first object may be a small sphere with blue color, the other object may be a larger sphere with white color, and the simplest times are 0.0 for the 1st scene and 1.0 for the 2nd scene. The animation will show the blue sphere growing larger and fading into the white color. Of course, any kind of models is allowed — e.g. it can be a walking man at various stages, so in effect you get an animation of walking man.

A special case when you pass only one scene to this class is allowed (it may be handy in some situations). This will obviously produce just a still result, i.e. resulting TCastlePrecalculatedAnimation will be just a wrapper around single TCastleScene instance.

For more information see our engine documentation on [http://castle-engine.sourceforge.net/engine_doc.php]. Specifically the section "Non-interactive precalculated animation: TCastlePrecalculatedAnimation", [http://castle-engine.sourceforge.net/vrml_engine_doc/output/xsl/html/section.animation_precalculated.html].

Hierarchy

  • TComponent
  • T3D
  • TCastlePrecalculatedAnimation

Overview

Methods

Protected procedure SetWorld(const Value: T3DWorld); override;
Protected procedure LoadCore( GetKeyNodeWithTime: TGetKeyNodeWithTime; KeyNodesCount: Cardinal; AOwnsFirstRootNode: boolean; ScenesPerTime: Cardinal; const EqualityEpsilon: Single);
Protected function HeightCollision(const Position, GravityUp: TVector3Single; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc; out AboveHeight: Single; out AboveGround: P3DTriangle): boolean; override;
Protected function MoveCollision( const OldPos, ProposedNewPos: TVector3Single; out NewPos: TVector3Single; const IsRadius: boolean; const Radius: Single; const OldBox, NewBox: TBox3D; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): boolean; override;
Protected function MoveCollision( const OldPos, NewPos: TVector3Single; const IsRadius: boolean; const Radius: Single; const OldBox, NewBox: TBox3D; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): boolean; override;
Protected function SegmentCollision(const Pos1, Pos2: TVector3Single; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc; const ALineOfSight: boolean): boolean; override;
Protected function SphereCollision(const Pos: TVector3Single; const Radius: Single; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): boolean; override;
Protected function BoxCollision(const Box: TBox3D; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): boolean; override;
Protected function RayCollision(const RayOrigin, RayDirection: TVector3Single; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): TRayCollision; override;
Public constructor Create(AOwner: TComponent); override;
Public constructor CreateCustomCache(AOwner: TComponent; ACache: TGLRendererContextCache);
Public destructor Destroy; override;
Public procedure Load( KeyNodes: TX3DNodeList; AOwnsFirstRootNode: boolean; AKeyTimes: TSingleList; ScenesPerTime: Cardinal; const EqualityEpsilon: Single);
Public procedure LoadFromEvents( RootNode: TX3DRootNode; AOwnsRootNode: boolean; const ATimeBegin, ATimeEnd: Single; ScenesPerTime: Cardinal; const EqualityEpsilon: Single; const ProgressTitle: string);
Public procedure LoadStatic(RootNode: TX3DNode; AOwnsRootNode: boolean);
Public procedure LoadFromFile(const URL: string; const AllowStdIn: boolean; const LoadTime: boolean);
Public procedure Close;
Public function ScenesCount: Integer;
Public function FirstScene: TCastleScene;
Public function LastScene: TCastleScene;
Public procedure PrepareResources(Options: TPrepareResourcesOptions; ProgressStep: boolean; BaseLights: TAbstractLightInstancesList); override;
Public function PrepareResourcesSteps: Cardinal; override;
Public procedure FreeResources(Resources: TSceneFreeResources);
Public procedure GLContextClose; override;
Public function TimeDuration: Single;
Public function TimeDurationWithBack: Single;
Public function Scene(const Time: Single): TCastleScene;
Public function Scene(const Time: Single; const Loop: boolean): TCastleScene;
Public function CurrentScene: TCastleScene;
Public function Attributes: TSceneRenderingAttributes;
Public function BoundingBox: TBox3D; override;
Public procedure BeforeNodesFree;
Public procedure ChangedAll;
Public function Info( ATriangleVerticesCounts, ABoundingBox, AManifoldAndBorderEdges: boolean): string; deprecated 'do not use this, better to construct a summary string yourself';
Public function Press(const Event: TInputPressRelease): boolean; override;
Public function Release(const Event: TInputPressRelease): boolean; override;
Public procedure Update(const SecondsPassed: Single; var RemoveMe: TRemoveType); override;
Public procedure ResetTimeAtLoad(const ForceTimeOrigin: boolean = false);
Public procedure ResetTime(const NewValue: TFloatTime);
Public procedure Render(const Frustum: TFrustum; const Params: TRenderParams); override;
Public procedure RenderShadowVolume( ShadowVolumeRenderer: TBaseShadowVolumeRenderer; const ParentTransformIsIdentity: boolean; const ParentTransform: TMatrix4Single); override;
Public procedure UpdateGeneratedTextures( const RenderFunc: TRenderFromViewFunction; const ProjectionNear, ProjectionFar: Single; const OriginalViewport: TRectangle); override;
Public procedure VisibleChangeNotification(const Changes: TVisibleChanges); override;
Public procedure CameraChanged(ACamera: TCamera); override;
Public function Dragging: boolean; override;

Properties

Public property Loaded: boolean read FLoaded;
Public property OwnsFirstRootNode: boolean read FOwnsFirstRootNode write SetOwnsFirstRootNode;
Public property Scenes[I:Integer]: TCastleScene read GetScenes;
Public property TimeBegin: Single read FTimeBegin;
Public property TimeEnd: Single read FTimeEnd;
Public property TimeAtLoad: TFloatTime read FTimeAtLoad;
Public property Time: TFloatTime read FTime;
Public property Cache: TGLRendererContextCache read FCache;
Public property TryFirstSceneDynamic: boolean read FTryFirstSceneDynamic write FTryFirstSceneDynamic default false;
Published property TimePlaying: boolean read FTimePlaying write FTimePlaying default true;
Published property TimePlayingSpeed: Single read FTimePlayingSpeed write FTimePlayingSpeed default 1.0;
Published property TimeLoop: boolean read FTimeLoop write FTimeLoop default true;
Published property TimeBackwards: boolean read FTimeBackwards write FTimeBackwards default false;
Published property CollisionUseLastScene: boolean read FCollisionUseLastScene write FCollisionUseLastScene default false;
Published property ShadowMaps: boolean read FShadowMaps write SetShadowMaps default true;
Published property ShadowMapsDefaultSize: Cardinal read FShadowMapsDefaultSize write SetShadowMapsDefaultSize default TCastleSceneCore.DefaultShadowMapsDefaultSize;
Published property InitialViewpointIndex: Cardinal read FInitialViewpointIndex write FInitialViewpointIndex;
Published property InitialViewpointName: string read FInitialViewpointName write FInitialViewpointName;

Description

Methods

Protected procedure SetWorld(const Value: T3DWorld); override;
 
Protected procedure LoadCore( GetKeyNodeWithTime: TGetKeyNodeWithTime; KeyNodesCount: Cardinal; AOwnsFirstRootNode: boolean; ScenesPerTime: Cardinal; const EqualityEpsilon: Single);

Internal version of Load routines, feasible to load from both ready KeyNodes array and to automatically generate KeyNodes on the fly.

GetKeyNodeWithTime will be called with indexes from 0 to KeyNodesCount - 1. It's guaranteed that it will be called in this order (from 0 upwards to KeyNodesCount - 1) and will be called exactly once for each index. So it's safe to e.g. create RootNode with some costly operation there.

Note that RootNode passed to GetKeyNodeWithTime becomes owned by this class. Well, you can get control over only the first one, by AOwnsFirstRootNode, but you cannot free it anyway while this is loaded.

See Load for more information, including the meaning of EqualityEpsilon.

Protected function HeightCollision(const Position, GravityUp: TVector3Single; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc; out AboveHeight: Single; out AboveGround: P3DTriangle): boolean; override;
 
Protected function MoveCollision( const OldPos, ProposedNewPos: TVector3Single; out NewPos: TVector3Single; const IsRadius: boolean; const Radius: Single; const OldBox, NewBox: TBox3D; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): boolean; override;
 
Protected function MoveCollision( const OldPos, NewPos: TVector3Single; const IsRadius: boolean; const Radius: Single; const OldBox, NewBox: TBox3D; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): boolean; override;
 
Protected function SegmentCollision(const Pos1, Pos2: TVector3Single; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc; const ALineOfSight: boolean): boolean; override;
 
Protected function SphereCollision(const Pos: TVector3Single; const Radius: Single; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): boolean; override;
 
Protected function BoxCollision(const Box: TBox3D; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): boolean; override;
 
Protected function RayCollision(const RayOrigin, RayDirection: TVector3Single; const TrianglesToIgnoreFunc: T3DTriangleIgnoreFunc): TRayCollision; override;
 
Public constructor Create(AOwner: TComponent); override;
 
Public constructor CreateCustomCache(AOwner: TComponent; ACache: TGLRendererContextCache);

Constructor that allows you to pass your own Cache instance.

Public destructor Destroy; override;
 
Public procedure Load( KeyNodes: TX3DNodeList; AOwnsFirstRootNode: boolean; AKeyTimes: TSingleList; ScenesPerTime: Cardinal; const EqualityEpsilon: Single);

Load the animation scenes. Must be called (this or some other loading routine like LoadFromFile) before you do almost anything with this object. Loaded changes to True after calling this.

Parameters
KeyNodes
Models describing the "predefined" frames of animation. They must descend from TX3DRootNode.

For all nodes except the first: They are always owned by this class — that's needed, because actually we may do some operations on these models when building animation (including even freeing some KeyNodes, if we will find that they are equivalent to some other KeyNodes). They all must point to different objects.

You must supply at least one item here (you cannot make an animation from 0 items).

Times
Array specifying the point of time for each "predefined" frame. Length of this array must equal to length of KeyNodes array.
ScenesPerTime
This says how many scenes will be used for period of time equal to 1.0. This will determine Scenes.Count. KeyNodes[0] always takes Scenes[0] and KeyNodes[High(KeyNodes)] always takes Scenes[Scenes.High].

Note that if we will find that some nodes along the way are exactly equal, we may drop scenes count between — because if they are both equal, we can simply render the same scene for some period of time. This is an optimization, and you shouldn't notice it at all, since rendeting will be the same (but less memory-consuming).

Special value ScenesPerTime = 0 means that you want to have only the KeyNodes you explicitly passed in the scene, not more. No more intermediate scenes will ever be created. This creates a trivial animation that suddenly jumps from one RootNode to the next at specified times. It may be useful if you already have generated a lot of KeyNodes, densely distributed over time, and you don't need TCastlePrecalculatedAnimation to insert any more scenes.

EqualityEpsilon
This will be used for comparing fields, to decide if two fields (and, consequently, nodes) are equal. It will be simply passed to TX3DField.Equals.

You can pass here 0 to use exact comparison, but it's advised to use here something > 0. Otherwise we could waste display list memory (and loading time) for many frames of the same node that are in fact equal.

Public procedure LoadFromEvents( RootNode: TX3DRootNode; AOwnsRootNode: boolean; const ATimeBegin, ATimeEnd: Single; ScenesPerTime: Cardinal; const EqualityEpsilon: Single; const ProgressTitle: string);

Load precalculated animation by playing a single VRML/X3D file with events (interpolators, TimeSensor and such working). Conceptually, this "records" interactive animation stored in VRML/X3D file into TCastlePrecalculatedAnimation precalculated animation.

ATimeBegin, ATimeEnd tell what time slice should be recorded. They will also set TimeBegin and TimeEnd properties.

Parameters
ScenesPerTime
tells with what density should the animation be recorded. See Load for ScenesPerTime, EqualityEpsilon precise documentation. Note that special value ScenesPerTime = 0 is interpreted here as "record only one, initial frame".
ProgressTitle
When <> '' we will use Progress.Init, Step, Fini to display nice progress of operation.
Public procedure LoadStatic(RootNode: TX3DNode; AOwnsRootNode: boolean);

Load a dumb animation that consists of only one frame (so actually there's no animation, everything is static).

This just calls Load with parameters such that

  1. KeyNodes list contains one specified node

  2. Times contain only one item 0.0

  3. ScenesPerTime and EqualityEpsilon have some unimportant values — they are not meaningfull when you have only one scene

This is usefull when you know that you have a static scene, but still you want to treat it as TCastlePrecalculatedAnimation.

Public procedure LoadFromFile(const URL: string; const AllowStdIn: boolean; const LoadTime: boolean);

Load animation parameters (models to use, times to use and such) from given file.

Various file formats are possible, everything that can be handled by Load3DSequence, in particular simple 3D model files, MD3, castle-anim-frames (described on [http://castle-engine.sourceforge.net/castle_animation_frames.php]).

If you need more control over loading, for example you want to change some parameters at loading (for example, ScenesPerTime and EqualityEpsilon of castle-anim-frames files), you should use more flexible (and less comfortable to use) LoadFromFileToVars class procedure (specialized for castle-anim-frames files) or Load3DSequence (if you want to handle any files).

Loaded property changes to True after calling this.

Parameters
AllowStdIn
If True, then URL = '-' is understood as "standard input".
LoadTime
If True then loading changes current TimeLoop and TimeBackwards properties. Sometimes this is sensible (you want to allow control over them from the file), sometimes not (e.g. you set suitable values for them by code).

Note that, independent of this, you can always change TimeLoop and TimeBackwards properties later, since these properties are writeable at any time.

Public procedure Close;

This releases all resources allocared by Load (or LoadFromFile). Loaded property changes to False after calling this.

It's safe to call this even if Loaded is already False — then this will do nothing.

Public function ScenesCount: Integer;
 
Public function FirstScene: TCastleScene;

Just a shortcut for Scenes[0].

Public function LastScene: TCastleScene;

Just a shortcut for Scenes[ScenesCount - 1].

Public procedure PrepareResources(Options: TPrepareResourcesOptions; ProgressStep: boolean; BaseLights: TAbstractLightInstancesList); override;

Prepare all scenes for rendering. Basically, this calls PrepareResources(...) for all Scenes.

There's also a special memory (and prepare time) optimization used for prManifoldAndBorderEdges: we use the fact that animation scenes are "structurally equal", and so prepare and share one manifold edges information for all scenes.

ProgressStep = True is especially useful with this: we'll call Progress.Step then after preparing each scene. For portability, always check PrepareResourcesSteps, but for now this is just always equal ScenesCount.

Public function PrepareResourcesSteps: Cardinal; override;
 
Public procedure FreeResources(Resources: TSceneFreeResources);

Free resources for all scenes, it's useful if you know that you will not need some allocated resources anymore and you want to conserve memory use.

See TCastleSceneCore.FreeResource documentation for a description of what are possible resources to free.

Public procedure GLContextClose; override;

Close anything associated with current OpenGL context in this class. This calls GLContextClose on every Scenes[], and additionally may close some other internal things here.

Public function TimeDuration: Single;

Just a shortcut for TimeEnd - TimeBegin.

Public function TimeDurationWithBack: Single;

This is TimeDuration * 2 if TimeBackwards, otherwise it's just TimeDuration. In other words, this is the time of the one "full" (forward + backward) animation.

Public function Scene(const Time: Single): TCastleScene;

Appropriate scene from Scenes based on given Time. If Time is between given TimeBegin and TimeEnd, then this will be appropriate scene in the middle.

For Time outside the range TimeBegin .. TimeEnd behavior depends on TimeLoop and TimeBackwards properties:

Overloaded version with explicit Loop parameter ignores the TimeLoop property. This way you can force looping (or force not looping), regardless of the TimeLoop property, so also regardless of loop setting in castle-anim-frames file.

Public function Scene(const Time: Single; const Loop: boolean): TCastleScene;
 
Public function CurrentScene: TCastleScene;

Appropriate scene from Scenes based on current Time. This is just a shortcut for Scene(Time), useful if you track animation time in our Time property.

Public function Attributes: TSceneRenderingAttributes;

Attributes controlling rendering. See TSceneRenderingAttributes and TRenderingAttributes for documentation of properties.

You can change properties of this object at any time, but beware that some changes may force time-consuming regeneration of some things (like OpenGL display lists) in the nearest Render of the scenes. So explicitly calling PrepareResources may be useful after changing these Attributes.

Note that Attributes may be accessed and even changed when the scene is not loaded (e.g. before calling Load / LoadFromFile). Also, Attributes are preserved between various animations loaded.

Public function BoundingBox: TBox3D; override;

The sum of bounding boxes of all animation frames.

Result of this function is cached, which means that it usually returns very fast. But you have to call ChangedAll when you changed something inside Scenes[] using some direct Scenes[].RootNode operations, to force recalculation of this box.

Public procedure BeforeNodesFree;

Call this before directly freeing some VRML nodes in animation scenes.

Public procedure ChangedAll;

Call this when you changed something inside Scenes[] using some direct Scenes[].RootNode operations. This calls TCastleScene.ChangedAll on all Scenes[] and invalidates some cached things inside this class.

Public function Info( ATriangleVerticesCounts, ABoundingBox, AManifoldAndBorderEdges: boolean): string; deprecated 'do not use this, better to construct a summary string yourself';

Warning: this symbol is deprecated: do not use this, better to construct a summary string yourself

Returns some textual info about this animation. Similar to TCastleScene.Info.

Public function Press(const Event: TInputPressRelease): boolean; override;

Handling key and mouse events.

We pass key and mouse events only if there's exactly one scene (ScenesCount = 1), as there's no sensible way of activating VRML/X3D events when TCastlePrecalculatedAnimation contains more than one scene. (Precalculated animation of this class, and interactive animation by TCastleSceneCore.ProcessEvents do not mix sensibly.)

So when ScenesCount = 1, we simply pass key and mouse events to the only Scene[0]. Be sure to turn on Scene[0].ProcessEvents := true if you want to make actual use of it.

Public function Release(const Event: TInputPressRelease): boolean; override;
 
Public procedure Update(const SecondsPassed: Single; var RemoveMe: TRemoveType); override;
 
Public procedure ResetTimeAtLoad(const ForceTimeOrigin: boolean = false);

Set Time to initial value after loading a world.

Public procedure ResetTime(const NewValue: TFloatTime);

Set Time to arbitrary value.

Public procedure Render(const Frustum: TFrustum; const Params: TRenderParams); override;
 
Public procedure RenderShadowVolume( ShadowVolumeRenderer: TBaseShadowVolumeRenderer; const ParentTransformIsIdentity: boolean; const ParentTransform: TMatrix4Single); override;
 
Public procedure UpdateGeneratedTextures( const RenderFunc: TRenderFromViewFunction; const ProjectionNear, ProjectionFar: Single; const OriginalViewport: TRectangle); override;
 
Public procedure VisibleChangeNotification(const Changes: TVisibleChanges); override;
 
Public procedure CameraChanged(ACamera: TCamera); override;
 
Public function Dragging: boolean; override;
 

Properties

Public property Loaded: boolean read FLoaded;
 
Public property OwnsFirstRootNode: boolean read FOwnsFirstRootNode write SetOwnsFirstRootNode;

Is the RootNode in first scene owned by this TCastlePrecalculatedAnimation instance? If yes, it will be freed at closing the animation. Otherwise, you are responsible for freeing it yourself (but you cannot do this while animation is loaded, anyway).

Public property Scenes[I:Integer]: TCastleScene read GetScenes;

You can read anything from Scenes below. But you cannot set some things: don't set their scenes Attributes properties. Use only our Attributes.

The scenes here have TCastleSceneCore.Static set to True, which means we assume you will not modify their VRML nodes graph (by TX3DField.Send and such). Note that this doesn't prevent you from enabling TCastleSceneCore.ProcessEvents on the first scene (TCastleSceneCore.ProcessEvents will be property handled regardless of TCastleSceneCore.Static value).

Public property TimeBegin: Single read FTimeBegin;

First and last time that you passed to Load (or that were read from file by LoadFromFile). In other words, Times[0] and Times[High(Times)].

Public property TimeEnd: Single read FTimeEnd;
 
Public property TimeAtLoad: TFloatTime read FTimeAtLoad;

Initial world time, set by the ResetTimeAtLoad call. This can be useful for showing user time like "Animation Time: LoadTime + %f" on status bar.

0 means that starting Time was TimeBegin of the animation (0.0 in case of normal VRML files, usually 0.0 in case of castle-anim-frames). Note that even when TimeBegin <> 0 (for castle-anim-frames), we still set TimeAtLoad to 0, this is nicer to show to user.

Other value means that we used current real time as time origin, following VRML/X3D specification. See also [http://castle-engine.sourceforge.net/x3d_time_origin_considered_uncomfortable.php]

Public property Time: TFloatTime read FTime;

Current time of the animation. Although you do not have to use it: you can always acccess any point in time of the animation by Scene. But sometimes tracking the current time here is most natural and comfortable.

When we have exactly one scene in Scenes, our methods (ResetTime, ResetTimeAtLoad and Update) will synchronize Scenes[0].Time always to the same value as our own Time. This makes time-dependent nodes (like TimeSensor, MovieTexture etc.) inside this scene work Ok.

Public property Cache: TGLRendererContextCache read FCache;
 
Public property TryFirstSceneDynamic: boolean read FTryFirstSceneDynamic write FTryFirstSceneDynamic default false;

Turn this on to treat specially the case when a single scene (Scenes.Count = 1) is loaded: we will set this scene's Static = False. This allows you to enable VRML/X3D events and dynamically change the scene in this very special case. The normal behavior, when we load many scenes (or when this property is False), is to set all children scenes Static = True.

Practically, this is useful only for tools like view3dscene, that want to have full VRML/X3D events when possible, and at the same time they want to load everything as TCastlePrecalculatedAnimation, for ease of coding.

To put it simply, just don't use this in normal programs – it's a hack.

Although Static can be later changed, but changing it (after loading) to False is expensive (needs ChangedAll, that also recalculates shape tree, forces shape octree and other recalculations). That's why this property is needed, it sets Static correctly before loading the contents.

Published property TimePlaying: boolean read FTimePlaying write FTimePlaying default true;

Is the animation time playing, and how fast.

For exact meaning of our TimePlaying, TimePlayingSpeed, see TCastleSceneCore.TimePlaying, TCastleSceneCore.TimePlayingSpeed. Like in TCastleSceneCore, these are realized by our Update method, so Time is automatically increased in Update which is called automatically if you added this to some TCastleWindowCustom.Controls or TCastleControlCustom.Controls.

Note that Scenes[0].TimePlaying, Scenes[0].TimePlayingSpeed do not matter when you're operating on the TCastlePrecalculatedAnimation level. They will not affect our Time, or even Scenes[0].Time, and they will not be synchronized with our values.

Published property TimePlayingSpeed: Single read FTimePlayingSpeed write FTimePlayingSpeed default 1.0;
 
Published property TimeLoop: boolean read FTimeLoop write FTimeLoop default true;

See Scene for precise description what this property does.

Published property TimeBackwards: boolean read FTimeBackwards write FTimeBackwards default false;

See Scene for precise description what this property does.

Published property CollisionUseLastScene: boolean read FCollisionUseLastScene write FCollisionUseLastScene default false;

Should collision checking check also last animation frame.

Regardless of this value, we always check collision with the first animation frame (FirstScene), of course only when FirstScene.OctreeCollisions is initialized, and only if GetCollides (which includes GetExists).

When CollisionUseLastScene is True, we will also check collision with the last animation frame's octree, i.e. LastScene.OctreeCollisions. (Of course, only if it's initialized, e.g. by adding ssDynamicCollisions to the LastScene.Spatial property.) So when CollisionUseLastScene, collision checking sees the animation as a sum of first and last frames geometry. CollisionUseLastScene is useful if the object is moving, but the move is very slight, so that the sum of first and last scenes geometry is good enough approximation of the whole geometry at any point of the animation.

Although it seems like a totally dumb way to check for collisions, it's suitable for many purposes (see e.g. uses on "castle hall" level), it's simple and not memory-consuming, and you don't have to take any action when animation frame changes (because Time changes don't change the colliding geometry, so the animation is static from the point of view of collision checking routines).

TODO: In the future other collision methods may be available. First of all, checking with sum of all bounding boxes, or with particular scene time box, should be available.

Published property ShadowMaps: boolean read FShadowMaps write SetShadowMaps default true;

At loading, process the animation to support shadow maps. See TCastleSceneCore.ShadowMaps and related properties for documentation.

Published property ShadowMapsDefaultSize: Cardinal read FShadowMapsDefaultSize write SetShadowMapsDefaultSize default TCastleSceneCore.DefaultShadowMapsDefaultSize;
 
Published property InitialViewpointIndex: Cardinal read FInitialViewpointIndex write FInitialViewpointIndex;
 
Published property InitialViewpointName: string read FInitialViewpointName write FInitialViewpointName;
 

Generated by PasDoc 0.14.0.