1 /** 2 RemoteTransform pushes its own $(D Transform) to another $(D Spatial) derived Node in the scene. 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.remotetransform; 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 RemoteTransform pushes its own $(D Transform) to another $(D Spatial) derived Node in the scene. 27 28 RemoteTransform pushes its own $(D Transform) to another $(D Spatial) derived Node (called the remote node) in the scene. 29 It can be set to update another Node's position, rotation and/or scale. It can use either global or local coordinates. 30 */ 31 @GodotBaseClass struct RemoteTransform 32 { 33 enum string _GODOT_internal_name = "RemoteTransform"; 34 public: 35 @nogc nothrow: 36 union { godot_object _godot_object; Spatial _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 _classBinding 41 { 42 __gshared: 43 @GodotName("set_remote_node") GodotMethod!(void, NodePath) setRemoteNode; 44 @GodotName("get_remote_node") GodotMethod!(NodePath) getRemoteNode; 45 @GodotName("set_use_global_coordinates") GodotMethod!(void, bool) setUseGlobalCoordinates; 46 @GodotName("get_use_global_coordinates") GodotMethod!(bool) getUseGlobalCoordinates; 47 @GodotName("set_update_position") GodotMethod!(void, bool) setUpdatePosition; 48 @GodotName("get_update_position") GodotMethod!(bool) getUpdatePosition; 49 @GodotName("set_update_rotation") GodotMethod!(void, bool) setUpdateRotation; 50 @GodotName("get_update_rotation") GodotMethod!(bool) getUpdateRotation; 51 @GodotName("set_update_scale") GodotMethod!(void, bool) setUpdateScale; 52 @GodotName("get_update_scale") GodotMethod!(bool) getUpdateScale; 53 } 54 bool opEquals(in RemoteTransform other) const { return _godot_object.ptr is other._godot_object.ptr; } 55 RemoteTransform opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; } 56 bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; } 57 mixin baseCasts; 58 static RemoteTransform _new() 59 { 60 static godot_class_constructor constructor; 61 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("RemoteTransform"); 62 if(constructor is null) return typeof(this).init; 63 return cast(RemoteTransform)(constructor()); 64 } 65 @disable new(size_t s); 66 /** 67 68 */ 69 void setRemoteNode(NodePathArg0)(in NodePathArg0 path) 70 { 71 checkClassBinding!(typeof(this))(); 72 ptrcall!(void)(_classBinding.setRemoteNode, _godot_object, path); 73 } 74 /** 75 76 */ 77 NodePath getRemoteNode() const 78 { 79 checkClassBinding!(typeof(this))(); 80 return ptrcall!(NodePath)(_classBinding.getRemoteNode, _godot_object); 81 } 82 /** 83 84 */ 85 void setUseGlobalCoordinates(in bool use_global_coordinates) 86 { 87 checkClassBinding!(typeof(this))(); 88 ptrcall!(void)(_classBinding.setUseGlobalCoordinates, _godot_object, use_global_coordinates); 89 } 90 /** 91 92 */ 93 bool getUseGlobalCoordinates() const 94 { 95 checkClassBinding!(typeof(this))(); 96 return ptrcall!(bool)(_classBinding.getUseGlobalCoordinates, _godot_object); 97 } 98 /** 99 100 */ 101 void setUpdatePosition(in bool update_remote_position) 102 { 103 checkClassBinding!(typeof(this))(); 104 ptrcall!(void)(_classBinding.setUpdatePosition, _godot_object, update_remote_position); 105 } 106 /** 107 108 */ 109 bool getUpdatePosition() const 110 { 111 checkClassBinding!(typeof(this))(); 112 return ptrcall!(bool)(_classBinding.getUpdatePosition, _godot_object); 113 } 114 /** 115 116 */ 117 void setUpdateRotation(in bool update_remote_rotation) 118 { 119 checkClassBinding!(typeof(this))(); 120 ptrcall!(void)(_classBinding.setUpdateRotation, _godot_object, update_remote_rotation); 121 } 122 /** 123 124 */ 125 bool getUpdateRotation() const 126 { 127 checkClassBinding!(typeof(this))(); 128 return ptrcall!(bool)(_classBinding.getUpdateRotation, _godot_object); 129 } 130 /** 131 132 */ 133 void setUpdateScale(in bool update_remote_scale) 134 { 135 checkClassBinding!(typeof(this))(); 136 ptrcall!(void)(_classBinding.setUpdateScale, _godot_object, update_remote_scale); 137 } 138 /** 139 140 */ 141 bool getUpdateScale() const 142 { 143 checkClassBinding!(typeof(this))(); 144 return ptrcall!(bool)(_classBinding.getUpdateScale, _godot_object); 145 } 146 /** 147 The $(D NodePath) to the remote node, relative to the RemoteTransform's position in the scene. 148 */ 149 @property NodePath remotePath() 150 { 151 return getRemoteNode(); 152 } 153 /// ditto 154 @property void remotePath(NodePath v) 155 { 156 setRemoteNode(v); 157 } 158 /** 159 If `true` global coordinates are used. If `false` local coordinates are used. Default value: `true`. 160 */ 161 @property bool useGlobalCoordinates() 162 { 163 return getUseGlobalCoordinates(); 164 } 165 /// ditto 166 @property void useGlobalCoordinates(bool v) 167 { 168 setUseGlobalCoordinates(v); 169 } 170 /** 171 If `true` the remote node's position is updated. Default value: `true`. 172 */ 173 @property bool updatePosition() 174 { 175 return getUpdatePosition(); 176 } 177 /// ditto 178 @property void updatePosition(bool v) 179 { 180 setUpdatePosition(v); 181 } 182 /** 183 If `true` the remote node's rotation is updated. Default value: `true`. 184 */ 185 @property bool updateRotation() 186 { 187 return getUpdateRotation(); 188 } 189 /// ditto 190 @property void updateRotation(bool v) 191 { 192 setUpdateRotation(v); 193 } 194 /** 195 If `true` the remote node's scale is updated. Default value: `true`. 196 */ 197 @property bool updateScale() 198 { 199 return getUpdateScale(); 200 } 201 /// ditto 202 @property void updateScale(bool v) 203 { 204 setUpdateScale(v); 205 } 206 }