VizualizerWPF
VizualizerWPF.CollisionDetection Class Reference

Static Public Member Functions

static void Init (MainWindow window)
 
static ? Point LineAndHalfLine (Line line1, HalfLineWithCoeffients halfLine)
 Function to detect whether Line and HalfLine intersect. More...
 
static Point TwoLines (Line line1, Line line2)
 Detect intersection of two line segment More...
 
static Point TwoLinesIntersectNotAtTheEnd (Line line1, Line line2)
 Detect if two lines intersect except of their end points and return the intersection More...
 
static bool CheckIfTwoLinesIntersectNotAtTheEnd (Line line1, Line line2)
 Detect if two lines intersect except of their end points More...
 
static bool IntersectsSomeLine (Line line)
 Function to detect whether conrete line intersect any of the lines of the window More...
 
static bool LineAndEllipseAtEnd (Line line, Ellipse ellipse)
 Function to detect if end of the line is in given ellipse(circle) More...
 
static bool CenterOfEllipseOnLine (Line line, Ellipse ellipse)
 Detect if center of ellipse lies on given line More...
 
static bool CenterOfVertexOnLine (Line line, Vertex v)
 Function to detect if vertex v lines on line. More...
 
static bool CenterOnLine (Line line, Point center)
 Detects if a point center lies on line line More...
 
static bool CenterInsideEllipse (Point point, Ellipse ellipse)
 Detect if point is inside ellipse (circle) More...
 
static bool LineAndEllipse (Line line, Ellipse ellipse)
 Detect if ellipse and line intersects More...
 
static bool TwoPaths (Path path1, Path path2)
 General collision detection for further generalization and bezier lines More...
 
static double GetDistance (Line line)
 
static IEnumerable< HalfLineWithCoeffientsGetRaysGoingFromPoint (Point point)
 Create many of rays going from point. More...
 
static IEnumerable< HalfLineWithCoeffientsGetPerpendicularsToAlmostMids (Line line)
 Iterator for getting many perpendicular lines to line More...
 
static int GetOrientation (Line line, List< Line > lines, Point point)
 Function to detect the orieantion of the triangle formed by lines and line, where point determines the reference face More...
 
static Point ChooseOppositeOne (Edge edge, Point point)
 Function to get opposite end of edge to point. More...
 
static Line ChooseTheLineBy (Vertex v, Edge e)
 Function to get line of Edge e incident to v. More...
 
static Line OrientLineProperly (Vertex v, Line l)
 Function to orient line l so that v is first point. More...
 
static IEnumerable< LineGetEdges (Vertex v, GraphCoordinates graphCoordinates)
 Iterator to get all the line of the edges incident to v. More...
 
static int CompareLinesByAngle (Vector v1, Vector v2)
 
static double Determinant (Vector a, Vector b)
 
static bool CheckIfEdgeIsInTriangle (Vertex from, Vertex to, Vertex third, Vertex firstEdgeVertex, Vertex secondEdgeVertex)
 

Static Public Attributes

static Line
 Function to add lines of triangle together except for the one to which we consider perpendicular rays More...
 

Static Private Member Functions

static Point GetAlmostMid (Line line, int a, int b)
 return point on line in ratio a to b. More...
 
static LineWithCoeffients GetLineWithCoefficients (Line line)
 Convert line into LineWithCoefficients More...
 
static HalfLineWithCoeffients GetPerpendicularToAlmostMid (Line line, int a, int b)
 
static List< LinePutLinesTogether (Edge e1, Edge e2, Edge e3)
 

Static Private Attributes

static MainWindow window
 Class to detect many types of collision in 2D More...
 
static bool debug = false
 
static readonly double epsilon = 0.00001
 Error rate More...
 
static HalfLineWithCoeffients
 Create a perpendicular line to linet at the point which has ration a to b. More...
 

Member Function Documentation

◆ CenterInsideEllipse()

static bool VizualizerWPF.CollisionDetection.CenterInsideEllipse ( Point  point,
Ellipse  ellipse 
)
static

Detect if point is inside ellipse (circle)

Parameters
point
ellipse
Returns

◆ CenterOfEllipseOnLine()

static bool VizualizerWPF.CollisionDetection.CenterOfEllipseOnLine ( Line  line,
Ellipse  ellipse 
)
static

Detect if center of ellipse lies on given line

Parameters
line
ellipse
Returns

◆ CenterOfVertexOnLine()

static bool VizualizerWPF.CollisionDetection.CenterOfVertexOnLine ( Line  line,
Vertex  v 
)
static

Function to detect if vertex v lines on line.

Parameters
line
v
Returns

◆ CenterOnLine()

static bool VizualizerWPF.CollisionDetection.CenterOnLine ( Line  line,
Point  center 
)
static

Detects if a point center lies on line line

Parameters
line
center
Returns

◆ CheckIfEdgeIsInTriangle()

static bool VizualizerWPF.CollisionDetection.CheckIfEdgeIsInTriangle ( Vertex  from,
Vertex  to,
Vertex  third,
Vertex  firstEdgeVertex,
Vertex  secondEdgeVertex 
)
static

◆ CheckIfTwoLinesIntersectNotAtTheEnd()

static bool VizualizerWPF.CollisionDetection.CheckIfTwoLinesIntersectNotAtTheEnd ( Line  line1,
Line  line2 
)
static

Detect if two lines intersect except of their end points

Parameters
line1
line2
Returns

◆ ChooseOppositeOne()

static Point VizualizerWPF.CollisionDetection.ChooseOppositeOne ( Edge  edge,
Point  point 
)
static

