Skip to content

Commit

Permalink
refactor: remove unused physx function
Browse files Browse the repository at this point in the history
  • Loading branch information
luzhuang committed Jan 7, 2025
1 parent 42d0927 commit 650f82a
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 114 deletions.
9 changes: 0 additions & 9 deletions packages/design/src/physics/IDynamicCollider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,12 @@ export interface IDynamicCollider extends ICollider {
*/
getWorldTransform(outPosition: Vector3, outRotation: Quaternion): void;

/**
* Get the linear damping coefficient.
*/
getLinearDamping(): number;

/**
* Sets the linear damping coefficient.
* @param value - Linear damping coefficient
*/
setLinearDamping(value: number): void;

/**
* Get the angular damping coefficient.
*/
getAngularDamping(): number;
/**
* Sets the angular damping coefficient.
* @param value - Angular damping coefficient
Expand Down
20 changes: 0 additions & 20 deletions packages/physics-lite/src/LiteDynamicCollider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,6 @@ export class LiteDynamicCollider extends LiteCollider implements IDynamicCollide
throw "Physics-lite don't support isSleeping. Use Physics-PhysX instead!";
}

/**
* {@inheritDoc IDynamicCollider.getAngularDamping }
*/
getAngularDamping(): number {
throw "Physics-lite don't support getAngularDamping. Use Physics-PhysX instead!";
}

/**
* {@inheritDoc IDynamicCollider.setAngularDamping }
*/
Expand Down Expand Up @@ -147,12 +140,6 @@ export class LiteDynamicCollider extends LiteCollider implements IDynamicCollide
Logger.error("Physics-lite don't support setIsKinematic. Use Physics-PhysX instead!");
}

/**
* {@inheritDoc IDynamicCollider.setLinearDamping }
*/
getLinearDamping(): number {
throw "Physics-lite don't support getLinearDamping. Use Physics-PhysX instead!";
}
/**
* {@inheritDoc IDynamicCollider.setLinearDamping }
*/
Expand Down Expand Up @@ -189,13 +176,6 @@ export class LiteDynamicCollider extends LiteCollider implements IDynamicCollide
Logger.error("Physics-lite don't support setMaxAngularVelocity. Use Physics-PhysX instead!");
}

/**
* {@inheritDoc IDynamicCollider.setMaxDepenetrationVelocity }
*/
getMaxDepenetrationVelocity(): number {
throw "Physics-lite don't support getMaxDepenetrationVelocity. Use Physics-PhysX instead!";
}

/**
* {@inheritDoc IDynamicCollider.setMaxDepenetrationVelocity }
*/
Expand Down
58 changes: 58 additions & 0 deletions packages/physics-physx/libs/physx.no-wasm.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/physics-physx/libs/physx.release.js

Large diffs are not rendered by default.

60 changes: 0 additions & 60 deletions packages/physics-physx/libs/physx.release.js.js

This file was deleted.

Binary file modified packages/physics-physx/libs/physx.release.wasm
Binary file not shown.
21 changes: 0 additions & 21 deletions packages/physics-physx/src/PhysXDynamicCollider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,13 @@ export class PhysXDynamicCollider extends PhysXCollider implements IDynamicColli
this._pxActor = physXPhysics._pxPhysics.createRigidDynamic(transform);
}

/**
* {@inheritDoc IDynamicCollider.getLinearDamping }
*/
getLinearDamping(): number {
return this._pxActor.getLinearDamping();
}

/**
* {@inheritDoc IDynamicCollider.setLinearDamping }
*/
setLinearDamping(value: number): void {
this._pxActor.setLinearDamping(value);
}

/**
* {@inheritDoc IDynamicCollider.getAngularDamping }
*/
getAngularDamping(): number {
return this._pxActor.getAngularDamping();
}

/**
* {@inheritDoc IDynamicCollider.setAngularDamping }
*/
Expand Down Expand Up @@ -148,13 +134,6 @@ export class PhysXDynamicCollider extends PhysXCollider implements IDynamicColli
this._pxActor.setMaxAngularVelocity(MathUtil.degreeToRadian(value));
}

/**
* {@inheritDoc IDynamicCollider.getMaxDepenetrationVelocity }
*/
getMaxDepenetrationVelocity(): number {
return this._pxActor.getMaxDepenetrationVelocity();
}

/**
* {@inheritDoc IDynamicCollider.setMaxDepenetrationVelocity }
*/
Expand Down
4 changes: 2 additions & 2 deletions packages/physics-physx/src/PhysXPhysics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ export class PhysXPhysics implements IPhysics {
}

if (runtimeMode == PhysXRuntimeMode.JavaScript) {
script.src = `https://mdn.alipayobjects.com/rms/afts/file/A*rnDeR58NNGoAAAAAAAAAAAAAARQnAQ/physx.release.js.js`;
script.src = `https://mdn.alipayobjects.com/rms/afts/file/A*yYWPSZFhS_0AAAAAAAAAAAAAARQnAQ/physx.no-wasm.js`;

Check warning on line 93 in packages/physics-physx/src/PhysXPhysics.ts

View check run for this annotation

Codecov / codecov/patch

packages/physics-physx/src/PhysXPhysics.ts#L93

Added line #L93 was not covered by tests
} else if (runtimeMode == PhysXRuntimeMode.WebAssembly) {
script.src = `https://mdn.alipayobjects.com/rms/afts/file/A*04GyRKeSJw4AAAAAAAAAAAAAARQnAQ/physx.release.js`;
script.src = `https://mdn.alipayobjects.com/rms/afts/file/A*LRfCQ4VcCFQAAAAAAAAAAAAAARQnAQ/physx.release.js`;
}
});

Expand Down

0 comments on commit 650f82a

Please sign in to comment.