GetAllSegments Returns all pairs of colliding segments. The first line of each pair is colliding with the second line of the pair. There might be more than one collision point in some cases, if several parts of the objects collide at the same time. Examples Collision collision = ...;
// Get all colliding segments // const std::vector< std::pair< Line, Line > *> &segments = collision.GetAllSegments(); // Draw the colliding segments // // (Object A's colliding segments will be green and Object B's red) // for( std::vector< std::pair< Line, Line > *> ::const_iterator iter = segments.begin(); iter != segments.end(); iter++ ) { (*iter)->first.Draw( Rgba::GREEN ); (*iter)->second.Draw( Rgba::RED ); } Other functions of the class Collision
Questions about GetAllSegments? Click here. |