1 /** 2 A CSG Box 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.csgbox; 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 Box shape. 28 29 This node allows you to create a box for use with the CSG system. 30 */ 31 @GodotBaseClass struct CSGBox 32 { 33 package(godot) enum string _GODOT_internal_name = "CSGBox"; 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_depth") GodotMethod!(double) getDepth; 44 @GodotName("get_height") GodotMethod!(double) getHeight; 45 @GodotName("get_material") GodotMethod!(Material) getMaterial; 46 @GodotName("get_width") GodotMethod!(double) getWidth; 47 @GodotName("set_depth") GodotMethod!(void, double) setDepth; 48 @GodotName("set_height") GodotMethod!(void, double) setHeight; 49 @GodotName("set_material") GodotMethod!(void, Material) setMaterial; 50 @GodotName("set_width") GodotMethod!(void, double) setWidth; 51 } 52 /// 53 pragma(inline, true) bool opEquals(in CSGBox other) const 54 { return _godot_object.ptr is other._godot_object.ptr; } 55 /// 56 pragma(inline, true) typeof(null) opAssign(typeof(null) n) 57 { _godot_object.ptr = n; return null; } 58 /// 59 pragma(inline, true) bool opEquals(typeof(null) n) const 60 { return _godot_object.ptr is n; } 61 /// 62 size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; } 63 mixin baseCasts; 64 /// Construct a new instance of CSGBox. 65 /// Note: use `memnew!CSGBox` instead. 66 static CSGBox _new() 67 { 68 static godot_class_constructor constructor; 69 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("CSGBox"); 70 if(constructor is null) return typeof(this).init; 71 return cast(CSGBox)(constructor()); 72 } 73 @disable new(size_t s); 74 /** 75 76 */ 77 double getDepth() const 78 { 79 checkClassBinding!(typeof(this))(); 80 return ptrcall!(double)(GDNativeClassBinding.getDepth, _godot_object); 81 } 82 /** 83 84 */ 85 double getHeight() const 86 { 87 checkClassBinding!(typeof(this))(); 88 return ptrcall!(double)(GDNativeClassBinding.getHeight, _godot_object); 89 } 90 /** 91 92 */ 93 Ref!Material getMaterial() const 94 { 95 checkClassBinding!(typeof(this))(); 96 return ptrcall!(Material)(GDNativeClassBinding.getMaterial, _godot_object); 97 } 98 /** 99 100 */ 101 double getWidth() const 102 { 103 checkClassBinding!(typeof(this))(); 104 return ptrcall!(double)(GDNativeClassBinding.getWidth, _godot_object); 105 } 106 /** 107 108 */ 109 void setDepth(in double depth) 110 { 111 checkClassBinding!(typeof(this))(); 112 ptrcall!(void)(GDNativeClassBinding.setDepth, _godot_object, depth); 113 } 114 /** 115 116 */ 117 void setHeight(in double height) 118 { 119 checkClassBinding!(typeof(this))(); 120 ptrcall!(void)(GDNativeClassBinding.setHeight, _godot_object, height); 121 } 122 /** 123 124 */ 125 void setMaterial(Material material) 126 { 127 checkClassBinding!(typeof(this))(); 128 ptrcall!(void)(GDNativeClassBinding.setMaterial, _godot_object, material); 129 } 130 /** 131 132 */ 133 void setWidth(in double width) 134 { 135 checkClassBinding!(typeof(this))(); 136 ptrcall!(void)(GDNativeClassBinding.setWidth, _godot_object, width); 137 } 138 /** 139 Depth of the box measured from the center of the box. 140 */ 141 @property double depth() 142 { 143 return getDepth(); 144 } 145 /// ditto 146 @property void depth(double v) 147 { 148 setDepth(v); 149 } 150 /** 151 Height of the box measured from the center of the box. 152 */ 153 @property double height() 154 { 155 return getHeight(); 156 } 157 /// ditto 158 @property void height(double v) 159 { 160 setHeight(v); 161 } 162 /** 163 Width of the box measured from the center of the box. 164 */ 165 @property double width() 166 { 167 return getWidth(); 168 } 169 /// ditto 170 @property void width(double v) 171 { 172 setWidth(v); 173 } 174 }