Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Tue Feb 28, 2012 7:50 pm 
Offline

Joined: Tue Feb 28, 2012 7:34 pm
Posts: 8
I created a btRigidBody
Code:
        ...
   btRigidBody::btRigidBodyConstructionInfo fallRigidBodyCI(
            this->mass,
            this->motionState,
            this->shape,
            fallInertia);
   fallRigidBodyCI.m_friction = 1.0f
   this->rigidBody = new btRigidBody(fallRigidBodyCI);

   this->rigidBody->setDamping(0.4, 0.4);
   this->physicsWorld->addRigidBody(rigidBody);
   this->rigidBody->setFriction(this->friction);
   std::cout << this->rigidBody << std::endl;

and when I query him in my idle function, I get a weird result:
Code:
            btWheelInfo   &wheel_inf = this->vehicle->getWheelInfo(i);

            btCollisionObject *contact_obj = (btCollisionObject*) (wheel_inf.m_raycastInfo.m_groundObject);

            if (contact_obj) {
                std::cout << "friction "
                          << contact_obj->getFriction()
                          << std::endl;
            }

I get output "friction 0.5", but expected "friction 1.0"

Runned in debugger, when adding btRigidBody(first code block), print this->rigidBody output differs from (second code block) print contac_obj. And when contacting with another btRigidBody, output of print contac_obj is the same all the time.

How can I proceed to actual rigidBody/collisionObject? It seems that any contact of Ray points to internal Bullet representation of RigidBody, where all of them is the one.


Top
 Profile  
 
PostPosted: Thu Mar 01, 2012 5:21 pm 
Offline

Joined: Tue Feb 28, 2012 7:34 pm
Posts: 8
Searching the forum I found viewtopic.php?f=9&t=3751 thread. Uncommenting this btRaycastVehicle.cpp#199 line helped for those users, but I would be very grateful for any claryfications on that side. Thanks.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group