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.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.primitivemesh; 24 import godot.mesh; 25 import godot.resource; 26 import godot.reference; 27 /** 28 Class representing a spherical $(D PrimitiveMesh). 29 30 31 */ 32 @GodotBaseClass struct SphereMesh 33 { 34 enum string _GODOT_internal_name = "SphereMesh"; 35 public: 36 @nogc nothrow: 37 union { godot_object _godot_object; PrimitiveMesh _GODOT_base; } 38 alias _GODOT_base this; 39 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 40 package(godot) __gshared bool _classBindingInitialized = false; 41 package(godot) static struct _classBinding 42 { 43 __gshared: 44 @GodotName("set_radius") GodotMethod!(void, double) setRadius; 45 @GodotName("get_radius") GodotMethod!(double) getRadius; 46 @GodotName("set_height") GodotMethod!(void, double) setHeight; 47 @GodotName("get_height") GodotMethod!(double) getHeight; 48 @GodotName("set_radial_segments") GodotMethod!(void, long) setRadialSegments; 49 @GodotName("get_radial_segments") GodotMethod!(long) getRadialSegments; 50 @GodotName("set_rings") GodotMethod!(void, long) setRings; 51 @GodotName("get_rings") GodotMethod!(long) getRings; 52 @GodotName("set_is_hemisphere") GodotMethod!(void, bool) setIsHemisphere; 53 @GodotName("get_is_hemisphere") GodotMethod!(bool) getIsHemisphere; 54 } 55 bool opEquals(in SphereMesh other) const { return _godot_object.ptr is other._godot_object.ptr; } 56 SphereMesh opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; } 57 bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; } 58 mixin baseCasts; 59 static SphereMesh _new() 60 { 61 static godot_class_constructor constructor; 62 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("SphereMesh"); 63 if(constructor is null) return typeof(this).init; 64 return cast(SphereMesh)(constructor()); 65 } 66 @disable new(size_t s); 67 /** 68 69 */ 70 void setRadius(in double radius) 71 { 72 checkClassBinding!(typeof(this))(); 73 ptrcall!(void)(_classBinding.setRadius, _godot_object, radius); 74 } 75 /** 76 77 */ 78 double getRadius() const 79 { 80 checkClassBinding!(typeof(this))(); 81 return ptrcall!(double)(_classBinding.getRadius, _godot_object); 82 } 83 /** 84 85 */ 86 void setHeight(in double height) 87 { 88 checkClassBinding!(typeof(this))(); 89 ptrcall!(void)(_classBinding.setHeight, _godot_object, height); 90 } 91 /** 92 93 */ 94 double getHeight() const 95 { 96 checkClassBinding!(typeof(this))(); 97 return ptrcall!(double)(_classBinding.getHeight, _godot_object); 98 } 99 /** 100 101 */ 102 void setRadialSegments(in long radial_segments) 103 { 104 checkClassBinding!(typeof(this))(); 105 ptrcall!(void)(_classBinding.setRadialSegments, _godot_object, radial_segments); 106 } 107 /** 108 109 */ 110 long getRadialSegments() const 111 { 112 checkClassBinding!(typeof(this))(); 113 return ptrcall!(long)(_classBinding.getRadialSegments, _godot_object); 114 } 115 /** 116 117 */ 118 void setRings(in long rings) 119 { 120 checkClassBinding!(typeof(this))(); 121 ptrcall!(void)(_classBinding.setRings, _godot_object, rings); 122 } 123 /** 124 125 */ 126 long getRings() const 127 { 128 checkClassBinding!(typeof(this))(); 129 return ptrcall!(long)(_classBinding.getRings, _godot_object); 130 } 131 /** 132 133 */ 134 void setIsHemisphere(in bool is_hemisphere) 135 { 136 checkClassBinding!(typeof(this))(); 137 ptrcall!(void)(_classBinding.setIsHemisphere, _godot_object, is_hemisphere); 138 } 139 /** 140 141 */ 142 bool getIsHemisphere() const 143 { 144 checkClassBinding!(typeof(this))(); 145 return ptrcall!(bool)(_classBinding.getIsHemisphere, _godot_object); 146 } 147 /** 148 Radius of sphere. Defaults to 1.0. 149 */ 150 @property double radius() 151 { 152 return getRadius(); 153 } 154 /// ditto 155 @property void radius(double v) 156 { 157 setRadius(v); 158 } 159 /** 160 Full height of the sphere. Defaults to 2.0. 161 */ 162 @property double height() 163 { 164 return getHeight(); 165 } 166 /// ditto 167 @property void height(double v) 168 { 169 setHeight(v); 170 } 171 /** 172 Number of radial segments on the sphere. Defaults to 64. 173 */ 174 @property long radialSegments() 175 { 176 return getRadialSegments(); 177 } 178 /// ditto 179 @property void radialSegments(long v) 180 { 181 setRadialSegments(v); 182 } 183 /** 184 Number of segments along the height of the sphere. Defaults to 32. 185 */ 186 @property long rings() 187 { 188 return getRings(); 189 } 190 /// ditto 191 @property void rings(long v) 192 { 193 setRings(v); 194 } 195 /** 196 Determines whether a full sphere or a hemisphere is created. Attention: To get a regular hemisphere the height and radius of the sphere have to equal. Defaults to false. 197 */ 198 @property bool isHemisphere() 199 { 200 return getIsHemisphere(); 201 } 202 /// ditto 203 @property void isHemisphere(bool v) 204 { 205 setIsHemisphere(v); 206 } 207 }