1 /** 2 A node that will attach to a bone. 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.boneattachment; 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.spatial; 24 import godot.node; 25 /** 26 A node that will attach to a bone. 27 28 This node must be the child of a $(D Skeleton) node. You can then select a bone for this node to attach to. The BoneAttachment node will copy the transform of the selected bone. 29 */ 30 @GodotBaseClass struct BoneAttachment 31 { 32 enum string _GODOT_internal_name = "BoneAttachment"; 33 public: 34 @nogc nothrow: 35 union { godot_object _godot_object; Spatial _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 _classBinding 40 { 41 __gshared: 42 @GodotName("set_bone_name") GodotMethod!(void, String) setBoneName; 43 @GodotName("get_bone_name") GodotMethod!(String) getBoneName; 44 } 45 bool opEquals(in BoneAttachment other) const { return _godot_object.ptr is other._godot_object.ptr; } 46 BoneAttachment opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; } 47 bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; } 48 mixin baseCasts; 49 static BoneAttachment _new() 50 { 51 static godot_class_constructor constructor; 52 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("BoneAttachment"); 53 if(constructor is null) return typeof(this).init; 54 return cast(BoneAttachment)(constructor()); 55 } 56 @disable new(size_t s); 57 /** 58 59 */ 60 void setBoneName(StringArg0)(in StringArg0 bone_name) 61 { 62 checkClassBinding!(typeof(this))(); 63 ptrcall!(void)(_classBinding.setBoneName, _godot_object, bone_name); 64 } 65 /** 66 67 */ 68 String getBoneName() const 69 { 70 checkClassBinding!(typeof(this))(); 71 return ptrcall!(String)(_classBinding.getBoneName, _godot_object); 72 } 73 /** 74 The name of the attached bone. 75 */ 76 @property String boneName() 77 { 78 return getBoneName(); 79 } 80 /// ditto 81 @property void boneName(String v) 82 { 83 setBoneName(v); 84 } 85 }