1 /**
2 A CSG Cylinder shape.
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.csgcylinder;
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.csgprimitive;
24 import godot.material;
25 import godot.csgshape;
26 import godot.visualinstance;
27 import godot.spatial;
28 import godot.node;
29 /**
30 A CSG Cylinder shape.
31 
32 This node allows you to create a cylinder (or cone) for use with the CSG system.
33 */
34 @GodotBaseClass struct CSGCylinder
35 {
36 	enum string _GODOT_internal_name = "CSGCylinder";
37 public:
38 @nogc nothrow:
39 	union { godot_object _godot_object; CSGPrimitive _GODOT_base; }
40 	alias _GODOT_base this;
41 	alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses);
42 	package(godot) __gshared bool _classBindingInitialized = false;
43 	package(godot) static struct _classBinding
44 	{
45 		__gshared:
46 		@GodotName("set_radius") GodotMethod!(void, double) setRadius;
47 		@GodotName("get_radius") GodotMethod!(double) getRadius;
48 		@GodotName("set_height") GodotMethod!(void, double) setHeight;
49 		@GodotName("get_height") GodotMethod!(double) getHeight;
50 		@GodotName("set_sides") GodotMethod!(void, long) setSides;
51 		@GodotName("get_sides") GodotMethod!(long) getSides;
52 		@GodotName("set_cone") GodotMethod!(void, bool) setCone;
53 		@GodotName("is_cone") GodotMethod!(bool) isCone;
54 		@GodotName("set_material") GodotMethod!(void, Material) setMaterial;
55 		@GodotName("get_material") GodotMethod!(Material) getMaterial;
56 		@GodotName("set_smooth_faces") GodotMethod!(void, bool) setSmoothFaces;
57 		@GodotName("get_smooth_faces") GodotMethod!(bool) getSmoothFaces;
58 	}
59 	bool opEquals(in CSGCylinder other) const { return _godot_object.ptr is other._godot_object.ptr; }
60 	CSGCylinder opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; }
61 	bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; }
62 	mixin baseCasts;
63 	static CSGCylinder _new()
64 	{
65 		static godot_class_constructor constructor;
66 		if(constructor is null) constructor = _godot_api.godot_get_class_constructor("CSGCylinder");
67 		if(constructor is null) return typeof(this).init;
68 		return cast(CSGCylinder)(constructor());
69 	}
70 	@disable new(size_t s);
71 	/**
72 	
73 	*/
74 	void setRadius(in double radius)
75 	{
76 		checkClassBinding!(typeof(this))();
77 		ptrcall!(void)(_classBinding.setRadius, _godot_object, radius);
78 	}
79 	/**
80 	
81 	*/
82 	double getRadius() const
83 	{
84 		checkClassBinding!(typeof(this))();
85 		return ptrcall!(double)(_classBinding.getRadius, _godot_object);
86 	}
87 	/**
88 	
89 	*/
90 	void setHeight(in double height)
91 	{
92 		checkClassBinding!(typeof(this))();
93 		ptrcall!(void)(_classBinding.setHeight, _godot_object, height);
94 	}
95 	/**
96 	
97 	*/
98 	double getHeight() const
99 	{
100 		checkClassBinding!(typeof(this))();
101 		return ptrcall!(double)(_classBinding.getHeight, _godot_object);
102 	}
103 	/**
104 	
105 	*/
106 	void setSides(in long sides)
107 	{
108 		checkClassBinding!(typeof(this))();
109 		ptrcall!(void)(_classBinding.setSides, _godot_object, sides);
110 	}
111 	/**
112 	
113 	*/
114 	long getSides() const
115 	{
116 		checkClassBinding!(typeof(this))();
117 		return ptrcall!(long)(_classBinding.getSides, _godot_object);
118 	}
119 	/**
120 	
121 	*/
122 	void setCone(in bool cone)
123 	{
124 		checkClassBinding!(typeof(this))();
125 		ptrcall!(void)(_classBinding.setCone, _godot_object, cone);
126 	}
127 	/**
128 	
129 	*/
130 	bool isCone() const
131 	{
132 		checkClassBinding!(typeof(this))();
133 		return ptrcall!(bool)(_classBinding.isCone, _godot_object);
134 	}
135 	/**
136 	
137 	*/
138 	void setMaterial(Material material)
139 	{
140 		checkClassBinding!(typeof(this))();
141 		ptrcall!(void)(_classBinding.setMaterial, _godot_object, material);
142 	}
143 	/**
144 	
145 	*/
146 	Ref!Material getMaterial() const
147 	{
148 		checkClassBinding!(typeof(this))();
149 		return ptrcall!(Material)(_classBinding.getMaterial, _godot_object);
150 	}
151 	/**
152 	
153 	*/
154 	void setSmoothFaces(in bool smooth_faces)
155 	{
156 		checkClassBinding!(typeof(this))();
157 		ptrcall!(void)(_classBinding.setSmoothFaces, _godot_object, smooth_faces);
158 	}
159 	/**
160 	
161 	*/
162 	bool getSmoothFaces() const
163 	{
164 		checkClassBinding!(typeof(this))();
165 		return ptrcall!(bool)(_classBinding.getSmoothFaces, _godot_object);
166 	}
167 	/**
168 	The radius of the cylinder.
169 	*/
170 	@property double radius()
171 	{
172 		return getRadius();
173 	}
174 	/// ditto
175 	@property void radius(double v)
176 	{
177 		setRadius(v);
178 	}
179 	/**
180 	The height of the cylinder.
181 	*/
182 	@property double height()
183 	{
184 		return getHeight();
185 	}
186 	/// ditto
187 	@property void height(double v)
188 	{
189 		setHeight(v);
190 	}
191 	/**
192 	The number of sides of the cylinder, the higher this number the more detail there will be in the cylinder.
193 	*/
194 	@property long sides()
195 	{
196 		return getSides();
197 	}
198 	/// ditto
199 	@property void sides(long v)
200 	{
201 		setSides(v);
202 	}
203 	/**
204 	If true a cone is created, the $(D radius) will only apply to one side.
205 	*/
206 	@property bool cone()
207 	{
208 		return isCone();
209 	}
210 	/// ditto
211 	@property void cone(bool v)
212 	{
213 		setCone(v);
214 	}
215 	/**
216 	If true the normals of the cylinder are set to give a smooth effect making the cylinder seem rounded. When false the cylinder will have a flat shaded look.
217 	*/
218 	@property bool smoothFaces()
219 	{
220 		return getSmoothFaces();
221 	}
222 	/// ditto
223 	@property void smoothFaces(bool v)
224 	{
225 		setSmoothFaces(v);
226 	}
227 }