1 /**
2 
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.physicalbone;
14 import std.meta : AliasSeq, staticIndexOf;
15 import std.traits : Unqual;
16 import godot.d.meta;
17 import godot.core;
18 import godot.c;
19 import godot.d.bind;
20 import godot.d.reference;
21 import godot.object;
22 import godot.classdb;
23 import godot.physicsbody;
24 import godot.collisionobject;
25 import godot.spatial;
26 import godot.node;
27 /**
28 
29 */
30 @GodotBaseClass struct PhysicalBone
31 {
32 	enum string _GODOT_internal_name = "PhysicalBone";
33 public:
34 @nogc nothrow:
35 	union { godot_object _godot_object; PhysicsBody _GODOT_base; }
36 	alias _GODOT_base this;
37 	alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses);
38 	package(godot) __gshared bool _classBindingInitialized = false;
39 	package(godot) static struct _classBinding
40 	{
41 		__gshared:
42 		@GodotName("_direct_state_changed") GodotMethod!(void, GodotObject) _directStateChanged;
43 		@GodotName("set_joint_type") GodotMethod!(void, long) setJointType;
44 		@GodotName("get_joint_type") GodotMethod!(PhysicalBone.JointType) getJointType;
45 		@GodotName("set_joint_offset") GodotMethod!(void, Transform) setJointOffset;
46 		@GodotName("get_joint_offset") GodotMethod!(Transform) getJointOffset;
47 		@GodotName("set_body_offset") GodotMethod!(void, Transform) setBodyOffset;
48 		@GodotName("get_body_offset") GodotMethod!(Transform) getBodyOffset;
49 		@GodotName("is_static_body") GodotMethod!(bool) isStaticBody;
50 		@GodotName("get_simulate_physics") GodotMethod!(bool) getSimulatePhysics;
51 		@GodotName("is_simulating_physics") GodotMethod!(bool) isSimulatingPhysics;
52 		@GodotName("get_bone_id") GodotMethod!(long) getBoneId;
53 		@GodotName("set_mass") GodotMethod!(void, double) setMass;
54 		@GodotName("get_mass") GodotMethod!(double) getMass;
55 		@GodotName("set_weight") GodotMethod!(void, double) setWeight;
56 		@GodotName("get_weight") GodotMethod!(double) getWeight;
57 		@GodotName("set_friction") GodotMethod!(void, double) setFriction;
58 		@GodotName("get_friction") GodotMethod!(double) getFriction;
59 		@GodotName("set_bounce") GodotMethod!(void, double) setBounce;
60 		@GodotName("get_bounce") GodotMethod!(double) getBounce;
61 		@GodotName("set_gravity_scale") GodotMethod!(void, double) setGravityScale;
62 		@GodotName("get_gravity_scale") GodotMethod!(double) getGravityScale;
63 	}
64 	bool opEquals(in PhysicalBone other) const { return _godot_object.ptr is other._godot_object.ptr; }
65 	PhysicalBone opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; }
66 	bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; }
67 	mixin baseCasts;
68 	static PhysicalBone _new()
69 	{
70 		static godot_class_constructor constructor;
71 		if(constructor is null) constructor = _godot_api.godot_get_class_constructor("PhysicalBone");
72 		if(constructor is null) return typeof(this).init;
73 		return cast(PhysicalBone)(constructor());
74 	}
75 	@disable new(size_t s);
76 	/// 
77 	enum JointType : int
78 	{
79 		/**
80 		
81 		*/
82 		jointTypeNone = 0,
83 		/**
84 		
85 		*/
86 		jointTypePin = 1,
87 		/**
88 		
89 		*/
90 		jointTypeCone = 2,
91 		/**
92 		
93 		*/
94 		jointTypeHinge = 3,
95 		/**
96 		
97 		*/
98 		jointTypeSlider = 4,
99 		/**
100 		
101 		*/
102 		jointType6dof = 5,
103 	}
104 	/// 
105 	enum Constants : int
106 	{
107 		jointTypeNone = 0,
108 		jointTypePin = 1,
109 		jointTypeCone = 2,
110 		jointTypeHinge = 3,
111 		jointTypeSlider = 4,
112 		jointType6dof = 5,
113 	}
114 	/**
115 	
116 	*/
117 	void _directStateChanged(GodotObject arg0)
118 	{
119 		Array _GODOT_args = Array.empty_array;
120 		_GODOT_args.append(arg0);
121 		String _GODOT_method_name = String("_direct_state_changed");
122 		this.callv(_GODOT_method_name, _GODOT_args);
123 	}
124 	/**
125 	
126 	*/
127 	void setJointType(in long joint_type)
128 	{
129 		checkClassBinding!(typeof(this))();
130 		ptrcall!(void)(_classBinding.setJointType, _godot_object, joint_type);
131 	}
132 	/**
133 	
134 	*/
135 	PhysicalBone.JointType getJointType() const
136 	{
137 		checkClassBinding!(typeof(this))();
138 		return ptrcall!(PhysicalBone.JointType)(_classBinding.getJointType, _godot_object);
139 	}
140 	/**
141 	
142 	*/
143 	void setJointOffset(in Transform offset)
144 	{
145 		checkClassBinding!(typeof(this))();
146 		ptrcall!(void)(_classBinding.setJointOffset, _godot_object, offset);
147 	}
148 	/**
149 	
150 	*/
151 	Transform getJointOffset() const
152 	{
153 		checkClassBinding!(typeof(this))();
154 		return ptrcall!(Transform)(_classBinding.getJointOffset, _godot_object);
155 	}
156 	/**
157 	
158 	*/
159 	void setBodyOffset(in Transform offset)
160 	{
161 		checkClassBinding!(typeof(this))();
162 		ptrcall!(void)(_classBinding.setBodyOffset, _godot_object, offset);
163 	}
164 	/**
165 	
166 	*/
167 	Transform getBodyOffset() const
168 	{
169 		checkClassBinding!(typeof(this))();
170 		return ptrcall!(Transform)(_classBinding.getBodyOffset, _godot_object);
171 	}
172 	/**
173 	
174 	*/
175 	bool isStaticBody()
176 	{
177 		checkClassBinding!(typeof(this))();
178 		return ptrcall!(bool)(_classBinding.isStaticBody, _godot_object);
179 	}
180 	/**
181 	
182 	*/
183 	bool getSimulatePhysics()
184 	{
185 		checkClassBinding!(typeof(this))();
186 		return ptrcall!(bool)(_classBinding.getSimulatePhysics, _godot_object);
187 	}
188 	/**
189 	
190 	*/
191 	bool isSimulatingPhysics()
192 	{
193 		checkClassBinding!(typeof(this))();
194 		return ptrcall!(bool)(_classBinding.isSimulatingPhysics, _godot_object);
195 	}
196 	/**
197 	
198 	*/
199 	long getBoneId() const
200 	{
201 		checkClassBinding!(typeof(this))();
202 		return ptrcall!(long)(_classBinding.getBoneId, _godot_object);
203 	}
204 	/**
205 	
206 	*/
207 	void setMass(in double mass)
208 	{
209 		checkClassBinding!(typeof(this))();
210 		ptrcall!(void)(_classBinding.setMass, _godot_object, mass);
211 	}
212 	/**
213 	
214 	*/
215 	double getMass() const
216 	{
217 		checkClassBinding!(typeof(this))();
218 		return ptrcall!(double)(_classBinding.getMass, _godot_object);
219 	}
220 	/**
221 	
222 	*/
223 	void setWeight(in double weight)
224 	{
225 		checkClassBinding!(typeof(this))();
226 		ptrcall!(void)(_classBinding.setWeight, _godot_object, weight);
227 	}
228 	/**
229 	
230 	*/
231 	double getWeight() const
232 	{
233 		checkClassBinding!(typeof(this))();
234 		return ptrcall!(double)(_classBinding.getWeight, _godot_object);
235 	}
236 	/**
237 	
238 	*/
239 	void setFriction(in double friction)
240 	{
241 		checkClassBinding!(typeof(this))();
242 		ptrcall!(void)(_classBinding.setFriction, _godot_object, friction);
243 	}
244 	/**
245 	
246 	*/
247 	double getFriction() const
248 	{
249 		checkClassBinding!(typeof(this))();
250 		return ptrcall!(double)(_classBinding.getFriction, _godot_object);
251 	}
252 	/**
253 	
254 	*/
255 	void setBounce(in double bounce)
256 	{
257 		checkClassBinding!(typeof(this))();
258 		ptrcall!(void)(_classBinding.setBounce, _godot_object, bounce);
259 	}
260 	/**
261 	
262 	*/
263 	double getBounce() const
264 	{
265 		checkClassBinding!(typeof(this))();
266 		return ptrcall!(double)(_classBinding.getBounce, _godot_object);
267 	}
268 	/**
269 	
270 	*/
271 	void setGravityScale(in double gravity_scale)
272 	{
273 		checkClassBinding!(typeof(this))();
274 		ptrcall!(void)(_classBinding.setGravityScale, _godot_object, gravity_scale);
275 	}
276 	/**
277 	
278 	*/
279 	double getGravityScale() const
280 	{
281 		checkClassBinding!(typeof(this))();
282 		return ptrcall!(double)(_classBinding.getGravityScale, _godot_object);
283 	}
284 	/**
285 	
286 	*/
287 	@property PhysicalBone.JointType jointType()
288 	{
289 		return getJointType();
290 	}
291 	/// ditto
292 	@property void jointType(long v)
293 	{
294 		setJointType(v);
295 	}
296 	/**
297 	
298 	*/
299 	@property Transform jointOffset()
300 	{
301 		return getJointOffset();
302 	}
303 	/// ditto
304 	@property void jointOffset(Transform v)
305 	{
306 		setJointOffset(v);
307 	}
308 	/**
309 	
310 	*/
311 	@property Transform bodyOffset()
312 	{
313 		return getBodyOffset();
314 	}
315 	/// ditto
316 	@property void bodyOffset(Transform v)
317 	{
318 		setBodyOffset(v);
319 	}
320 	/**
321 	
322 	*/
323 	@property double mass()
324 	{
325 		return getMass();
326 	}
327 	/// ditto
328 	@property void mass(double v)
329 	{
330 		setMass(v);
331 	}
332 	/**
333 	
334 	*/
335 	@property double weight()
336 	{
337 		return getWeight();
338 	}
339 	/// ditto
340 	@property void weight(double v)
341 	{
342 		setWeight(v);
343 	}
344 	/**
345 	
346 	*/
347 	@property double friction()
348 	{
349 		return getFriction();
350 	}
351 	/// ditto
352 	@property void friction(double v)
353 	{
354 		setFriction(v);
355 	}
356 	/**
357 	
358 	*/
359 	@property double bounce()
360 	{
361 		return getBounce();
362 	}
363 	/// ditto
364 	@property void bounce(double v)
365 	{
366 		setBounce(v);
367 	}
368 	/**
369 	
370 	*/
371 	@property double gravityScale()
372 	{
373 		return getGravityScale();
374 	}
375 	/// ditto
376 	@property void gravityScale(double v)
377 	{
378 		setGravityScale(v);
379 	}
380 }