C# Class TerrainDisplay.Collision.Intersection

Exibir arquivo Open project: WCell/WCell-Terrain

Public Methods

Method Description
Barycentric ( System.Vector3 a, System.Vector3 b, System.Vector3 c, System.Vector3 p, System.Vector3 &uvw ) : void
Barycentric2 ( System.Vector3 a, System.Vector3 b, System.Vector3 c, System.Vector3 p, System.Vector2 &uv ) : void
Clamp ( float n, float min, float max ) : float
ClosestPointOnPlane ( System.Vector3 point, Plane plane ) : System.Vector3
ClosestPointOnSegment ( System.Vector3 c, System.Vector3 a, System.Vector3 b, float &t, System.Vector3 &d ) : void
ClosestPtPointAABB ( System.Vector4 p, BoundingBox b, System.Vector3 &q ) : void
ClosestPtPointRect ( System.Vector3 p, System.Vector3 a, System.Vector3 b, System.Vector3 c, System.Vector3 &q ) : void
ClosestPtPointSegment2D ( System.Vector2 c, System.Vector2 a, System.Vector2 b, float &t, System.Vector2 &d ) : void
ClosestPtPointTriangle ( System.Vector3 p, System.Vector3 a, System.Vector3 b, System.Vector3 c ) : System.Vector3
ClosestPtPointTriangleNew ( System.Vector3 p, System.Vector3 a, System.Vector3 b, System.Vector3 c ) : System.Vector3
Corner ( BoundingBox b, int n ) : System.Vector3
DistPointPlane ( System.Vector3 q, Plane p ) : float
IntersectMovingSpherePlane ( BoundingSphere s, System.Vector3 v, Plane p, float &t, System.Vector3 &q ) : bool
IntersectPlanes ( Plane p1, Plane p2, Plane p3, System.Vector3 &p ) : bool
IntersectPlanes ( Plane p1, Plane p2, System.Vector3 &p, System.Vector3 &d ) : bool
IntersectRaySphere ( System.Vector3 p, System.Vector3 d, BoundingSphere s, float &t, System.Vector3 &q ) : bool
IntersectSegmentCylinder ( System.Vector3 sa, System.Vector3 sb, System.Vector3 p, System.Vector3 q, float r, float &t ) : bool
IntersectSegmentPlane ( System.Vector3 a, System.Vector3 b, Plane p, float &t, System.Vector3 &q ) : bool
IntersectSegmentPolyhedron ( System.Vector3 a, System.Vector3 b, Plane p, int n, float &tfirst, float &tlast ) : bool
IntersectSegmentRectangle2D ( System.Vector2 rectMin, System.Vector2 rectMax, System.Vector2 point1, System.Vector2 point2 ) : bool
IntersectSegmentRectangle2DXY ( WCell.Util.Graphics.Rect rect, System.Vector3 point1, System.Vector3 point2 ) : bool
IntersectSegmentTriangle ( System.Vector3 p, System.Vector3 q, System.Vector3 a, System.Vector3 b, System.Vector3 c, float &u, float &v, float &w, float &t ) : bool
IntersectionOfTwoLines ( System.Vector3 a, System.Vector3 b, System.Vector3 c, System.Vector3 d, System.Vector3 &result ) : bool
IsConvexQuad ( System.Vector3 a, System.Vector3 b, System.Vector3 c, System.Vector3 d ) : bool
LineSegmentIntersectsPlane ( System.Vector3 v1, System.Vector3 v2, Plane plane, System.Vector3 &pos ) : bool
PointInTriangle ( System.Vector2 &p, System.Vector2 &a, System.Vector2 &b, System.Vector2 &c ) : bool
PointInTriangle ( System.Vector3 p, System.Vector3 a, System.Vector3 b, System.Vector3 c ) : bool
PointInTriangle2D ( System.Vector2 &p, System.Vector2 &a, System.Vector2 &b, System.Vector2 &c ) : bool
PointInTriangle2DXY ( Point p, System.Vector3 a, System.Vector3 b, System.Vector3 c ) : bool
PointInTriangle2DXY ( System.Vector3 p, System.Vector3 a, System.Vector3 b, System.Vector3 c ) : bool

Checks if point P is inside Triangle ABC using only the X and Y coordinates of the Vector3.

