Open ghost opened 5 months ago
You made a typo :smile:
PhysX enum values are prefixed with a lower case 'e'. It has to be eENABLE_ACTIVE_ACTORS
instead of ENABLE_ACTIVE_ACTORS
:
scene.setFlag(PhysX.PxSceneFlagEnum.eENABLE_ACTIVE_ACTORS, true)
It's a bit odd that this is not an error. I assume the wasm runtime simply treats the undefined as a 0 and sets some other flag instead.
we have some faulty typescript types, here is the declaration in the physx-js-webidl.wasm.d.ts
file.
enum PxSceneFlagEnum {
'ENABLE_ACTIVE_ACTORS',
[...]
}
and faulty me, should have researched a little bit more.
Thanks again for responding to my question, have a great day!
Hey, i hope you are doing well
introduction
I was looking the physx official documentation and stumbled upon the active actors API, it creates a list of rigid bodies that moved in the last iteration, it is pretty handy and provides a slight performance improvement.
https://nvidia-omniverse.github.io/PhysX/physx/5.3.1/docs/RigidBodyDynamics.html?highlight=active%20actor#active-actors
problem
When consuming the api like this.
And checking if there are any active actors like this.
It always returns
0
no matter what.reproducible example
Here is the modified example scene to reflect this bug. I added some comments indicating changes and added a console.log for logging activeActors.size()