Gorilla.Physics.Q3.Geometry
Unit Gorilla.Physics.Q3.Geometry.pasRecords
- record TQ3RaycastData
- record TQ3RaycastResult
- record TQ3Edge
- record TQ3AABB
- record TQ3OBB
- record TQ3HalfSpace
- record TQ3Interval
- record TQ3Line
- record TQ3Plane
- record TQ3Sphere
- record TQ3Triangle
- 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 PQ3BVHNode = pointer to TQ3BVHNode;
- type PQ3Mesh = pointer to TQ3Mesh;
- 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 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; const ARot : TQ3Mat3 ) ;
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 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 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 ;
- 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 triangle : PQ3Triangle ) : Boolean ;
- public function Length ( ) : Single ;
- public function LengthSq ( ) : Single ;
- public function GetDirection ( AInverse : Boolean = False ) : TPoint3D ;
TQ3Plane
Fields
Methods
- public constructor Create ( ADummy : Integer ) ;
- public function Contains ( const p : TPoint3D ) : Boolean ;
- public function ClosestPoint ( const p : TPoint3D ) : TPoint3D ;
- public function IntersectsWith ( const AOBB : TQ3OBB ) : Boolean ;
- public function Raycast ( const ray : TQ3RaycastData ) : Single ; overload;
- public function Raycast ( const ray : TQ3RaycastData; AResult : PQ3RaycastResult ) : 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 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 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;
TQ3BVHNode
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;
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;