Skip to content

Commit

Permalink
Merge pull request #14 from galacean/feat/physics-case
Browse files Browse the repository at this point in the history
feat: opt physics case
  • Loading branch information
gz65555 authored May 17, 2024
2 parents 72e9a54 + b4d003d commit 1b305ed
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/babylon/collider-benchmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const createScene = async function () {

var boxCount = 0;
setInterval(() => {
if (boxCount > 850) return;
if (boxCount > 1000) return;

addBox(
scene,
Expand Down
5 changes: 1 addition & 4 deletions src/galacean/collider-benchmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
WebGLEngine,
} from "@galacean/engine";
import { OrbitControl } from "@galacean/engine-toolkit";
import { Stats } from "@galacean/engine-toolkit";

import { PhysXPhysics } from "@galacean/engine-physics-physx";

Expand All @@ -36,7 +35,7 @@ function init(rootEntity: Entity) {

var boxCount = 0;
setInterval(() => {
if (boxCount > 850) return;
if (boxCount > 1000) return;

addBox(
rootEntity,
Expand Down Expand Up @@ -129,8 +128,6 @@ WebGLEngine.create({ canvas: "canvas", physics: new PhysXPhysics(), graphicDevic
const pos = cameraEntity.transform.position;
pos.set(-1, 1.5, 2);
cameraEntity.transform.lookAt(new Vector3());
cameraEntity.addComponent(OrbitControl);
cameraEntity.addComponent(Stats);

// init directional light
const light = rootEntity.createChild("light");
Expand Down
2 changes: 1 addition & 1 deletion src/three/collider-benchmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ scriptPromise.then(() => {

var boxCount = 0;
setInterval(() => {
if (boxCount > 850) return;
if (boxCount > 1000) return;

addBox(
new THREE.Vector3(
Expand Down

0 comments on commit 1b305ed

Please sign in to comment.