Class TAbstractTimeDependentNode

Unit

Declaration

type TAbstractTimeDependentNode = class(TAbstractChildNode)

Description

Abstract node from which most (but not all) time-dependent nodes are derived.

Hierarchy

Overview

Methods

Public constructor Create(const AX3DName: String = ''; const ABaseUrl: String = ''); override;
Public procedure CreateNode; override;
Public function GetCycleInterval: TFloatTime; virtual; abstract;
Public function IsActive: boolean;
Public function IsPaused: boolean;
Public function ElapsedTime: TFloatTime;
Public function ElapsedTimeInCycle: TFloatTime;

Properties

Public property FdLoop: TSFBool read FFdLoop;
Public property FdPauseTime: TSFTime read FFdPauseTime;
Public property FdResumeTime: TSFTime read FFdResumeTime;
Public property FdStartTime: TSFTimeIgnoreWhenActive read FFdStartTime;
Public property FdStopTime: TSFStopTime read FFdStopTime;
Public property EventElapsedTime: TSFTimeEvent read FEventElapsedTime;
Public property EventIsActive: TSFBoolEvent read FEventIsActive;
Public property EventIsPaused: TSFBoolEvent read FEventIsPaused;
Public property Loop: Boolean read GetLoop write SetLoop;
Public property PauseTime: TFloatTime read GetPauseTime write SetPauseTime;
Public property ResumeTime: TFloatTime read GetResumeTime write SetResumeTime;
Public property StartTime: TFloatTime read GetStartTime write SetStartTime;
Public property StopTime: TFloatTime read GetStopTime write SetStopTime;

Description

Methods

Public constructor Create(const AX3DName: String = ''; const ABaseUrl: String = ''); override;
 
Public procedure CreateNode; override;
 
Public function GetCycleInterval: TFloatTime; virtual; abstract;

Final length (in seconds) of this animation. For a looping animation, this is the time it takes to make a single cycle. Should always be > 0.

This is not called "duration", as that word is reserved to mean "unscaled time length" for X3D AudioClip and MovieTexture nodes. The final length, returned here, is the AudioClip.duration divided by AudioClip.pitch, or MovieTexture.duration / MovieTexture.speed.

On TTimeSensorNode descendants, you can also get and set this by the class helper property TTimeSensorNode.CycleInterval. The name collision is harmless here, as both ways get the same value.

Public function IsActive: boolean;

Is the sensor enabled and running (ignoring whether it is paused).

For a precise (and complicated:) specification of how this behaves, see the X3D TimeSensor.isActive specification at http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/time.html#TimeSensor

Public function IsPaused: boolean;

Is the sensor paused.

For a precise (and complicated:) specification of how this behaves, see the X3D TimeSensor.isPaused specification at http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/time.html#TimeSensor

Public function ElapsedTime: TFloatTime;

Time in seconds since the sensor was activated and running, not counting any time while in pause state.

For non-looping animations, note that the sensor automatically stops when the animation finishes, so ElapsedTime will not grow beyond the "duration". If you want to observe when the animation ended, you probably do not want to use this property. Instead observe when IsActive changed to False, by registering a callback on EventIsActive.AddNotification. See the examples/3d_rendering_processing/listen_on_x3d_events.lpr .

BTW, the "duration" mentioned above is usually just GetCycleInterval, but sometimes it's a GetCycleInterval multiplied by some scaling factor, like in case of TAudioClipNode or TMovieTextureNode).

For a precise (and complicated:) specification of how this behaves, see the X3D TimeSensor.elapsedTime specification at http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/time.html#TimeSensor

Public function ElapsedTimeInCycle: TFloatTime;

Time in seconds since the sensor was activated and running, in this cycle, not counting any time while in pause state.

This is like ike ElapsedTime, but counting only the current cycle. When GetCycleInterval = 0, this is always 0. When GetCycleInterval <> 0, this is always >= 0 and < CycleInterval .

Properties

Public property FdLoop: TSFBool read FFdLoop;
 
Public property FdPauseTime: TSFTime read FFdPauseTime;
 
Public property FdResumeTime: TSFTime read FFdResumeTime;
 
Public property FdStartTime: TSFTimeIgnoreWhenActive read FFdStartTime;
 
Public property FdStopTime: TSFStopTime read FFdStopTime;
 
Public property EventElapsedTime: TSFTimeEvent read FEventElapsedTime;
 
Public property EventIsActive: TSFBoolEvent read FEventIsActive;
 
Public property EventIsPaused: TSFBoolEvent read FEventIsPaused;
 
Public property Loop: Boolean read GetLoop write SetLoop;
 
Public property PauseTime: TFloatTime read GetPauseTime write SetPauseTime;
 
Public property ResumeTime: TFloatTime read GetResumeTime write SetResumeTime;
 
Public property StartTime: TFloatTime read GetStartTime write SetStartTime;
 
Public property StopTime: TFloatTime read GetStopTime write SetStopTime;
 

Generated by PasDoc 0.16.0.