Debian Codegraph @

src/scene/x3d/auto_generated_node_helpers/x3dnodes_transform.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 GetCenter: TVector3;
28 procedure SetCenter(const Value: TVector3);
29 function GetRotation: TVector4;
30 procedure SetRotation(const Value: TVector4);
31 function GetScale: TVector3;
32 procedure SetScale(const Value: TVector3);
33 function GetScaleOrientation: TVector4;
34 procedure SetScaleOrientation(const Value: TVector4);
35 function GetTranslation: TVector3;
36 procedure SetTranslation(const Value: TVector3);
37 public
38 { Create node fields and events. }
39 procedure CreateNode; override;
40 class function ClassX3DType: String; override;
41
42 strict private FFdCenter: TSFVec3f;
43 { Internal wrapper for property @code(Center). This wrapper API may change, we advise to access simpler @code(Center) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
44 public property FdCenter: TSFVec3f read FFdCenter;
45 { Center point around which the @link(Rotation) and @link(Scale) is performed. }
46 property Center: TVector3 read GetCenter write SetCenter;
47
48 strict private FFdRotation: TSFRotation;
49 { Internal wrapper for property @code(Rotation). This wrapper API may change, we advise to access simpler @code(Rotation) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
50 public property FdRotation: TSFRotation read FFdRotation;
51 { Rotate children in 3D, around a specified axis. Rotation is expressed as a 4D vector, in which the first 3 components specify the rotation axis (does not need to be normalized, but must be non-zero) and the last component is the rotation angle @italic(in radians). Rotation is done around @link(Center). }
52 property Rotation: TVector4 read GetRotation write SetRotation;
53
54 strict private FFdScale: TSFVec3f;
55 { Internal wrapper for property @code(Scale). This wrapper API may change, we advise to access simpler @code(Scale) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
56 public property FdScale: TSFVec3f read FFdScale;
57 { Scale in 3D. Scaling is done around @link(Center) and with orientation given by @link(ScaleOrientation). Note about negative scale: We do the best we can to work with @italic(any) scale value, even negative or zero. But usually, it's best to keep the scale positive. See the @link(TCastleTransform.Scale) documentation for some good guidelines about the scale. }
58 property Scale: TVector3 read GetScale write SetScale;
59
60 strict private FFdScaleOrientation: TSFRotation;
61 { Internal wrapper for property @code(ScaleOrientation). This wrapper API may change, we advise to access simpler @code(ScaleOrientation) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
62 public property FdScaleOrientation: TSFRotation read FFdScaleOrientation;
63 { Orientation in which 3D @link(Scale) is performed. }
64 property ScaleOrientation: TVector4 read GetScaleOrientation write SetScaleOrientation;
65
66 strict private FFdTranslation: TSFVec3f;
67 { Internal wrapper for property @code(Translation). This wrapper API may change, we advise to access simpler @code(Translation) instead, if it is defined (TODO: for now, some field types do not have a simpler counterpart). }
68 public property FdTranslation: TSFVec3f read FFdTranslation;
69 { Translation (move) the children nodes. }
70 property Translation: TVector3 read GetTranslation write SetTranslation;
71
72 {$endif read_interface}
73
74 {$ifdef read_implementation}
75
76 { TTransformNode ----------------------------------------------- }
77
78 function TTransformNode.GetCenter: TVector3;
79 begin
80 Result := FdCenter.Value;
81 end;
82
83 procedure TTransformNode.SetCenter(const Value: TVector3);
84 begin
85 FdCenter.Send(Value);
86 end;
87
88 function TTransformNode.GetRotation: TVector4;
89 begin
90 Result := FdRotation.Value;
91 end;
92
93 procedure TTransformNode.SetRotation(const Value: TVector4);
94 begin
95 FdRotation.Send(Value);
96 end;
97
98 function TTransformNode.GetScale: TVector3;
99 begin
100 Result := FdScale.Value;
101 end;
102
103 procedure TTransformNode.SetScale(const Value: TVector3);
104 begin
105 FdScale.Send(Value);
106 end;
107
108 function TTransformNode.GetScaleOrientation: TVector4;
109 begin
110 Result := FdScaleOrientation.Value;
111 end;
112
113 procedure TTransformNode.SetScaleOrientation(const Value: TVector4);
114 begin
115 FdScaleOrientation.Send(Value);
116 end;
117
118 function TTransformNode.GetTranslation: TVector3;
119 begin
120 Result := FdTranslation.Value;
121 end;
122
123 procedure TTransformNode.SetTranslation(const Value: TVector3);
124 begin
125 FdTranslation.Send(Value);
126 end;
127
128 class function TTransformNode.ClassX3DType: String;
129 begin
130 Result := 'Transform';
131 end;
132
133 procedure TTransformNode.CreateNode;
134 begin
135 inherited;
136
137 FFdCenter := TSFVec3f.Create(Self, True, 'center', Vector3(0, 0, 0));
138 FdCenter.ChangeAlways := chTransform;
139 AddField(FFdCenter);
140
141 FFdRotation := TSFRotation.Create(Self, True, 'rotation', Vector3(0, 0, 1), 0);
142 FdRotation.ChangeAlways := chTransform;
143 AddField(FFdRotation);
144
145 FFdScale := TSFVec3f.Create(Self, True, 'scale', Vector3(1, 1, 1));
146 FdScale.ChangeAlways := chTransform;
147 AddField(FFdScale);
148
149 FFdScaleOrientation := TSFRotation.Create(Self, True, 'scaleOrientation', Vector3(0, 0, 1), 0);
150 FdScaleOrientation.ChangeAlways := chTransform;
151 AddField(FFdScaleOrientation);
152
153 FFdTranslation := TSFVec3f.Create(Self, True, 'translation', Vector3(0, 0, 0));
154 FdTranslation.ChangeAlways := chTransform;
155 AddField(FFdTranslation);
156 end;
157
158 {$endif read_implementation}