Skip to content

Track PhysX integration follow-ups after #3025 #3038

Description

@luzhuang

Context

PR #3025 brings the current engine-side PhysX integration much closer to the semantics exposed by galacean/physX.js. While reviewing it against the local physX.js binding, a few worthwhile follow-ups came up that are not merge blockers for #3025 and are better handled as separate work.

Follow-ups

  1. Expose PxRigidBodyExt::addForceAtPos in physX.js and route DynamicCollider.applyForceAtPosition through it.

    Reason: physX.js currently binds addForce / addTorque, while the addForceAtPos binding is present but commented out in ActorBinding.h. Engine-side torque calculation is correct today, but pushing this operation back to the PhysX extension reduces long-term maintenance risk around center-of-mass, coordinate-space, and scale semantics.

    Acceptance direction: expose the binding in physX.js, add/update engine-side adapter support, and keep the existing applyForceAtPosition behavior tests passing.

  2. Add an offline/pre-cooked mesh collider path for static imported assets.

    Reason: runtime mesh cooking is useful for editor preview, hot updates, and dynamic/generated meshes. For production static collider meshes, PhysX recommends offline cooking and loading cooked streams to avoid runtime cooking cost and first-use stalls.

    Acceptance direction: imported/static model collider meshes can reuse cached cooked data, while runtime cooking remains available as a fallback for dynamic meshes.

  3. Make PhysX scene/filter contact and CCD reporting configurable.

    Reason: the current physX.js default scene desc enables CCD, keeps kinematic/static filtering pairs, and the filter shader emits contact notifications, contact points, CCD contact detection, and CCD touch notifications by default. This is a useful engine default, but projects that do not need full contact reporting should be able to avoid that overhead.

    Acceptance direction: expose engine-level PhysX options for contact/CCD reporting policy without changing the current default behavior.

Non-goals

  • This is not a blocker for fix(physics): gate contact event buffering #3025.
  • This issue should not force all three items into one implementation PR; they can be split when scoped.
  • Do not remove runtime cooking, since editor and dynamic mesh scenarios still need it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions