Skip to content

Commit

Permalink
AmmoPhysics: Moved drawUsage logic to example.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Apr 20, 2021
1 parent 4a580e0 commit 1da44f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion examples/jsm/physics/AmmoPhysics.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ async function AmmoPhysics() {

if ( mass > 0 ) {

mesh.instanceMatrix.setUsage( 35048 ); // THREE.DynamicDrawUsage = 35048
meshes.push( mesh );

meshMap.set( mesh, bodies );
Expand Down
2 changes: 2 additions & 0 deletions examples/physics_ammo_instancing.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@

const geometryBox = new THREE.BoxGeometry( 0.1, 0.1, 0.1 );
boxes = new THREE.InstancedMesh( geometryBox, material, 100 );
boxes.instanceMatrix.setUsage( THREE.DynamicDrawUsage ); // will be updated every frame
boxes.castShadow = true;
boxes.receiveShadow = true;
scene.add( boxes );
Expand All @@ -90,6 +91,7 @@

const geometrySphere = new THREE.IcosahedronGeometry( 0.075, 3 );
spheres = new THREE.InstancedMesh( geometrySphere, material, 100 );
spheres.instanceMatrix.setUsage( THREE.DynamicDrawUsage ); // will be updated every frame
spheres.castShadow = true;
spheres.receiveShadow = true;
scene.add( spheres );
Expand Down

0 comments on commit 1da44f6

Please sign in to comment.