How to set the axis of btSliderConstraint?
-
- Posts: 6
- Joined: Mon Jan 28, 2013 2:51 am
How to set the axis of btSliderConstraint?
Hi,everyone,it seems the default axis of btSliderConstraint is 'X',how can I set the axis along the arbitrary vector?thx!
-
- Posts: 74
- Joined: Thu Feb 10, 2011 8:27 pm
Re: How to set the axis of btSliderConstraint?
When setting up the slider, you pass in a tranform which contains the translation axis. So just set your axis vector in that transform.
-
- Posts: 6
- Joined: Mon Jan 28, 2013 2:51 am
Re: How to set the axis of btSliderConstraint?
Thanks!But how to set my axis vector in the transform?SynapticBytes wrote:When setting up the slider, you pass in a tranform which contains the translation axis. So just set your axis vector in that transform.
-
- Posts: 74
- Joined: Thu Feb 10, 2011 8:27 pm
Re: How to set the axis of btSliderConstraint?
Something like this
Code: Select all
btTransform tr = new btTransform;
tr.setIdentity();
tr.setOrigin(btVector3(0,1,0)); // whatever vector values you want for your translation axis