C# Class FlatRedBall.Math.Geometry.Segment

Afficher le fichier Open project: vchelaru/FlatRedBall Class Usage Examples

Méthodes publiques

Свойство Type Description
Point1 Point
Point2 Point
ZeroLength Segment

Méthodes publiques

Méthode Description
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

Method Details

AsRay() public méthode

public AsRay ( ) : Microsoft.Xna.Framework.Ray
Résultat Microsoft.Xna.Framework.Ray

ClosestPointTo() public méthode

public ClosestPointTo ( Point point ) : Point
point Point
Résultat Point

CollideAgainst() public méthode

public CollideAgainst ( Polygon polygon ) : bool
polygon Polygon
Résultat bool

DistanceTo() public méthode

public DistanceTo ( AxisAlignedRectangle rectangle ) : float
rectangle AxisAlignedRectangle
Résultat float

DistanceTo() public méthode

public DistanceTo ( Microsoft.Xna.Framework.Circle circle ) : float
circle Microsoft.Xna.Framework.Circle
Résultat float

DistanceTo() public méthode

public DistanceTo ( Point point ) : float
point Point
Résultat float

DistanceTo() public méthode

public DistanceTo ( Point point, Segment &connectingSegment ) : float
point Point
connectingSegment Segment
Résultat float

DistanceTo() public méthode

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.
Résultat float

DistanceTo() public méthode

public DistanceTo ( Polygon polygon ) : float
polygon Polygon
Résultat float

DistanceTo() public méthode

public DistanceTo ( Segment otherSegment ) : float
otherSegment Segment
Résultat float

DistanceTo() public méthode

public DistanceTo ( Microsoft.Xna.Framework.Vector3 vector ) : float
vector Microsoft.Xna.Framework.Vector3
Résultat float

DistanceTo() public méthode

public DistanceTo ( double x, double y ) : float
x double
y double
Résultat float

DistanceToSquared() public méthode

public DistanceToSquared ( Microsoft.Xna.Framework.Vector3 &vector, Segment &connectingSegment ) : float
vector Microsoft.Xna.Framework.Vector3
connectingSegment Segment
Résultat float

GetLength() public méthode

Returns the length of the segment.
public GetLength ( ) : double
Résultat double

GetLengthSquared() public méthode

public GetLengthSquared ( ) : double
Résultat double

IntersectionPoint() public méthode

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
Résultat void

Intersects() public méthode

Determines whether this segment intersects the argument segment.
public Intersects ( Segment s2 ) : bool
s2 Segment The segment to test for intersection.
Résultat bool

Intersects() public méthode

public Intersects ( Segment s2, Point &intersectionPoint ) : bool
s2 Segment
intersectionPoint Point
Résultat bool

IsClosestPointOnEndpoint() public méthode

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.
Résultat bool

IsParallelAndTouching() public méthode

public IsParallelAndTouching ( Segment s2, Point &intersectionPoint ) : bool
s2 Segment
intersectionPoint Point
Résultat bool

MoveBy() public méthode

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.
Résultat void

Normalize() public méthode

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
Résultat void

ScaleBy() public méthode

public ScaleBy ( float amountToScaleBy ) : void
amountToScaleBy float
Résultat void

Segment() public méthode

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
Résultat System

Segment() public méthode

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.
Résultat System

Segment() public méthode

public Segment ( Microsoft.Xna.Framework.Vector3 point1, Microsoft.Xna.Framework.Vector3 point2 ) : System
point1 Microsoft.Xna.Framework.Vector3
point2 Microsoft.Xna.Framework.Vector3
Résultat System

Segment() public méthode

public Segment ( double point1X, double point1Y, double point2X, double point2Y ) : System
point1X double
point1Y double
point2X double
point2Y double
Résultat System

SetPoints() public méthode

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
Résultat void

SetPoints() public méthode

public SetPoints ( float x1, float y1, float x2, float y2 ) : void
x1 float
y1 float
x2 float
y2 float
Résultat void

ToString() public méthode

public ToString ( ) : string
Résultat string

ToVector3() public méthode

public ToVector3 ( ) : Microsoft.Xna.Framework.Vector3
Résultat Microsoft.Xna.Framework.Vector3

Property Details

Point1 public_oe property

The first point of the segment.
public Point Point1
Résultat Point

Point2 public_oe property

The second point of the segment.
public Point Point2
Résultat Point

ZeroLength public_oe static_oe property

public static Segment,FlatRedBall.Math.Geometry ZeroLength
Résultat Segment