Kinematic Target is applied one frame delayed #35
-
PxRigidDynamic->setKinematicTarget applies the target transform one frame delayed. Reproduction: After looking through the source it may happen because of the below reasoning in the comment: As a static physics deltatime is used in many games, a solution would be to add a flag |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
It sounds like the debug visualization is not updated after the first step, i.e. only at the beginning of the step, maybe? Kinematic actors are expected to not attain the kinematic target immediately, but only at the end of the next simulation step. So this snippet:
will print:
You can teleport the kinematic any time by calling |
Beta Was this translation helpful? Give feedback.
-
First of all, thanks a lot for your reply and for the amazing Physx5 release.
Is there a benefit for the user in doing so? It seems for me rather like an oversight, especially when When applying the Kinematic target one frame delayed, then you are no more synced with the games 3d animations that drive
This works nicely to remove the one frame delay but breaks collision response because the Linear and Angular Velocity If you could supply a setGlobalPose method that allows to specify linear and angular velocity then this would also be a solution to this issue. |
Beta Was this translation helpful? Give feedback.
-
Yes, we infer the velocity of the kinematic from the current pose and the kinematic target, and use this velocity for interactions with dynamics.
Is that not a matter of just delaying the animation too?
Given that we compute the kinematics' velocities from current and target pose, it does not make sense to supply velocities. |
Beta Was this translation helpful? Give feedback.
-
Hey Fred, these kinds of behavior details are important. Its hard to argue that the current approach is wrong given that as far as I can remember kinematics in PhysX have always worked like this, and its the way all kinematic PhysX in e.g. Unity and Unreal works, so it has been very broadly used and we haven't had any big complaints. That is not to say that the behavior you ask for is necessarily less valid. I suggest you try to implement this alternate behavior with a flag like you suggest yourself, provide a PR and see if anyone else prefers it -- after all that is what the source is for. |
Beta Was this translation helpful? Give feedback.
Hey Fred,
these kinds of behavior details are important. Its hard to argue that the current approach is wrong given that as far as I can remember kinematics in PhysX have always worked like this, and its the way all kinematic PhysX in e.g. Unity and Unreal works, so it has been very broadly used and we haven't had any big complaints.
That is not to say that the behavior you ask for is necessarily less valid. I suggest you try to implement this alternate behavior with a flag like you suggest yourself, provide a PR and see if anyone else prefers it -- after all that is what the source is for.