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