• Advertisement
Sign in to follow this  

Tokamak - Bullets ?

This topic is 4343 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there, I've got an engine up and running with physics supplied by tokamak. I've managed to get a gravity gun / grab and drag system up and running for the physics objects, using the applyImpulse() function. Has anyone ever implemented bullets using tokamak, and if so, how is it done?

Share this post


Link to post
Share on other sites
Advertisement
Bullets are almost never done physically. Nearly all games use raycasts for bullets. They travel too fast and are too small for physics systems unless your system supports swept collision. Even if it does it's far cheaper to do it with raycasts.

Share this post


Link to post
Share on other sites
Yes, to extend upon the raycasting idea, you cast a ray from the gun point, to the object where the bullet would ideally hit. To do that, you can use picking to calculate the 3D ray and origin and direction, then just apply an impulse to the rigid body with this ray.

Hth

Share this post


Link to post
Share on other sites
There are some games that model bullets. Max Payne comes to mind. It certainly does raise some tough questions though. You should first decide if it's vital to your game design. If it's not, it falls more into the "would be cool" category.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement