# Physics Simulation Forum

 Page 1 of 1 [ 3 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Beginner Bullet QuestionPosted: Mon Jan 09, 2012 1:48 am

Joined: Sun Jan 08, 2012 11:00 pm
Posts: 2
Hey everyone, I started to use bullet not long ago, and I have some questions for bullet.

1) Is it possible to to set the gravity so that the speed of falling object is constant?
2) I'm not sure what's the best way to implement moving a object manually. In other words, Say there's a cube falling down, and there's a static platform at the bottom. I want to be able to rotate and move the platform but also keep the physics collision. I don't think applyImpulse is a good idea because i want to set the final destination of the rigid body. Thanks!

Steven

Top

 Post subject: Re: Beginner Bullet QuestionPosted: Wed Jan 11, 2012 4:03 am

Joined: Sat Feb 21, 2009 5:08 am
Posts: 24
1) By definition, gravity is an acceleration, not a velocity. So if you want something to fall at a constant speed you can't use gravity.

2) It's been a while since I've programmed Bullet but I believe there's a setPosition method for rigid bodies. I'm sure it exists, not sure of the exact function name or usage. If you want to move a plane, don't use a static plane, use the surface of a very large box.

Top

 Post subject: Re: Beginner Bullet QuestionPosted: Wed Jan 11, 2012 4:13 am

Joined: Sun Jan 08, 2012 11:00 pm
Posts: 2
Kukanani wrote:
1) By definition, gravity is an acceleration, not a velocity. So if you want something to fall at a constant speed you can't use gravity.

2) It's been a while since I've programmed Bullet but I believe there's a setPosition method for rigid bodies. I'm sure it exists, not sure of the exact function name or usage. If you want to move a plane, don't use a static plane, use the surface of a very large box.

Hey Kukanani,

1) If there's no gravity, then the object will not fall down right?
2) I'm using btConvexHullShape for the platform, and the mass is 0. The following code will not change the position of the rigidbody.

Code:

// code for creating rigidbody.
Isgl3dMotionState * motionState = new Isgl3dMotionState(node);

// Create a rigid body
btVector3 localInertia(0, 0, 0);
shape->calculateLocalInertia(mass, localInertia);
btRigidBody * rigidBody = new btRigidBody(mass, motionState, shape, localInertia);
rigidBody->setRestitution(restitution);
rigidBody->setActivationState(DISABLE_DEACTIVATION);

// code for moving object.
btTransform tr;
rigidBody->getMotionState()->getWorldTransform(tr);
tr.setOrigin(btVector3(btScalar(object.node.x), btScalar(object.node.y), btScalar(object.node.z)));
rigidBody->getMotionState()->setWorldTransform(tr);

I've also set

Code:
physicsPlatform.rigidBody->setActivationState(DISABLE_DEACTIVATION);

when I created the rigidbody. Thanks!

Steven

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 3 posts ]

#### Who is online

Users browsing this forum: No registered users and 2 guests

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

Search for:
 Jump to:  Select a forum ------------------ BULLET PHYSICS LIBRARY USERS    General Bullet Physics Support and Feedback    Release Announcements    Applications, Games, Demos or Movies using Bullet PHYSICS AUTHORING TOOLS, SERIALIZATION AND STANDARDS    Physics authoring tools, serialization, standards and related topics RESEARCH AND DEVELOPMENT IN COLLISION DETECTION & PHYSICS. Don't post Bullet support questions here!    Research and development discussion about Collision Detection and Physics Simulation    Links, Papers, Libraries, Demos, Movies, Comparisons       Non-technical forum and license/patent discussion    Career Opportunities