1 /** 2 Class representing a spherical $(D PrimitiveMesh). 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.spheremesh; 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.primitivemesh; 25 import godot.mesh; 26 import godot.resource; 27 import godot.reference; 28 /** 29 Class representing a spherical $(D PrimitiveMesh). 30 31 32 */ 33 @GodotBaseClass struct SphereMesh 34 { 35 package(godot) enum string _GODOT_internal_name = "SphereMesh"; 36 public: 37 @nogc nothrow: 38 union { /** */ godot_object _godot_object; /** */ PrimitiveMesh _GODOT_base; } 39 alias _GODOT_base this; 40 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 41 package(godot) __gshared bool _classBindingInitialized = false; 42 package(godot) static struct GDNativeClassBinding 43 { 44 __gshared: 45 @GodotName("get_height") GodotMethod!(double) getHeight; 46 @GodotName("get_is_hemisphere") GodotMethod!(bool) getIsHemisphere; 47 @GodotName("get_radial_segments") GodotMethod!(long) getRadialSegments; 48 @GodotName("get_radius") GodotMethod!(double) getRadius; 49 @GodotName("get_rings") GodotMethod!(long) getRings; 50 @GodotName("set_height") GodotMethod!(void, double) setHeight; 51 @GodotName("set_is_hemisphere") GodotMethod!(void, bool) setIsHemisphere; 52 @GodotName("set_radial_segments") GodotMethod!(void, long) setRadialSegments; 53 @GodotName("set_radius") GodotMethod!(void, double) setRadius; 54 @GodotName("set_rings") GodotMethod!(void, long) setRings; 55 } 56 /// 57 pragma(inline, true) bool opEquals(in SphereMesh 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 SphereMesh. 69 /// Note: use `memnew!SphereMesh` instead. 70 static SphereMesh _new() 71 { 72 static godot_class_constructor constructor; 73 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("SphereMesh"); 74 if(constructor is null) return typeof(this).init; 75 return cast(SphereMesh)(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 bool getIsHemisphere() const 90 { 91 checkClassBinding!(typeof(this))(); 92 return ptrcall!(bool)(GDNativeClassBinding.getIsHemisphere, _godot_object); 93 } 94 /** 95 96 */ 97 long getRadialSegments() const 98 { 99 checkClassBinding!(typeof(this))(); 100 return ptrcall!(long)(GDNativeClassBinding.getRadialSegments, _godot_object); 101 } 102 /** 103 104 */ 105 double getRadius() const 106 { 107 checkClassBinding!(typeof(this))(); 108 return ptrcall!(double)(GDNativeClassBinding.getRadius, _godot_object); 109 } 110 /** 111 112 */ 113 long getRings() const 114 { 115 checkClassBinding!(typeof(this))(); 116 return ptrcall!(long)(GDNativeClassBinding.getRings, _godot_object); 117 } 118 /** 119 120 */ 121 void setHeight(in double height) 122 { 123 checkClassBinding!(typeof(this))(); 124 ptrcall!(void)(GDNativeClassBinding.setHeight, _godot_object, height); 125 } 126 /** 127 128 */ 129 void setIsHemisphere(in bool is_hemisphere) 130 { 131 checkClassBinding!(typeof(this))(); 132 ptrcall!(void)(GDNativeClassBinding.setIsHemisphere, _godot_object, is_hemisphere); 133 } 134 /** 135 136 */ 137 void setRadialSegments(in long radial_segments) 138 { 139 checkClassBinding!(typeof(this))(); 140 ptrcall!(void)(GDNativeClassBinding.setRadialSegments, _godot_object, radial_segments); 141 } 142 /** 143 144 */ 145 void setRadius(in double radius) 146 { 147 checkClassBinding!(typeof(this))(); 148 ptrcall!(void)(GDNativeClassBinding.setRadius, _godot_object, radius); 149 } 150 /** 151 152 */ 153 void setRings(in long rings) 154 { 155 checkClassBinding!(typeof(this))(); 156 ptrcall!(void)(GDNativeClassBinding.setRings, _godot_object, rings); 157 } 158 /** 159 Full height of the sphere. 160 */ 161 @property double height() 162 { 163 return getHeight(); 164 } 165 /// ditto 166 @property void height(double v) 167 { 168 setHeight(v); 169 } 170 /** 171 If `true`, a hemisphere is created rather than a full sphere. 172 $(B Note:) To get a regular hemisphere, the height and radius of the sphere must be equal. 173 */ 174 @property bool isHemisphere() 175 { 176 return getIsHemisphere(); 177 } 178 /// ditto 179 @property void isHemisphere(bool v) 180 { 181 setIsHemisphere(v); 182 } 183 /** 184 Number of radial segments on the sphere. 185 */ 186 @property long radialSegments() 187 { 188 return getRadialSegments(); 189 } 190 /// ditto 191 @property void radialSegments(long v) 192 { 193 setRadialSegments(v); 194 } 195 /** 196 Radius of sphere. 197 */ 198 @property double radius() 199 { 200 return getRadius(); 201 } 202 /// ditto 203 @property void radius(double v) 204 { 205 setRadius(v); 206 } 207 /** 208 Number of segments along the height of the sphere. 209 */ 210 @property long rings() 211 { 212 return getRings(); 213 } 214 /// ditto 215 @property void rings(long v) 216 { 217 setRings(v); 218 } 219 }