Module org.dyn4j

Class TimeOfImpact

  • All Implemented Interfaces:
    Copyable<TimeOfImpact>

    public class TimeOfImpact
    extends Object
    implements Copyable<TimeOfImpact>
    Represents the time of impact information between two objects.

    The getTime() is in the range of [0, 1] and represents the time within the current timestep that the collision occurred.

    Since:
    1.2.0
    Version:
    4.0.0
    Author:
    William Bittle
    • Constructor Detail

      • TimeOfImpact

        public TimeOfImpact()
        Default constructor.
    • Method Detail

      • getTime

        public double getTime()
        Returns the time of impact in the range [0, 1].
        Returns:
        double
        Since:
        3.1.5
      • setTime

        public void setTime​(double time)
        Sets the time of impact.
        Parameters:
        time - the time of impact in the range [0, 1]
        Since:
        3.1.5
      • getSeparation

        public Separation getSeparation()
        Returns the separation at the time of impact.
        Returns:
        Separation
      • setSeparation

        public void setSeparation​(Separation separation)
        Sets the separation at the time of impact.
        Parameters:
        separation - the separation