Skip to content

Commit

Permalink
modify physics examples
Browse files Browse the repository at this point in the history
  • Loading branch information
stemkoski committed Mar 17, 2022
1 parent 90b6c31 commit e77eaa5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
2 changes: 1 addition & 1 deletion physX.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</a-assets>

<!-- camera -->
<a-entity camera look-controls wasd-controls="acceleration:10" position="0 1.6 0"></a-entity>
<a-entity camera look-controls wasd-controls="acceleration: 4" position="0 1.6 0"></a-entity>

<!-- Floor -->
<a-box physx-body="type: static;"
Expand Down
34 changes: 23 additions & 11 deletions quest-physics.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<body>

<script>
// if raycaster is pointing at this object, press trigger to change color

AFRAME.registerComponent("physics-grab", {
init: function ()
{
Expand Down Expand Up @@ -88,7 +88,8 @@
class="environmentGround"
position="0 0.02 0"
width="20" depth="20" height="0.1"
material="src: #crate; repeat: 10 10;">
material="src: #crate; repeat: 10 10;"
shadow="receive: true;">
</a-box>

<!-- Walls -->
Expand Down Expand Up @@ -116,6 +117,16 @@
material="src: #crate; repeat: 5 1;">
</a-box>

<!-- Ramp -->
<a-box

physx-body="type: static;"
depth="5" width="5"
position="0 1 -10"
rotation="45 0 0"
material="src: #crate; color: #888888; repeat: 5 1;">
</a-box>

<!-- Dynamic objects -->

<a-box physx-body="type: dynamic; highPrecision: true;"
Expand Down Expand Up @@ -168,7 +179,8 @@
physics-grab
position="1 6 -5"
radius="0.5"
material="src:#ball; color:red;">
material="src:#ball; color:red;"
shadow="cast: true;">
</a-sphere>

<a-sphere physx-body="type: dynamic;" physx-material="restitution: 0.8;"
Expand Down Expand Up @@ -215,32 +227,32 @@

<a-box
physx-body="type: kinematic;"
width="0.1" depth="1" height="4"
position = "-1 1 -2"
width="0.1" depth="4" height="1"
position = "-9 1 -4"
color = "#BBBBBB"
raycaster-target="canGrab: true;">
</a-box>

<a-box
physx-body="type: kinematic;"
width="0.1" depth="1" height="4"
position = "1 1 -2"
width="0.1" depth="4" height="1"
position = "9 1 -4"
color = "#BBBBBB"
raycaster-target="canGrab: true;">
</a-box>

<a-box
physx-body="type: kinematic;"
width="0.1" depth="1" height="4"
position = "-3 1 -2"
width="0.1" depth="4" height="1"
position = "-9 1 4"
color = "#BBBBBB"
raycaster-target="canGrab: true;">
</a-box>

<a-box
physx-body="type: kinematic;"
width="0.1" depth="1" height="4"
position = "3 1 -2"
width="0.1" depth="4" height="1"
position = "9 1 4"
color = "#BBBBBB"
raycaster-target="canGrab: true;">
</a-box>
Expand Down

0 comments on commit e77eaa5

Please sign in to comment.