HeightFieldAlgorithmGetTimeOfImpact Method |
Namespace: DigitalRune.Geometry.Collisions.Algorithms
public override float GetTimeOfImpact( CollisionObject objectA, Pose targetPoseA, CollisionObject objectB, Pose targetPoseB, float allowedPenetration )
Exception | Condition |
---|---|
ArgumentException | Neither objectA nor objectB contains a HeightField. |
ArgumentNullException | objectA or objectB is . |
NotSupportedException | objectA or objectB contains a HeightField with a negative scaling. Computing collisions for height fields with a negative scaling is not supported. |
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.