How to shoot boxes

Post Reply
shashwatsher
Posts: 5
Joined: Thu Mar 19, 2015 6:08 pm

How to shoot boxes

Post by shashwatsher »

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!!!
lucas001
Posts: 3
Joined: Thu Feb 19, 2015 12:53 pm

Re: How to shoot boxes

Post by lucas001 »

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.
Basroil
Posts: 463
Joined: Fri Nov 30, 2012 4:50 am

Re: How to shoot boxes

Post by Basroil »

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.
RazzorFlame
Posts: 5
Joined: Sun Mar 08, 2015 2:31 pm

Re: How to shoot boxes

Post by RazzorFlame »

Camera target - Camera position = Direction you're lookin' at. Just setLinearVelocity of an object to Direction * Multiplier (where multiplier affects velocity).
Park4a!
Posts: 1
Joined: Wed Apr 01, 2015 11:55 am

Re: How to shoot boxes

Post by Park4a! »

This is interesting.
shashwatsher
Posts: 5
Joined: Thu Mar 19, 2015 6:08 pm

Re: How to shoot boxes

Post by shashwatsher »

Thanks for the reply guys. Got the functionality what I was looking for
Post Reply