Spinning Topp Logo BlackTopp Studios
inc
Public Types | Public Member Functions | Public Attributes | List of all members
Mezzanine::LineSegment2D Class Reference

A geometry math class for expressing a line connecting 2 points in 2D space. More...

#include <linesegment.h>

+ Collaboration diagram for Mezzanine::LineSegment2D:

Public Types

typedef std::pair< Boole, Vector2IntersectionTestResult
 This is a type used for the return of a intersection test. More...
 

Public Member Functions

 LineSegment2D ()
 Blank constructor.
 
 LineSegment2D (const Vector2 &A, const Vector2 &B)
 Descriptive constructor. More...
 
 LineSegment2D (const LineSegment2D &Other)
 Copy constructor. More...
 
IntersectionTestResult Intersects (const LineSegment2D &Other) const
 Gets whether or not another line segment intersects with this one. More...
 

Public Attributes

Vector2 PointA
 The first point defining the segment.
 
Vector2 PointB
 The second point defining the segment.
 

Detailed Description

A geometry math class for expressing a line connecting 2 points in 2D space.

Definition at line 52 of file linesegment.h.

Member Typedef Documentation

This is a type used for the return of a intersection test.

This type provides more verbose return data that can be used for further tests.

The first member stores whether or not there was a hit. The second member stores the point in 2D space where the segments intersect.

Definition at line 58 of file linesegment.h.

Constructor & Destructor Documentation

Mezzanine::LineSegment2D::LineSegment2D ( const Vector2 A,
const Vector2 B 
)

Descriptive constructor.

Parameters
AThe first point defining the segment.
BThe second point defining the segment.

Definition at line 57 of file linesegment.cpp.

Mezzanine::LineSegment2D::LineSegment2D ( const LineSegment2D Other)

Copy constructor.

Parameters
OtherThe other line segment to copy from.

Definition at line 62 of file linesegment.cpp.

Member Function Documentation

LineSegment2D::IntersectionTestResult Mezzanine::LineSegment2D::Intersects ( const LineSegment2D Other) const

Gets whether or not another line segment intersects with this one.

Parameters
OtherThe other line segment to compare with.
Returns
Returns true if this line segment intersects with the other segment, false otherwise.

Definition at line 70 of file linesegment.cpp.


The documentation for this class was generated from the following files: