| PlaneBoxAlgorithmGetTimeOfImpact Method |
Gets the time of impact between two moving objects.
Namespace: DigitalRune.Geometry.Collisions.AlgorithmsAssembly: DigitalRune.Geometry (in DigitalRune.Geometry.dll) Version: 1.18.0.0 (1.18.2.14427)
Syntax public override float GetTimeOfImpact(
CollisionObject objectA,
Pose targetPoseA,
CollisionObject objectB,
Pose targetPoseB,
float allowedPenetration
)
Public Overrides Function GetTimeOfImpact (
objectA As CollisionObject,
targetPoseA As Pose,
objectB As CollisionObject,
targetPoseB As Pose,
allowedPenetration As Single
) As Single
public:
virtual float GetTimeOfImpact(
CollisionObject^ objectA,
Pose targetPoseA,
CollisionObject^ objectB,
Pose targetPoseB,
float allowedPenetration
) override
abstract GetTimeOfImpact :
objectA : CollisionObject *
targetPoseA : Pose *
objectB : CollisionObject *
targetPoseB : Pose *
allowedPenetration : float32 -> float32
override GetTimeOfImpact :
objectA : CollisionObject *
targetPoseA : Pose *
objectB : CollisionObject *
targetPoseB : Pose *
allowedPenetration : float32 -> float32
Parameters
- objectA
- Type: DigitalRune.Geometry.CollisionsCollisionObject
The object A. - targetPoseA
- Type: DigitalRune.GeometryPose
The target pose of A. - objectB
- Type: DigitalRune.Geometry.CollisionsCollisionObject
The object B. - targetPoseB
- Type: DigitalRune.GeometryPose
The target pose of B. - allowedPenetration
- Type: SystemSingle
The allowed penetration. A positive allowed penetration value makes sure that the objects
have a measurable contact at the time of impact.
Return Value
Type:
SingleThe time of impact in the range [0, 1].
Exceptions Remarks
Both objects are moved from their current pose (time = 0) to the given target pose (time =
1). If they collide during this movement the first time of impact is returned. A time of
impact of 1 can mean that the objects do not collide or they collide at their target
positions.
The result is undefined if the objects are already in contact at their start poses.
Notes to Inheritors: The base implementation already computes the time of
impact for convex shapes. For other shapes it returns 1. Optimized versions should be
implemented in derived classes.
See Also