diff --git a/templates/room.hbs b/templates/room.hbs index da9f0cb8d2187fc4a74f509e2735c26f97ec5059..5383036521d2c171b6714babb7129c20dbacbbb4 100644 --- a/templates/room.hbs +++ b/templates/room.hbs @@ -117,30 +117,44 @@ scale="6 6 6" ></a-entity> </script> + <script id="physics-cube" type="text/html"> - <a-box class="collidable" remote-dynamic-body="counter: #counter" physics-collider scale="0.25 0.25 0.25" material="color: green"></a-box> + <a-box + class="collidable" + remote-dynamic-body="counter: #counter" + scale="0.25 0.25 0.25" + material="color: green" + ></a-box> </script> + + <a-mixin id="super-hands" + super-hands="colliderEvent: collisions; colliderEventProperty: els; + colliderEndEvent: collisions; colliderEndEventProperty: clearedEls; + grabStartButtons: action_grab; grabEndButtons: action_release; + stretchStartButtons: action_grab; stretchEndButtons: action_release; + dargDropStartButtons: action_grab; dragDropEndButtons: action_release; + " + collision-filter="collisionForces: false" + physics-collider + ></a-mixin> </a-assets> <a-entity id="counter" networked-counter="max: 3; ttl: 120"></a-entity> - <a-entity id="cube-spawner" super-spawner="template: #physics-cube; spawn_position: 2.5 1.2 0;" position="2.5 1.2 0" > - <a-box material="color: blue" class="collidable" physics-collider scale="0.25 0.25 0.25"></a-box> + <a-entity + id="cube-spawner" + super-spawner="template: #physics-cube; spawn_position: 2.5 1.2 0;" + position="2.5 1.2 0" + > + <a-box material="color: blue" class="collidable" scale="0.25 0.25 0.25"></a-box> </a-entity> <a-sphere id="3d-cursor" material="color: #00EFFF" radius=0.02 - physics-collider - collision-filter="collisionForces: false" static-body="shape: sphere;" - super-hands="colliderEvent: collisions; colliderEventProperty: els; - colliderEndEvent: collisions; colliderEndEventProperty: clearedEls; - grabStartButtons: action_grab; grabEndButtons: action_release; - stretchStartButtons: action_grab; stretchEndButtons: action_release; - dargDropStartButtons: action_grab; dragDropEndButtons: action_release; - " + mixin="super-hands" ></a-sphere> <!-- Player Rig --> @@ -153,14 +167,14 @@ > <a-entity id="head" - camera="userHeight: 1.6" + camera personal-space-bubble look-controls networked="template: #head-template; showLocalTemplate: false;" > <a-entity cursor-hand="cursor: #3d-cursor" - position="0 -0.1 0" + position="0 0 0" raycaster="objects: .collidable; direction: 0 0 -1; recursive: false;" ></a-entity> </a-entity> @@ -181,16 +195,8 @@ haptic-feedback teleport-controls="cameraRig: #player-rig; teleportOrigin: #head; button: action_teleport_" networked="template: #left-hand-template;" - - physics-collider - collision-filter="collisionForces: false" static-body="shape: sphere; sphereRadius: 0.02" - super-hands="colliderEvent: collisions; colliderEventProperty: els; - colliderEndEvent: collisions; colliderEndEventProperty: clearedEls; - grabStartButtons: action_grab; grabEndButtons: action_release; - stretchStartButtons: action_grab; stretchEndButtons: action_release; - dargDropStartButtons: action_grab; dragDropEndButtons: action_release; - " + mixin="super-hands" > <a-entity id="watch" @@ -211,16 +217,7 @@ hitEntity: #telepor-indicator; button: action_teleport_;" networked="template: #right-hand-template;" - - physics-collider - collision-filter="collisionForces: false" - static-body="shape: sphere; sphereRadius: 0.02" - super-hands="colliderEvent: collisions; colliderEventProperty: els; - colliderEndEvent: collisions; colliderEndEventProperty: clearedEls; - grabStartButtons: action_grab; grabEndButtons: action_release; - stretchStartButtons: action_grab; stretchEndButtons: action_release; - dargDropStartButtons: action_grab; dragDropEndButtons: action_release; - " + mixin="super-hands" ></a-entity> </a-entity>