1 /** 2 A CSG Torus 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.csgtorus; 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 Torus shape. 31 32 This node allows you to create a torus for use with the CSG system. 33 */ 34 @GodotBaseClass struct CSGTorus 35 { 36 enum string _GODOT_internal_name = "CSGTorus"; 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_inner_radius") GodotMethod!(void, double) setInnerRadius; 47 @GodotName("get_inner_radius") GodotMethod!(double) getInnerRadius; 48 @GodotName("set_outer_radius") GodotMethod!(void, double) setOuterRadius; 49 @GodotName("get_outer_radius") GodotMethod!(double) getOuterRadius; 50 @GodotName("set_sides") GodotMethod!(void, long) setSides; 51 @GodotName("get_sides") GodotMethod!(long) getSides; 52 @GodotName("set_ring_sides") GodotMethod!(void, long) setRingSides; 53 @GodotName("get_ring_sides") GodotMethod!(long) getRingSides; 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 CSGTorus other) const { return _godot_object.ptr is other._godot_object.ptr; } 60 CSGTorus 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 CSGTorus _new() 64 { 65 static godot_class_constructor constructor; 66 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("CSGTorus"); 67 if(constructor is null) return typeof(this).init; 68 return cast(CSGTorus)(constructor()); 69 } 70 @disable new(size_t s); 71 /** 72 73 */ 74 void setInnerRadius(in double radius) 75 { 76 checkClassBinding!(typeof(this))(); 77 ptrcall!(void)(_classBinding.setInnerRadius, _godot_object, radius); 78 } 79 /** 80 81 */ 82 double getInnerRadius() const 83 { 84 checkClassBinding!(typeof(this))(); 85 return ptrcall!(double)(_classBinding.getInnerRadius, _godot_object); 86 } 87 /** 88 89 */ 90 void setOuterRadius(in double radius) 91 { 92 checkClassBinding!(typeof(this))(); 93 ptrcall!(void)(_classBinding.setOuterRadius, _godot_object, radius); 94 } 95 /** 96 97 */ 98 double getOuterRadius() const 99 { 100 checkClassBinding!(typeof(this))(); 101 return ptrcall!(double)(_classBinding.getOuterRadius, _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 setRingSides(in long sides) 123 { 124 checkClassBinding!(typeof(this))(); 125 ptrcall!(void)(_classBinding.setRingSides, _godot_object, sides); 126 } 127 /** 128 129 */ 130 long getRingSides() const 131 { 132 checkClassBinding!(typeof(this))(); 133 return ptrcall!(long)(_classBinding.getRingSides, _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 inner radius of the torus. 169 */ 170 @property double innerRadius() 171 { 172 return getInnerRadius(); 173 } 174 /// ditto 175 @property void innerRadius(double v) 176 { 177 setInnerRadius(v); 178 } 179 /** 180 The outer radius of the torus. 181 */ 182 @property double outerRadius() 183 { 184 return getOuterRadius(); 185 } 186 /// ditto 187 @property void outerRadius(double v) 188 { 189 setOuterRadius(v); 190 } 191 /** 192 The number of slices the torus is constructed of. 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 The number of edges each ring of the torus is constructed of. 205 */ 206 @property long ringSides() 207 { 208 return getRingSides(); 209 } 210 /// ditto 211 @property void ringSides(long v) 212 { 213 setRingSides(v); 214 } 215 /** 216 If true the normals of the torus are set to give a smooth effect making the torus seem rounded. When false the torus 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 }