PointInTriangleBarycentric ( System.Vector3 a, System.Vector3 b, System.Vector3 c, System.Vector3 p ) : bool
PointInsideEdge ( System.Vector3 &edgeA, System.Vector3 &edgeB, System.Vector3 &point ) : bool
PointInsidePoly ( System.Vector3 &vA, System.Vector3 &vB, System.Vector3 &vC, System.Vector3 &p ) : bool
RayTriangleIntersect ( Ray r, System.Vector3 vert0, System.Vector3 vert1, System.Vector3 vert2, float &distance ) : bool
RayTriangleIntersect ( System.Vector3 ray_origin, System.Vector3 ray_direction, System.Vector3 vert0, System.Vector3 vert1, System.Vector3 vert2, float &t, float &u, float &v ) : bool
Signed2DTriArea ( System.Vector2 a, System.Vector2 b, System.Vector2 c ) : float
SqDistPointAABB ( System.Vector3 p, BoundingBox b ) : float
SqDistPointSegment ( System.Vector3 a, System.Vector3 b, System.Vector3 c ) : float
Test2DSegmentSegment ( System.Vector2 a, System.Vector2 b, System.Vector2 c, System.Vector2 d, float &t, System.Vector2 &p ) : bool
TestMovingSpherePlane ( System.Vector3 a, System.Vector3 b, float r, Plane p ) : bool
TestMovingSphereSphere ( BoundingSphere s0, BoundingSphere s1, System.Vector3 v0, System.Vector3 v1, float &t ) : bool
TestPointPolyhedron ( System.Vector3 p, Plane planes ) : bool
TestRaySphere ( System.Vector3 p, System.Vector3 d, BoundingSphere s ) : bool
TriArea2D ( System.Vector2 p1, System.Vector2 p2, System.Vector2 p3 ) : float
TriArea2D ( float x1, float y1, float x2, float y2, float x3, float y3 ) : float
Vector3FarthestFromEdge ( System.Vector2 a, System.Vector2 b, System.Vector2 p, int n ) : int

Method Details

Barycentric() public static method

public static Barycentric ( System.Vector3 a, System.Vector3 b, System.Vector3 c, System.Vector3 p, System.Vector3 &uvw ) : void
a System.Vector3
b System.Vector3
c System.Vector3
p System.Vector3
uvw System.Vector3
return void

Barycentric2() public static method

public static Barycentric2 ( System.Vector3 a, System.Vector3 b, System.Vector3 c, System.Vector3 p, System.Vector2 &uv ) : void
a System.Vector3
b System.Vector3
c System.Vector3
p System.Vector3
uv System.Vector2
return void

Clamp() public static method

public static Clamp ( float n, float min, float max ) : float
n float
min float
max float
return float

ClosestPointOnPlane() public static method

public static ClosestPointOnPlane ( System.Vector3 point, Plane plane ) : System.Vector3
point System.Vector3
plane Plane
return System.Vector3

ClosestPointOnSegment() public static method

public static ClosestPointOnSegment ( System.Vector3 c, System.Vector3 a, System.Vector3 b, float &t, System.Vector3 &d ) : void
c System.Vector3
a System.Vector3
b System.Vector3
t float
d System.Vector3
return void

ClosestPtPointAABB() public static method

public static ClosestPtPointAABB ( System.Vector4 p, BoundingBox b, System.Vector3 &q ) : void
p System.Vector4
b BoundingBox
q System.Vector3
return void

ClosestPtPointRect() public static method

public static ClosestPtPointRect ( System.Vector3 p, System.Vector3 a, System.Vector3 b, System.Vector3 c, System.Vector3 &q ) : void
p System.Vector3
a System.Vector3
b System.Vector3
c System.Vector3
q System.Vector3
return void

ClosestPtPointSegment2D() public static method

public static ClosestPtPointSegment2D ( System.Vector2 c, System.Vector2 a, System.Vector2 b, float &t, System.Vector2 &d ) : void
c System.Vector2
a System.Vector2
b System.Vector2
t float
d System.Vector2
return void

ClosestPtPointTriangle() public static method

public static ClosestPtPointTriangle ( System.Vector3 p, System.Vector3 a, System.Vector3 b, System.Vector3 c ) : System.Vector3
p System.Vector3
a System.Vector3
b System.Vector3
c System.Vector3
return System.Vector3

ClosestPtPointTriangleNew() public static method

public static ClosestPtPointTriangleNew ( System.Vector3 p, System.Vector3 a, System.Vector3 b, System.Vector3 c ) : System.Vector3
p System.Vector3
a System.Vector3
b System.Vector3
c System.Vector3
return System.Vector3

Corner() public static method

public static Corner ( BoundingBox b, int n ) : System.Vector3
b BoundingBox
n int
return System.Vector3

DistPointPlane() public static method

public static DistPointPlane ( System.Vector3 q, Plane p ) : float
q System.Vector3
p Plane
return float

IntersectMovingSpherePlane() public static method

