1 /** 2 A CSG Mesh shape that uses a mesh resource. 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.csgmesh; 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.csgprimitive; 24 import godot.mesh; 25 import godot.csgshape; 26 import godot.visualinstance; 27 import godot.spatial; 28 import godot.node; 29 /** 30 A CSG Mesh shape that uses a mesh resource. 31 32 This CSG node allows you to use any mesh resource as a CSG shape provided it is closed, does not self-intersect, does not contain internal faces and has no edges that connect to more then two faces. 33 */ 34 @GodotBaseClass struct CSGMesh 35 { 36 enum string _GODOT_internal_name = "CSGMesh"; 37 public: 38 @nogc nothrow: 39 union { godot_object _godot_object; CSGPrimitive _GODOT_base; } 40 alias _GODOT_base this; 41 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 42 package(godot) __gshared bool _classBindingInitialized = false; 43 package(godot) static struct _classBinding 44 { 45 __gshared: 46 @GodotName("set_mesh") GodotMethod!(void, Mesh) setMesh; 47 @GodotName("get_mesh") GodotMethod!(Mesh) getMesh; 48 @GodotName("_mesh_changed") GodotMethod!(void) _meshChanged; 49 } 50 bool opEquals(in CSGMesh other) const { return _godot_object.ptr is other._godot_object.ptr; } 51 CSGMesh opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; } 52 bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; } 53 mixin baseCasts; 54 static CSGMesh _new() 55 { 56 static godot_class_constructor constructor; 57 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("CSGMesh"); 58 if(constructor is null) return typeof(this).init; 59 return cast(CSGMesh)(constructor()); 60 } 61 @disable new(size_t s); 62 /** 63 64 */ 65 void setMesh(Mesh mesh) 66 { 67 checkClassBinding!(typeof(this))(); 68 ptrcall!(void)(_classBinding.setMesh, _godot_object, mesh); 69 } 70 /** 71 72 */ 73 Ref!Mesh getMesh() 74 { 75 checkClassBinding!(typeof(this))(); 76 return ptrcall!(Mesh)(_classBinding.getMesh, _godot_object); 77 } 78 /** 79 80 */ 81 void _meshChanged() 82 { 83 Array _GODOT_args = Array.empty_array; 84 String _GODOT_method_name = String("_mesh_changed"); 85 this.callv(_GODOT_method_name, _GODOT_args); 86 } 87 /** 88 The mesh resource to use as a CSG shape. 89 */ 90 @property Mesh mesh() 91 { 92 return getMesh(); 93 } 94 /// ditto 95 @property void mesh(Mesh v) 96 { 97 setMesh(v); 98 } 99 }