Class TTimeSensorNode
Unit
Declaration
type TTimeSensorNode = class(TAbstractTimeDependentNode, IAbstractSensorNode)
Description
Generate events as time passes.
Hierarchy
- TObject
- TPersistent
- TNonRefCountedInterfacedPersistent
- TX3DFileItem
- TX3DNode
- TAbstractNode
- TAbstractChildNode
- TAbstractTimeDependentNode
- TTimeSensorNode
Overview
Methods
![]() |
procedure CreateNode; override; |
![]() |
class function ClassX3DType: string; override; |
![]() |
function GetCycleInterval: TFloatTime; override; |
![]() |
procedure FakeTime(const TimeInAnimation: TFloatTime; const ALoop, AFractionIncreasing: boolean; const PartialSend: TPartialSend = nil); overload; |
![]() |
procedure FakeTime(const TimeInAnimation: TFloatTime; const ALoop, AFractionIncreasing: boolean; const TimeOfEvents: TX3DTime; const PartialSend: TPartialSend = nil); overload; |
![]() |
procedure Start(const ALoop: Boolean; const AFractionIncreasing: Boolean = true; const InitialTime: TFloatTime = 0); |
![]() |
procedure Stop; |
Properties
![]() |
property FdCycleInterval: TSFTimeIgnoreWhenActive read FFdCycleInterval; |
![]() |
property CycleInterval: TFloatTime read GetCycleInterval write SetCycleInterval; |
![]() |
property EventCycleTime: TSFTimeEvent read FEventCycleTime; |
![]() |
property EventFraction_changed: TSFFloatEvent read FEventFraction_changed; |
![]() |
property EventTime: TSFTimeEvent read FEventTime; |
![]() |
property FdEnabled: TSFBool read FFdEnabled; |
![]() |
property FdDetectAffectedFields: TSFBool read FFdDetectAffectedFields; |
![]() |
property FdFractionIncreasing: TSFBool read FFdFractionIncreasing; |
![]() |
property Enabled: Boolean read GetEnabled write SetEnabled; |
![]() |
property FractionIncreasing: Boolean read GetFractionIncreasing write SetFractionIncreasing; |
![]() |
property DetectAffectedFields: Boolean read GetDetectAffectedFields write SetDetectAffectedFields; |
Description
Methods
![]() |
procedure CreateNode; override; |
![]() |
class function ClassX3DType: string; override; |
![]() |
function GetCycleInterval: TFloatTime; override; |
![]() |
procedure FakeTime(const TimeInAnimation: TFloatTime; const ALoop, AFractionIncreasing: boolean; const PartialSend: TPartialSend = nil); overload; |
|
Send TimeSensor output events, without actually activating the TimeSensor. This is useful in situations when you want the X3D scene state to reflect given time, but you do not want to activate sensor and generally you do not want to initialize anything that would continue animating on it's own. Using TimeSensor this way is contrary to the VRML/X3D specified behavior. But it's useful when we have VRML/X3D scene inside T3DResource, that is shared by many T3D instances (like creatures and items) that want to simultaneusly display different time moments of the same scene within a single frame. In other words, this is useful when a single scene is shared (if you have a 100 creatures in your game using the same 3D model, you don't want to create 100 copies of this 3D model in memory). We ignore TimeSensor.loop (FdLoop) field, instead we follow our own ALoop parameter. We also ignore TimeSensor.fractionIncreasing field, instead we follow our own AFractionIncreasing parameter. We also ignore TimeSensor.enabled field, assuming that you always want to behave like it's enabled (in particular, this makes TCastleSceneCore.ForceAnimationPose always working, even if TCastleSceneCore.PlayAnimation set enabled = false on previously-stopped animation). We take into account TimeSensor.cycleInterval (FdCycleInterval), just like during normal TimeSensor behaviour. We send out isActive:=true, fraction_changed, elapsedTime and time X3D output events, and they should drive the rest of animation. | |
![]() |
procedure FakeTime(const TimeInAnimation: TFloatTime; const ALoop, AFractionIncreasing: boolean; const TimeOfEvents: TX3DTime; const PartialSend: TPartialSend = nil); overload; |
![]() |
procedure Start(const ALoop: Boolean; const AFractionIncreasing: Boolean = true; const InitialTime: TFloatTime = 0); |
|
Start or stop the time sensor right now, by setting the fields of this time sensor. Usually you should prefer using the TCastleSceneCore.PlayAnimation or TCastleSceneCore.StopAnimation instead of these methods. The scene methods allow to play the animation with lots of features, and are more comfortable to use (e.g. you do not need to find the TTimeSensorNode reference). Using these methods directly is useful to play multiple animations simultaneously. | |
![]() |
procedure Stop; |
Properties
![]() |
property FdCycleInterval: TSFTimeIgnoreWhenActive read FFdCycleInterval; |
![]() |
property CycleInterval: TFloatTime read GetCycleInterval write SetCycleInterval; |
![]() |
property EventCycleTime: TSFTimeEvent read FEventCycleTime; |
![]() |
property EventFraction_changed: TSFFloatEvent read FEventFraction_changed; |
![]() |
property EventTime: TSFTimeEvent read FEventTime; |
![]() |
property FdEnabled: TSFBool read FFdEnabled; |
![]() |
property FdDetectAffectedFields: TSFBool read FFdDetectAffectedFields; |
![]() |
property FdFractionIncreasing: TSFBool read FFdFractionIncreasing; |
![]() |
property Enabled: Boolean read GetEnabled write SetEnabled; |
![]() |
property FractionIncreasing: Boolean read GetFractionIncreasing write SetFractionIncreasing; |
![]() |
property DetectAffectedFields: Boolean read GetDetectAffectedFields write SetDetectAffectedFields; |
Generated by PasDoc 0.16.0.
