1 /** 2 Contains a $(D Curve3D) path for $(D PathFollow) nodes to follow. 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.path; 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.spatial; 25 import godot.curve3d; 26 /** 27 Contains a $(D Curve3D) path for $(D PathFollow) nodes to follow. 28 29 Can have $(D PathFollow) child nodes moving along the $(D Curve3D). See $(D PathFollow) for more information on the usage. 30 Note that the path is considered as relative to the moved nodes (children of $(D PathFollow)). As such, the curve should usually start with a zero vector `(0, 0, 0)`. 31 */ 32 @GodotBaseClass struct Path 33 { 34 package(godot) enum string _GODOT_internal_name = "Path"; 35 public: 36 @nogc nothrow: 37 union { /** */ godot_object _godot_object; /** */ Spatial _GODOT_base; } 38 alias _GODOT_base this; 39 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 40 package(godot) __gshared bool _classBindingInitialized = false; 41 package(godot) static struct GDNativeClassBinding 42 { 43 __gshared: 44 @GodotName("_curve_changed") GodotMethod!(void) _curveChanged; 45 @GodotName("get_curve") GodotMethod!(Curve3D) getCurve; 46 @GodotName("set_curve") GodotMethod!(void, Curve3D) setCurve; 47 } 48 /// 49 pragma(inline, true) bool opEquals(in Path other) const 50 { return _godot_object.ptr is other._godot_object.ptr; } 51 /// 52 pragma(inline, true) typeof(null) opAssign(typeof(null) n) 53 { _godot_object.ptr = n; return null; } 54 /// 55 pragma(inline, true) bool opEquals(typeof(null) n) const 56 { return _godot_object.ptr is n; } 57 /// 58 size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; } 59 mixin baseCasts; 60 /// Construct a new instance of Path. 61 /// Note: use `memnew!Path` instead. 62 static Path _new() 63 { 64 static godot_class_constructor constructor; 65 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("Path"); 66 if(constructor is null) return typeof(this).init; 67 return cast(Path)(constructor()); 68 } 69 @disable new(size_t s); 70 /** 71 72 */ 73 void _curveChanged() 74 { 75 Array _GODOT_args = Array.make(); 76 String _GODOT_method_name = String("_curve_changed"); 77 this.callv(_GODOT_method_name, _GODOT_args); 78 } 79 /** 80 81 */ 82 Ref!Curve3D getCurve() const 83 { 84 checkClassBinding!(typeof(this))(); 85 return ptrcall!(Curve3D)(GDNativeClassBinding.getCurve, _godot_object); 86 } 87 /** 88 89 */ 90 void setCurve(Curve3D curve) 91 { 92 checkClassBinding!(typeof(this))(); 93 ptrcall!(void)(GDNativeClassBinding.setCurve, _godot_object, curve); 94 } 95 /** 96 A $(D Curve3D) describing the path. 97 */ 98 @property Curve3D curve() 99 { 100 return getCurve(); 101 } 102 /// ditto 103 @property void curve(Curve3D v) 104 { 105 setCurve(v); 106 } 107 }