Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Commit

Permalink
Merge pull request #156 from AltspaceVR/bug/collider-updates
Browse files Browse the repository at this point in the history
Improved test for collider updates
  • Loading branch information
brianpeiris authored Nov 11, 2016
2 parents 9406142 + 1a87c0d commit c0afd0f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .agignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
examples/steamvr/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,24 @@
return boxMesh;
}

makeBox(-boxSize * 0.6, 0);
// This box just changes its color when you click on it
makeBox(boxSize * 0.6, -boxSize * 1.2);

// This box flips between having a collider and not having a collider
var hitboxlessBoxMesh = makeBox(boxSize * 0.6, 0);
hitboxlessBoxMesh.userData.altspace = {collider: {enabled: false}};
hitboxlessBoxMesh.material.color.r = 1;
var collider = hitboxlessBoxMesh.userData.altspace.collider;

// This box indicates whether the above box has a collider or not
var indicatorBox = makeBox(boxSize * 0.6, boxSize * 1.2);
indicatorBox.visible = false;

// This box's material should never become visible
var invisibleMaterialBox = makeBox(boxSize * 1.8, 0);
invisibleMaterialBox.material.visible = false;
invisibleMaterialBox.userData.altspace = {collider: {enabled: true}};

sim.renderer.render(sim.scene, sim.camera);

var lastFlip = 0;
Expand All @@ -55,7 +65,7 @@
}
if (performance.now() - lastFlip > 3000) {
collider.enabled = !collider.enabled;
hitboxlessBoxMesh.material.color.r = collider.enabled ? 0 : 1;
indicatorBox.visible = collider.enabled;
lastFlip = performance.now();
}
sim.renderer.render(sim.scene, sim.camera);
Expand Down
2 changes: 1 addition & 1 deletion examples/tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
'renderer-tests.html',
'gamepad-and-focus.html',
'visibility.html',
'disable-hitbox.html',
'disable-hitbox-collider.html',
'material-side.html',
'transparency.html',
'transparency-stress.html',
Expand Down

0 comments on commit c0afd0f

Please sign in to comment.