- Object
-
- 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 Summary
Constructors Constructor Description TimeOfImpact()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TimeOfImpact
copy()
Returns a deep copy of this object.void
copy(TimeOfImpact toi)
Copies (deep) the givenTimeOfImpact
to thisTimeOfImpact
.Separation
getSeparation()
Returns the separation at the time of impact.double
getTime()
Returns the time of impact in the range [0, 1].void
setSeparation(Separation separation)
Sets the separation at the time of impact.void
setTime(double time)
Sets the time of impact.String
toString()
-
-
-
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
-
copy
public void copy(TimeOfImpact toi)
Copies (deep) the givenTimeOfImpact
to thisTimeOfImpact
.- Parameters:
toi
- the time of impact data to copy- Since:
- 4.0.0
-
copy
public TimeOfImpact copy()
Description copied from interface:Copyable
Returns a deep copy of this object.- Specified by:
copy
in interfaceCopyable<TimeOfImpact>
- Returns:
- T
-
-