How to specify a btBoxShape's transformation?

Post Reply
lucky7456969
Posts: 26
Joined: Thu Sep 11, 2014 5:40 am

How to specify a btBoxShape's transformation?

Post by lucky7456969 »

I want to define a box shape that has a position, probably an orientation...
How can I achieve this?
Thanks
Jack
xexuxjy
Posts: 225
Joined: Wed Jan 07, 2009 11:43 am
Location: London

Re: How to specify a btBoxShape's transformation?

Post by xexuxjy »

you just set the world transform on the collision object / rigid body that's using that shape. So define your box shape, and then attach it to a collision object and update that.
c6burns
Posts: 149
Joined: Fri May 24, 2013 6:08 am

Re: How to specify a btBoxShape's transformation?

Post by c6burns »

The answer to this question is in every sample and in the wiki and in the manual. You can do this! :lol:
lucky7456969
Posts: 26
Joined: Thu Sep 11, 2014 5:40 am

Re: How to specify a btBoxShape's transformation?

Post by lucky7456969 »

Hi there,
Can I just create a shape without attaching any collision object to it, I need it for cooperative pathfinding
as a placeholder...
Thanks
Jack
xexuxjy
Posts: 225
Joined: Wed Jan 07, 2009 11:43 am
Location: London

Re: How to specify a btBoxShape's transformation?

Post by xexuxjy »

A shape by itself really doesn't do very much, and won't detect any collisions for you, you really need a collision object,rigidy body, ghost object , whatever to get anything meaningful picked up. You can even just have one collision shape (box) and lots of collision objects sharing it.
lucky7456969
Posts: 26
Joined: Thu Sep 11, 2014 5:40 am

Re: How to specify a btBoxShape's transformation?

Post by lucky7456969 »

Okay, thank you then, let me take some read on the documentation first.
Thanks
Jack
c6burns
Posts: 149
Joined: Fri May 24, 2013 6:08 am

Re: How to specify a btBoxShape's transformation?

Post by c6burns »

There is a method to get a transformed aabb from a collision shape by passing in a transformation. But as xexuxjy is saying collision shapes don't themselves have a transform ... that's something the collision object handles (btCollisionObject -> btRigidBody and others)
Post Reply