Recent content by black_em2

  1. B

    Elastic Collision Reponse in a Game

    here this code I ended up using thanks to alephzero if([tile isRock]) { c = magnitude(d); \\d is a CGPoint of distance (x & y components) between two objects if(c <= 0.5) // ball collides { float x_tan, y_tan, det, A, B...
  2. B

    How can I fix syntax errors in my C code?

    Well you are going to need to post your code, your errors, and the goal of the program or no one will be able to help you.
  3. B

    Elastic Collision Reponse in a Game

    Thanks so much for all the help. Everything seems to be working great. When I looked over the values for the determinant again, it does seem pretty impossible that the determinant would result in 0. But I would rather include a check just in case something else glitched & doesn't cause the...
  4. B

    Elastic Collision Reponse in a Game

    Thanks for the link, ill have to give it a good look through ok so then I just have to take the magnitude to find the corresponding velocity components X_v = sqrt((-A*xn)^2 + (B*xt)^2) Y_v = sqrt((-A*yn)^2 + (B*xt)^2) Also to solve the system of equations in a program, it seems easiest...
  5. B

    Elastic Collision Reponse in a Game

    Yes one obstacle will always be static. The image (from wikipedia) was something I was using to ask if I could assume that the new velocity vector is orthogonal to the vector between the centers of the objects, which I think you are agreeing to in your post. I'm sorry but I'm just not...
  6. B

    Elastic Collision Reponse in a Game

    I am trying to program the elastic collision response between a ball and an immovable obstacle (such as a rock with infinite mass). However I can't seem to figure out the angle at which the ball would bounce off of the object. Both objects are to be considered as circles, with their positions...
Back
Top