Description | Hierarchy | Fields | Methods | Properties |
type TSceneCollisionManager = class(TReferenceCounted)
The Scene Collision Manager provides methods for performing collision tests and picking on scene nodes.
![]() |
constructor Create(Ref: Pointer; NManager: TReferenceCounted; AutoDrop: Boolean = False); |
![]() |
function GetCollisionPoint(const Ray: TLine3D; Selector: TTriangleSelector; out CollisionPoint: TVector3D; out Triangle: TTriangle; out Node: TSceneNode): Boolean; inline; |
![]() |
function GetCollisionResultPosition(Selector: TTriangleSelector; const EllipsoidPosition, EllipsoidRadius, EllipsoidDirectionAndSpeed: TVector3D; out Triangle: TTriangle; out HitPosition: TVector3D; out Falling: Boolean; out Node: TSceneNode; SlidingSpeed: Single = 0.0005): TVector3D; overload; inline; |
![]() |
function GetCollisionResultPosition(Selector: TTriangleSelector; const EllipsoidPosition, EllipsoidRadius, EllipsoidDirectionAndSpeed: TVector3D; out Triangle: TTriangle; out HitPosition: TVector3D; out Falling: Boolean; out Node: TSceneNode; SlidingSpeed: Single; const Gravity: TVector3D): TVector3D; overload; inline; |
![]() |
function GetRayFromScreenCoordinates(const Pos: TPoint; Camera: TCameraSceneNode): TLine3D; inline; |
![]() |
function GetSceneNodeAndCollisionPointFromRay(const Ray: TLine3D; out CollisionPoint: TVector3D; out Triangle: TTriangle; BitMask: LongInt = 0; CollisionRootNode: TSceneNode = nil; NoDebugObjects: Boolean = false): TSceneNode; inline; |
![]() |
function GetSceneNodeFromCameraBB(Camera: TCameraSceneNode; BitMask: LongInt = 0; NoDebugObjects: Boolean = False): TSceneNode; inline; |
![]() |
function GetSceneNodeFromRayBB(const Ray: TLine3D; IDBitMask: LongInt = 0; NoDebugObjects: Boolean = False; Root: TSceneNode = nil): TSceneNode; inline; |
![]() |
function GetScreenCoordinatesFrom3DPosition(const Pos: TVector3D; Camera: TCameraSceneNode = nil): TPoint; inline; |
![]() |
constructor Create(Ref: Pointer; NManager: TReferenceCounted; AutoDrop: Boolean = False); |
Constructor. Only used internally. |
![]() |
function GetCollisionPoint(const Ray: TLine3D; Selector: TTriangleSelector; out CollisionPoint: TVector3D; out Triangle: TTriangle; out Node: TSceneNode): Boolean; inline; |
Finds the nearest collision point of a line and lots of triangles, if there is one. Parameters
ReturnsTrue if a collision was detected and false if not. |
![]() |
function GetCollisionResultPosition(Selector: TTriangleSelector; const EllipsoidPosition, EllipsoidRadius, EllipsoidDirectionAndSpeed: TVector3D; out Triangle: TTriangle; out HitPosition: TVector3D; out Falling: Boolean; out Node: TSceneNode; SlidingSpeed: Single = 0.0005): TVector3D; overload; inline; |
Collides a moving ellipsoid with a 3d world with gravity and returns the resulting new position of the ellipsoid. Parameters
ReturnsNew position of the ellipsoid. |
![]() |
function GetCollisionResultPosition(Selector: TTriangleSelector; const EllipsoidPosition, EllipsoidRadius, EllipsoidDirectionAndSpeed: TVector3D; out Triangle: TTriangle; out HitPosition: TVector3D; out Falling: Boolean; out Node: TSceneNode; SlidingSpeed: Single; const Gravity: TVector3D): TVector3D; overload; inline; |
Collides a moving ellipsoid with a 3d world with gravity and returns the resulting new position of the ellipsoid. Parameters
ReturnsNew position of the ellipsoid. |
![]() |
function GetRayFromScreenCoordinates(const Pos: TPoint; Camera: TCameraSceneNode): TLine3D; inline; |
Returns a 3d ray which would go through the 2d screen coodinates. Parameters
ReturnsRay starting from the position of the camera and ending at a length of the far value of the camera at a position which would be behind the 2d screen coodinates. |
![]() |
function GetSceneNodeAndCollisionPointFromRay(const Ray: TLine3D; out CollisionPoint: TVector3D; out Triangle: TTriangle; BitMask: LongInt = 0; CollisionRootNode: TSceneNode = nil; NoDebugObjects: Boolean = false): TSceneNode; inline; |
Perform a ray/box and ray/triangle collision check on a heirarchy of scene nodes. Parameters
ReturnsThe scene node containing the hit triangle nearest to ray.start. If no collision is detected, then nil is returned. |
![]() |
function GetSceneNodeFromCameraBB(Camera: TCameraSceneNode; BitMask: LongInt = 0; NoDebugObjects: Boolean = False): TSceneNode; inline; |
Get the scene node, which the given camera is looking at and whose id matches the bitmask. Parameters
ReturnsScene node nearest to the camera, which collides with the ray and matches the BitMask, if the mask is not null. If no scene node is found, nil is returned. |
![]() |
function GetSceneNodeFromRayBB(const Ray: TLine3D; IDBitMask: LongInt = 0; NoDebugObjects: Boolean = False; Root: TSceneNode = nil): TSceneNode; inline; |
Returns the nearest scene node which collides with a 3d ray and whose id matches a bitmask. Parameters
ReturnsScene node nearest to ray.start, which collides with the ray and matches the BitMask, if the mask is not nil. If no scene node is found, nil is returned. |
![]() |
function GetScreenCoordinatesFrom3DPosition(const Pos: TVector3D; Camera: TCameraSceneNode = nil): TPoint; inline; |
Calculates 2d screen position from a 3d position. Parameters
Returns2D screen coordinates which a object in the 3d world would have if it would be rendered to the screen. If the 3d position is behind the camera, it is set to (-10000,-10000). In most cases you can ignore this fact, because if you use this method for drawing a decorator over a 3d object, it will be clipped by the screen borders. |