C# Класс FlatRedBall.Math.Geometry.Segment

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Point1 Point
Point2 Point
ZeroLength Segment

Открытые методы

Метод Описание
AsRay ( ) : Microsoft.Xna.Framework.Ray
ClosestPointTo ( Point point ) : Point
CollideAgainst ( Polygon polygon ) : bool
DistanceTo ( AxisAlignedRectangle rectangle ) : float
DistanceTo ( Microsoft.Xna.Framework.Circle circle ) : float
DistanceTo ( Point point ) : float
DistanceTo ( Point point, Segment &connectingSegment ) : float
DistanceTo ( Point point, Microsoft.Xna.Framework.Vector3 &connectingVector ) : float

Returns the distance to the argument point as well as the connectin Vector3 from the Point to this.

DistanceTo ( Polygon polygon ) : float
DistanceTo ( Segment otherSegment ) : float
DistanceTo ( Microsoft.Xna.Framework.Vector3 vector ) : float
DistanceTo ( double x, double y ) : float
DistanceToSquared ( Microsoft.Xna.Framework.Vector3 &vector, Segment &connectingSegment ) : float
GetLength ( ) : double

Returns the length of the segment.

GetLengthSquared ( ) : double
IntersectionPoint ( Segment &s2, Point &intersectionPoint ) : void

Returns the point where this segment intersects the argument segment.

Intersects ( Segment s2 ) : bool

Determines whether this segment intersects the argument segment.

Intersects ( Segment s2, Point &intersectionPoint ) : bool
IsClosestPointOnEndpoint ( Point &point ) : bool

Determines whether the closest point on the segment lies on one of the endpoints.

IsParallelAndTouching ( Segment s2, Point &intersectionPoint ) : bool
MoveBy ( float x, float y ) : void

Shifts the segment by moving both points by the argument x,y values.

Normalize ( ) : void

Sets the length of the segment to 1 unit by moving the 2nd point.

If the segment has 0 length (the endpoints are equal), the method does not change the segment; length will remain 0.

ScaleBy ( float amountToScaleBy ) : void
Segment ( Microsoft.Xna.Framework.Graphics.VertexPositionColor &point1, Microsoft.Xna.Framework.Graphics.VertexPositionColor &point2 ) : System
Segment ( Point point1, Point point2 ) : System

Creates a new Segment with the argument points as the endpoints.

Segment ( Microsoft.Xna.Framework.Vector3 point1, Microsoft.Xna.Framework.Vector3 point2 ) : System
Segment ( double point1X, double point1Y, double point2X, double point2Y ) : System
SetPoints ( Microsoft.Xna.Framework.Graphics.VertexPositionColor &point1, Microsoft.Xna.Framework.Graphics.VertexPositionColor &point2 ) : void
SetPoints ( float x1, float y1, float x2, float y2 ) : void
ToString ( ) : string
ToVector3 ( ) : Microsoft.Xna.Framework.Vector3

Описание методов

AsRay() публичный Метод

public AsRay ( ) : Microsoft.Xna.Framework.Ray
Результат Microsoft.Xna.Framework.Ray

ClosestPointTo() публичный Метод

public ClosestPointTo ( Point point ) : Point
point Point
Результат Point

CollideAgainst() публичный Метод

public CollideAgainst ( Polygon polygon ) : bool
polygon Polygon
Результат bool

DistanceTo() публичный Метод

public DistanceTo ( AxisAlignedRectangle rectangle ) : float
rectangle AxisAlignedRectangle
Результат float

DistanceTo() публичный Метод

public DistanceTo ( Microsoft.Xna.Framework.Circle circle ) : float
circle Microsoft.Xna.Framework.Circle
Результат float

DistanceTo() публичный Метод

public DistanceTo ( Point point ) : float
point Point
Результат float

DistanceTo() публичный Метод

public DistanceTo ( Point point, Segment &connectingSegment ) : float
point Point
connectingSegment Segment
Результат float

DistanceTo() публичный Метод

Returns the distance to the argument point as well as the connectin Vector3 from the Point to this.
public DistanceTo ( Point point, Microsoft.Xna.Framework.Vector3 &connectingVector ) : float
point Point The point to get the distance to.
connectingVector Microsoft.Xna.Framework.Vector3 The connecting vector from the argument Pointn to this.
Результат float

DistanceTo() публичный Метод

public DistanceTo ( Polygon polygon ) : float
polygon Polygon
Результат float

DistanceTo() публичный Метод

public DistanceTo ( Segment otherSegment ) : float
otherSegment Segment
Результат float

