1 /** 2 Class representing a capsule-shaped $(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.capsulemesh; 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 capsule-shaped $(D PrimitiveMesh). 29 30 31 */ 32 @GodotBaseClass struct CapsuleMesh 33 { 34 enum string _GODOT_internal_name = "CapsuleMesh"; 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_mid_height") GodotMethod!(void, double) setMidHeight; 47 @GodotName("get_mid_height") GodotMethod!(double) getMidHeight; 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 } 53 bool opEquals(in CapsuleMesh other) const { return _godot_object.ptr is other._godot_object.ptr; } 54 CapsuleMesh opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; } 55 bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; } 56 mixin baseCasts; 57 static CapsuleMesh _new() 58 { 59 static godot_class_constructor constructor; 60 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("CapsuleMesh"); 61 if(constructor is null) return typeof(this).init; 62 return cast(CapsuleMesh)(constructor()); 63 } 64 @disable new(size_t s); 65 /** 66 67 */ 68 void setRadius(in double radius) 69 { 70 checkClassBinding!(typeof(this))(); 71 ptrcall!(void)(_classBinding.setRadius, _godot_object, radius); 72 } 73 /** 74 75 */ 76 double getRadius() const 77 { 78 checkClassBinding!(typeof(this))(); 79 return ptrcall!(double)(_classBinding.getRadius, _godot_object); 80 } 81 /** 82 83 */ 84 void setMidHeight(in double mid_height) 85 { 86 checkClassBinding!(typeof(this))(); 87 ptrcall!(void)(_classBinding.setMidHeight, _godot_object, mid_height); 88 } 89 /** 90 91 */ 92 double getMidHeight() const 93 { 94 checkClassBinding!(typeof(this))(); 95 return ptrcall!(double)(_classBinding.getMidHeight, _godot_object); 96 } 97 /** 98 99 */ 100 void setRadialSegments(in long segments) 101 { 102 checkClassBinding!(typeof(this))(); 103 ptrcall!(void)(_classBinding.setRadialSegments, _godot_object, segments); 104 } 105 /** 106 107 */ 108 long getRadialSegments() const 109 { 110 checkClassBinding!(typeof(this))(); 111 return ptrcall!(long)(_classBinding.getRadialSegments, _godot_object); 112 } 113 /** 114 115 */ 116 void setRings(in long rings) 117 { 118 checkClassBinding!(typeof(this))(); 119 ptrcall!(void)(_classBinding.setRings, _godot_object, rings); 120 } 121 /** 122 123 */ 124 long getRings() const 125 { 126 checkClassBinding!(typeof(this))(); 127 return ptrcall!(long)(_classBinding.getRings, _godot_object); 128 } 129 /** 130 Radius of the capsule mesh. Defaults to 1.0. 131 */ 132 @property double radius() 133 { 134 return getRadius(); 135 } 136 /// ditto 137 @property void radius(double v) 138 { 139 setRadius(v); 140 } 141 /** 142 Height of the capsule mesh from the center point. Defaults to 1.0. 143 */ 144 @property double midHeight() 145 { 146 return getMidHeight(); 147 } 148 /// ditto 149 @property void midHeight(double v) 150 { 151 setMidHeight(v); 152 } 153 /** 154 Number of radial segments on the capsule mesh. Defaults to 64. 155 */ 156 @property long radialSegments() 157 { 158 return getRadialSegments(); 159 } 160 /// ditto 161 @property void radialSegments(long v) 162 { 163 setRadialSegments(v); 164 } 165 /** 166 Number of rings along the height of the capsule. Defaults to 8. 167 */ 168 @property long rings() 169 { 170 return getRings(); 171 } 172 /// ditto 173 @property void rings(long v) 174 { 175 setRings(v); 176 } 177 }