Debian Codegraph @

src/scene/x3d/auto_generated_node_helpers/x3dnodes_spotlight_1.inc

raw
1 { -*- buffer-read-only: t -*-
2
3 Copyright 2015-2024 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 { Automatically generated node properties.
18
19 Do not edit this file manually!
20 To add new properties:
21 - add them to the text files in tools/internal/x3d-nodes-to-pascal/nodes-specification/ ,
22 - and regenerate include files by running x3d-nodes-to-pascal }
23
24 {$ifdef read_interface}
25
26 strict private
27 function GetDirection: TVector3;
28 procedure SetDirection(const Value: TVector3);
29 function GetDropOffRate: Single;
30 procedure SetDropOffRate(const Value: Single);
31 function GetCutOffAngle: Single;
32 procedure SetCutOffAngle(const Value: Single);
33 public
34 { Create node fields and events. }
35 procedure CreateNode; override;
36 class function ClassX3DType: String; override;
37 class function ForVRMLVersion(const Version: TX3DVersion): Boolean; override;
38
39 strict private FFdDirection: TSFVec3f;
40 { Internal wrapper for property @code(Direction). This wrapper API may change, we advise to access simpler @code(Direction) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
41 public property FdDirection: TSFVec3f read FFdDirection;
42 { }
43 property Direction: TVector3 read GetDirection write SetDirection;
44
45 strict private FFdDropOffRate: TSFFloat;
46 { Internal wrapper for property @code(DropOffRate). This wrapper API may change, we advise to access simpler @code(DropOffRate) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
47 public property FdDropOffRate: TSFFloat read FFdDropOffRate;
48 { }
49 property DropOffRate: Single read GetDropOffRate write SetDropOffRate;
50
51 strict private FFdCutOffAngle: TSFFloat;
52 { Internal wrapper for property @code(CutOffAngle). This wrapper API may change, we advise to access simpler @code(CutOffAngle) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
53 public property FdCutOffAngle: TSFFloat read FFdCutOffAngle;
54 { }
55 property CutOffAngle: Single read GetCutOffAngle write SetCutOffAngle;
56
57 {$endif read_interface}
58
59 {$ifdef read_implementation}
60
61 { TSpotLightNode_1 ----------------------------------------------- }
62
63 function TSpotLightNode_1.GetDirection: TVector3;
64 begin
65 Result := FdDirection.Value;
66 end;
67
68 procedure TSpotLightNode_1.SetDirection(const Value: TVector3);
69 begin
70 FdDirection.Send(Value);
71 end;
72
73 function TSpotLightNode_1.GetDropOffRate: Single;
74 begin
75 Result := FdDropOffRate.Value;
76 end;
77
78 procedure TSpotLightNode_1.SetDropOffRate(const Value: Single);
79 begin
80 FdDropOffRate.Send(Value);
81 end;
82
83 function TSpotLightNode_1.GetCutOffAngle: Single;
84 begin
85 Result := FdCutOffAngle.Value;
86 end;
87
88 procedure TSpotLightNode_1.SetCutOffAngle(const Value: Single);
89 begin
90 FdCutOffAngle.Send(Value);
91 end;
92
93 class function TSpotLightNode_1.ForVRMLVersion(const Version: TX3DVersion): Boolean;
94 begin
95 Result := Version.Major <= 1; // parse this node only in VRML 1.0 and Inventor files
96 end;
97
98 class function TSpotLightNode_1.ClassX3DType: String;
99 begin
100 Result := 'SpotLight';
101 end;
102
103 procedure TSpotLightNode_1.CreateNode;
104 begin
105 inherited;
106
107 FFdDirection := TSFVec3f.Create(Self, True, 'direction', Vector3(0, 0, -1));
108 FdDirection.ChangeAlways := chLightLocationDirection;
109 AddField(FFdDirection);
110
111 FFdDropOffRate := TSFFloat.Create(Self, True, 'dropOffRate', 0);
112 FdDropOffRate.ChangeAlways := chVisibleNonGeometry;
113 AddField(FFdDropOffRate);
114
115 FFdCutOffAngle := TSFFloat.Create(Self, True, 'cutOffAngle', Pi/4);
116 FdCutOffAngle.ChangeAlways := chVisibleNonGeometry;
117 AddField(FFdCutOffAngle);
118 end;
119
120 {$endif read_implementation}