| 1 |
{%MainUnit x3dnodes.pas} |
| 2 |
{ |
| 3 |
Copyright 2003-2018 Michalis Kamburelis. |
| 4 |
|
| 5 |
This file is part of "Castle Game Engine". |
| 6 |
|
| 7 |
"Castle Game Engine" is free software; see the file COPYING.txt, |
| 8 |
included in this distribution, for details about the copyright. |
| 9 |
|
| 10 |
"Castle Game Engine" is distributed in the hope that it will be useful, |
| 11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 13 |
|
| 14 |
---------------------------------------------------------------------------- |
| 15 |
} |
| 16 |
|
| 17 |
{ TX3DEventsEngine (ancestor of TCastleSceneCore, with which the nodes |
| 18 |
implementations interact) and related types. } |
| 19 |
|
| 20 |
{$ifdef read_interface} |
| 21 |
|
| 22 |
{ } |
| 23 |
TX3DBindableStackBasic = class(TX3DNodeList) |
| 24 |
public |
| 25 |
{ Handle set_bind event send to given Node. |
| 26 |
This always generates appropriate events. } |
| 27 |
procedure Set_Bind(Node: TAbstractBindableNode; const Value: boolean); virtual; abstract; |
| 28 |
end; |
| 29 |
|
| 30 |
{ Abstract class representing a scene that renders and processed events of the X3D nodes. |
| 31 |
See TCastleSceneCore for documentation of these methods, |
| 32 |
TCastleSceneCore is the only implementation of this abstract class in practice. } |
| 33 |
TX3DEventsEngine = class(TCastleTransform) |
| 34 |
protected |
| 35 |
procedure ExecuteCompiledScript(const HandlerName: string; ReceivedValue: TX3DField); virtual; abstract; |
| 36 |
|
| 37 |
{ Called before changing one node into another, |
| 38 |
when old node may have beeen associated with a shape using TShapeTree.AssociateNode. } |
| 39 |
procedure InternalMoveShapeAssociations(const OldNode, NewNode: TX3DNode; const ContainingShapes: TObject); virtual; abstract; |
| 40 |
public |
| 41 |
function GetBackgroundStack: TX3DBindableStackBasic; virtual; abstract; |
| 42 |
function GetFogStack: TX3DBindableStackBasic; virtual; abstract; |
| 43 |
function GetNavigationInfoStack: TX3DBindableStackBasic; virtual; abstract; |
| 44 |
function GetViewpointStack: TX3DBindableStackBasic; virtual; abstract; |
| 45 |
function Time: TFloatTime; virtual; abstract; |
| 46 |
function NextEventTime: TX3DTime; virtual; abstract; |
| 47 |
procedure ChangedAll(const OnlyAdditions: Boolean = false); virtual; abstract; |
| 48 |
procedure BeforeNodesFree(const InternalChangedAll: boolean = false); virtual; abstract; |
| 49 |
procedure InternalChangedField(const Field: TX3DField; const Change: TX3DChange); overload; virtual; abstract; |
| 50 |
procedure InternalChangedField(const Field: TX3DField); overload; |
| 51 |
end; |
| 52 |
|
| 53 |
TX3DEventsEngineList = class({$ifdef FPC}specialize{$endif} TObjectList<TX3DEventsEngine>) |
| 54 |
end; |
| 55 |
|
| 56 |
{$endif read_interface} |
| 57 |
|
| 58 |
{$ifdef read_implementation} |
| 59 |
|
| 60 |
procedure TX3DEventsEngine.InternalChangedField(const Field: TX3DField); |
| 61 |
begin |
| 62 |
InternalChangedField(Field, Field.ExecuteChange); |
| 63 |
end; |
| 64 |
|
| 65 |
{$endif read_implementation} |