class Prism::Maths::Vector2f
- Prism::Maths::Vector2f
- Reference
- Object
Defined in:
prism/maths/vector2f.crConstructors
Instance Method Summary
-
#*(r : Vector2f) : Vector2f
Multiplies two vectors
-
#*(r : Float32) : Vector2f
Multiplies the vector with a scalar
-
#+(r : Vector2f) : Vector2f
Adds two vectors
-
#+(r : Float32) : Vector2f
Adds a scalar value to the vector
-
#-(r : Vector2f) : Vector2f
Subtracts two vectors
-
#-(r : Float32) : Vector2f
Subtracts a scalar value from the vector
-
#/(r : Vector2f) : Vector2f
Divides two vectors
-
#/(r : Float32) : Vector2f
Divides the vector by a scalar
- #==(r : Vector2f) : Bool
- #abs : Vector2f
- #cross(r : Vector2f) : Float32
-
#dot(r : Vectorf2) : Float32
Returns the dot product of the vectors
-
#length : Float32
Returns the length the vector (pythagorean theorem)
- #lerp(dest : Vector2f, lerp_factor : Float32) : Vector2f
-
#max
Returns the maximum component size
-
#rotate(angle : Float32) : Vector2f
Rotates the vector by some angle in radians
- #set(x : Float32, y : Float32)
- #set(r : Vector2f)
-
#to_normalized : Vector2f
Normalizes this vector to a length of 1
-
#to_s
Returns a nicely readable and concise string representation of this object, typically intended for users.
- #x : Float32
- #x=(x : Float32)
- #y : Float32
- #y=(y : Float32)
Constructor Detail
Instance Method Detail
Returns a nicely readable and concise string representation of this object, typically intended for users.
This method should usually not be overridden. It delegates to
#to_s(IO)
which can be overridden for custom implementations.
Also see #inspect
.