-
-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* main: Add physic unit test timeout (#1717) "v1.0.0-beta.20" Fix `PhysicManager` fixedTimeStep less than 0 bug (#1715) Fix physx unit test (#1714) Fix a series of physical system problems (#1712) Fix avoid destroyed material error (#1705) "v1.0.0-beta.19" # Conflicts: # packages/core/package.json # packages/core/src/physics/PhysicsScene.ts # packages/design/package.json # packages/draco/package.json # packages/galacean/package.json # packages/loader/package.json # packages/math/package.json # packages/physics-lite/package.json # packages/physics-lite/src/LitePhysicsManager.ts # packages/physics-physx/package.json # packages/physics-physx/src/PhysXPhysics.ts # packages/rhi-webgl/package.json # tests/package.json
- Loading branch information
Showing
14 changed files
with
378 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { Entity, CapsuleColliderShape, CharacterController } from "@galacean/engine-core"; | ||
import { Ray, Vector3 } from "@galacean/engine-math"; | ||
import { PhysXPhysics } from "@galacean/engine-physics-physx"; | ||
import { WebGLEngine } from "@galacean/engine-rhi-webgl"; | ||
import { expect } from "chai"; | ||
|
||
describe("physics collider test", function () { | ||
this.timeout(5000); | ||
|
||
let engine: WebGLEngine; | ||
let rootEntity: Entity; | ||
let controllerEntity: Entity; | ||
|
||
before(async () => { | ||
engine = await WebGLEngine.create({ canvas: document.createElement("canvas"), physics: new PhysXPhysics() }); | ||
const scene = engine.sceneManager.activeScene; | ||
rootEntity = scene.createRootEntity("root"); | ||
|
||
engine.run(); | ||
}); | ||
|
||
beforeEach(() => { | ||
rootEntity.clearChildren(); | ||
|
||
controllerEntity = rootEntity.createChild("controller"); | ||
}); | ||
|
||
it("Set Position", async () => { | ||
const physicsCapsule = new CapsuleColliderShape(); | ||
physicsCapsule.radius = 0.15; | ||
physicsCapsule.height = 0.2; | ||
const characterController = controllerEntity.addComponent(CharacterController); | ||
characterController.addShape(physicsCapsule); | ||
|
||
physicsCapsule.position = new Vector3(5, 3, 3); | ||
expect(physicsCapsule.position.x).to.equal(5); | ||
expect(physicsCapsule.position.y).to.equal(3); | ||
expect(physicsCapsule.position.z).to.equal(3); | ||
}); | ||
}); |
Oops, something went wrong.