Module technology.sola.engine
Package technology.sola.engine.physics
Record Class MinimumTranslationVector
java.lang.Object
java.lang.Record
technology.sola.engine.physics.MinimumTranslationVector
- Record Components:
normal
- the collision normalpenetration
- the penetration of the collision
@NullMarked
public record MinimumTranslationVector(Vector2D normal, float penetration)
extends Record
The minimum translation vector contains the information needed to resolve a collision.
-
Constructor Summary
ConstructorsConstructorDescriptionMinimumTranslationVector
(Vector2D normal, float penetration) Creates an instance of aMinimumTranslationVector
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.normal()
Returns the value of thenormal
record component.float
Returns the value of thepenetration
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
MinimumTranslationVector
Creates an instance of aMinimumTranslationVector
record class.- Parameters:
normal
- the value for thenormal
record componentpenetration
- the value for thepenetration
record component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
normal
Returns the value of thenormal
record component.- Returns:
- the value of the
normal
record component
-
penetration
public float penetration()Returns the value of thepenetration
record component.- Returns:
- the value of the
penetration
record component
-