Castle Game Engine: CastleResources: Class T3DResourceAnimation

# Class T3DResourceAnimation
Description | Hierarchy | Fields | Methods | Properties
## Unit CastleResources ## Declaration `type T3DResourceAnimation = class(TObject)` ## Description Animation defined by T3DResource. ## Hierarchy TObject T3DResourceAnimation ## Overview ### Methods
| `constructor Create(const AOwner: T3DResource; const AName: string; const ARequired: boolean = true);`
| `function BoundingBox: TBox3D;`
| `function Defined: boolean;`
| `function Scene(const Time: Single; const Loop: boolean): TCastleScene;`
### Properties
| `property Duration: Single read FDuration;`
| `property URL: string read FURL write FURL;`
| `property TimeSensor: string read FTimeSensor write FTimeSensor;`
| `property Name: string read FName;`
| `property Required: boolean read FRequired;`
## Description ### Methods
| `constructor Create(const AOwner: T3DResource; const AName: string; const ARequired: boolean = true);`
| `function BoundingBox: TBox3D;`
| `function Defined: boolean;`
Was the animation state defined in resource.xml file. May be `False` only if Required was `False`, or before we actually read animation info from resource.xml file.
| `function Scene(const Time: Single; const Loop: boolean): TCastleScene;`
Current Scene to render for given time. Looping is automatically done here, if parameter Loop is `True`. When it is `False`, there is no looping, which means that when Time is < 0, we show the first frame, and when Time is > Duration, we show the last frame forever. This looping (or not looping) is done regardless of whether the 3D model wants (or not) looping. For example, in case of kanim files, we ignore their loop boolean attribute. In case of X3D TimeSensor node, we ignore TimeSensor.loop field. In other words, any looping settings inside 3D model are ignored. You control looping fully by the Loop parameter to this method. If we use TCastlePrecalculatedAnimation underneath, then this returns appropriate frame of this animation. If we use TCastleScene with TimeSensor underneath, then this returns the scene with state reflecting given time — in other words, we'll send proper events to TimeSensor to make this Time current.
### Properties
| `property Duration: Single read FDuration;`
Duration of the animation. See engine tutorial about how resources animations duration is calculated. Always 0 if not Defined.
| `property URL: string read FURL write FURL;`
Animation `URL`, only when each animation is inside a separate 3D file. See [http://castle-engine.sourceforge.net/creating_data_resources.php] for documentation how you can define creature animations.
| `property TimeSensor: string read FTimeSensor write FTimeSensor;`
Time sensor name, when animations are started by X3D `TimeSensor` node. This refers to an X3D `TimeSensor` node inside animation model (from URL) or, when not defined, inside whole resource model (from T3DResource.ModelURL). See [http://castle-engine.sourceforge.net/creating_data_resources.php] for documentation how you can define creature animations.
| `property Name: string read FName;`
| `property Required: boolean read FRequired;`
Generated by PasDoc 0.13.0 on 2015-06-15 04:43:11