1 /** 2 Height map shape for 3D physics (Bullet only). 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.heightmapshape; 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.shape; 25 /** 26 Height map shape for 3D physics (Bullet only). 27 28 Height map shape resource, which can be added to a $(D PhysicsBody) or $(D Area). 29 */ 30 @GodotBaseClass struct HeightMapShape 31 { 32 package(godot) enum string _GODOT_internal_name = "HeightMapShape"; 33 public: 34 @nogc nothrow: 35 union { /** */ godot_object _godot_object; /** */ Shape _GODOT_base; } 36 alias _GODOT_base this; 37 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 38 package(godot) __gshared bool _classBindingInitialized = false; 39 package(godot) static struct GDNativeClassBinding 40 { 41 __gshared: 42 @GodotName("get_map_data") GodotMethod!(PoolRealArray) getMapData; 43 @GodotName("get_map_depth") GodotMethod!(long) getMapDepth; 44 @GodotName("get_map_width") GodotMethod!(long) getMapWidth; 45 @GodotName("set_map_data") GodotMethod!(void, PoolRealArray) setMapData; 46 @GodotName("set_map_depth") GodotMethod!(void, long) setMapDepth; 47 @GodotName("set_map_width") GodotMethod!(void, long) setMapWidth; 48 } 49 /// 50 pragma(inline, true) bool opEquals(in HeightMapShape other) const 51 { return _godot_object.ptr is other._godot_object.ptr; } 52 /// 53 pragma(inline, true) typeof(null) opAssign(typeof(null) n) 54 { _godot_object.ptr = n; return null; } 55 /// 56 pragma(inline, true) bool opEquals(typeof(null) n) const 57 { return _godot_object.ptr is n; } 58 /// 59 size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; } 60 mixin baseCasts; 61 /// Construct a new instance of HeightMapShape. 62 /// Note: use `memnew!HeightMapShape` instead. 63 static HeightMapShape _new() 64 { 65 static godot_class_constructor constructor; 66 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("HeightMapShape"); 67 if(constructor is null) return typeof(this).init; 68 return cast(HeightMapShape)(constructor()); 69 } 70 @disable new(size_t s); 71 /** 72 73 */ 74 PoolRealArray getMapData() const 75 { 76 checkClassBinding!(typeof(this))(); 77 return ptrcall!(PoolRealArray)(GDNativeClassBinding.getMapData, _godot_object); 78 } 79 /** 80 81 */ 82 long getMapDepth() const 83 { 84 checkClassBinding!(typeof(this))(); 85 return ptrcall!(long)(GDNativeClassBinding.getMapDepth, _godot_object); 86 } 87 /** 88 89 */ 90 long getMapWidth() const 91 { 92 checkClassBinding!(typeof(this))(); 93 return ptrcall!(long)(GDNativeClassBinding.getMapWidth, _godot_object); 94 } 95 /** 96 97 */ 98 void setMapData(in PoolRealArray data) 99 { 100 checkClassBinding!(typeof(this))(); 101 ptrcall!(void)(GDNativeClassBinding.setMapData, _godot_object, data); 102 } 103 /** 104 105 */ 106 void setMapDepth(in long height) 107 { 108 checkClassBinding!(typeof(this))(); 109 ptrcall!(void)(GDNativeClassBinding.setMapDepth, _godot_object, height); 110 } 111 /** 112 113 */ 114 void setMapWidth(in long width) 115 { 116 checkClassBinding!(typeof(this))(); 117 ptrcall!(void)(GDNativeClassBinding.setMapWidth, _godot_object, width); 118 } 119 /** 120 Height map data, pool array must be of $(D mapWidth) * $(D mapDepth) size. 121 */ 122 @property PoolRealArray mapData() 123 { 124 return getMapData(); 125 } 126 /// ditto 127 @property void mapData(PoolRealArray v) 128 { 129 setMapData(v); 130 } 131 /** 132 Depth of the height map data. Changing this will resize the $(D mapData). 133 */ 134 @property long mapDepth() 135 { 136 return getMapDepth(); 137 } 138 /// ditto 139 @property void mapDepth(long v) 140 { 141 setMapDepth(v); 142 } 143 /** 144 Width of the height map data. Changing this will resize the $(D mapData). 145 */ 146 @property long mapWidth() 147 { 148 return getMapWidth(); 149 } 150 /// ditto 151 @property void mapWidth(long v) 152 { 153 setMapWidth(v); 154 } 155 }