Hi i made my character walk in my world, collision is working on trimesh and everything but i still have a problem
my character is not walking in a smooth way… it shakes when it walks as if it is really hard to do it. I reduced friction but with this my character takes too long to stop.
I thought about setting its vel to zero when it is on the ground and no key is pressed but it sounded like a bad solution… is this the right way? or you guys have another suggestion?
obs: There is a way to know what objects collided? I am using autoCollide feature and couldnt find in Reference a function that could do that. If i want to know that i have to use autoCallback?
Im doing collisions like this:
56 def checkCollisions (self, task):
59 for ent in self.objectList:
66 return Task.cont
I see you’re using globalClock.getDt() as timestep, which is basically fine but ODE works best with a constant timestep. Try making your timestep more constant. More information on that can be found here:
panda3d.org/manual/index.php/Simul … sics_World
To find out which objects collided, iterate through the ContactJoints in your contactgroup after having called autoCollide.
I think you can then retrieve the bodies using getBody(0) and getBody(1), consult the API reference for more info.
thanks a lot pro-soft the collisions are now pretty smooth.
I couldnt find documentation about this function… on reference section they are all undocummented. Is there another site?
to illustrate my problem i posted this video on youtube. I think that to correct that i only have to dont put forces while the fox is not in contact with the ground.
This video is just to show you guys the progress with my project.
I’ve worked with PyODE before and the way we moved our character around is with addForce. I’m not sure if this is the best way to do it though, we also had problems with having nice air movement. I think the recommended way of moving a character around is with a motor, although I’m not quite sure how to do this yet. I’m trying to implement a car simulation myself but the motors are kinda driving me crazy.
I’m not quite sure how to check if your character is in contact with the level geometry. You can’t get the contact joints from the OdeJointGroup and the OdeUtil class doesn’t seem to check for connections that are made with contact joints.
i set a maxVel parameter and now it is much better… im changing some options and i am almost getting there!
later i will post more videos
ps. i still want to know whether the fox is making contact with the terrain or not.
I’ve been coming up against a variation of this same problem, how to get contactjoint’s from panda’s ODE system. I’ve been trying different methods but unfortunately I can’t seem to make any headway. An alternate method you can use is to use panda’s collision system for checking if you model is touching the ground. There is a blueprint up for discussion on having future builds of panda have a way to make your own near callback which could solve this problem, but thats not immediately helpful for you.