Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have got stupid and annoying problem in my app. I am using bullet physics and I've started with hello world example on wiki: http://bulletphysics.org/mediawiki-1.5.8/index.php/Hello_World

There is someting like this:

btDefaultMotionState* fallMotionState =
            new btDefaultMotionState(btTransform(btQuaternion(0,0,0,1),btVector3(0,50,0)));

What is described as set object 50m above something. So I can change the height but nothing more. I can't move it left, right - anything. Also when I set 0 everywhere ( I mean in btVector3) the object is jumping up rather than falling down or better stay still.

Can someone help me with that?

Also are there any materials except those on bullets page where are some tutorials or something?

EDIT

The main thing which I want to achive is to move my object for example left not only top or bottom.

Hope It will help in understanding.

share|improve this question
    
I assume you mean to make the object controllable by the player? –  ChrisC Jan 6 '12 at 21:30
    
For now it has lower priority, but in fact I would like to. Some of objects yes. Maybe by adding some force - I am making bowling game and I have got my own physics which is quite poor. And this sphere is a prototype for new ball. But as I said now even if I would be able to change position to defined in code would be nice. But I can't –  sebap123 Jan 6 '12 at 21:36
    
Okay, so you want to apply a linear force. –  ChrisC Jan 6 '12 at 21:42
    
I think yes. Can you write something about it - maybe edit your previous answer? And what to do with this axis and ball position? –  sebap123 Jan 6 '12 at 21:45
add comment

1 Answer

up vote 0 down vote accepted

The btVector3 class should let you move the object sideways by changing the first or third (X and Z) parameters. The tutorial assumes that you understand vector math.

Also, when you set 0 in all btVector3's, that makes the sphere intersect the plane halfway through, because they are both in the origin. This means a collision is already happening during initialization. That's probably why the sphere object is jumping up, because it has responded to the collision.

Setting up rigid bodies with a finite mass in a way that they're alrady intersect each other during initialization can have unexpected results in their movement. Usually, the only rigid bodies that can overlap without moving are the ones with "infinite" mass, and these are usually for static scenery objects.

share|improve this answer
    
Well, the thing is that I understand the vector math and I've tried to change X or Z axis. In other words I wouldn't write here if I wouldn't check it. So if I try for example 'btVector3(4,1,0)' or 'btVector3(2,0,0)' it doesn't react. –  sebap123 Jan 6 '12 at 21:06
    
When you change the X or Z (and leave Y at 50m for now) does the sphere no longer respond to gravity? –  ChrisC Jan 6 '12 at 21:13
    
When I am changing X or Z axis sphere is responding to gravity. It don't take X or Z values. Simply just like there would be 0 still. –  sebap123 Jan 6 '12 at 21:16
    
You should edit your question so that your statement is easier to understand, then. I don't know if you are making a distinction between X and Z values, and X and Z axes. –  ChrisC Jan 6 '12 at 21:24
    
edited hope it would help –  sebap123 Jan 6 '12 at 21:28
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.