[C++] Collision Event, don't want to use If and Case

GooS

Azrael
Reaction score
154
For starters I'm gonna show you a picture:

attachment.php



This is what I want to achieve, the image might be abit confusing,
but it's how I think of the problem.

Basically I want a smooth ricochet with and impossibility of 180 rebounce and both objects ricochet upon eachother, if that made anything more clear o_O.
(Best shown through case 3)

However the only way I can think of for achieving this is by mile long
Case and If/Else statements. So I'm asking you for help, as I'm sure
there are better ways than this, but I suck at math :p.

If you get confused by my way of thinking of the angles just focus on
the cases, ignore the values and look at what happens when the objects
collide, that's what I want.

If you don't really understand the picture but think you know what I
want just ask and I'll explain further.

//==GooS

PS: I can easily get and manipulate the facing angles and velocity of the objects.
 

Attachments

  • collisionEvent2.jpg
    collisionEvent2.jpg
    62.8 KB · Views: 268
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top