michael.zhang Posted August 17, 2011 Share Posted August 17, 2011 Hello, I've searched the entire samples etc. for any example of how to use the getContactDepth, getContactNormal, etc. methods. However, there is only one sample: callbacks_02.cpp which doesn't actually use or do anything with the result of the functions. I am currently attempting to scale the contact normal by the contact depth, and translating the colliding body by that vector. This doesn't seem to work. Contact depth tends to be an extremely small value. What exactly is contact depth? Is it the depth by which the body has penetrated the other? What about getContactTime? It seems to always return 0. Michael Zhang Link to comment
michael.zhang Posted August 18, 2011 Author Share Posted August 18, 2011 I have gotten to the contactNormal and contactDepth resolution approach to work. I was making a mistake in a transformation into a different space (the space in which movement is defined for my character). Still interested in why getContactTime is always 0. Or, general information regarding smooth natural looking contact resolution, since waiting on contact collision before moving it back causes this sort of stuttering effect. Link to comment
manguste Posted August 19, 2011 Share Posted August 19, 2011 getContactTime() is for CCD only. It returns the time between the current physics simulation tick (that would be the zero time point) and the moment when a sphere or a capsule hit an obstacle (between physics ticks). For noncontinuous collision detection 0 is always returned. Contact depth is simply how far the body has penetrated an obstacle along the contact normal (measured in units). Link to comment
michael.zhang Posted August 19, 2011 Author Share Posted August 19, 2011 Well, I am using a Capsule with the Continuous checkbox checked in the node editor. Still getting contactTime = 0 when I respond to a contact callback. Link to comment
manguste Posted August 24, 2011 Share Posted August 24, 2011 The body velocity could be too low to return non-zero contact time. Link to comment
ulf.schroeter Posted August 24, 2011 Share Posted August 24, 2011 Still getting contactTime = 0 when I respond to a contact callback. Michael, not sure, but might be related to the fact that you are handling contact data evaluation not directly within contact callback triggered from asynchronous physics thread but at a later point in time within world update/flush() Link to comment
Recommended Posts