DistanceTo() публичный Метод

public DistanceTo ( Microsoft.Xna.Framework.Vector3 vector ) : float
vector Microsoft.Xna.Framework.Vector3
Результат float

DistanceTo() публичный Метод

public DistanceTo ( double x, double y ) : float
x double
y double
Результат float

DistanceToSquared() публичный Метод

public DistanceToSquared ( Microsoft.Xna.Framework.Vector3 &vector, Segment &connectingSegment ) : float
vector Microsoft.Xna.Framework.Vector3
connectingSegment Segment
Результат float

GetLength() публичный Метод

Returns the length of the segment.
public GetLength ( ) : double
Результат double

GetLengthSquared() публичный Метод

public GetLengthSquared ( ) : double
Результат double

IntersectionPoint() публичный Метод

Returns the point where this segment intersects the argument segment.
public IntersectionPoint ( Segment &s2, Point &intersectionPoint ) : void
s2 Segment The segment to test for intersection.
intersectionPoint Point
Результат void

Intersects() публичный Метод

Determines whether this segment intersects the argument segment.
public Intersects ( Segment s2 ) : bool
s2 Segment The segment to test for intersection.
Результат bool

Intersects() публичный Метод

public Intersects ( Segment s2, Point &intersectionPoint ) : bool
s2 Segment
intersectionPoint Point
Результат bool

IsClosestPointOnEndpoint() публичный Метод

Determines whether the closest point on the segment lies on one of the endpoints.
public IsClosestPointOnEndpoint ( Point &point ) : bool
point Point The point to test to.
Результат bool

IsParallelAndTouching() публичный Метод

public IsParallelAndTouching ( Segment s2, Point &intersectionPoint ) : bool
s2 Segment
intersectionPoint Point
Результат bool

MoveBy() публичный Метод

Shifts the segment by moving both points by the argument x,y values.
public MoveBy ( float x, float y ) : void
x float The number of units to shift the segment by on the x axis.
y float The number of units to shift the segment by on the y axis.
Результат void

Normalize() публичный Метод

Sets the length of the segment to 1 unit by moving the 2nd point.
If the segment has 0 length (the endpoints are equal), the method does not change the segment; length will remain 0.
public Normalize ( ) : void
Результат void

ScaleBy() публичный Метод

public ScaleBy ( float amountToScaleBy ) : void
amountToScaleBy float
Результат void

Segment() публичный Метод

public Segment ( Microsoft.Xna.Framework.Graphics.VertexPositionColor &point1, Microsoft.Xna.Framework.Graphics.VertexPositionColor &point2 ) : System
point1 Microsoft.Xna.Framework.Graphics.VertexPositionColor
point2 Microsoft.Xna.Framework.Graphics.VertexPositionColor
Результат System

Segment() публичный Метод

Creates a new Segment with the argument points as the endpoints.
public Segment ( Point point1, Point point2 ) : System
point1 Point The first Point.
point2 Point The second Point.
Результат System

Segment() публичный Метод

public Segment ( Microsoft.Xna.Framework.Vector3 point1, Microsoft.Xna.Framework.Vector3 point2 ) : System
point1 Microsoft.Xna.Framework.Vector3
point2 Microsoft.Xna.Framework.Vector3
Результат System

Segment() публичный Метод

public Segment ( double point1X, double point1Y, double point2X, double point2Y ) : System
point1X double
point1Y double
point2X double
point2Y double
Результат System

SetPoints() публичный Метод

public SetPoints ( Microsoft.Xna.Framework.Graphics.VertexPositionColor &point1, Microsoft.Xna.Framework.Graphics.VertexPositionColor &point2 ) : void
point1 Microsoft.Xna.Framework.Graphics.VertexPositionColor
point2 Microsoft.Xna.Framework.Graphics.VertexPositionColor
Результат void

SetPoints() публичный Метод

public SetPoints ( float x1, float y1, float x2, float y2 ) : void
x1 float
y1 float
x2 float
y2 float
Результат void

ToString() публичный Метод

public ToString ( ) : string
Результат string

ToVector3() публичный Метод

public ToVector3 ( ) : Microsoft.Xna.Framework.Vector3
Результат Microsoft.Xna.Framework.Vector3

Описание свойств

Point1 публичное свойство

The first point of the segment.
public Point Point1
Результат Point

Point2 публичное свойство

The second point of the segment.
public Point Point2
Результат Point

ZeroLength публичное статическое свойство

public static Segment,FlatRedBall.Math.Geometry ZeroLength
Результат Segment