1 /** 2 Most basic 3D game object, parent of all 3D-related nodes. 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.spatial; 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.node; 25 import godot.spatialgizmo; 26 import godot.world; 27 /** 28 Most basic 3D game object, parent of all 3D-related nodes. 29 30 Most basic 3D game object, with a 3D $(D Transform) and visibility settings. All other 3D game objects inherit from Spatial. Use $(D Spatial) as a parent node to move, scale, rotate and show/hide children in a 3D project. 31 Affine operations (rotate, scale, translate) happen in parent's local coordinate system, unless the $(D Spatial) object is set as top-level. Affine operations in this coordinate system correspond to direct affine operations on the $(D Spatial)'s transform. The word local below refers to this coordinate system. The coordinate system that is attached to the $(D Spatial) object itself is referred to as object-local coordinate system. 32 $(B Note:) Unless otherwise specified, all methods that have angle parameters must have angles specified as $(I radians). To convert degrees to radians, use $(D @GDScript.deg2rad). 33 */ 34 @GodotBaseClass struct Spatial 35 { 36 package(godot) enum string _GODOT_internal_name = "Spatial"; 37 public: 38 @nogc nothrow: 39 union { /** */ godot_object _godot_object; /** */ Node _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 GDNativeClassBinding 44 { 45 __gshared: 46 @GodotName("_update_gizmo") GodotMethod!(void) _updateGizmo; 47 @GodotName("force_update_transform") GodotMethod!(void) forceUpdateTransform; 48 @GodotName("get_gizmo") GodotMethod!(SpatialGizmo) getGizmo; 49 @GodotName("get_global_transform") GodotMethod!(Transform) getGlobalTransform; 50 @GodotName("get_parent_spatial") GodotMethod!(Spatial) getParentSpatial; 51 @GodotName("get_rotation") GodotMethod!(Vector3) getRotation; 52 @GodotName("get_rotation_degrees") GodotMethod!(Vector3) getRotationDegrees; 53 @GodotName("get_scale") GodotMethod!(Vector3) getScale; 54 @GodotName("get_transform") GodotMethod!(Transform) getTransform; 55 @GodotName("get_translation") GodotMethod!(Vector3) getTranslation; 56 @GodotName("get_world") GodotMethod!(World) getWorld; 57 @GodotName("global_rotate") GodotMethod!(void, Vector3, double) globalRotate; 58 @GodotName("global_scale") GodotMethod!(void, Vector3) globalScale; 59 @GodotName("global_translate") GodotMethod!(void, Vector3) globalTranslate; 60 @GodotName("hide") GodotMethod!(void) hide; 61 @GodotName("is_local_transform_notification_enabled") GodotMethod!(bool) isLocalTransformNotificationEnabled; 62 @GodotName("is_scale_disabled") GodotMethod!(bool) isScaleDisabled; 63 @GodotName("is_set_as_toplevel") GodotMethod!(bool) isSetAsToplevel; 64 @GodotName("is_transform_notification_enabled") GodotMethod!(bool) isTransformNotificationEnabled; 65 @GodotName("is_visible") GodotMethod!(bool) isVisible; 66 @GodotName("is_visible_in_tree") GodotMethod!(bool) isVisibleInTree; 67 @GodotName("look_at") GodotMethod!(void, Vector3, Vector3) lookAt; 68 @GodotName("look_at_from_position") GodotMethod!(void, Vector3, Vector3, Vector3) lookAtFromPosition; 69 @GodotName("orthonormalize") GodotMethod!(void) orthonormalize; 70 @GodotName("rotate") GodotMethod!(void, Vector3, double) rotate; 71 @GodotName("rotate_object_local") GodotMethod!(void, Vector3, double) rotateObjectLocal; 72 @GodotName("rotate_x") GodotMethod!(void, double) rotateX; 73 @GodotName("rotate_y") GodotMethod!(void, double) rotateY; 74 @GodotName("rotate_z") GodotMethod!(void, double) rotateZ; 75 @GodotName("scale_object_local") GodotMethod!(void, Vector3) scaleObjectLocal; 76 @GodotName("set_as_toplevel") GodotMethod!(void, bool) setAsToplevel; 77 @GodotName("set_disable_scale") GodotMethod!(void, bool) setDisableScale; 78 @GodotName("set_gizmo") GodotMethod!(void, SpatialGizmo) setGizmo; 79 @GodotName("set_global_transform") GodotMethod!(void, Transform) setGlobalTransform; 80 @GodotName("set_identity") GodotMethod!(void) setIdentity; 81 @GodotName("set_ignore_transform_notification") GodotMethod!(void, bool) setIgnoreTransformNotification; 82 @GodotName("set_notify_local_transform") GodotMethod!(void, bool) setNotifyLocalTransform; 83 @GodotName("set_notify_transform") GodotMethod!(void, bool) setNotifyTransform; 84 @GodotName("set_rotation") GodotMethod!(void, Vector3) setRotation; 85 @GodotName("set_rotation_degrees") GodotMethod!(void, Vector3) setRotationDegrees; 86 @GodotName("set_scale") GodotMethod!(void, Vector3) setScale; 87 @GodotName("set_transform") GodotMethod!(void, Transform) setTransform; 88 @GodotName("set_translation") GodotMethod!(void, Vector3) setTranslation; 89 @GodotName("set_visible") GodotMethod!(void, bool) setVisible; 90 @GodotName("show") GodotMethod!(void) show; 91 @GodotName("to_global") GodotMethod!(Vector3, Vector3) toGlobal; 92 @GodotName("to_local") GodotMethod!(Vector3, Vector3) toLocal; 93 @GodotName("translate") GodotMethod!(void, Vector3) translate; 94 @GodotName("translate_object_local") GodotMethod!(void, Vector3) translateObjectLocal; 95 @GodotName("update_gizmo") GodotMethod!(void) updateGizmo; 96 } 97 /// 98 pragma(inline, true) bool opEquals(in Spatial other) const 99 { return _godot_object.ptr is other._godot_object.ptr; } 100 /// 101 pragma(inline, true) typeof(null) opAssign(typeof(null) n) 102 { _godot_object.ptr = n; return null; } 103 /// 104 pragma(inline, true) bool opEquals(typeof(null) n) const 105 { return _godot_object.ptr is n; } 106 /// 107 size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; } 108 mixin baseCasts; 109 /// Construct a new instance of Spatial. 110 /// Note: use `memnew!Spatial` instead. 111 static Spatial _new() 112 { 113 static godot_class_constructor constructor; 114 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("Spatial"); 115 if(constructor is null) return typeof(this).init; 116 return cast(Spatial)(constructor()); 117 } 118 @disable new(size_t s); 119 /// 120 enum Constants : int 121 { 122 /** 123 Spatial nodes receives this notification when they are registered to new $(D World) resource. 124 */ 125 notificationEnterWorld = 41, 126 /** 127 Spatial nodes receives this notification when they are unregistered from current $(D World) resource. 128 */ 129 notificationExitWorld = 42, 130 /** 131 Spatial nodes receives this notification when their visibility changes. 132 */ 133 notificationVisibilityChanged = 43, 134 /** 135 Spatial nodes receives this notification when their global transform changes. This means that either the current or a parent node changed its transform. 136 In order for $(D constant NOTIFICATION_TRANSFORM_CHANGED) to work, users first need to ask for it, with $(D setNotifyTransform). The notification is also sent if the node is in the editor context and it has a valid gizmo. 137 */ 138 notificationTransformChanged = 2000, 139 } 140 /** 141 142 */ 143 void _updateGizmo() 144 { 145 Array _GODOT_args = Array.make(); 146 String _GODOT_method_name = String("_update_gizmo"); 147 this.callv(_GODOT_method_name, _GODOT_args); 148 } 149 /** 150 Forces the transform to update. Transform changes in physics are not instant for performance reasons. Transforms are accumulated and then set. Use this if you need an up-to-date transform when doing physics operations. 151 */ 152 void forceUpdateTransform() 153 { 154 checkClassBinding!(typeof(this))(); 155 ptrcall!(void)(GDNativeClassBinding.forceUpdateTransform, _godot_object); 156 } 157 /** 158 159 */ 160 Ref!SpatialGizmo getGizmo() const 161 { 162 checkClassBinding!(typeof(this))(); 163 return ptrcall!(SpatialGizmo)(GDNativeClassBinding.getGizmo, _godot_object); 164 } 165 /** 166 167 */ 168 Transform getGlobalTransform() const 169 { 170 checkClassBinding!(typeof(this))(); 171 return ptrcall!(Transform)(GDNativeClassBinding.getGlobalTransform, _godot_object); 172 } 173 /** 174 Returns the parent $(D Spatial), or an empty $(D GodotObject) if no parent exists or parent is not of type $(D Spatial). 175 */ 176 Spatial getParentSpatial() const 177 { 178 checkClassBinding!(typeof(this))(); 179 return ptrcall!(Spatial)(GDNativeClassBinding.getParentSpatial, _godot_object); 180 } 181 /** 182 183 */ 184 Vector3 getRotation() const 185 { 186 checkClassBinding!(typeof(this))(); 187 return ptrcall!(Vector3)(GDNativeClassBinding.getRotation, _godot_object); 188 } 189 /** 190 191 */ 192 Vector3 getRotationDegrees() const 193 { 194 checkClassBinding!(typeof(this))(); 195 return ptrcall!(Vector3)(GDNativeClassBinding.getRotationDegrees, _godot_object); 196 } 197 /** 198 199 */ 200 Vector3 getScale() const 201 { 202 checkClassBinding!(typeof(this))(); 203 return ptrcall!(Vector3)(GDNativeClassBinding.getScale, _godot_object); 204 } 205 /** 206 207 */ 208 Transform getTransform() const 209 { 210 checkClassBinding!(typeof(this))(); 211 return ptrcall!(Transform)(GDNativeClassBinding.getTransform, _godot_object); 212 } 213 /** 214 215 */ 216 Vector3 getTranslation() const 217 { 218 checkClassBinding!(typeof(this))(); 219 return ptrcall!(Vector3)(GDNativeClassBinding.getTranslation, _godot_object); 220 } 221 /** 222 Returns the current $(D World) resource this $(D Spatial) node is registered to. 223 */ 224 Ref!World getWorld() const 225 { 226 checkClassBinding!(typeof(this))(); 227 return ptrcall!(World)(GDNativeClassBinding.getWorld, _godot_object); 228 } 229 /** 230 Rotates the global (world) transformation around axis, a unit $(D Vector3), by specified angle in radians. The rotation axis is in global coordinate system. 231 */ 232 void globalRotate(in Vector3 axis, in double angle) 233 { 234 checkClassBinding!(typeof(this))(); 235 ptrcall!(void)(GDNativeClassBinding.globalRotate, _godot_object, axis, angle); 236 } 237 /** 238 Scales the global (world) transformation by the given $(D Vector3) scale factors. 239 */ 240 void globalScale(in Vector3 scale) 241 { 242 checkClassBinding!(typeof(this))(); 243 ptrcall!(void)(GDNativeClassBinding.globalScale, _godot_object, scale); 244 } 245 /** 246 Moves the global (world) transformation by $(D Vector3) offset. The offset is in global coordinate system. 247 */ 248 void globalTranslate(in Vector3 offset) 249 { 250 checkClassBinding!(typeof(this))(); 251 ptrcall!(void)(GDNativeClassBinding.globalTranslate, _godot_object, offset); 252 } 253 /** 254 Disables rendering of this node. Changes $(D visible) to `false`. 255 */ 256 void hide() 257 { 258 checkClassBinding!(typeof(this))(); 259 ptrcall!(void)(GDNativeClassBinding.hide, _godot_object); 260 } 261 /** 262 Returns whether node notifies about its local transformation changes. $(D Spatial) will not propagate this by default. 263 */ 264 bool isLocalTransformNotificationEnabled() const 265 { 266 checkClassBinding!(typeof(this))(); 267 return ptrcall!(bool)(GDNativeClassBinding.isLocalTransformNotificationEnabled, _godot_object); 268 } 269 /** 270 Returns whether this node uses a scale of `(1, 1, 1)` or its local transformation scale. 271 */ 272 bool isScaleDisabled() const 273 { 274 checkClassBinding!(typeof(this))(); 275 return ptrcall!(bool)(GDNativeClassBinding.isScaleDisabled, _godot_object); 276 } 277 /** 278 Returns whether this node is set as Toplevel, that is whether it ignores its parent nodes transformations. 279 */ 280 bool isSetAsToplevel() const 281 { 282 checkClassBinding!(typeof(this))(); 283 return ptrcall!(bool)(GDNativeClassBinding.isSetAsToplevel, _godot_object); 284 } 285 /** 286 Returns whether the node notifies about its global and local transformation changes. $(D Spatial) will not propagate this by default. 287 */ 288 bool isTransformNotificationEnabled() const 289 { 290 checkClassBinding!(typeof(this))(); 291 return ptrcall!(bool)(GDNativeClassBinding.isTransformNotificationEnabled, _godot_object); 292 } 293 /** 294 295 */ 296 bool isVisible() const 297 { 298 checkClassBinding!(typeof(this))(); 299 return ptrcall!(bool)(GDNativeClassBinding.isVisible, _godot_object); 300 } 301 /** 302 Returns `true` if the node is present in the $(D SceneTree), its $(D visible) property is `true` and all its antecedents are also visible. If any antecedent is hidden, this node will not be visible in the scene tree. 303 */ 304 bool isVisibleInTree() const 305 { 306 checkClassBinding!(typeof(this))(); 307 return ptrcall!(bool)(GDNativeClassBinding.isVisibleInTree, _godot_object); 308 } 309 /** 310 Rotates itself so that the local -Z axis points towards the `target` position. 311 The transform will first be rotated around the given `up` vector, and then fully aligned to the target by a further rotation around an axis perpendicular to both the `target` and `up` vectors. 312 Operations take place in global space. 313 */ 314 void lookAt(in Vector3 target, in Vector3 up) 315 { 316 checkClassBinding!(typeof(this))(); 317 ptrcall!(void)(GDNativeClassBinding.lookAt, _godot_object, target, up); 318 } 319 /** 320 Moves the node to the specified `position`, and then rotates itself to point toward the `target` as per $(D lookAt). Operations take place in global space. 321 */ 322 void lookAtFromPosition(in Vector3 position, in Vector3 target, in Vector3 up) 323 { 324 checkClassBinding!(typeof(this))(); 325 ptrcall!(void)(GDNativeClassBinding.lookAtFromPosition, _godot_object, position, target, up); 326 } 327 /** 328 Resets this node's transformations (like scale, skew and taper) preserving its rotation and translation by performing Gram-Schmidt orthonormalization on this node's $(D Transform). 329 */ 330 void orthonormalize() 331 { 332 checkClassBinding!(typeof(this))(); 333 ptrcall!(void)(GDNativeClassBinding.orthonormalize, _godot_object); 334 } 335 /** 336 Rotates the local transformation around axis, a unit $(D Vector3), by specified angle in radians. 337 */ 338 void rotate(in Vector3 axis, in double angle) 339 { 340 checkClassBinding!(typeof(this))(); 341 ptrcall!(void)(GDNativeClassBinding.rotate, _godot_object, axis, angle); 342 } 343 /** 344 Rotates the local transformation around axis, a unit $(D Vector3), by specified angle in radians. The rotation axis is in object-local coordinate system. 345 */ 346 void rotateObjectLocal(in Vector3 axis, in double angle) 347 { 348 checkClassBinding!(typeof(this))(); 349 ptrcall!(void)(GDNativeClassBinding.rotateObjectLocal, _godot_object, axis, angle); 350 } 351 /** 352 Rotates the local transformation around the X axis by angle in radians. 353 */ 354 void rotateX(in double angle) 355 { 356 checkClassBinding!(typeof(this))(); 357 ptrcall!(void)(GDNativeClassBinding.rotateX, _godot_object, angle); 358 } 359 /** 360 Rotates the local transformation around the Y axis by angle in radians. 361 */ 362 void rotateY(in double angle) 363 { 364 checkClassBinding!(typeof(this))(); 365 ptrcall!(void)(GDNativeClassBinding.rotateY, _godot_object, angle); 366 } 367 /** 368 Rotates the local transformation around the Z axis by angle in radians. 369 */ 370 void rotateZ(in double angle) 371 { 372 checkClassBinding!(typeof(this))(); 373 ptrcall!(void)(GDNativeClassBinding.rotateZ, _godot_object, angle); 374 } 375 /** 376 Scales the local transformation by given 3D scale factors in object-local coordinate system. 377 */ 378 void scaleObjectLocal(in Vector3 scale) 379 { 380 checkClassBinding!(typeof(this))(); 381 ptrcall!(void)(GDNativeClassBinding.scaleObjectLocal, _godot_object, scale); 382 } 383 /** 384 Makes the node ignore its parents transformations. Node transformations are only in global space. 385 */ 386 void setAsToplevel(in bool enable) 387 { 388 checkClassBinding!(typeof(this))(); 389 ptrcall!(void)(GDNativeClassBinding.setAsToplevel, _godot_object, enable); 390 } 391 /** 392 Sets whether the node uses a scale of `(1, 1, 1)` or its local transformation scale. Changes to the local transformation scale are preserved. 393 */ 394 void setDisableScale(in bool disable) 395 { 396 checkClassBinding!(typeof(this))(); 397 ptrcall!(void)(GDNativeClassBinding.setDisableScale, _godot_object, disable); 398 } 399 /** 400 401 */ 402 void setGizmo(SpatialGizmo gizmo) 403 { 404 checkClassBinding!(typeof(this))(); 405 ptrcall!(void)(GDNativeClassBinding.setGizmo, _godot_object, gizmo); 406 } 407 /** 408 409 */ 410 void setGlobalTransform(in Transform global) 411 { 412 checkClassBinding!(typeof(this))(); 413 ptrcall!(void)(GDNativeClassBinding.setGlobalTransform, _godot_object, global); 414 } 415 /** 416 Reset all transformations for this node (sets its $(D Transform) to the identity matrix). 417 */ 418 void setIdentity() 419 { 420 checkClassBinding!(typeof(this))(); 421 ptrcall!(void)(GDNativeClassBinding.setIdentity, _godot_object); 422 } 423 /** 424 Sets whether the node ignores notification that its transformation (global or local) changed. 425 */ 426 void setIgnoreTransformNotification(in bool enabled) 427 { 428 checkClassBinding!(typeof(this))(); 429 ptrcall!(void)(GDNativeClassBinding.setIgnoreTransformNotification, _godot_object, enabled); 430 } 431 /** 432 Sets whether the node notifies about its local transformation changes. $(D Spatial) will not propagate this by default. 433 */ 434 void setNotifyLocalTransform(in bool enable) 435 { 436 checkClassBinding!(typeof(this))(); 437 ptrcall!(void)(GDNativeClassBinding.setNotifyLocalTransform, _godot_object, enable); 438 } 439 /** 440 Sets whether the node notifies about its global and local transformation changes. $(D Spatial) will not propagate this by default, unless it is in the editor context and it has a valid gizmo. 441 */ 442 void setNotifyTransform(in bool enable) 443 { 444 checkClassBinding!(typeof(this))(); 445 ptrcall!(void)(GDNativeClassBinding.setNotifyTransform, _godot_object, enable); 446 } 447 /** 448 449 */ 450 void setRotation(in Vector3 euler) 451 { 452 checkClassBinding!(typeof(this))(); 453 ptrcall!(void)(GDNativeClassBinding.setRotation, _godot_object, euler); 454 } 455 /** 456 457 */ 458 void setRotationDegrees(in Vector3 euler_degrees) 459 { 460 checkClassBinding!(typeof(this))(); 461 ptrcall!(void)(GDNativeClassBinding.setRotationDegrees, _godot_object, euler_degrees); 462 } 463 /** 464 465 */ 466 void setScale(in Vector3 scale) 467 { 468 checkClassBinding!(typeof(this))(); 469 ptrcall!(void)(GDNativeClassBinding.setScale, _godot_object, scale); 470 } 471 /** 472 473 */ 474 void setTransform(in Transform local) 475 { 476 checkClassBinding!(typeof(this))(); 477 ptrcall!(void)(GDNativeClassBinding.setTransform, _godot_object, local); 478 } 479 /** 480 481 */ 482 void setTranslation(in Vector3 translation) 483 { 484 checkClassBinding!(typeof(this))(); 485 ptrcall!(void)(GDNativeClassBinding.setTranslation, _godot_object, translation); 486 } 487 /** 488 489 */ 490 void setVisible(in bool visible) 491 { 492 checkClassBinding!(typeof(this))(); 493 ptrcall!(void)(GDNativeClassBinding.setVisible, _godot_object, visible); 494 } 495 /** 496 Enables rendering of this node. Changes $(D visible) to `true`. 497 */ 498 void show() 499 { 500 checkClassBinding!(typeof(this))(); 501 ptrcall!(void)(GDNativeClassBinding.show, _godot_object); 502 } 503 /** 504 Transforms `local_point` from this node's local space to world space. 505 */ 506 Vector3 toGlobal(in Vector3 local_point) const 507 { 508 checkClassBinding!(typeof(this))(); 509 return ptrcall!(Vector3)(GDNativeClassBinding.toGlobal, _godot_object, local_point); 510 } 511 /** 512 Transforms `global_point` from world space to this node's local space. 513 */ 514 Vector3 toLocal(in Vector3 global_point) const 515 { 516 checkClassBinding!(typeof(this))(); 517 return ptrcall!(Vector3)(GDNativeClassBinding.toLocal, _godot_object, global_point); 518 } 519 /** 520 Changes the node's position by the given offset $(D Vector3). 521 Note that the translation `offset` is affected by the node's scale, so if scaled by e.g. `(10, 1, 1)`, a translation by an offset of `(2, 0, 0)` would actually add 20 (`2 * 10`) to the X coordinate. 522 */ 523 void translate(in Vector3 offset) 524 { 525 checkClassBinding!(typeof(this))(); 526 ptrcall!(void)(GDNativeClassBinding.translate, _godot_object, offset); 527 } 528 /** 529 Changes the node's position by the given offset $(D Vector3) in local space. 530 */ 531 void translateObjectLocal(in Vector3 offset) 532 { 533 checkClassBinding!(typeof(this))(); 534 ptrcall!(void)(GDNativeClassBinding.translateObjectLocal, _godot_object, offset); 535 } 536 /** 537 Updates the $(D SpatialGizmo) of this node. 538 */ 539 void updateGizmo() 540 { 541 checkClassBinding!(typeof(this))(); 542 ptrcall!(void)(GDNativeClassBinding.updateGizmo, _godot_object); 543 } 544 /** 545 The $(D SpatialGizmo) for this node. Used for example in $(D EditorSpatialGizmo) as custom visualization and editing handles in Editor. 546 */ 547 @property SpatialGizmo gizmo() 548 { 549 return getGizmo(); 550 } 551 /// ditto 552 @property void gizmo(SpatialGizmo v) 553 { 554 setGizmo(v); 555 } 556 /** 557 World space (global) $(D Transform) of this node. 558 */ 559 @property Transform globalTransform() 560 { 561 return getGlobalTransform(); 562 } 563 /// ditto 564 @property void globalTransform(Transform v) 565 { 566 setGlobalTransform(v); 567 } 568 /** 569 Rotation part of the local transformation in radians, specified in terms of YXZ-Euler angles in the format (X angle, Y angle, Z angle). 570 $(B Note:) In the mathematical sense, rotation is a matrix and not a vector. The three Euler angles, which are the three independent parameters of the Euler-angle parametrization of the rotation matrix, are stored in a $(D Vector3) data structure not because the rotation is a vector, but only because $(D Vector3) exists as a convenient data-structure to store 3 floating-point numbers. Therefore, applying affine operations on the rotation "vector" is not meaningful. 571 */ 572 @property Vector3 rotation() 573 { 574 return getRotation(); 575 } 576 /// ditto 577 @property void rotation(Vector3 v) 578 { 579 setRotation(v); 580 } 581 /** 582 Rotation part of the local transformation in degrees, specified in terms of YXZ-Euler angles in the format (X angle, Y angle, Z angle). 583 */ 584 @property Vector3 rotationDegrees() 585 { 586 return getRotationDegrees(); 587 } 588 /// ditto 589 @property void rotationDegrees(Vector3 v) 590 { 591 setRotationDegrees(v); 592 } 593 /** 594 Scale part of the local transformation. 595 */ 596 @property Vector3 scale() 597 { 598 return getScale(); 599 } 600 /// ditto 601 @property void scale(Vector3 v) 602 { 603 setScale(v); 604 } 605 /** 606 Local space $(D Transform) of this node, with respect to the parent node. 607 */ 608 @property Transform transform() 609 { 610 return getTransform(); 611 } 612 /// ditto 613 @property void transform(Transform v) 614 { 615 setTransform(v); 616 } 617 /** 618 Local translation of this node. 619 */ 620 @property Vector3 translation() 621 { 622 return getTranslation(); 623 } 624 /// ditto 625 @property void translation(Vector3 v) 626 { 627 setTranslation(v); 628 } 629 /** 630 If `true`, this node is drawn. The node is only visible if all of its antecedents are visible as well (in other words, $(D isVisibleInTree) must return `true`). 631 */ 632 @property bool visible() 633 { 634 return isVisible(); 635 } 636 /// ditto 637 @property void visible(bool v) 638 { 639 setVisible(v); 640 } 641 }