1 /** 2 Class representing a planar $(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.planemesh; 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 planar $(D PrimitiveMesh). 29 30 This flat mesh does not have a thickness. 31 */ 32 @GodotBaseClass struct PlaneMesh 33 { 34 enum string _GODOT_internal_name = "PlaneMesh"; 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_size") GodotMethod!(void, Vector2) setSize; 45 @GodotName("get_size") GodotMethod!(Vector2) getSize; 46 @GodotName("set_subdivide_width") GodotMethod!(void, long) setSubdivideWidth; 47 @GodotName("get_subdivide_width") GodotMethod!(long) getSubdivideWidth; 48 @GodotName("set_subdivide_depth") GodotMethod!(void, long) setSubdivideDepth; 49 @GodotName("get_subdivide_depth") GodotMethod!(long) getSubdivideDepth; 50 } 51 bool opEquals(in PlaneMesh other) const { return _godot_object.ptr is other._godot_object.ptr; } 52 PlaneMesh opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; } 53 bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; } 54 mixin baseCasts; 55 static PlaneMesh _new() 56 { 57 static godot_class_constructor constructor; 58 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("PlaneMesh"); 59 if(constructor is null) return typeof(this).init; 60 return cast(PlaneMesh)(constructor()); 61 } 62 @disable new(size_t s); 63 /** 64 65 */ 66 void setSize(in Vector2 size) 67 { 68 checkClassBinding!(typeof(this))(); 69 ptrcall!(void)(_classBinding.setSize, _godot_object, size); 70 } 71 /** 72 73 */ 74 Vector2 getSize() const 75 { 76 checkClassBinding!(typeof(this))(); 77 return ptrcall!(Vector2)(_classBinding.getSize, _godot_object); 78 } 79 /** 80 81 */ 82 void setSubdivideWidth(in long subdivide) 83 { 84 checkClassBinding!(typeof(this))(); 85 ptrcall!(void)(_classBinding.setSubdivideWidth, _godot_object, subdivide); 86 } 87 /** 88 89 */ 90 long getSubdivideWidth() const 91 { 92 checkClassBinding!(typeof(this))(); 93 return ptrcall!(long)(_classBinding.getSubdivideWidth, _godot_object); 94 } 95 /** 96 97 */ 98 void setSubdivideDepth(in long subdivide) 99 { 100 checkClassBinding!(typeof(this))(); 101 ptrcall!(void)(_classBinding.setSubdivideDepth, _godot_object, subdivide); 102 } 103 /** 104 105 */ 106 long getSubdivideDepth() const 107 { 108 checkClassBinding!(typeof(this))(); 109 return ptrcall!(long)(_classBinding.getSubdivideDepth, _godot_object); 110 } 111 /** 112 Size of the generated plane. Defaults to (2.0, 2.0). 113 */ 114 @property Vector2 size() 115 { 116 return getSize(); 117 } 118 /// ditto 119 @property void size(Vector2 v) 120 { 121 setSize(v); 122 } 123 /** 124 Number of subdivision along the x-axis. Defaults to 0. 125 */ 126 @property long subdivideWidth() 127 { 128 return getSubdivideWidth(); 129 } 130 /// ditto 131 @property void subdivideWidth(long v) 132 { 133 setSubdivideWidth(v); 134 } 135 /** 136 Number of subdivision along the z-axis. Defaults to 0. 137 */ 138 @property long subdivideDepth() 139 { 140 return getSubdivideDepth(); 141 } 142 /// ditto 143 @property void subdivideDepth(long v) 144 { 145 setSubdivideDepth(v); 146 } 147 }