Ballistics

I am trying to accurately model the path of a bullet and have run into several problems.

I cannot find the “actor” and “dynamic” settings in 2.35 so I have been using 2.34.

Collision detection is very poor when the projectile is moving at extreme speeds. (I am trying to do a real bullet and long distance, so I don’t want to do slow speeds)

The physics do not seem to be entirely correct (at least in 2.34). If I fire off a projectile at a known (slow) speed and known angle it does not land where predicted. I thought to turn off dampening and increase the mass, but it still doesn’t land right. Gravity is set normal too.

I cannot get the rendering range past 100 squares. I figure I can just scale everything down and that might solve most of these problems, but it’s kind of a jerry rig.

I’ve looked at multiple tutorials but can’t find any that cover this material.

So, I was thinking that
A) I am missing some important point about projectile motion in blender
B) I might be better off not using actual projectiles and just have the engine calculate the path of the bullet and determine collision from that… but I have no idea how I would do that, or if it can be done :wink:

So if anyone can point me to some good tuts on A or B I’d appreciate it.

Blender’s physics don’t seem to really be correct, it doesn’t seem to do gravity right, it seems way too slow. For actual projectiles, it really isn’t the best way to do guns in blender. The best way would probably be using a ray to detect what was hit, you can find scripts for htis all over this forum.

As for actor or dynamic not showing, go to the shading buttons (F5) and go into the world buttons and under physics, change the thing that says “none” to “sumo”

Pooba

I found the sumo setting and tested stuff in 2.35. Objects do land in the correct spot according to the equation for projectile motion, but they move too slowly.

I am guessing you mean the ray sensor in the logic bricks. The problem is that I can only make a ray that is a perfectly straight line, but bullets move in a parabola(or somewhat close to to a parabola if you count wind resistance). Is there a way I can make a ray follow the shape of an equation?

Now THAT would be cool! Unfortunately, I don’t think there is. :frowning:

The only way I could think of doing it is finding a way to calculate where the bullet would hit, and then firing a ray at that.

for example:

Flight path -v
G ~``````~
U /______________ x collision
N ray-^

Though that would probably slow things down too, since it has to perform more calculations and whatnot. Just an idea… Also I’m not familiar with Python, so don’t ask me how you would do that, hehe

i hope the ascii image’s font shows up right in everyone’s browsers…

The only way I could think of doing it is finding a way to calculate where the bullet would hit, and then firing a ray at that.

If I can calculate where the bullet hits why would I need a ray ? :slight_smile:

How about messing with blender to allow bigger bounding spheres so the bullet can’t pass through a target without being calculated for a collision? Or does blender use the bounding sphere for the actual collision instead of using it to determine whether it needs to use more complicated collision detection?

Or, how hard would it be for a python newb to add a new sensor that will follow an equation and detect collision with it?

I think the problem you have with the bullet going through objects is due to a fairly low refreshrate of the physics, which looses track of the objects the bullet hits if the distance between them is too big.

Like this:

[Frame 1] B------_____Object-[frame 2]------B (phyics check: bullet couldn’t have passed; Frame 2 Is rendered with bullet having stopped)

[Frame 1]B------Object__-[frame 2]------B (Physics check returns nothing; it goes through)

This is of course just my theory, I have no idea how it actually works.

I think the problem you have with the bullet going through objects is due to a fairly low refreshrate of the physics, which looses track of the objects the bullet hits if the distance between them is too big.

That’s what I thought it was too, and from messing around with it I am pretty sure that is the problem.

That’s why I wanted to use an equation or bigger bounding spheres.
With an equation I just need to check where the first object the equation intersects is and I don’t need to rely on how often the physics checks for collisions.
With bigger bounding spheres I could increase the likelihood of the physics detecting a collision.

B (small sphere) [Frame 2] (small sphere) B -Bullet has passed and no collision.

B ( big sphere ) [Frame 2] ( B big sphere ) -The physics realizes the bullet has intersected thh bounding sphere and registers a collision.

Unfortunately the engine uses the sphere for the collision (as opposed to using the sphere to check if the bullet has also intersected the object) so my bullets bounce off objects way before they appear to hit the object.

I’ve pretty much given up on doing it to scale. I’ll have to keep the general intent without the specific details.

I set the logicTicRate to 60 and physicsTicRate to 790 i can get pretty much flawless collisions with very small (.01 and .03) spheres even at close ranges.

Also the bullet travels nearly the correct distance in nearly the correct amount of time which is a plus.

But I realize the physics tic rate is extremely high. It works fine on my comp when all I have is a bullet and a box. Will it still work on other computers and when I add more stuff?