1 /**
2 Groove constraint for 2D physics.
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.groovejoint2d;
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.joint2d;
25 /**
26 Groove constraint for 2D physics.
27 
28 This is useful for making a body "slide" through a segment placed in another.
29 */
30 @GodotBaseClass struct GrooveJoint2D
31 {
32 	package(godot) enum string _GODOT_internal_name = "GrooveJoint2D";
33 public:
34 @nogc nothrow:
35 	union { /** */ godot_object _godot_object; /** */ Joint2D _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 GDNativeClassBinding
40 	{
41 		__gshared:
42 		@GodotName("get_initial_offset") GodotMethod!(double) getInitialOffset;
43 		@GodotName("get_length") GodotMethod!(double) getLength;
44 		@GodotName("set_initial_offset") GodotMethod!(void, double) setInitialOffset;
45 		@GodotName("set_length") GodotMethod!(void, double) setLength;
46 	}
47 	/// 
48 	pragma(inline, true) bool opEquals(in GrooveJoint2D other) const
49 	{ return _godot_object.ptr is other._godot_object.ptr; }
50 	/// 
51 	pragma(inline, true) typeof(null) opAssign(typeof(null) n)
52 	{ _godot_object.ptr = n; return null; }
53 	/// 
54 	pragma(inline, true) bool opEquals(typeof(null) n) const
55 	{ return _godot_object.ptr is n; }
56 	/// 
57 	size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; }
58 	mixin baseCasts;
59 	/// Construct a new instance of GrooveJoint2D.
60 	/// Note: use `memnew!GrooveJoint2D` instead.
61 	static GrooveJoint2D _new()
62 	{
63 		static godot_class_constructor constructor;
64 		if(constructor is null) constructor = _godot_api.godot_get_class_constructor("GrooveJoint2D");
65 		if(constructor is null) return typeof(this).init;
66 		return cast(GrooveJoint2D)(constructor());
67 	}
68 	@disable new(size_t s);
69 	/**
70 	
71 	*/
72 	double getInitialOffset() const
73 	{
74 		checkClassBinding!(typeof(this))();
75 		return ptrcall!(double)(GDNativeClassBinding.getInitialOffset, _godot_object);
76 	}
77 	/**
78 	
79 	*/
80 	double getLength() const
81 	{
82 		checkClassBinding!(typeof(this))();
83 		return ptrcall!(double)(GDNativeClassBinding.getLength, _godot_object);
84 	}
85 	/**
86 	
87 	*/
88 	void setInitialOffset(in double offset)
89 	{
90 		checkClassBinding!(typeof(this))();
91 		ptrcall!(void)(GDNativeClassBinding.setInitialOffset, _godot_object, offset);
92 	}
93 	/**
94 	
95 	*/
96 	void setLength(in double length)
97 	{
98 		checkClassBinding!(typeof(this))();
99 		ptrcall!(void)(GDNativeClassBinding.setLength, _godot_object, length);
100 	}
101 	/**
102 	The body B's initial anchor position defined by the joint's origin and a local offset $(D initialOffset) along the joint's Y axis (along the groove).
103 	*/
104 	@property double initialOffset()
105 	{
106 		return getInitialOffset();
107 	}
108 	/// ditto
109 	@property void initialOffset(double v)
110 	{
111 		setInitialOffset(v);
112 	}
113 	/**
114 	The groove's length. The groove is from the joint's origin towards $(D length) along the joint's local Y axis.
115 	*/
116 	@property double length()
117 	{
118 		return getLength();
119 	}
120 	/// ditto
121 	@property void length(double v)
122 	{
123 		setLength(v);
124 	}
125 }