I am a begginner with Bullet Physics and just exploring its features. One of the first things that caught my fancy is the ability to shoot boxes provided in all demos. I want to know through which function call or in which header file the functionality is described? Also is it possible to change the camera position of the strating point from where the boxes seem to emerge? What I mean is currently on pressing '.' the boxes seem to emerge from the viewer's camera position. I want to change it so that boxes seems to emerge from a particular point in the camera space.
Kindly help!!!
How to shoot boxes
-
- Posts: 3
- Joined: Thu Feb 19, 2015 12:53 pm
Re: How to shoot boxes
Hey man, this video tutorial may help you in this question:
https://www.youtube.com/watch?v=1CEI2pOym1Y
The code is available in the video descritpion.
https://www.youtube.com/watch?v=1CEI2pOym1Y
The code is available in the video descritpion.
-
- Posts: 463
- Joined: Fri Nov 30, 2012 4:50 am
Re: How to shoot boxes
Just follow the hierarchy up to opengl support/demoapplicaiton and enjoy.
The shooting method is actually really easy, just pick a starting point and direction, make an object at the point and give it a velocity in the direction you want. Should be no more than a dozen lines of code.
The shooting method is actually really easy, just pick a starting point and direction, make an object at the point and give it a velocity in the direction you want. Should be no more than a dozen lines of code.
-
- Posts: 5
- Joined: Sun Mar 08, 2015 2:31 pm
Re: How to shoot boxes
Camera target - Camera position = Direction you're lookin' at. Just setLinearVelocity of an object to Direction * Multiplier (where multiplier affects velocity).
-
- Posts: 5
- Joined: Thu Mar 19, 2015 6:08 pm
Re: How to shoot boxes
Thanks for the reply guys. Got the functionality what I was looking for