public static IntersectMovingSpherePlane ( BoundingSphere s, System.Vector3 v, Plane p, float &t, System.Vector3 &q ) : bool
s BoundingSphere
v System.Vector3
p Plane
t float
q System.Vector3
return bool

IntersectPlanes() public static method

public static IntersectPlanes ( Plane p1, Plane p2, Plane p3, System.Vector3 &p ) : bool
p1 Plane
p2 Plane
p3 Plane
p System.Vector3
return bool

IntersectPlanes() public static method

public static IntersectPlanes ( Plane p1, Plane p2, System.Vector3 &p, System.Vector3 &d ) : bool
p1 Plane
p2 Plane
p System.Vector3
d System.Vector3
return bool

IntersectRaySphere() public static method

public static IntersectRaySphere ( System.Vector3 p, System.Vector3 d, BoundingSphere s, float &t, System.Vector3 &q ) : bool
p System.Vector3
d System.Vector3
s BoundingSphere
t float
q System.Vector3
return bool

IntersectSegmentCylinder() public static method

public static IntersectSegmentCylinder ( System.Vector3 sa, System.Vector3 sb, System.Vector3 p, System.Vector3 q, float r, float &t ) : bool
sa System.Vector3
sb System.Vector3
p System.Vector3
q System.Vector3
r float
t float
return bool

IntersectSegmentPlane() public static method

public static IntersectSegmentPlane ( System.Vector3 a, System.Vector3 b, Plane p, float &t, System.Vector3 &q ) : bool
a System.Vector3
b System.Vector3
p Plane
t float
q System.Vector3
return bool

IntersectSegmentPolyhedron() public static method

public static IntersectSegmentPolyhedron ( System.Vector3 a, System.Vector3 b, Plane p, int n, float &tfirst, float &tlast ) : bool
a System.Vector3
b System.Vector3
p Plane
n int
tfirst float
tlast float
return bool

IntersectSegmentRectangle2D() public static method

public static IntersectSegmentRectangle2D ( System.Vector2 rectMin, System.Vector2 rectMax, System.Vector2 point1, System.Vector2 point2 ) : bool
rectMin System.Vector2
rectMax System.Vector2
point1 System.Vector2
point2 System.Vector2
return bool

IntersectSegmentRectangle2DXY() public static method

public static IntersectSegmentRectangle2DXY ( WCell.Util.Graphics.Rect rect, System.Vector3 point1, System.Vector3 point2 ) : bool
rect WCell.Util.Graphics.Rect
point1 System.Vector3
point2 System.Vector3
return bool

IntersectSegmentTriangle() public static method

public static IntersectSegmentTriangle ( System.Vector3 p, System.Vector3 q, System.Vector3 a, System.Vector3 b, System.Vector3 c, float &u, float &v, float &w, float &t ) : bool
p System.Vector3
q System.Vector3
a System.Vector3
b System.Vector3
c System.Vector3
u float
v float
w float
t float
return bool

IntersectionOfTwoLines() public static method

public static IntersectionOfTwoLines ( System.Vector3 a, System.Vector3 b, System.Vector3 c, System.Vector3 d, System.Vector3 &result ) : bool
a System.Vector3
b System.Vector3
c System.Vector3
d System.Vector3
result System.Vector3
return bool

IsConvexQuad() public static method

public static IsConvexQuad ( System.Vector3 a, System.Vector3 b, System.Vector3 c, System.Vector3 d ) : bool
a System.Vector3
b System.Vector3
c System.Vector3
d System.Vector3
return bool

LineSegmentIntersectsPlane() public static method

public static LineSegmentIntersectsPlane ( System.Vector3 v1, System.Vector3 v2, Plane plane, System.Vector3 &pos ) : bool
v1 System.Vector3
v2 System.Vector3
plane Plane
pos System.Vector3
return bool

PointInTriangle() public static method

public static PointInTriangle ( System.Vector2 &p, System.Vector2 &a, System.Vector2 &b, System.Vector2 &c ) : bool
p System.Vector2
a System.Vector2
b System.Vector2
c System.Vector2
return bool

PointInTriangle() public static method

public static PointInTriangle ( System.Vector3 p, System.Vector3 a, System.Vector3 b, System.Vector3 c ) : bool
p System.Vector3
a System.Vector3
b System.Vector3
c System.Vector3
return bool

PointInTriangle2D() public static method

public static PointInTriangle2D ( System.Vector2 &p, System.Vector2 &a, System.Vector2 &b, System.Vector2 &c ) : bool
p System.Vector2
a System.Vector2
b System.Vector2
c System.Vector2
return bool

PointInTriangle2DXY() public static method

