Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script function for physical response #378

Closed
yangfengzzz opened this issue Jul 12, 2021 · 2 comments · Fixed by #505
Closed

Script function for physical response #378

yangfengzzz opened this issue Jul 12, 2021 · 2 comments · Fixed by #505
Assignees
Labels
enhancement New feature or request high priority High priority issue physics Engine's physical system
Milestone

Comments

@yangfengzzz
Copy link
Member

yangfengzzz commented Jul 12, 2021

Collision and Trigger will produce events #33 #187 , Script component should have related functions to consume these events.

PR reviewers: @GuoLei1990 , @cptbtptpbcptdtptp , @singlecoder

@yangfengzzz yangfengzzz self-assigned this Jul 12, 2021
@yangfengzzz yangfengzzz added enhancement New feature or request physics Engine's physical system labels Jul 12, 2021
@yangfengzzz yangfengzzz added this to the 0.6 milestone Jul 12, 2021
@yangfengzzz
Copy link
Member Author

In PhysX, PxSceneDesc have some members related to callback function including PxSimulationEventCallback, PxContactModifyCallback, PxCCDContactModifyCallback, PxSimulationFilterCallback, PxBroadPhaseCallback, which contain a lot of onXXX methods like onContact and so on.

Script function is related to collision or collider which will consumer event created by PxScene.

@yangfengzzz
Copy link
Member Author

yangfengzzz commented Jul 12, 2021

When the physic scene is updated, the callbacks which are set in SceneDesc which be called and return PxContactPair. In order to be able to convert Physx objects to Typescript objects, we need to set index for PhysX and store them. In PxShape, we can set QueryFilterData, store index in it, and then when the callback returns, we can find the corresponding object based on the indicator.

@yangfengzzz yangfengzzz added the high priority High priority issue label Jul 14, 2021
@yangfengzzz yangfengzzz linked a pull request Sep 6, 2021 that will close this issue
3 tasks
@yangfengzzz yangfengzzz linked a pull request Sep 11, 2021 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high priority High priority issue physics Engine's physical system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants