btGhostObject attachment transform

Singular
Posts: 13
Joined: Tue Sep 13, 2011 2:20 pm
Location: ru

btGhostObject attachment transform

Post by Singular »

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.
User avatar
Dr.Shepherd
Posts: 168
Joined: Tue Jan 04, 2011 11:47 pm

Re: btGhostObject attachment transform

Post by Dr.Shepherd »

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
Singular
Posts: 13
Joined: Tue Sep 13, 2011 2:20 pm
Location: ru

Re: btGhostObject attachment transform

Post by Singular »

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.
User avatar
Dr.Shepherd
Posts: 168
Joined: Tue Jan 04, 2011 11:47 pm

Re: btGhostObject attachment transform

Post by Dr.Shepherd »

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.
Stubborn is a good thing, I am stubborn, =)

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 ?
Singular
Posts: 13
Joined: Tue Sep 13, 2011 2:20 pm
Location: ru

Re: btGhostObject attachment transform

Post by Singular »

i counted line 93 as attachment.
User avatar
Dr.Shepherd
Posts: 168
Joined: Tue Jan 04, 2011 11:47 pm

Re: btGhostObject attachment transform

Post by Dr.Shepherd »

Singular wrote:i counted line 93 as attachment.
Sorry, but I didn't catch your point....