hey, bt forum. need your help again...
issue:
1st. trying to attach ghost object to btCompoundShape. but i have no idea how to handle transform in that case.
no matter what i try, then i add btGhostObject to world it screws up physics(i would like to know why the hell it affects "real" objects collision and transformation in the first place) for objects that positioned not on (0, 0, 0) point; tried to set it's transform to same as compoundObject, identity, removing compoundObject transformation and setting it only for ghostObject.
2nd. if ignore that problem, it steel does react on collision only between static and dynamic body. if two dynamic bodies collide it doesn't report collision(but they visually do bounce).
initialization:
http://pastebin.com/W3sJEAGx //ghost object transform setup
usage:
http://pastebin.com/tKmWLfSd //not likely has something to do with the problem. 70% of code is from example and therest is pretty simple and 100% reliable.
btGhostObject attachment transform
-
- Posts: 13
- Joined: Tue Sep 13, 2011 2:20 pm
- Location: ru
-
- Posts: 168
- Joined: Tue Jan 04, 2011 11:47 pm
Re: btGhostObject attachment transform
I don't see the reason why you need to specify each object as the GhostObject, if in that way, why don't you just specify them as rigidbody, that would be simple and straight, perhaps your problems are gone.
GhostObject is designed when you want to focus on some special objects
GhostObject is designed when you want to focus on some special objects
-
- Posts: 13
- Joined: Tue Sep 13, 2011 2:20 pm
- Location: ru
Re: btGhostObject attachment transform
well that's not affecting problem. of course further i will add condition to make ghost test only for "special" objects. but that will not fix transform problems. and from reading CharacterDemo source i assume that ghost object is supposed to be attached to regular physical object(e.g. rigid body) for additional collision handling, and it should look absolutely the same no matter how many objects have ghost object attached. but in character demo it's pretty specific case so it covers really a bit of needed info. in character demo, btGhostObject used to visualize contact points for CharacterController... but there it looked like it replaces regular body or something? because i thougth you should create and add rigid body as regular and then add ghost object for that body. would be nice to see initialization example was for less specific type of collision object, multiple ghost objects.
btw my suffering is really over, i found gContactProcessedCallback enough for all needs with proper wrap(i created pretty simple wrap that stores collision info in object-space, instead of contact-point space). callbacks are obviously cheapest way of custom collision processing, wrapping for your own way of storing collisions is not cheap at all with naive implementation, but with certain optimizations(handling of redundant calls\caching) it will be, probably, superior.
so i just want to know it because of my stubborness.
btw my suffering is really over, i found gContactProcessedCallback enough for all needs with proper wrap(i created pretty simple wrap that stores collision info in object-space, instead of contact-point space). callbacks are obviously cheapest way of custom collision processing, wrapping for your own way of storing collisions is not cheap at all with naive implementation, but with certain optimizations(handling of redundant calls\caching) it will be, probably, superior.
so i just want to know it because of my stubborness.
-
- Posts: 168
- Joined: Tue Jan 04, 2011 11:47 pm
Re: btGhostObject attachment transform
Stubborn is a good thing, I am stubborn, =)Singular wrote:and from reading CharacterDemo source i assume that ghost object is supposed to be attached to regular physical object(e.g. rigid body) for additional collision handling, and it should look absolutely the same no matter how many objects have ghost object attached. but in character demo it's pretty specific case so it covers really a bit of needed info.
But what I understand about GhostObject, it is separate from RigidBody, i.e. there is no need to attatch your GhostObject to your RigidBody, and you can also combine your GhostObject with any CollisionShape you like, no matter it is Convex, Concave, or Compound.
Actually, I read the CharacterDemo, but didn't find that it attatches the GhostObject to the Character, could you please point it out for me ?
-
- Posts: 13
- Joined: Tue Sep 13, 2011 2:20 pm
- Location: ru
Re: btGhostObject attachment transform
i counted line 93 as attachment.
-
- Posts: 168
- Joined: Tue Jan 04, 2011 11:47 pm
Re: btGhostObject attachment transform
Sorry, but I didn't catch your point....Singular wrote:i counted line 93 as attachment.