This commit is contained in:
minjaesong
2023-08-10 23:49:43 +09:00
parent c0c98c3b80
commit cef58f6a73
3 changed files with 57 additions and 45 deletions

View File

@@ -28,6 +28,7 @@
package org.dyn4j.geometry
import org.dyn4j.Epsilon
import kotlin.math.sign
/**
* This class represents a vector or point in 2D space.
@@ -699,6 +700,9 @@ class Vector2 {
return a
}
val signum: Vector2
get() = Vector2(this.x.sign, this.y.sign)
companion object {
/** A vector representing the x-axis; this vector should not be changed at runtime; used internally */
internal val X_AXIS = Vector2(1.0, 0.0)