Class TTimeDependentNodeHandler
Unit
X3DNodes
Declaration
type TTimeDependentNodeHandler = class(TObject)
Description
Common helper for all X3DTimeDependentNode descendants. This includes things descending from interface IAbstractTimeDependentNode, in particular (but not only) descending from class TAbstractTimeDependentNode.
It would be cleaner to have Node declared as IAbstractTimeDependentNode, and have IAbstractTimeDependentNode contain common fields. Then a lot of fields of this class would not be needed, as they would be accessible as IAbstractTimeDependentNode fields. TODO: maybe in the future.
Hierarchy
- TObject
- TTimeDependentNodeHandler
Overview
Fields
Methods
Properties
Description
Fields
 |
OnCycleInterval: TTimeFunction; |
Cycle interval for this time-dependent node.
|
 |
Fdenabled: TSFBool; |
May be Nil if node doesn't have an "enabled" field.
|
 |
EventcycleTime: TX3DEvent; |
May be Nil if node doesn't have a "cycleTime" event.
|
Methods
 |
function SetTime(const OldValue, NewValue: TX3DTime; const TimeIncrease: TFloatTime; const ResetTime: boolean): boolean; |
Call this when world time increases. This is the most important method of this class, that basically implements time-dependent nodes operations.
OldValue, NewValue and TimeIncrease must match, as produced by TCastleSceneCore.SetTime and friends.
When ResetTime = true, this means that "TimeIncrease value is unknown" (you must pass TimeIncrease = 0 in this case). This can happen only when were called by ResetTime.
In other circumstances, TimeIncrease must be >= 0. (It's allowed to pass TimeIncrease = 0 and ResetTime = false, this doesn't advance the clock, but is a useful trick to force some update, see TVRMScene.ChangedField implementation.)
References: see X3D specification "Time" component, 8.2 ("concepts") for logic behind all those start/stop/pause/resumeTime, cycleInterval, loop properties.
Returns
If some state of time-dependent node changed. |
Properties
 |
property IsActive: boolean read FIsActive write SetIsActive; |
These describe current state of this TimeDependentNode, see X3D specification about "Time" component.
Their setting causes appropriate events to be generated (with Time = CurrentTime, so be sure to update it before changing these properties. SetTime automatically does this for you.).
|
 |
property IsPaused: boolean read FIsPaused write SetIsPaused; |
|
 |
property ElapsedTime: TFloatTime read FElapsedTime write SetElapsedTime; |
|
Generated by PasDoc 0.12.1 on 2013-02-04 20:26:54
|