How to find the point of impact in collision?

CapitalGamesCapitalGames Member Posts: 5
edited November -1 in Working with GS (Mac)
Hi all, I'm making a game and need to find the coordinates of the point of impact of 2 actors. I'm doing this so that I can place an explosion at that point, ie showing where the 2 actors collided.

Typically when there is collision detection, it's from a bullet/shot, and in those cases the bullet can spawn an explosion actor at it's coordinates, but what I have is 2 large actors and I want to show where exactly they collided.

I'm thinking that magnitude might be the direction to go?

Thanks in advance! This forum rocks!

Comments

  • JackBQuickJackBQuick Member Posts: 524
    Maybe this would help:

    Collision angle

    You can click and drag any of the actors, and have them collide.

    Once you get the angle, you can use this to determine the point of impact:

    Finding coordinates of a point in a circle with angle
  • CapitalGamesCapitalGames Member Posts: 5
    Thanks! Those are great demos for figuring out the angles.

    Unfortunately, I don't think they will work as my actors are not circles, they are long rectangles, so if they impact at an angle (like chopsticks) then if I use vector to angle between the 2 actors, it will give me an angle in between them, but not at the point of contact. I also do not know the distance from the center of each actor to that point. I know the length and width of the actor, but they are both different.

    Too bad GS collisions don't just give you the coordinates of the collision.
  • MotherHooseMotherHoose Member Posts: 2,456
    the center of an actor is its personal x,y intersection

    which should be its length/2, width/2 ... and correlate that for both the collision actors

    though we work mostly with angles and arcs of a circle... an angle is just the degrees of separation between two intersecting lines.

    in plane geometry (2D) the sum of internal angles for each shape is 360° (the sum of the outside angles created by its lines is what determines the shape... )

    as squares that are bisected on a diagonal consist of 2 triangles... you could use some trigonometry to determine actual impact site...

    think it would be much simpler to look at and modify Tshirtbooth's...


    MH
Sign In or Register to comment.