Function to get opposite end of edge to point.

Parameters
edge
point
Returns

◆ ChooseTheLineBy()

static Line VizualizerWPF.CollisionDetection.ChooseTheLineBy ( Vertex  v,
Edge  e 
)
static

Function to get line of Edge e incident to v.

Parameters
v
e
Returns

◆ CompareLinesByAngle()

static int VizualizerWPF.CollisionDetection.CompareLinesByAngle ( Vector  v1,
Vector  v2 
)
static

◆ Determinant()

static double VizualizerWPF.CollisionDetection.Determinant ( Vector  a,
Vector  b 
)
static

◆ GetAlmostMid()

static Point VizualizerWPF.CollisionDetection.GetAlmostMid ( Line  line,
int  a,
int  b 
)
staticprivate

return point on line in ratio a to b.

Parameters
line
a
b
Returns

◆ GetDistance()

static double VizualizerWPF.CollisionDetection.GetDistance ( Line  line)
static

◆ GetEdges()

static IEnumerable<Line> VizualizerWPF.CollisionDetection.GetEdges ( Vertex  v,
GraphCoordinates  graphCoordinates 
)
static

Iterator to get all the line of the edges incident to v.

Parameters
v
graphCoordinates
Returns

◆ GetLineWithCoefficients()

static LineWithCoeffients VizualizerWPF.CollisionDetection.GetLineWithCoefficients ( Line  line)
staticprivate

Convert line into LineWithCoefficients

Parameters
line
Returns

◆ GetOrientation()

static int VizualizerWPF.CollisionDetection.GetOrientation ( Line  line,
List< Line lines,
Point  point 
)
static

Function to detect the orieantion of the triangle formed by lines and line, where point determines the reference face

Parameters
line
lines
point
Returns

◆ GetPerpendicularsToAlmostMids()

static IEnumerable<HalfLineWithCoeffients> VizualizerWPF.CollisionDetection.GetPerpendicularsToAlmostMids ( Line  line)
static

Iterator for getting many perpendicular lines to line

Parameters
line
Returns

◆ GetPerpendicularToAlmostMid()

static HalfLineWithCoeffients VizualizerWPF.CollisionDetection.GetPerpendicularToAlmostMid ( Line  line,
int  a,
int  b 
)
staticprivate

◆ GetRaysGoingFromPoint()

static IEnumerable<HalfLineWithCoeffients> VizualizerWPF.CollisionDetection.GetRaysGoingFromPoint ( Point  point)
static

Create many of rays going from point.

Parameters
point
Returns

◆ Init()

static void VizualizerWPF.CollisionDetection.Init ( MainWindow  window)
static

◆ IntersectsSomeLine()

static bool VizualizerWPF.CollisionDetection.IntersectsSomeLine ( Line  line)
static

Function to detect whether conrete line intersect any of the lines of the window

Parameters
line
Returns

◆ LineAndEllipse()

static bool VizualizerWPF.CollisionDetection.LineAndEllipse ( Line  line,
Ellipse  ellipse 
)
static

Detect if ellipse and line intersects

Parameters
line
ellipse
Returns

◆ LineAndEllipseAtEnd()

static bool VizualizerWPF.CollisionDetection.LineAndEllipseAtEnd ( Line  line,
Ellipse  ellipse 
)
static

Function to detect if end of the line is in given ellipse(circle)

Parameters
line
ellipse
Returns

◆ LineAndHalfLine()

static ? Point VizualizerWPF.CollisionDetection.LineAndHalfLine ( Line  line1,
HalfLineWithCoeffients  halfLine 
)
static

Function to detect whether Line and HalfLine intersect.

Parameters
line1
halfLine
Returns

◆ OrientLineProperly()

static Line VizualizerWPF.CollisionDetection.OrientLineProperly ( Vertex  v,
Line  l 
)
static

Function to orient line l so that v is first point.

Parameters
v
l
Returns

◆ PutLinesTogether()

static List<Line> VizualizerWPF.CollisionDetection.PutLinesTogether ( Edge  e1,
Edge  e2,
Edge  e3 
)
staticprivate

◆ TwoLines()

static Point VizualizerWPF.CollisionDetection.TwoLines ( Line  line1,
Line  line2 
)
static

Detect intersection of two line segment

Parameters
line1
line2
Returns

◆ TwoLinesIntersectNotAtTheEnd()

static Point VizualizerWPF.CollisionDetection.TwoLinesIntersectNotAtTheEnd ( Line  line1,
Line  line2 
)
static

Detect if two lines intersect except of their end points and return the intersection

Parameters
line1
line2
Returns

◆ TwoPaths()

static bool VizualizerWPF.CollisionDetection.TwoPaths ( Path  path1,
Path  path2 
)
static

General collision detection for further generalization and bezier lines

Parameters
path1first object
path2second object
Returns

Field Documentation

◆ debug

bool VizualizerWPF.CollisionDetection.debug = false
staticprivate

◆ epsilon

readonly double VizualizerWPF.CollisionDetection.epsilon = 0.00001
staticprivate

Error rate

◆ HalfLineWithCoeffients

VizualizerWPF.CollisionDetection.HalfLineWithCoeffients
staticprivate

Create a perpendicular line to linet at the point which has ration a to b.

Parameters
line
a
b
Returns

◆ Line

VizualizerWPF.CollisionDetection.Line
static

Function to add lines of triangle together except for the one to which we consider perpendicular rays

Parameters
e1
e2
e3
Returns

◆ window

MainWindow VizualizerWPF.CollisionDetection.window
staticprivate

Class to detect many types of collision in 2D


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