1 /**
2 The origin point in AR/VR.
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.arvrorigin;
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 /**
26 The origin point in AR/VR.
27 
28 This is a special node within the AR/VR system that maps the physical location of the center of our tracking space to the virtual location within our game world.
29 There should be only one of these nodes in your scene and you must have one. All the ARVRCamera, ARVRController and ARVRAnchor nodes should be direct children of this node for spatial tracking to work correctly.
30 It is the position of this node that you update when your character needs to move through your game world while we're not moving in the real world. Movement in the real world is always in relation to this origin point.
31 For example, if your character is driving a car, the ARVROrigin node should be a child node of this car. Or, if you're implementing a teleport system to move your character, you should change the position of this node.
32 */
33 @GodotBaseClass struct ARVROrigin
34 {
35 	package(godot) enum string _GODOT_internal_name = "ARVROrigin";
36 public:
37 @nogc nothrow:
38 	union { /** */ godot_object _godot_object; /** */ Spatial _GODOT_base; }
39 	alias _GODOT_base this;
40 	alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses);
41 	package(godot) __gshared bool _classBindingInitialized = false;
42 	package(godot) static struct GDNativeClassBinding
43 	{
44 		__gshared:
45 		@GodotName("get_world_scale") GodotMethod!(double) getWorldScale;
46 		@GodotName("set_world_scale") GodotMethod!(void, double) setWorldScale;
47 	}
48 	/// 
49 	pragma(inline, true) bool opEquals(in ARVROrigin 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 ARVROrigin.
61 	/// Note: use `memnew!ARVROrigin` instead.
62 	static ARVROrigin _new()
63 	{
64 		static godot_class_constructor constructor;
65 		if(constructor is null) constructor = _godot_api.godot_get_class_constructor("ARVROrigin");
66 		if(constructor is null) return typeof(this).init;
67 		return cast(ARVROrigin)(constructor());
68 	}
69 	@disable new(size_t s);
70 	/**
71 	
72 	*/
73 	double getWorldScale() const
74 	{
75 		checkClassBinding!(typeof(this))();
76 		return ptrcall!(double)(GDNativeClassBinding.getWorldScale, _godot_object);
77 	}
78 	/**
79 	
80 	*/
81 	void setWorldScale(in double world_scale)
82 	{
83 		checkClassBinding!(typeof(this))();
84 		ptrcall!(void)(GDNativeClassBinding.setWorldScale, _godot_object, world_scale);
85 	}
86 	/**
87 	Allows you to adjust the scale to your game's units. Most AR/VR platforms assume a scale of 1 game world unit = 1 real world meter.
88 	$(B Note:) This method is a passthrough to the $(D ARVRServer) itself.
89 	*/
90 	@property double worldScale()
91 	{
92 		return getWorldScale();
93 	}
94 	/// ditto
95 	@property void worldScale(double v)
96 	{
97 		setWorldScale(v);
98 	}
99 }