Skip to content

Daze.Geometry

Federico Capece edited this page Nov 20, 2017 · 1 revision

Circle

It's a circle... yes, just a circle.

public struct Daze.Geometry.Circle

Fields

Type Name Summary
Point center The center of the circle
Single radius The radius of the circle

Methods

Type Name Summary
Boolean contains(Point point)

ConvexPolygon

An abstract class that is the base for creating convex polygons for colliders.

public abstract class Daze.Geometry.ConvexPolygon

Fields

Type Name Summary
Line[] lines The edges of this polygon
Single ray The ray of the polygon is the distance from the center and a vertex

Properties

Type Name Summary
Point center The center of this polygon
Single rotation The rotation of this polygon

Methods

Type Name Summary
Boolean contains(Point point) Check if this polygon contains the specified point

Line

public struct Daze.Geometry.Line

Fields

Type Name Summary
Point point1
Point point2

Methods

Type Name Summary
String ToString()

Point

A point, it has a X cordinate and a Y coordinate... that's pretty much all.

public struct Daze.Geometry.Point

Fields

Type Name Summary
Single x The position of the point on the X axis
Single y The position of the point on the Y axis

Methods

Type Name Summary
Point duplicate() return a copy of this Point
void rotatePointAroundO(Single angle) This method rotate the point counterclockwise around the origin point
String ToString() A string rapresentation of this point

Static Fields

Type Name Summary
Point O The origin point (0,0)

Rectangle

A rectangle. Yes, it's just a rectangle.

public class Daze.Geometry.Rectangle
    : ConvexPolygon

Fields

Type Name Summary
Point A Vertex of the rectangle
Point B Vertex of the rectangle
Point C Vertex of the rectangle
Point D Vertex of the rectangle

Properties

Type Name Summary
Point center The center of the rectangle
Single height The height of the rectangle
Single rotation The rotation of the rectangle
Single width The width of the rectangle

Size

public struct Daze.Geometry.Size

Fields

Type Name Summary
Int32 height
Int32 width

Methods

Type Name Summary
Size duplicate()
void set(Int32 width, Int32 height)

Utility

A static class with some methods that can be useful for creating new collider Types

public static class Daze.Geometry.Utility

Static Methods

Type Name Summary
Boolean between(Single toCheck, Single extreme1, Single extreme2)
Single calculateLineOffsetYFromO(Line line)
Single distance(Point point1, Point point2)
Single getAngularCoefficient(Line line)
Single getAngularCoefficient(Point p1, Point p2)
Single getHypotenuse(Single cathetus1, Single cathetus2)
Boolean lineIntersect(Line line, Circle circle)
Boolean linesIntersect(Line line1, Line line2)
Boolean linesIntersect(Line line1, Circle circle)
Boolean pointInSegmentBoundingBox(Point pointToCheck, Line line)

Clone this wiki locally