Browse Source

new level and item fix

master
Cailean Finn 2 weeks ago
parent
commit
5580487e48
  1. 2
      data/drawings.json
  2. 4
      js/Player.js
  3. 10
      js/main.js
  4. 66
      public/json/ItemsNew.json
  5. BIN
      public/models/wip-world-exr-e.glb
  6. BIN
      public/models/wip-world-exr.glb

2
data/drawings.json

File diff suppressed because one or more lines are too long

4
js/Player.js

@ -20,7 +20,7 @@ export class Player {
this.rigibody = null; this.rigibody = null;
this.collider = null; this.collider = null;
this.moveSpeed = 20; this.moveSpeed = 40;
this.mouseSensitivity = 0.002; this.mouseSensitivity = 0.002;
this.maxInteractionDistance = 200.0; this.maxInteractionDistance = 200.0;
@ -609,7 +609,7 @@ export class Player {
if (this.enableInput) { if (this.enableInput) {
if (this.attachedItem && !this.renderer.xr.isPresenting) { // Only lock camera for desktop if (this.attachedItem && !this.renderer.xr.isPresenting) { // Only lock camera for desktop
this._lockCameraForAttachedItem(); this._lockCameraForAttachedItem();
} else if (!this.renderer.xr.isPresenting) { // Only update movement if not in VR } else if (!this.renderer.xr.isPresenting) { // Only update movement if not in VR
this._updatePlayerMovement(delta); this._updatePlayerMovement(delta);
} }

10
js/main.js

@ -24,7 +24,7 @@ import { ModelLoader } from './ModelLoader';
let scene, renderer; let scene, renderer;
let player; let player;
let rapierWorld, debugLines, itemManager; let rapierWorld, debugLines, itemManager;
let debugRapier = false; let debugRapier = true;
let isPaused = false; let isPaused = false;
let floorGridSize = new THREE.Vector2(10, 200); let floorGridSize = new THREE.Vector2(10, 200);
const worldScale = 20.0; const worldScale = 20.0;
@ -91,7 +91,7 @@ async function init() {
scene.add(player.playerRig);; scene.add(player.playerRig);;
/* Load Items/Content */ /* Load Items/Content */
loadWorldModel("models/demo-world-comp.glb"); loadWorldModel("models/wip-world-exr.glb");
instructions.innerHTML = "Click to play"; instructions.innerHTML = "Click to play";
instructions.addEventListener( 'click', function () { instructions.addEventListener( 'click', function () {
@ -133,8 +133,6 @@ async function init() {
} }
} }
}); });
//console.log(scene)
} }
async function animate() { async function animate() {
@ -454,7 +452,7 @@ async function loadWorldModel(modelUrl) {
rapierWorld, rapierWorld,
staticWorldGroup, staticWorldGroup,
player, player,
true, false,
object.position, object.position,
1, 1,
object.name || 'static-world-object', object.name || 'static-world-object',
@ -489,7 +487,7 @@ async function loadWorldModel(modelUrl) {
}); });
itemManager = new ItemManager( itemManager = new ItemManager(
"json/Items.json", "json/ItemsNew.json",
preloadedObjectsMap, preloadedObjectsMap,
dynamicGroupsMap, dynamicGroupsMap,
scene, scene,

66
public/json/ItemsNew.json

@ -2,88 +2,88 @@
"items": [ "items": [
{ {
"id": 0, "id": 0,
"groupId": "reddit_Sensordata", "groupId": "group_reddit_Sensordata",
"name": "Reddit_RawSensorData", "name": "dyBall",
"contentType": "image", "contentType": "image",
"file": "./images/reddit_Sensordata/Reddit_RawSensorData.png", "file": "./images/reddit_Sensordata/Reddit_RawSensorData.png",
"links": [] "links": []
}, },
{ {
"id": 1, "id": 1,
"groupId": "reddit_Dataconcerns", "groupId": "group_reddit_Dataconcerns",
"name": "reddit_Dataconcerns_0", "name": "dyDetergent",
"contentType": "image", "contentType": "image",
"file": "./images/reddit_Dataconcerns.png", "file": "./images/reddit_Dataconcerns/reddit_Dataconcerns_0.png",
"links": [] "links": []
}, },
{ {
"id": 2, "id": 2,
"groupId": "reddit_Dataconcerns", "groupId": "group_reddit_Dataconcerns",
"name": "reddit_Dataconcerns_1", "name": "dyToy",
"contentType": "image", "contentType": "image",
"file": "./images/reddit_Dataconcerns.png", "file": "./images/reddit_Dataconcerns/reddit_Dataconcerns_1.png",
"links": [] "links": []
}, },
{ {
"id": 3, "id": 3,
"groupId": "reddit_Dataconcerns", "groupId": "group_reddit_Dataconcerns",
"name": "reddit_Dataconcerns_2", "name": "dyCan",
"contentType": "image", "contentType": "image",
"file": "./images/reddit_Dataconcerns.png", "file": "./images/reddit_Dataconcerns/reddit_Dataconcerns_2.png",
"links": [] "links": []
}, },
{ {
"id": 4, "id": 4,
"groupId": "reddit_Dataconcerns", "groupId": "group_reddit_Dataconcerns",
"name": "reddit_Dataconcerns_3", "name": "dyBottle",
"contentType": "image", "contentType": "image",
"file": "./images/reddit_Dataconcerns.png", "file": "./images/reddit_Dataconcerns/reddit_Dataconcerns_3.png",
"links": [] "links": []
}, },
{ {
"id": 5, "id": 5,
"groupId": "reddit_Dataconcerns", "groupId": "group_reddit_Dataconcerns",
"name": "reddit_Dataconcerns_4", "name": "dyChair",
"contentType": "image", "contentType": "image",
"file": "./images/reddit_Dataconcerns.png", "file": "./images/reddit_Dataconcerns/reddit_Dataconcerns_4.png",
"links": [] "links": []
}, },
{ {
"id": 6, "id": 6,
"groupId": "reddit_Dataconcerns", "groupId": "group_reddit_Dataconcerns",
"name": "reddit_Dataconcerns_5", "name": "dyCig",
"contentType": "image", "contentType": "image",
"file": "./images/reddit_Dataconcerns.png", "file": "./images/reddit_Dataconcerns/reddit_Dataconcerns_5.png",
"links": [] "links": []
}, },
{ {
"id": 7, "id": 7,
"groupId": "reddit_ChangeOS", "groupId": "group_reddit_ChangeOS",
"name": "reddit_ChangeOS_0", "name": "dyPan",
"contentType": "image", "contentType": "image",
"file": "./images/reddit_Change_OS.png", "file": "./images/reddit_ChangeOS/reddit_ChangeOS_0.png",
"links": [] "links": []
}, },
{ {
"id": 8, "id": 8,
"groupId": "reddit_ChangeOS", "groupId": "group_reddit_ChangeOS",
"name": "reddit_ChangeOS_1", "name": "dySoda",
"contentType": "image", "contentType": "image",
"file": "./images/reddit_Change_OS.png", "file": "./images/reddit_ChangeOS/reddit_ChangeOS_0.png",
"links": [] "links": []
}, },
{ {
"id": 9, "id": 9,
"groupId": "XR_FLOSS_Init", "groupId": "group_XRFLOSS",
"name": "XR_FLOSS_Init", "name": "dyLettuce",
"contentType": "text", "contentType": "text",
"file": "./text/XR_FLOSS_Init.md", "file": "./texts/XR_FLOSS_Init.md",
"links": [] "links": []
}, },
{ {
"id": 10, "id": 10,
"groupId": "Quest3_root_demo", "groupId": "group_Q3Root",
"name": "Quest3_root_demo.mov", "name": "dyRifle",
"contentType": "video", "contentType": "video",
"file": "./videos/Quest3_root_demo.mov", "file": "./videos/Quest3_root_demo.mov",
"links": [] "links": []
@ -91,7 +91,7 @@
], ],
"groupLinks": [ "groupLinks": [
["Quest3_root_demo", "reddit_ChangeOS"], ["group_Q3Root", "group_reddit_ChangeOS"],
["reddit_Dataconcerns", "reddit_Sensordata"] ["group_reddit_Dataconcerns", "group_reddit_Sensordata"]
] ]
} }

BIN
public/models/wip-world-exr-e.glb (Stored with Git LFS)

Binary file not shown.

BIN
public/models/wip-world-exr.glb (Stored with Git LFS)

Binary file not shown.
Loading…
Cancel
Save