Otter  0.9.88
2d Game Development Framework based on SFML.Net
 All Classes Namespaces Functions Variables Enumerations Properties
Otter.Line2 Class Reference

Class for a simple line with two points. More...

Public Member Functions

 Line2 (float x1, float y1, float x2, float y2)
 Create a new Line2. More...
 
 Line2 (Vector2 xy1, Vector2 xy2)
 Create a new Line2. More...
 
bool Intersects (Line2 other)
 Intersection test on another line. (http://ideone.com/PnPJgb) More...
 
override string ToString ()
 
bool IntersectsRect (float x, float y, float width, float height)
 Check intersection against a rectangle. More...
 
bool IntersectCircle (Vector2 circle, float radius)
 Check the intersection against a circle. More...
 

Public Attributes

float X1
 The X position for the first point. More...
 
float Y1
 The Y position for the first point. More...
 
float X2
 The X position for the second point. More...
 
float Y2
 The Y position for the second point. More...
 

Properties

Vector2 PointA [get, set]
 The first point of the line as a vector2. More...
 
Vector2 PointB [get, set]
 The second point of a line as a vector2. More...
 
float A [get]
 A in the line equation Ax + By = C. More...
 
float B [get]
 B in the line equation Ax + By = C. More...
 
float C [get]
 C in the line equation Ax + By = C. More...
 

Detailed Description

Class for a simple line with two points.

Constructor & Destructor Documentation

Otter.Line2.Line2 ( float  x1,
float  y1,
float  x2,
float  y2 
)

Create a new Line2.

Parameters
x1X of the first point
y1Y of the first point
x2X of the second point
y2Y of the second point
Otter.Line2.Line2 ( Vector2  xy1,
Vector2  xy2 
)

Create a new Line2.

Parameters
xy1X,Y of the first point
xy2X,Y of the second point

Member Function Documentation

bool Otter.Line2.IntersectCircle ( Vector2  circle,
float  radius 
)

Check the intersection against a circle.

Parameters
circle
radius
Returns
bool Otter.Line2.Intersects ( Line2  other)

Intersection test on another line. (http://ideone.com/PnPJgb)

Parameters
otherThe line to test against
Returns
bool Otter.Line2.IntersectsRect ( float  x,
float  y,
float  width,
float  height 
)

Check intersection against a rectangle.

Parameters
xX Position of the rectangle.
yY Position of the rectangle.
widthWidth of the rectangle.
heightHeight of the rectangle.
Returns
True if the line intersects any line on the rectangle, or if the line is inside the rectangle.

Member Data Documentation

float Otter.Line2.X1

The X position for the first point.

float Otter.Line2.X2

The X position for the second point.

float Otter.Line2.Y1

The Y position for the first point.

float Otter.Line2.Y2

The Y position for the second point.

Property Documentation

float Otter.Line2.A
get

A in the line equation Ax + By = C.

float Otter.Line2.B
get

B in the line equation Ax + By = C.

float Otter.Line2.C
get

C in the line equation Ax + By = C.

Vector2 Otter.Line2.PointA
getset

The first point of the line as a vector2.

Vector2 Otter.Line2.PointB
getset

The second point of a line as a vector2.


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