Castle Game EngineIntroduction Units Class Hierarchy Classes, Interfaces, Objects and Records Types Variables Constants Functions and Procedures Identifiers
|
Class TX3DRoute
Unit
X3DNodes
Declaration
type TX3DRoute = class(TX3DFileItem)
Description
Route makes a connection between two X3D events, making the destination event occur when the source event happened.
Hierarchy
Overview
Methods
Properties
Description
Methods
 |
constructor Create; |
|
 |
destructor Destroy; override; |
|
 |
procedure SetSource( const SourceNodeName, SourceFieldOrEventName: string; Reader: TX3DReaderNames); |
Set source/destination of the route.
This does everything that VRML parser should do when parsed VRML route. It looks for given node name (in Names.Nodes, then Names.Imported), then it looks for field/event within this node, and if everything is successful — sets route properties.
If something goes wrong, WritelnWarning is generated and route ending is left unset.
|
 |
procedure SetDestination( const DestinationNodeName, DestinationFieldOrEventName: string; Reader: TX3DReaderNames); |
|
 |
procedure SetSourceDirectly( const NewNode: TX3DNode; const FieldOrEvent: TX3DFieldOrEvent); overload; |
These set source/destination of the route in more direct way.
FieldOrEvent is used to set SourceEvent (or DestinationEvent). FieldOrEvent may be the actual event to set, or exposed field containing this event.
You specify explictly NewNode, which is not checked in any way. We don't check whether it exists, whether it contains given FieldOrEvent, etc. — you have to guarantee this yourself. Also, remember that normal SetSource actually look for events inside PrototypeInstanceSourceNode, if exists — if you want this, you have to do this yourself when using these SetXxxDirectly. It is used to set SourceNode (or DestinationNode). Overloaded versions that don't take NewNode parameter just assume that NewNode can be taken from FieldOrEvent.ParentNode.
|
 |
procedure SetDestinationDirectly(const FieldOrEvent: TX3DFieldOrEvent); overload; |
|
 |
procedure Parse(Lexer: TX3DLexer; Reader: TX3DReaderNames); |
Parse the route (classic VRML encoding). Implementation should be able to safely assume that current token is ROUTE.
|
 |
procedure ParseXML(Element: TDOMElement; Reader: TX3DReaderNames); |
Parse the route (XML encoding). Given Element here must have TagName = 'ROUTE'.
|
 |
procedure ResetLastEventTime; |
Clear the memory when the last event passed through this route. Route must remember such thing, to avoid loops in routes. This is following VRML 2.0 / X3D specifications, that explicitly say that only one event per ROUTE per timestamp is allowed.
Use ResetLastEventTime when you really want to reset this memory. In practice, this should be used only by TCastleSceneCore.ResetTime implementation.
|
Properties
 |
property SourceNode: TX3DNode read FSourceNode; |
Source event properties. Either all three are Nil , or:
SourceEvent is assigned, meaning is self-explanatory.
Note: if you want to get it's exposed field, remember this is available in SourceEvent.ParentExposedField.
SourceNode must also be assigned and this must be the node enclosing SourceEvent. That is, the node that has SourceEvent as one of explicit (on TX3DNode.Events list) or implicit (exposed by some field) event.
|
 |
property SourceEvent: TX3DEvent read FSourceEvent; |
|
 |
property DestinationEvent: TX3DEvent read FDestinationEvent; |
|
 |
property Internal: boolean read FInternal write FInternal default false; |
Internal routes are created by PROTO expansion code, which needs to create internal routes to implement "IS" clauses for events.
These routes work exactly like normal routes, except:
They are not saved to file (SaveToStream will ignore internal route).
It's allowed (in fact, this will always happen for current internal routes) to route one input event to another input event.
|
Generated by PasDoc 0.15.0.
|