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

[Question] Do not impart the based object's velocity #632

Open
KristofMorva opened this issue Apr 13, 2023 · 6 comments
Open

[Question] Do not impart the based object's velocity #632

KristofMorva opened this issue Apr 13, 2023 · 6 comments

Comments

@KristofMorva
Copy link

Hey there!

Sorry if this is a trivial question, I'm an absolute layman when it comes to PhysX (3.4): is it possible to not impart linear and angular velocity from a specific object in user-land code? So for example if I have a platform, and it stops suddenly, I'd like every object on it to remain in place and not impart the velocity of the platform they are based on (but I'd like the platform to be able to transport them).

Again, sorry for such an unprofessional question, I hope this is the right place for these.

@preist-nvidia
Copy link
Collaborator

One option would be to set the object velocities to zero when you stop the (I assume kinematic) platform.

@KristofMorva
Copy link
Author

One option would be to set the object velocities to zero when you stop the (I assume kinematic) platform.

Thank you @preist-nvidia, that however has the undesired side effect of also stopping even if another force was applied to the object (which I'd like to keep). I have attempted to apply just enough counter-force to try to balance it, but it seems to be unstable, especially when the kinematic platform does not stop immediately, but with some transition. Knowing exactly how much linear and angular counter-force to apply seems non-trivial. I had hoped that PhysX has a nice option for it somewhere that I just can't seem to be able to find :')

@preist-nvidia
Copy link
Collaborator

Are you controlling the kinematic slow-down? Could you not apply the corresponding per-sim-step forces to the objects on the platform then?

@KristofMorva
Copy link
Author

Are you controlling the kinematic slow-down? Could you not apply the corresponding per-sim-step forces to the objects on the platform then?

Hey @preist-nvidia, yes I do control the kinematic movement; however, I don't have a deep enough physics knowledge to calculate how much angular counter-force I should apply when the platform slows down (for linear velocity, it's fairly straightforward), especially considering fraction / restitution and whatnot (also, the platform is not sub-stepped, while the physics is, which might complicate it further). Or is this trivial, am I missing something obvious?

@preist-nvidia
Copy link
Collaborator

preist-nvidia commented Apr 19, 2023

What effect do these other forces that may be applied on the objects on the platform have?

@KristofMorva
Copy link
Author

What effect do these other forces that may be applied on the objects on the platform have?

@preist-nvidia any number of forces could be applied from any direction, so i.e. there could be a force that actually pushes the object down, the object could be in constant movement (i.e. rolling in-between two forces), it might have no forces applied but still in movement (i.e. it's a sphere that's rolling due to some force that was applied before getting onto the platform), etc. In all these cases, I'd like to keep the movement of the object when the kinematic platform stops.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants