Loading model transform into bullet rigid bodies

Started by
2 comments, last by Uttam Kushwah 5 years, 9 months ago

hello,this is my first post of all time on game dev.net or any website
even including facebook
i have been working on a project  some kind of fps (even though i can render static model only ) 
but  when i tried  to integrate bullet i stuck in some scaling transformation everything is good but the scaling is messed up .
i am doing it like
btTransform t;
t.setFromOpenglMatrix(&modelTransform[][]);
set this transform to any rigid body  an step simulation and then
btTransform t;
t.getOpenglMatrix(&modelTransform[][]);
upload the model transform to the shader ,is am i doing wrong ? can someone suggest how we usually do it?
or bullet transforms not support the scaling  and we need to do it manualy.
thanks in advance.
(sorry for the syntax of the question as i told this is my first time) :)

Advertisement

I've never heard of those functions before, but what I do is I create a shape object and a rigid body object. You can control the position (relative to the rigid body) and scale of the shape. The world space position and rotation are controlled only for the rigid body, using setOrigin and setRotation for the transform object. You will need to use quaternions for the rotation though. It's always good to have your original position, scale and rotation available separate from your world matrices, so you can use them for things like this.

View my game dev blog here!

Actually these function  are Part of btTransform which we pass in btmotionstate function for a shape thank you for your reply I will try to do as you said.

 

This topic is closed to new replies.

Advertisement