1 /**
2 RemoteTransform pushes its own $(D Transform) to another $(D Spatial) derived Node in the scene.
3 
4 Copyright:
5 Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur.  
6 Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md)  
7 Copyright (c) 2017-2018 Godot-D contributors  
8 
9 License: $(LINK2 https://opensource.org/licenses/MIT, MIT License)
10 
11 
12 */
13 module godot.remotetransform;
14 import std.meta : AliasSeq, staticIndexOf;
15 import std.traits : Unqual;
16 import godot.d.traits;
17 import godot.core;
18 import godot.c;
19 import godot.d.bind;
20 import godot.d.reference;
21 import godot.globalenums;
22 import godot.object;
23 import godot.classdb;
24 import godot.spatial;
25 /**
26 RemoteTransform pushes its own $(D Transform) to another $(D Spatial) derived Node in the scene.
27 
28 RemoteTransform pushes its own $(D Transform) to another $(D Spatial) derived Node (called the remote node) in the scene.
29 It can be set to update another Node's position, rotation and/or scale. It can use either global or local coordinates.
30 */
31 @GodotBaseClass struct RemoteTransform
32 {
33 	package(godot) enum string _GODOT_internal_name = "RemoteTransform";
34 public:
35 @nogc nothrow:
36 	union { /** */ godot_object _godot_object; /** */ Spatial _GODOT_base; }
37 	alias _GODOT_base this;
38 	alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses);
39 	package(godot) __gshared bool _classBindingInitialized = false;
40 	package(godot) static struct GDNativeClassBinding
41 	{
42 		__gshared:
43 		@GodotName("force_update_cache") GodotMethod!(void) forceUpdateCache;
44 		@GodotName("get_remote_node") GodotMethod!(NodePath) getRemoteNode;
45 		@GodotName("get_update_position") GodotMethod!(bool) getUpdatePosition;
46 		@GodotName("get_update_rotation") GodotMethod!(bool) getUpdateRotation;
47 		@GodotName("get_update_scale") GodotMethod!(bool) getUpdateScale;
48 		@GodotName("get_use_global_coordinates") GodotMethod!(bool) getUseGlobalCoordinates;
49 		@GodotName("set_remote_node") GodotMethod!(void, NodePath) setRemoteNode;
50 		@GodotName("set_update_position") GodotMethod!(void, bool) setUpdatePosition;
51 		@GodotName("set_update_rotation") GodotMethod!(void, bool) setUpdateRotation;
52 		@GodotName("set_update_scale") GodotMethod!(void, bool) setUpdateScale;
53 		@GodotName("set_use_global_coordinates") GodotMethod!(void, bool) setUseGlobalCoordinates;
54 	}
55 	/// 
56 	pragma(inline, true) bool opEquals(in RemoteTransform other) const
57 	{ return _godot_object.ptr is other._godot_object.ptr; }
58 	/// 
59 	pragma(inline, true) typeof(null) opAssign(typeof(null) n)
60 	{ _godot_object.ptr = n; return null; }
61 	/// 
62 	pragma(inline, true) bool opEquals(typeof(null) n) const
63 	{ return _godot_object.ptr is n; }
64 	/// 
65 	size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; }
66 	mixin baseCasts;
67 	/// Construct a new instance of RemoteTransform.
68 	/// Note: use `memnew!RemoteTransform` instead.
69 	static RemoteTransform _new()
70 	{
71 		static godot_class_constructor constructor;
72 		if(constructor is null) constructor = _godot_api.godot_get_class_constructor("RemoteTransform");
73 		if(constructor is null) return typeof(this).init;
74 		return cast(RemoteTransform)(constructor());
75 	}
76 	@disable new(size_t s);
77 	/**
78 	$(D RemoteTransform) caches the remote node. It may not notice if the remote node disappears; $(D forceUpdateCache) forces it to update the cache again.
79 	*/
80 	void forceUpdateCache()
81 	{
82 		checkClassBinding!(typeof(this))();
83 		ptrcall!(void)(GDNativeClassBinding.forceUpdateCache, _godot_object);
84 	}
85 	/**
86 	
87 	*/
88 	NodePath getRemoteNode() const
89 	{
90 		checkClassBinding!(typeof(this))();
91 		return ptrcall!(NodePath)(GDNativeClassBinding.getRemoteNode, _godot_object);
92 	}
93 	/**
94 	
95 	*/
96 	bool getUpdatePosition() const
97 	{
98 		checkClassBinding!(typeof(this))();
99 		return ptrcall!(bool)(GDNativeClassBinding.getUpdatePosition, _godot_object);
100 	}
101 	/**
102 	
103 	*/
104 	bool getUpdateRotation() const
105 	{
106 		checkClassBinding!(typeof(this))();
107 		return ptrcall!(bool)(GDNativeClassBinding.getUpdateRotation, _godot_object);
108 	}
109 	/**
110 	
111 	*/
112 	bool getUpdateScale() const
113 	{
114 		checkClassBinding!(typeof(this))();
115 		return ptrcall!(bool)(GDNativeClassBinding.getUpdateScale, _godot_object);
116 	}
117 	/**
118 	
119 	*/
120 	bool getUseGlobalCoordinates() const
121 	{
122 		checkClassBinding!(typeof(this))();
123 		return ptrcall!(bool)(GDNativeClassBinding.getUseGlobalCoordinates, _godot_object);
124 	}
125 	/**
126 	
127 	*/
128 	void setRemoteNode(NodePathArg0)(in NodePathArg0 path)
129 	{
130 		checkClassBinding!(typeof(this))();
131 		ptrcall!(void)(GDNativeClassBinding.setRemoteNode, _godot_object, path);
132 	}
133 	/**
134 	
135 	*/
136 	void setUpdatePosition(in bool update_remote_position)
137 	{
138 		checkClassBinding!(typeof(this))();
139 		ptrcall!(void)(GDNativeClassBinding.setUpdatePosition, _godot_object, update_remote_position);
140 	}
141 	/**
142 	
143 	*/
144 	void setUpdateRotation(in bool update_remote_rotation)
145 	{
146 		checkClassBinding!(typeof(this))();
147 		ptrcall!(void)(GDNativeClassBinding.setUpdateRotation, _godot_object, update_remote_rotation);
148 	}
149 	/**
150 	
151 	*/
152 	void setUpdateScale(in bool update_remote_scale)
153 	{
154 		checkClassBinding!(typeof(this))();
155 		ptrcall!(void)(GDNativeClassBinding.setUpdateScale, _godot_object, update_remote_scale);
156 	}
157 	/**
158 	
159 	*/
160 	void setUseGlobalCoordinates(in bool use_global_coordinates)
161 	{
162 		checkClassBinding!(typeof(this))();
163 		ptrcall!(void)(GDNativeClassBinding.setUseGlobalCoordinates, _godot_object, use_global_coordinates);
164 	}
165 	/**
166 	The $(D NodePath) to the remote node, relative to the RemoteTransform's position in the scene.
167 	*/
168 	@property NodePath remotePath()
169 	{
170 		return getRemoteNode();
171 	}
172 	/// ditto
173 	@property void remotePath(NodePath v)
174 	{
175 		setRemoteNode(v);
176 	}
177 	/**
178 	If `true`, the remote node's position is updated.
179 	*/
180 	@property bool updatePosition()
181 	{
182 		return getUpdatePosition();
183 	}
184 	/// ditto
185 	@property void updatePosition(bool v)
186 	{
187 		setUpdatePosition(v);
188 	}
189 	/**
190 	If `true`, the remote node's rotation is updated.
191 	*/
192 	@property bool updateRotation()
193 	{
194 		return getUpdateRotation();
195 	}
196 	/// ditto
197 	@property void updateRotation(bool v)
198 	{
199 		setUpdateRotation(v);
200 	}
201 	/**
202 	If `true`, the remote node's scale is updated.
203 	*/
204 	@property bool updateScale()
205 	{
206 		return getUpdateScale();
207 	}
208 	/// ditto
209 	@property void updateScale(bool v)
210 	{
211 		setUpdateScale(v);
212 	}
213 	/**
214 	If `true`, global coordinates are used. If `false`, local coordinates are used.
215 	*/
216 	@property bool useGlobalCoordinates()
217 	{
218 		return getUseGlobalCoordinates();
219 	}
220 	/// ditto
221 	@property void useGlobalCoordinates(bool v)
222 	{
223 		setUseGlobalCoordinates(v);
224 	}
225 }