1 /** 2 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.spatialvelocitytracker; 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.reference; 24 /** 25 26 */ 27 @GodotBaseClass struct SpatialVelocityTracker 28 { 29 enum string _GODOT_internal_name = "SpatialVelocityTracker"; 30 public: 31 @nogc nothrow: 32 union { godot_object _godot_object; Reference _GODOT_base; } 33 alias _GODOT_base this; 34 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 35 package(godot) __gshared bool _classBindingInitialized = false; 36 package(godot) static struct _classBinding 37 { 38 __gshared: 39 @GodotName("set_track_physics_step") GodotMethod!(void, bool) setTrackPhysicsStep; 40 @GodotName("is_tracking_physics_step") GodotMethod!(bool) isTrackingPhysicsStep; 41 @GodotName("update_position") GodotMethod!(void, Vector3) updatePosition; 42 @GodotName("get_tracked_linear_velocity") GodotMethod!(Vector3) getTrackedLinearVelocity; 43 @GodotName("reset") GodotMethod!(void, Vector3) reset; 44 } 45 bool opEquals(in SpatialVelocityTracker other) const { return _godot_object.ptr is other._godot_object.ptr; } 46 SpatialVelocityTracker 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 SpatialVelocityTracker _new() 50 { 51 static godot_class_constructor constructor; 52 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("SpatialVelocityTracker"); 53 if(constructor is null) return typeof(this).init; 54 return cast(SpatialVelocityTracker)(constructor()); 55 } 56 @disable new(size_t s); 57 /** 58 59 */ 60 void setTrackPhysicsStep(in bool enable) 61 { 62 checkClassBinding!(typeof(this))(); 63 ptrcall!(void)(_classBinding.setTrackPhysicsStep, _godot_object, enable); 64 } 65 /** 66 67 */ 68 bool isTrackingPhysicsStep() const 69 { 70 checkClassBinding!(typeof(this))(); 71 return ptrcall!(bool)(_classBinding.isTrackingPhysicsStep, _godot_object); 72 } 73 /** 74 75 */ 76 void updatePosition(in Vector3 position) 77 { 78 checkClassBinding!(typeof(this))(); 79 ptrcall!(void)(_classBinding.updatePosition, _godot_object, position); 80 } 81 /** 82 83 */ 84 Vector3 getTrackedLinearVelocity() const 85 { 86 checkClassBinding!(typeof(this))(); 87 return ptrcall!(Vector3)(_classBinding.getTrackedLinearVelocity, _godot_object); 88 } 89 /** 90 91 */ 92 void reset(in Vector3 position) 93 { 94 checkClassBinding!(typeof(this))(); 95 ptrcall!(void)(_classBinding.reset, _godot_object, position); 96 } 97 /** 98 99 */ 100 @property bool trackPhysicsStep() 101 { 102 return isTrackingPhysicsStep(); 103 } 104 /// ditto 105 @property void trackPhysicsStep(bool v) 106 { 107 setTrackPhysicsStep(v); 108 } 109 }