In my game I wan't to put some dynamic "obstacles". These obstacles can't be affected by external forces. I mean they are physical bodies but they can't move if they get hit, although they will be rotating deliberately.
I have tried with different collision flags but none seem to do what I want.
How do I do this? How cant I tell the body it can't move?
Making Dynamic Rigid Bodies unmovable by others
-
- Posts: 12
- Joined: Mon May 10, 2010 1:59 am
Making Dynamic Rigid Bodies unmovable by others
Last edited by toglia on Wed Jun 16, 2010 10:09 am, edited 3 times in total.
-
- Posts: 12
- Joined: Mon May 10, 2010 1:59 am
Re: Making Dynamic Rigid Bodies unmovable by others or gravi
For example, If I set the Body to CF_KINEMATIC_OBJECT, they body seems to get invulnerability but then I cant move it myself. Methods like setAngularVelocity or apply Torque does not seem to work with this flag on.
EDIT: I have found I actually can move my body with setWolrdTranform method.
EDIT: I have found I actually can move my body with setWolrdTranform method.
-
- Posts: 12
- Joined: Mon May 10, 2010 1:59 am
Re: Making Dynamic Rigid Bodies unmovable by others
Hello again. This post is basically a consequence of the previous one.
I trying to port some of my physx stuff to bullet and its going great so far. I even managed to tweak the CCD variables in my actors so that no tunneling/trespassing occurred at incredible speeds.
Anyway, there is one important thing I have noticed though. In my game I have some "kinematic" actors, they cannot be moved by others but they should be able to move anything in the scene (infinite mass I guess...). I was able to simulate this in bullet by assigning zero mass to them and therefore tying me up to setWorldTransform to move them. So far so good.
But what I found is that I cannot be too creative when moving these kinematic actors cause tunneling will certainly occur. And this makes sense cause if my delta Position is too big and my actor is too small, the kinematic body wont be able to touch the actor at all. This of course is not the case of dynamic actors accompanied with physics actions like applyForce, Torque etc, where this is prevented.
So basically, What I want is to be able to use applyForce/Torque in my "kinematic" (infinite massed objects) so that I can prevent tunneling even when moving them around, or is there another way?
EDIT: In physx I could lift a tag that lock solidly the position of my actors, or the rotations, this is very helpful for what I'm doing.
I trying to port some of my physx stuff to bullet and its going great so far. I even managed to tweak the CCD variables in my actors so that no tunneling/trespassing occurred at incredible speeds.
Anyway, there is one important thing I have noticed though. In my game I have some "kinematic" actors, they cannot be moved by others but they should be able to move anything in the scene (infinite mass I guess...). I was able to simulate this in bullet by assigning zero mass to them and therefore tying me up to setWorldTransform to move them. So far so good.
But what I found is that I cannot be too creative when moving these kinematic actors cause tunneling will certainly occur. And this makes sense cause if my delta Position is too big and my actor is too small, the kinematic body wont be able to touch the actor at all. This of course is not the case of dynamic actors accompanied with physics actions like applyForce, Torque etc, where this is prevented.
So basically, What I want is to be able to use applyForce/Torque in my "kinematic" (infinite massed objects) so that I can prevent tunneling even when moving them around, or is there another way?
EDIT: In physx I could lift a tag that lock solidly the position of my actors, or the rotations, this is very helpful for what I'm doing.
-
- Posts: 12
- Joined: Mon May 10, 2010 1:59 am
Re: Making Dynamic Rigid Bodies unmovable by others
Ok, so after looking for a while I think I'll be needing constraints and settings the mass really high. I'll try not to annoy you guys anymore