Skip to content

Commit

Permalink
Merge pull request #17 from diarmidmackenzie/high-precision-static-ex…
Browse files Browse the repository at this point in the history
…ceptions

setSolverIterationCounts not available on static bodies
  • Loading branch information
diarmidmackenzie authored Apr 17, 2023
2 parents 60771f3 + 889ae9c commit 048d731
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/physx.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/physx.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@c-frame/physx",
"version": "0.1.1",
"version": "0.1.2",
"description": "Physics for A-Frame using Nvidia PhysX",
"main": "index.js",
"directories": {
Expand Down
3 changes: 2 additions & 1 deletion src/physics.js
Original file line number Diff line number Diff line change
Expand Up @@ -1048,11 +1048,12 @@ AFRAME.registerComponent('physx-body', {

if (this.data.highPrecision)
{
this.rigidBody.setSolverIterationCounts(4, 2);
if (this.data.type === 'dynamic') {
this.rigidBody.setSolverIterationCounts(4, 2);
this.rigidBody.setRigidBodyFlag(PhysX.PxRigidBodyFlag.eENABLE_CCD, true)
}
else if (this.data.type === 'kinematic') {
this.rigidBody.setSolverIterationCounts(4, 2);
this.rigidBody.setRigidBodyFlag(PhysX.PxRigidBodyFlag.eENABLE_SPECULATIVE_CCD, true);
}
}
Expand Down

0 comments on commit 048d731

Please sign in to comment.