arvr_nodes.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  1. /*************************************************************************/
  2. /* arvr_nodes.cpp */
  3. /*************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /*************************************************************************/
  8. /* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
  9. /* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /*************************************************************************/
  30. #include "arvr_nodes.h"
  31. #include "core/os/input.h"
  32. #include "servers/arvr/arvr_interface.h"
  33. #include "servers/arvr_server.h"
  34. ////////////////////////////////////////////////////////////////////////////////////////////////////
  35. void ARVRCamera::_notification(int p_what) {
  36. switch (p_what) {
  37. case NOTIFICATION_ENTER_TREE: {
  38. // need to find our ARVROrigin parent and let it know we're it's camera!
  39. ARVROrigin *origin = Object::cast_to<ARVROrigin>(get_parent());
  40. if (origin != NULL) {
  41. origin->set_tracked_camera(this);
  42. }
  43. }; break;
  44. case NOTIFICATION_EXIT_TREE: {
  45. // need to find our ARVROrigin parent and let it know we're no longer it's camera!
  46. ARVROrigin *origin = Object::cast_to<ARVROrigin>(get_parent());
  47. if (origin != NULL) {
  48. origin->clear_tracked_camera_if(this);
  49. }
  50. }; break;
  51. };
  52. };
  53. String ARVRCamera::get_configuration_warning() const {
  54. if (!is_visible() || !is_inside_tree())
  55. return String();
  56. // must be child node of ARVROrigin!
  57. ARVROrigin *origin = Object::cast_to<ARVROrigin>(get_parent());
  58. if (origin == NULL) {
  59. return TTR("ARVRCamera must have an ARVROrigin node as its parent");
  60. };
  61. return String();
  62. };
  63. Vector3 ARVRCamera::project_local_ray_normal(const Point2 &p_pos) const {
  64. // get our ARVRServer
  65. ARVRServer *arvr_server = ARVRServer::get_singleton();
  66. ERR_FAIL_NULL_V(arvr_server, Vector3());
  67. Ref<ARVRInterface> arvr_interface = arvr_server->get_primary_interface();
  68. ERR_FAIL_COND_V(arvr_interface.is_null(), Vector3());
  69. if (!is_inside_tree()) {
  70. ERR_EXPLAIN("Camera is not inside scene.");
  71. ERR_FAIL_COND_V(!is_inside_tree(), Vector3());
  72. };
  73. Size2 viewport_size = get_viewport()->get_camera_rect_size();
  74. Vector2 cpos = get_viewport()->get_camera_coords(p_pos);
  75. Vector3 ray;
  76. CameraMatrix cm = arvr_interface->get_projection_for_eye(ARVRInterface::EYE_MONO, viewport_size.aspect(), get_znear(), get_zfar());
  77. float screen_w, screen_h;
  78. cm.get_viewport_size(screen_w, screen_h);
  79. ray = Vector3(((cpos.x / viewport_size.width) * 2.0 - 1.0) * screen_w, ((1.0 - (cpos.y / viewport_size.height)) * 2.0 - 1.0) * screen_h, -get_znear()).normalized();
  80. return ray;
  81. };
  82. Point2 ARVRCamera::unproject_position(const Vector3 &p_pos) const {
  83. // get our ARVRServer
  84. ARVRServer *arvr_server = ARVRServer::get_singleton();
  85. ERR_FAIL_NULL_V(arvr_server, Vector2());
  86. Ref<ARVRInterface> arvr_interface = arvr_server->get_primary_interface();
  87. ERR_FAIL_COND_V(arvr_interface.is_null(), Vector2());
  88. if (!is_inside_tree()) {
  89. ERR_EXPLAIN("Camera is not inside scene.");
  90. ERR_FAIL_COND_V(!is_inside_tree(), Vector2());
  91. };
  92. Size2 viewport_size = get_viewport()->get_visible_rect().size;
  93. CameraMatrix cm = arvr_interface->get_projection_for_eye(ARVRInterface::EYE_MONO, viewport_size.aspect(), get_znear(), get_zfar());
  94. Plane p(get_camera_transform().xform_inv(p_pos), 1.0);
  95. p = cm.xform4(p);
  96. p.normal /= p.d;
  97. Point2 res;
  98. res.x = (p.normal.x * 0.5 + 0.5) * viewport_size.x;
  99. res.y = (-p.normal.y * 0.5 + 0.5) * viewport_size.y;
  100. return res;
  101. };
  102. Vector3 ARVRCamera::project_position(const Point2 &p_point) const {
  103. // get our ARVRServer
  104. ARVRServer *arvr_server = ARVRServer::get_singleton();
  105. ERR_FAIL_NULL_V(arvr_server, Vector3());
  106. Ref<ARVRInterface> arvr_interface = arvr_server->get_primary_interface();
  107. ERR_FAIL_COND_V(arvr_interface.is_null(), Vector3());
  108. if (!is_inside_tree()) {
  109. ERR_EXPLAIN("Camera is not inside scene.");
  110. ERR_FAIL_COND_V(!is_inside_tree(), Vector3());
  111. };
  112. Size2 viewport_size = get_viewport()->get_visible_rect().size;
  113. CameraMatrix cm = arvr_interface->get_projection_for_eye(ARVRInterface::EYE_MONO, viewport_size.aspect(), get_znear(), get_zfar());
  114. Size2 vp_size;
  115. cm.get_viewport_size(vp_size.x, vp_size.y);
  116. Vector2 point;
  117. point.x = (p_point.x / viewport_size.x) * 2.0 - 1.0;
  118. point.y = (1.0 - (p_point.y / viewport_size.y)) * 2.0 - 1.0;
  119. point *= vp_size;
  120. Vector3 p(point.x, point.y, -get_znear());
  121. return get_camera_transform().xform(p);
  122. };
  123. Vector<Plane> ARVRCamera::get_frustum() const {
  124. // get our ARVRServer
  125. ARVRServer *arvr_server = ARVRServer::get_singleton();
  126. ERR_FAIL_NULL_V(arvr_server, Vector<Plane>());
  127. Ref<ARVRInterface> arvr_interface = arvr_server->get_primary_interface();
  128. ERR_FAIL_COND_V(arvr_interface.is_null(), Vector<Plane>());
  129. ERR_FAIL_COND_V(!is_inside_world(), Vector<Plane>());
  130. Size2 viewport_size = get_viewport()->get_visible_rect().size;
  131. CameraMatrix cm = arvr_interface->get_projection_for_eye(ARVRInterface::EYE_MONO, viewport_size.aspect(), get_znear(), get_zfar());
  132. return cm.get_projection_planes(get_camera_transform());
  133. };
  134. ARVRCamera::ARVRCamera(){
  135. // nothing to do here yet for now..
  136. };
  137. ARVRCamera::~ARVRCamera(){
  138. // nothing to do here yet for now..
  139. };
  140. ////////////////////////////////////////////////////////////////////////////////////////////////////
  141. void ARVRController::_notification(int p_what) {
  142. switch (p_what) {
  143. case NOTIFICATION_ENTER_TREE: {
  144. set_process_internal(true);
  145. }; break;
  146. case NOTIFICATION_EXIT_TREE: {
  147. set_process_internal(false);
  148. }; break;
  149. case NOTIFICATION_INTERNAL_PROCESS: {
  150. // get our ARVRServer
  151. ARVRServer *arvr_server = ARVRServer::get_singleton();
  152. ERR_FAIL_NULL(arvr_server);
  153. // find the tracker for our controller
  154. ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_CONTROLLER, controller_id);
  155. if (tracker == NULL) {
  156. // this controller is currently turned off
  157. is_active = false;
  158. button_states = 0;
  159. } else {
  160. is_active = true;
  161. set_transform(tracker->get_transform(true));
  162. int joy_id = tracker->get_joy_id();
  163. if (joy_id >= 0) {
  164. int mask = 1;
  165. // check button states
  166. for (int i = 0; i < 16; i++) {
  167. bool was_pressed = (button_states & mask) == mask;
  168. bool is_pressed = Input::get_singleton()->is_joy_button_pressed(joy_id, i);
  169. if (!was_pressed && is_pressed) {
  170. emit_signal("button_pressed", i);
  171. button_states += mask;
  172. } else if (was_pressed && !is_pressed) {
  173. emit_signal("button_release", i);
  174. button_states -= mask;
  175. };
  176. mask = mask << 1;
  177. };
  178. } else {
  179. button_states = 0;
  180. };
  181. };
  182. }; break;
  183. default:
  184. break;
  185. };
  186. };
  187. void ARVRController::_bind_methods() {
  188. ClassDB::bind_method(D_METHOD("set_controller_id", "controller_id"), &ARVRController::set_controller_id);
  189. ClassDB::bind_method(D_METHOD("get_controller_id"), &ARVRController::get_controller_id);
  190. ADD_PROPERTY(PropertyInfo(Variant::INT, "controller_id", PROPERTY_HINT_RANGE, "1,32,1"), "set_controller_id", "get_controller_id");
  191. ClassDB::bind_method(D_METHOD("get_controller_name"), &ARVRController::get_controller_name);
  192. // passthroughs to information about our related joystick
  193. ClassDB::bind_method(D_METHOD("get_joystick_id"), &ARVRController::get_joystick_id);
  194. ClassDB::bind_method(D_METHOD("is_button_pressed", "button"), &ARVRController::is_button_pressed);
  195. ClassDB::bind_method(D_METHOD("get_joystick_axis", "axis"), &ARVRController::get_joystick_axis);
  196. ClassDB::bind_method(D_METHOD("get_is_active"), &ARVRController::get_is_active);
  197. ClassDB::bind_method(D_METHOD("get_hand"), &ARVRController::get_hand);
  198. ClassDB::bind_method(D_METHOD("get_rumble"), &ARVRController::get_rumble);
  199. ClassDB::bind_method(D_METHOD("set_rumble", "rumble"), &ARVRController::set_rumble);
  200. ADD_PROPERTY(PropertyInfo(Variant::REAL, "rumble", PROPERTY_HINT_RANGE, "0.0,1.0,0.01"), "set_rumble", "get_rumble");
  201. ADD_SIGNAL(MethodInfo("button_pressed", PropertyInfo(Variant::INT, "button")));
  202. ADD_SIGNAL(MethodInfo("button_release", PropertyInfo(Variant::INT, "button")));
  203. };
  204. void ARVRController::set_controller_id(int p_controller_id) {
  205. // we don't check any bounds here, this controller may not yet be active and just be a place holder until it is.
  206. controller_id = p_controller_id;
  207. };
  208. int ARVRController::get_controller_id(void) const {
  209. return controller_id;
  210. };
  211. String ARVRController::get_controller_name(void) const {
  212. // get our ARVRServer
  213. ARVRServer *arvr_server = ARVRServer::get_singleton();
  214. ERR_FAIL_NULL_V(arvr_server, String());
  215. ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_CONTROLLER, controller_id);
  216. if (tracker == NULL) {
  217. return String("Not connected");
  218. };
  219. return tracker->get_name();
  220. };
  221. int ARVRController::get_joystick_id() const {
  222. // get our ARVRServer
  223. ARVRServer *arvr_server = ARVRServer::get_singleton();
  224. ERR_FAIL_NULL_V(arvr_server, 0);
  225. ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_CONTROLLER, controller_id);
  226. if (tracker == NULL) {
  227. return 0;
  228. };
  229. return tracker->get_joy_id();
  230. };
  231. int ARVRController::is_button_pressed(int p_button) const {
  232. int joy_id = get_joystick_id();
  233. if (joy_id == -1) {
  234. return false;
  235. };
  236. return Input::get_singleton()->is_joy_button_pressed(joy_id, p_button);
  237. };
  238. float ARVRController::get_joystick_axis(int p_axis) const {
  239. int joy_id = get_joystick_id();
  240. if (joy_id == -1) {
  241. return 0.0;
  242. };
  243. return Input::get_singleton()->get_joy_axis(joy_id, p_axis);
  244. };
  245. real_t ARVRController::get_rumble() const {
  246. // get our ARVRServer
  247. ARVRServer *arvr_server = ARVRServer::get_singleton();
  248. ERR_FAIL_NULL_V(arvr_server, 0.0);
  249. ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_CONTROLLER, controller_id);
  250. if (tracker == NULL) {
  251. return 0.0;
  252. };
  253. return tracker->get_rumble();
  254. };
  255. void ARVRController::set_rumble(real_t p_rumble) {
  256. // get our ARVRServer
  257. ARVRServer *arvr_server = ARVRServer::get_singleton();
  258. ERR_FAIL_NULL(arvr_server);
  259. ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_CONTROLLER, controller_id);
  260. if (tracker != NULL) {
  261. tracker->set_rumble(p_rumble);
  262. };
  263. };
  264. bool ARVRController::get_is_active() const {
  265. return is_active;
  266. };
  267. ARVRPositionalTracker::TrackerHand ARVRController::get_hand() const {
  268. // get our ARVRServer
  269. ARVRServer *arvr_server = ARVRServer::get_singleton();
  270. ERR_FAIL_NULL_V(arvr_server, ARVRPositionalTracker::TRACKER_HAND_UNKNOWN);
  271. ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_CONTROLLER, controller_id);
  272. if (tracker == NULL) {
  273. return ARVRPositionalTracker::TRACKER_HAND_UNKNOWN;
  274. };
  275. return tracker->get_hand();
  276. };
  277. String ARVRController::get_configuration_warning() const {
  278. if (!is_visible() || !is_inside_tree())
  279. return String();
  280. // must be child node of ARVROrigin!
  281. ARVROrigin *origin = Object::cast_to<ARVROrigin>(get_parent());
  282. if (origin == NULL) {
  283. return TTR("ARVRController must have an ARVROrigin node as its parent");
  284. };
  285. if (controller_id == 0) {
  286. return TTR("The controller id must not be 0 or this controller will not be bound to an actual controller");
  287. };
  288. return String();
  289. };
  290. ARVRController::ARVRController() {
  291. controller_id = 0;
  292. is_active = true;
  293. button_states = 0;
  294. };
  295. ARVRController::~ARVRController(){
  296. // nothing to do here yet for now..
  297. };
  298. ////////////////////////////////////////////////////////////////////////////////////////////////////
  299. void ARVRAnchor::_notification(int p_what) {
  300. switch (p_what) {
  301. case NOTIFICATION_ENTER_TREE: {
  302. set_process_internal(true);
  303. }; break;
  304. case NOTIFICATION_EXIT_TREE: {
  305. set_process_internal(false);
  306. }; break;
  307. case NOTIFICATION_INTERNAL_PROCESS: {
  308. // get our ARVRServer
  309. ARVRServer *arvr_server = ARVRServer::get_singleton();
  310. ERR_FAIL_NULL(arvr_server);
  311. // find the tracker for our anchor
  312. ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_ANCHOR, anchor_id);
  313. if (tracker == NULL) {
  314. // this anchor is currently not available
  315. is_active = false;
  316. } else {
  317. is_active = true;
  318. Transform transform;
  319. // we'll need our world_scale
  320. real_t world_scale = arvr_server->get_world_scale();
  321. // get our info from our tracker
  322. transform.basis = tracker->get_orientation();
  323. transform.origin = tracker->get_position(); // <-- already adjusted to world scale
  324. // our basis is scaled to the size of the plane the anchor is tracking
  325. // extract the size from our basis and reset the scale
  326. size = transform.basis.get_scale() * world_scale;
  327. transform.basis.orthonormalize();
  328. // apply our reference frame and set our transform
  329. set_transform(arvr_server->get_reference_frame() * transform);
  330. };
  331. }; break;
  332. default:
  333. break;
  334. };
  335. };
  336. void ARVRAnchor::_bind_methods() {
  337. ClassDB::bind_method(D_METHOD("set_anchor_id", "anchor_id"), &ARVRAnchor::set_anchor_id);
  338. ClassDB::bind_method(D_METHOD("get_anchor_id"), &ARVRAnchor::get_anchor_id);
  339. ADD_PROPERTY(PropertyInfo(Variant::INT, "anchor_id"), "set_anchor_id", "get_anchor_id");
  340. ClassDB::bind_method(D_METHOD("get_anchor_name"), &ARVRAnchor::get_anchor_name);
  341. ClassDB::bind_method(D_METHOD("get_is_active"), &ARVRAnchor::get_is_active);
  342. ClassDB::bind_method(D_METHOD("get_size"), &ARVRAnchor::get_size);
  343. ClassDB::bind_method(D_METHOD("get_plane"), &ARVRAnchor::get_plane);
  344. };
  345. void ARVRAnchor::set_anchor_id(int p_anchor_id) {
  346. // we don't check any bounds here, this anchor may not yet be active and just be a place holder until it is.
  347. anchor_id = p_anchor_id;
  348. };
  349. int ARVRAnchor::get_anchor_id(void) const {
  350. return anchor_id;
  351. };
  352. Vector3 ARVRAnchor::get_size() const {
  353. return size;
  354. };
  355. String ARVRAnchor::get_anchor_name(void) const {
  356. // get our ARVRServer
  357. ARVRServer *arvr_server = ARVRServer::get_singleton();
  358. ERR_FAIL_NULL_V(arvr_server, String());
  359. ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_ANCHOR, anchor_id);
  360. if (tracker == NULL) {
  361. return String("Not connected");
  362. };
  363. return tracker->get_name();
  364. };
  365. bool ARVRAnchor::get_is_active() const {
  366. return is_active;
  367. };
  368. String ARVRAnchor::get_configuration_warning() const {
  369. if (!is_visible() || !is_inside_tree())
  370. return String();
  371. // must be child node of ARVROrigin!
  372. ARVROrigin *origin = Object::cast_to<ARVROrigin>(get_parent());
  373. if (origin == NULL) {
  374. return TTR("ARVRAnchor must have an ARVROrigin node as its parent");
  375. };
  376. if (anchor_id == 0) {
  377. return TTR("The anchor id must not be 0 or this anchor will not be bound to an actual anchor");
  378. };
  379. return String();
  380. };
  381. Plane ARVRAnchor::get_plane() const {
  382. Vector3 location = get_translation();
  383. Basis orientation = get_transform().basis;
  384. Plane plane(location, orientation.get_axis(1).normalized());
  385. return plane;
  386. };
  387. ARVRAnchor::ARVRAnchor() {
  388. anchor_id = 0;
  389. is_active = true;
  390. };
  391. ARVRAnchor::~ARVRAnchor(){
  392. // nothing to do here yet for now..
  393. };
  394. ////////////////////////////////////////////////////////////////////////////////////////////////////
  395. String ARVROrigin::get_configuration_warning() const {
  396. if (!is_visible() || !is_inside_tree())
  397. return String();
  398. if (tracked_camera == NULL)
  399. return TTR("ARVROrigin requires an ARVRCamera child node");
  400. return String();
  401. };
  402. void ARVROrigin::_bind_methods() {
  403. ClassDB::bind_method(D_METHOD("set_world_scale", "world_scale"), &ARVROrigin::set_world_scale);
  404. ClassDB::bind_method(D_METHOD("get_world_scale"), &ARVROrigin::get_world_scale);
  405. ADD_PROPERTY(PropertyInfo(Variant::REAL, "world_scale"), "set_world_scale", "get_world_scale");
  406. };
  407. void ARVROrigin::set_tracked_camera(ARVRCamera *p_tracked_camera) {
  408. tracked_camera = p_tracked_camera;
  409. };
  410. void ARVROrigin::clear_tracked_camera_if(ARVRCamera *p_tracked_camera) {
  411. if (tracked_camera == p_tracked_camera) {
  412. tracked_camera = NULL;
  413. };
  414. };
  415. float ARVROrigin::get_world_scale() const {
  416. // get our ARVRServer
  417. ARVRServer *arvr_server = ARVRServer::get_singleton();
  418. ERR_FAIL_NULL_V(arvr_server, 1.0);
  419. return arvr_server->get_world_scale();
  420. };
  421. void ARVROrigin::set_world_scale(float p_world_scale) {
  422. // get our ARVRServer
  423. ARVRServer *arvr_server = ARVRServer::get_singleton();
  424. ERR_FAIL_NULL(arvr_server);
  425. arvr_server->set_world_scale(p_world_scale);
  426. };
  427. void ARVROrigin::_notification(int p_what) {
  428. switch (p_what) {
  429. case NOTIFICATION_ENTER_TREE: {
  430. set_process_internal(true);
  431. }; break;
  432. case NOTIFICATION_EXIT_TREE: {
  433. set_process_internal(false);
  434. }; break;
  435. case NOTIFICATION_INTERNAL_PROCESS: {
  436. // get our ARVRServer
  437. ARVRServer *arvr_server = ARVRServer::get_singleton();
  438. ERR_FAIL_NULL(arvr_server);
  439. // set our world origin to our node transform
  440. arvr_server->set_world_origin(get_global_transform());
  441. // check if we have a primary interface
  442. Ref<ARVRInterface> arvr_interface = arvr_server->get_primary_interface();
  443. if (arvr_interface.is_valid() && tracked_camera != NULL) {
  444. // get our positioning transform for our headset
  445. Transform t = arvr_interface->get_transform_for_eye(ARVRInterface::EYE_MONO, Transform());
  446. // now apply this to our camera
  447. tracked_camera->set_transform(t);
  448. };
  449. }; break;
  450. default:
  451. break;
  452. };
  453. };
  454. ARVROrigin::ARVROrigin() {
  455. tracked_camera = NULL;
  456. };
  457. ARVROrigin::~ARVROrigin(){
  458. // nothing to do here yet for now..
  459. };