Gun Collision

Started by gamerfan, November 28, 2011, 06:35:32 PM

Previous topic - Next topic

gamerfan

May be the answer for this question will have already answered, but I could not find much info needed in the posts.In the 'FPS' sample, the collision detection takes place with camera and wall.But I want when the gun is almost hit on the wall, it will generate collision detection.Now what happens is that when the gun hits on the wall, it just goes through it.So how can I disable it? Thanks in advance.

EgonOlsen

The simple solution would be to increase the radius of the collision ellipsoid, so that the gun never touches the wall. If that's not an option, you would have to triggern an addition collision detection from the top of the gun and if that triggers, you would have to do something to the gun like move it up or down or something. Personally, i would consider this to be overkill and i would  simply live with the gun penetrating the wall, but that's just me...

gamerfan

I increased ellipsoid radius to double.But, it affects the movement.It produces lot of friction while moving.I have one clarification here.Suppose, If I add a collision listener, then I can manipulate the gun movement. But, what I am worried here is that will it override with the default behaviour of camera's collision detection.So what I really want is when the gun hits on the wall, it should either stride along the wall or bounce back.