Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interactable Drawings #100

Merged
merged 5 commits into from
Feb 8, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,19 +1,31 @@
// 'esversion: 6'

// Remember: also change Assets\Packages\KomodoCore\Hidden~\WebGLTemplates\KomodoWebXRFullView2020\relay.js
// Remember: also change Assets\WebGLTemplates\KomodoWebXRFullView2020\relay.js (or re-copy the WebGLTemplates to the Assets folder) if you intend for the changes to be reflected in the build. If you are reading this from inside a build folder, you can change this file as you please.

// Tip: if you need to change this on-the-fly, you can edit this file without rebuilding. It's also possible to use the inspector to inspect the VR frame and call `window.RELAY_API_BASE_URL="<your-server-url>"`, if for some reason you need to do that in real time.

/*
* ---------------------------------------------------------------------------------
* CONFIG
* ---------------------------------------------------------------------------------
*/

// Replace these with your own server's URLs.

var RELAY_BASE_URL = "http://localhost:3000";
var API_BASE_URL = "http://localhost:4040";
var VR_BASE_URL = "https://localhost:8123"; //TODO -- change this to a better default
var VR_BASE_URL = "http://localhost:8123"; //TODO -- change this to a better default

// init globals which Unity will assign when setup is done.
var sync = null;
var chat = null;

/*
parseccentric marked this conversation as resolved.
Show resolved Hide resolved
* ---------------------------------------------------------------------------------
* FUNCTIONALITY
* ---------------------------------------------------------------------------------
*/

/**
* Get the URL parameters
* source: https://css-tricks.com/snippets/javascript/get-url-variables/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void CreateUserStrokeInstance(int strokeID, LineRenderer lineRenderer, bo
var nAGO = NetworkedObjectsManager.Instance.CreateNetworkedGameObject(pivot, strokeID, strokeID);

//tag it as a drawing for ECS
pivot.tag = TagList.drawing;
pivot.tag = TagList.interactable;
entityManager.AddComponentData(nAGO.Entity, new DrawingTag { });

var bColl = pivot.GetComponent<BoxCollider>();
Expand Down Expand Up @@ -116,7 +116,7 @@ public void CreateExternalClientStrokeInstance(int strokeID, LineRenderer curren
NetworkedGameObject nAGO = NetworkedObjectsManager.Instance.CreateNetworkedGameObject(pivot, strokeID, strokeID, true);

//overide interactable tag when creatingNetworkGameObject since we are not moving drawings only deleting them
pivot.tag = TagList.drawing;
pivot.tag = TagList.interactable;
//tag created drawing object will be useful in the future for having items with multiple tags
entityManager.AddComponentData(nAGO.Entity, new DrawingTag { });

Expand Down
15 changes: 13 additions & 2 deletions Komodo/Assets/WebGLTemplates/KomodoWebXRFullView2020/relay.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
// 'esversion: 6'

// Replace these with your own server's URLs.
// Remember: also change Assets\Packages\KomodoCore\Hidden~\WebGLTemplates\KomodoWebXRFullView2020\relay.js if you intend for the changes to be reflected in projects that use the package. If you are reading this from inside a build folder, you can change this file as you please.

// Remember: also change Assets\WebGLTemplates\KomodoWebXRFullView2020\relay.js
// Tip: if you need to change this on-the-fly, you can edit this file without rebuilding. It's also possible to use the inspector to inspect the VR frame and call `window.RELAY_API_BASE_URL="<your-server-url>"`, if for some reason you need to do that in real time.

/*
* ---------------------------------------------------------------------------------
* CONFIG
* ---------------------------------------------------------------------------------
*/

// Replace these with your own server's URLs.

var RELAY_BASE_URL = "http://localhost:3000";
Expand All @@ -15,6 +20,12 @@ var VR_BASE_URL = "http://localhost:8123"; //TODO -- change this to a better def
var sync = null;
var chat = null;

/*
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: move this above the global sync and chat variables

* ---------------------------------------------------------------------------------
* FUNCTIONALITY
* ---------------------------------------------------------------------------------
*/

/**
* Get the URL parameters
* source: https://css-tricks.com/snippets/javascript/get-url-variables/
Expand Down