wTrackerLib.jslib 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. mergeInto(LibraryManager.library, {
  2. WebGLPlaceOrigin: function(camPosStr)
  3. {
  4. window.wTracker.placeOrigin(UTF8ToString(camPosStr));
  5. },
  6. WebGLResetOrigin: function()
  7. {
  8. window.wTracker.resetOrigin();
  9. },
  10. StartWebGLwTracker: function(name)
  11. {
  12. if(!window.wTracker){
  13. console.error('%cwTracker not found! Please make sure to use the wTracker WebGLTemplate in your ProjectSettings','font-size: 32px; font-weight: bold');
  14. throw new Error("Tracker not found! Please make sure to use the wTracker WebGLTemplate in your ProjectSettings");
  15. return;
  16. }
  17. window.wTracker.startTracker(UTF8ToString(name));
  18. },
  19. StopWebGLwTracker: function()
  20. {
  21. window.wTracker.stopTracker();
  22. },
  23. IsWebGLwTrackerReady: function()
  24. {
  25. return window.wTracker != null;
  26. },
  27. SetWebGLwTrackerSettings: function(settings)
  28. {
  29. window.wTracker.setTrackerSettings(UTF8ToString(settings),"1.5.0.150238");
  30. },
  31. WebGLSetViewportPos: function(vStr){
  32. window.wTracker.setViewportPos(UTF8ToString(vStr));
  33. },
  34. WebGLGetGPSPosition: function(){
  35. window.wTracker.getGPSPosition();
  36. },
  37. WebGLSubscribeToGPSPositionUpdates: function(){
  38. window.wTracker.subscribeToGPSPositionChanges();
  39. },
  40. WebGLUnsubscribeToGPSPositionUpdates: function(){
  41. window.wTracker.unsubscribeToGPSPositionChanges();
  42. },
  43. });