Bullet collision help

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
needshelprendering
Posts: 25
Joined: Mon Sep 17, 2012 1:17 am

Bullet collision help

Post by needshelprendering »

Hello, I am using a Raycast to determine if my bullets will hit an Entity. My goal would be to apply force exactly where the Raycast hits, and not the entire entity. Right mow I am altering the Linear Velocity. But, that simply moves the box. I tried ApplyImpulse too, but that does the same thing. I made a gif to show you how it currently acts. I would like the bullets to cause the entity to rotate and such. So for example, if I shoot a corner, the Entity will spin in that direction. I am sure it is fairly simple, I just cannot find out which one would work. Thank you.

Image
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Bullet collision help

Post by Norbo »

Entity.ApplyImpulse is what you're looking for. For the impulse location, use the ray hit location instead of the center of the entity.
needshelprendering
Posts: 25
Joined: Mon Sep 17, 2012 1:17 am

Re: Bullet collision help

Post by needshelprendering »

Norbo wrote:Entity.ApplyImpulse is what you're looking for. For the impulse location, use the ray hit location instead of the center of the entity.
This worked perfectly, thank you very much!
Post Reply