public static PointInTriangle2DXY ( Point p, System.Vector3 a, System.Vector3 b, System.Vector3 c ) : bool
p Point
a System.Vector3
b System.Vector3
c System.Vector3
return bool

PointInTriangle2DXY() public static method

Checks if point P is inside Triangle ABC using only the X and Y coordinates of the Vector3.
public static PointInTriangle2DXY ( System.Vector3 p, System.Vector3 a, System.Vector3 b, System.Vector3 c ) : bool
p System.Vector3
a System.Vector3
b System.Vector3
c System.Vector3
return bool

PointInTriangleBarycentric() public static method

public static PointInTriangleBarycentric ( System.Vector3 a, System.Vector3 b, System.Vector3 c, System.Vector3 p ) : bool
a System.Vector3
b System.Vector3
c System.Vector3
p System.Vector3
return bool

PointInsideEdge() public static method

public static PointInsideEdge ( System.Vector3 &edgeA, System.Vector3 &edgeB, System.Vector3 &point ) : bool
edgeA System.Vector3
edgeB System.Vector3
point System.Vector3
return bool

PointInsidePoly() public static method

public static PointInsidePoly ( System.Vector3 &vA, System.Vector3 &vB, System.Vector3 &vC, System.Vector3 &p ) : bool
vA System.Vector3
vB System.Vector3
vC System.Vector3
p System.Vector3
return bool

RayTriangleIntersect() public static method

public static RayTriangleIntersect ( Ray r, System.Vector3 vert0, System.Vector3 vert1, System.Vector3 vert2, float &distance ) : bool
r Ray
vert0 System.Vector3
vert1 System.Vector3
vert2 System.Vector3
distance float
return bool

RayTriangleIntersect() public static method

public static RayTriangleIntersect ( System.Vector3 ray_origin, System.Vector3 ray_direction, System.Vector3 vert0, System.Vector3 vert1, System.Vector3 vert2, float &t, float &u, float &v ) : bool
ray_origin System.Vector3
ray_direction System.Vector3
vert0 System.Vector3
vert1 System.Vector3
vert2 System.Vector3
t float
u float
v float
return bool

Signed2DTriArea() public static method

public static Signed2DTriArea ( System.Vector2 a, System.Vector2 b, System.Vector2 c ) : float
a System.Vector2
b System.Vector2
c System.Vector2
return float

SqDistPointAABB() public static method

public static SqDistPointAABB ( System.Vector3 p, BoundingBox b ) : float
p System.Vector3
b BoundingBox
return float

SqDistPointSegment() public static method

public static SqDistPointSegment ( System.Vector3 a, System.Vector3 b, System.Vector3 c ) : float
a System.Vector3
b System.Vector3
c System.Vector3
return float

Test2DSegmentSegment() public static method

public static Test2DSegmentSegment ( System.Vector2 a, System.Vector2 b, System.Vector2 c, System.Vector2 d, float &t, System.Vector2 &p ) : bool
a System.Vector2
b System.Vector2
c System.Vector2
d System.Vector2
t float
p System.Vector2
return bool

TestMovingSpherePlane() public static method

public static TestMovingSpherePlane ( System.Vector3 a, System.Vector3 b, float r, Plane p ) : bool
a System.Vector3
b System.Vector3
r float
p Plane
return bool

TestMovingSphereSphere() public static method

public static TestMovingSphereSphere ( BoundingSphere s0, BoundingSphere s1, System.Vector3 v0, System.Vector3 v1, float &t ) : bool
s0 BoundingSphere
s1 BoundingSphere
v0 System.Vector3
v1 System.Vector3
t float
return bool

TestPointPolyhedron() public static method

public static TestPointPolyhedron ( System.Vector3 p, Plane planes ) : bool
p System.Vector3
planes Plane
return bool

TestRaySphere() public static method

public static TestRaySphere ( System.Vector3 p, System.Vector3 d, BoundingSphere s ) : bool
p System.Vector3
d System.Vector3
s BoundingSphere
return bool

TriArea2D() public static method

public static TriArea2D ( System.Vector2 p1, System.Vector2 p2, System.Vector2 p3 ) : float
p1 System.Vector2
p2 System.Vector2
p3 System.Vector2
return float

TriArea2D() public static method

public static TriArea2D ( float x1, float y1, float x2, float y2, float x3, float y3 ) : float
x1 float
y1 float
x2 float
y2 float
x3 float
y3 float
return float

Vector3FarthestFromEdge() public static method

public static Vector3FarthestFromEdge ( System.Vector2 a, System.Vector2 b, System.Vector2 p, int n ) : int
a System.Vector2
b System.Vector2
p System.Vector2
n int
return int