Gorilla.Physics.Q3.Geometry
Unit Gorilla.Physics.Q3.Geometry.pasRecords
- record TQ3RaycastData
- record TQ3RaycastResult
- record TQ3Edge
- record TQ3PlaneVec
- record TQ3AABB
- record TQ3OBB
- record TQ3HalfSpace
- record TQ3Interval
- record TQ3Line
- record TQ3Plane
- record TQ3Sphere
- record TQ3Cylinder
- record TQ3Triangle
- record TQ3Capsule
- record TQ3BVHNode
- record TQ3Mesh
- record TQ3Model
Mics. types
- type PQ3Triangle = pointer to TQ3Triangle;
- type PQ3RaycastData = pointer to TQ3RaycastData;
- type PQ3RaycastResult = pointer to TQ3RaycastResult;
- type PQ3Edge = pointer to TQ3Edge;
- type PQ3AABB = pointer to TQ3AABB;
- type PQ3OBB = pointer to TQ3OBB;
- type PQ3HalfSpace = pointer to TQ3HalfSpace;
- type PQ3Interval = pointer to TQ3Interval;
- type PQ3Line = pointer to TQ3Line;
- type PQ3Plane = pointer to TQ3Plane;
- type PQ3Mesh = pointer to TQ3Mesh;
- type PQ3BVHNode = pointer to TQ3BVHNode;
- type PQ3Model = pointer to TQ3Model;
Functions / Procedures
- public function CMP ( const X : Single; const Y : Single ) : Boolean ;
- public procedure q3ComputeBasis ( const a : TPoint3D; var b : TPoint3D; var c : TPoint3D ) ;
- public function q3AABBToAABB ( const a : TQ3AABB; const b : TQ3AABB ) : Boolean ;
- public function q3OBBToOBB ( const obb1 : TQ3OBB; const obb2 : TQ3OBB ) : Boolean ;
- public function q3MeshToAABB ( const AMesh : PQ3Mesh; const AABB : TQ3AABB ) : Boolean ; overload;
- public function q3MeshToAABB ( const AMesh : PQ3Mesh; const AABB : TQ3AABB; out ANode : PQ3BVHNode ) : Boolean ; overload;
- public function q3ModelToAABB ( const AModel : PQ3Model; const AABB : TQ3AABB ) : Boolean ; overload;
- public function q3ModelToAABB ( const AModel : PQ3Model; const AABB : TQ3AABB; out ANode : PQ3BVHNode ) : Boolean ; overload;
- public function q3ModelToOBB ( const AModel : PQ3Model; const AOBB : TQ3OBB ) : Boolean ; overload;
- public function q3ModelToOBB ( const AModel : PQ3Model; const AOBB : TQ3OBB; out ANode : PQ3BVHNode ) : Boolean ; overload;
- public function q3Combine ( const A : TQ3AABB; const B : TQ3AABB ) : TQ3AABB ;
- public procedure SplitBVHNode ( ANode : PQ3BVHNode; const AModel : PQ3Mesh; ADepth : Integer ) ;
- public procedure FreeBVHNode ( ANode : PQ3BVHNode ) ;
- public procedure AccelerateMesh ( AMesh : PQ3Mesh ) ;
- public procedure FreeMesh ( AMesh : PQ3Mesh ) ;
- public function GetInterval ( const ATriangle : TQ3Triangle; const AAxis : TPoint3D ) : TQ3Interval ; overload;
- public function GetInterval ( const AABB : TQ3AABB; const AAxis : TPoint3D ) : TQ3Interval ; overload;
- public function GetInterval ( const OBB : TQ3OBB; const AAxis : TPoint3D ) : TQ3Interval ; overload;
- public function OverlapOnAxis ( const AABB : TQ3AABB; const ATriangle : PQ3Triangle; const AAxis : TPoint3D ) : Boolean ; overload;
- public function OverlapOnAxis ( const OBB : TQ3OBB; const ATriangle : PQ3Triangle; const AAxis : TPoint3D ) : Boolean ; overload;
- public function OverlapOnAxis ( const obb1 : TQ3OBB; const obb2 : TQ3OBB; const AAxis : TPoint3D ) : Boolean ; overload;
- public function OverlapOnAxis ( const t1 : PQ3Triangle; const t2 : PQ3Triangle; const AAxis : TPoint3D ) : Boolean ; overload;
TQ3AABB
Fields
Methods
- public constructor Create ( X : Single; Y : Single; Z : Single ) ; public constructor CreateFromOrigin ( const AOrigin : TPoint3D; const ASize : TPoint3D ) ; public constructor FromMinMax ( AMin : TPoint3D; AMax : TPoint3D ) ; public constructor FromBoundingBox ( ABox : TBoundingBox ) ;
- public function Zero ( ) : TQ3AABB ; static;
- public function Contains ( const Other : TQ3AABB ) : Boolean ; overload;
- public function Contains ( const Point : TPoint3D ) : Boolean ; overload;
- public function SurfaceArea ( ) : Single ;
- public function Raycast ( const ARay : TQ3RaycastData ) : Single ;
- public function Combine ( B : TQ3AABB ) : TQ3AABB ;
- public function GetPosition ( ) : TPoint3D ;
- public function GetSize ( ) : TPoint3D ;
- public function GetExtent ( ) : TPoint3D ;
- public procedure Transform ( const APos : TPoint3D ) ; overload;
- public procedure Transform ( const ARot : TQ3Mat3 ) ; overload;
- public procedure Transform ( const APos : TPoint3D; const ARot : TQ3Mat3 ) ; overload;
TQ3OBB
Fields
Methods
- public constructor Create ( AWidth : Single; AHeight : Single; ADepth : Single ) ; public constructor Create ( ASize : TPoint3D; APosition : TPoint3D ) ; public constructor Create ( ASize : TPoint3D; APosition : TPoint3D; AOrientation : TQ3Mat3 ) ;
- public function Zero ( ) : TQ3OBB ; static;
- public function GetAxis ( AIndex : Integer ) : PPoint3D ;
- public function Contains ( const APoint : TPoint3D ) : Boolean ;
- public procedure GetCorners ( out AVertices : TArray<System.Math.Vectors.TPoint3D> ) ;
- public function GetEdges ( ) : TQ3EdgeArray ;
- public function GetPlanes ( ) : TQ3PlaneVecArray ;
- public function GetAABB ( ) : TQ3AABB ;
- public function ToMeshData ( ) : TMeshData ;
- public function ClosestPoint ( const APoint : TPoint3D ) : TPoint3D ;
- public function Raycast ( const ARay : TQ3RaycastData ) : Single ; overload;
- public function Raycast ( const ARay : TQ3RaycastData; AResult : PQ3RaycastResult ) : Single ; overload;
TQ3HalfSpace
Fields
Methods
- public constructor Create ( ADummy : Integer ) ; public constructor Create ( const ANormal : TPoint3D; ADistance : Single ) ;
- public procedure _Set ( const A : TPoint3D; const B : TPoint3D; const C : TPoint3D ) ; overload;
- public procedure _Set ( const N : TPoint3D; const P : TPoint3D ) ; overload;
- public function Origin ( ) : TPoint3D ;
- public function GetDistance ( const P : TPoint3D ) : Single ;
- public function Projected ( const P : TPoint3D ) : TPoint3D ;
TQ3Line
Fields
Methods
- public constructor Create ( ADummy : Integer ) ; public constructor Create ( const A : TPoint3D; const B : TPoint3D ) ; public constructor Create ( AEdge : TQ3Edge ) ;
- public function Contains ( const p : TPoint3D ) : Boolean ;
- public function ClosestPoint ( const p : TPoint3D ) : TPoint3D ; overload;
- public function ClosestPoint ( ALine : TQ3Line ) : TPoint3D ; overload;
- public function SphereLinetest ( const APos : TPoint3D; const ARadius : Single ) : Boolean ;
- public function AABBLinetest ( const AABB : TQ3AABB ) : Boolean ;
- public function OBBLinetest ( const OBB : TQ3OBB ) : Boolean ; overload;
- public function OBBLinetest ( const OBB : TQ3OBB; AResult : PQ3RaycastResult ) : Boolean ; overload;
- public function TriangleLinetest ( const ATri : PQ3Triangle ) : Boolean ; overload;
- public function TriangleLinetest ( const ATri : PQ3Triangle; out APoint : TPoint3D; out ANormal : TPoint3D; out ADistance : Single ) : Boolean ; overload;
- public function Length ( ) : Single ;
- public function LengthSq ( ) : Single ;
- public function GetDirection ( AInverse : Boolean = False ) : TPoint3D ;
- public function GetDistance ( ALine : TQ3Line ) : Single ;
- public function GetSegmentDistance ( S2 : TQ3Line ) : Single ;
TQ3Plane
Fields
Methods
- public constructor Create ( ADummy : Integer ) ; public constructor Create ( const AVec : TQ3PlaneVec ) ; public constructor Create ( const A : TPoint3D; const B : TPoint3D; const C : TPoint3D ) ;
- public function ToQ3PlaneVec ( ) : TQ3PlaneVec ;
- public function CenterPoint ( ) : TPoint3D ;
- public function Contains ( const p : TPoint3D ) : Boolean ;
- public function ClosestPoint ( const p : TPoint3D ) : TPoint3D ;
- public function IntersectsWith ( const AOBB : TQ3OBB ) : Boolean ; overload;
- public function IntersectsWith ( const APlane : TQ3Plane; out ALen : Single ) : Boolean ; overload;
- public function GetDistanceToPoint ( P : TPoint3D ) : Single ;
- public function Raycast ( const ray : TQ3RaycastData ) : Single ; overload;
- public function Raycast ( const ray : TQ3RaycastData; AResult : PQ3RaycastResult ) : Boolean ; overload;
TQ3Sphere
Fields
Methods
- public constructor Create ( APos : TPoint3D; ARadius : Single ) ;
- public function Contains ( const p : TPoint3D ) : Boolean ;
- public function ClosestPoint ( const p : TPoint3D ) : TPoint3D ;
- public function Intersects ( const p : TQ3Plane; out C : TPoint3D ) : Boolean ; overload;
- public function Intersects ( const AOBB : TQ3OBB; out C : TPoint3D ) : Boolean ; overload;
TQ3Triangle
Fields
Methods
- public constructor Create ( const ADummy : Integer ) ; public constructor Create ( const APoint1 : TPoint3D; const APoint2 : TPoint3D; const APoint3 : TPoint3D ) ;
- public function Contains ( const p : TPoint3D ) : Boolean ;
- public function ToPlane ( ) : TQ3Plane ;
- public function ToAABB ( ) : TQ3AABB ;
- public function GetLine ( AIndex : Integer; AInverse : Boolean = False ) : TQ3Line ;
- public function ClosestPoint
(
const
p :
TPoint3D
)
: TPoint3D
;
Computes the closest point on a triangle to the source point.
- public function ClosestPoint2
(
const
pSource :
TPoint3D
)
: TPoint3D
;
Computes the closest point on a triangle to the source point. This method is a bit faster than ClosestPoint() because of less method calls.
- public procedure Transform ( const APos : TPoint3D; const ARot : TQ3Mat3 ) ; overload;
- public procedure Transform ( const AMat : TMatrix3D ) ; overload;
- public function IntersectsWith ( const AABB : TQ3AABB ) : Boolean ; overload;
- public function IntersectsWith ( const OBB : TQ3OBB ) : Boolean ; overload;
- public function IntersectsWith ( const ATriangle : TQ3Triangle ) : Boolean ; overload;
- public function IntersectsWithRobust ( const ATriangle : TQ3Triangle ) : Boolean ;
- public function IntersectsWith ( const Sphere : TQ3Sphere ) : Boolean ; overload;
- public function SatCrossEdge ( const A : TPoint3D; const B : TPoint3D; const C : TPoint3D; const D : TPoint3D ) : TPoint3D ;
- public function Barycentric ( const p : TPoint3D ) : TPoint3D ;
- public function Center ( ) : TPoint3D ;
- public function Normal ( ) : TPoint3D ;
- public function Raycast ( const ray : TQ3RaycastData ) : Single ; overload;
- public function Raycast ( const ray : TQ3RaycastData; AResult : PQ3RaycastResult ) : Boolean ; overload;
- public function Raycast ( const OBB : TQ3OBB; var AResult : TArray<Gorilla.Physics.Q3.Geometry.TQ3RaycastResult> ) : Boolean ; overload;
- public function Raycast ( const ATriangle : TQ3Triangle; var AResult : TArray<Gorilla.Physics.Q3.Geometry.TQ3RaycastResult> ) : Boolean ; overload;
TQ3Capsule
Fields
Methods
- public constructor Create ( APos : TPoint3D; ARotation : TQ3Mat3; ARadius : Single; AHeight : Single ) ;
- public function GetAxisLine ( ) : TQ3Line ;
- public function GetInnerAxisLine ( ) : TQ3Line ;
- public function GetTip
(
)
: TPoint3D
;
Returns the highest point incl. radius.
- public function GetBase
(
)
: TPoint3D
;
Returns the lowest point incl. radius.
- public function GetA
(
)
: TPoint3D
;
Returns the top point, which is the center of the top-halfsphere.
- public function GetB
(
)
: TPoint3D
;
Returns the lower point, which is the center of the bottom-halfsphere.
- public procedure GetATransform
(
const
AWithRad :
Boolean; out
ATransf :
TMatrix3D
)
;
Returns a transformation matrix incl. rotation and translation to retrieve the current world position for the tip or A point.
- public procedure GetBTransform
(
const
AWithRad :
Boolean; out
ATransf :
TMatrix3D
)
;
Returns a transformation matrix incl. rotation and translation to retrieve the current world position for the base or B point.
- public function SqDistPointSegment ( const p : TPoint3D; const s0 : TPoint3D; const s1 : TPoint3D ) : Single ; static;
- public function ClosestPointOnLineSegment ( const line1 : TPoint3D; const line2 : TPoint3D; const point : TPoint3D; out d : Single ) : TPoint3D ; static;
- public function IntersectsWith ( const ACapsule : TQ3Capsule; out APoints : TArray<System.Math.Vectors.TPoint3D>; out ANormals : TArray<System.Math.Vectors.TPoint3D>; out ADistances : TArray<System.Single> ) : Boolean ; overload;
- public function IntersectsWith ( const ASphere : TQ3Sphere; out APoint : TPoint3D; out ANormal : TPoint3D; out ADistance : Single ) : Boolean ; overload;
- public function IntersectsWith ( const AOBB : TQ3OBB; out APoints : TArray<System.Math.Vectors.TPoint3D>; out ANormals : TArray<System.Math.Vectors.TPoint3D>; out ADistances : TArray<System.Single> ) : Boolean ; overload;
- public function IntersectsWith ( const ATri : TQ3Triangle; out APoint : TPoint3D; out ANormal : TPoint3D; out ADistance : Single ) : Boolean ; overload;
- public function GetAABB ( ) : TQ3AABB ;
- public function GetOBB ( ) : TQ3OBB ;
TQ3BVHNode
Fields
- public Bounds :
TQ3AABB
- public Children :
:TQ3BVHNode.:1
- public NumTriangles :
Integer
- public Triangles :
:TQ3BVHNode.:2
Methods
- public constructor Create ( ADummy : Integer ) ;
- public function IntersectsWith ( const A : TQ3AABB ) : Boolean ; overload;
- public function IntersectsWith ( const A : TQ3AABB; out ANode : PQ3BVHNode ) : Boolean ; overload;
- public function Raycast ( const AMesh : PQ3Mesh; const APos : TPoint3D; const ARot : TQ3Mat3; const ARay : TQ3RaycastData; AResult : PQ3RaycastResult ) : Single ;
TQ3Mesh
Fields
Methods
- public constructor Create ( ADummy : Integer ) ; public constructor Create ( const AData : TMeshData; const ALocal : TMatrix3D ) ;
- private function GetVertex ( AIndex : Integer ) : PPoint3D ;
- private procedure SetVertex ( AIndex : Integer; AValue : PPoint3D ) ;
- private function GetValue ( AIndex : Integer ) : PSingle ;
- private procedure SetValue ( AIndex : Integer; AValue : PSingle ) ;
- public function ToMeshData ( ) : TMeshData ;
- public function IntersectsWith ( const A : TQ3AABB ) : Boolean ; overload;
- public function IntersectsWith ( const A : TQ3AABB; out ANode : PQ3BVHNode ) : Boolean ; overload;
- public function Raycast ( const APos : TPoint3D; const ARot : TQ3Mat3; const ARay : TQ3RaycastData; AResult : PQ3RaycastResult ) : Single ; overload;
Properties
TQ3Model
Fields
- private FContent :
PQ3Mesh
- private FBounds :
TQ3AABB
- public Position :
PPoint3D
- public Rotation :
PQ3Mat3
- public Parent :
PQ3Model
Methods
- public constructor Create ( ADummy : Integer ) ; public constructor Create ( AMesh : PQ3Mesh ) ;
- public function GetMesh ( ) : PQ3Mesh ;
- public function GetBounds ( ) : TQ3AABB ;
- public procedure SetContent ( const AMesh : PQ3Mesh ) ;
- public function GetOBB ( ) : TQ3OBB ;
- public function IntersectsWith ( const A : TQ3AABB ) : Boolean ; overload;
- public function IntersectsWith ( const A : TQ3AABB; out ANode : PQ3BVHNode ) : Boolean ; overload;
- public function IntersectsWith ( const A : TQ3OBB; out ANode : PQ3BVHNode ) : Boolean ; overload;