Author Topic: Gun Collision  (Read 2060 times)

Offline gamerfan

  • int
  • **
  • Posts: 97
    • View Profile
Gun Collision
« on: November 28, 2011, 06:35:32 pm »
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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Gun Collision
« Reply #1 on: November 28, 2011, 08:08:59 pm »
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...

Offline gamerfan

  • int
  • **
  • Posts: 97
    • View Profile
Re: Gun Collision
« Reply #2 on: November 29, 2011, 05:22:22 am »
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.