-
-
Notifications
You must be signed in to change notification settings - Fork 9
Vector2f
Vector2f
represents the type of a two float vector.
Type | Size | Memory Management Model | File |
---|---|---|---|
Vector2f |
8 bytes | None | 2.7/Vector2f.adept |
struct Vector2f (x, y float)
Name | Type | Description |
---|---|---|
x |
float |
X Value |
y |
float |
Y Value |
func __add__(a POD Vector2f, b POD Vector2f) Vector2f
func __subtract__(a POD Vector2f, b POD Vector2f) Vector2f
func __multiply__(a POD Vector2f, b POD Vector2f) Vector2f
func __multiply__(a POD Vector2f, factor float) Vector2f
-
func Vector2f(x, y float) Vector2f
Constructs a
Vector2f
. -
func vector2f(x, y float) Vector2f
Constructs a
Vector2f
.
-
func zero(this *Vector2f) void
Sets all components of a vector to zero.
-
func set(this *Vector2f, x, y float) void
Sets the components of a vector.
-
func set(this *Vector2f, other Vector2f) void
Sets the components of a vector to those of another.
-
func add(this *Vector2f, other Vector2f) void
Adds the components of a vector to another.
-
func subtract(this *Vector2f, other Vector2f) void
Subtracts the components of a vector from another.
-
func multiply(this *Vector2f, other Vector2f) void
Multiplies the components of a vector by another.
-
func negate(this *Vector2f) void
Negates the components of a vector.
-
func negated(this *Vector2f) Vector2f
Returns a negated copy of a vector.
-
func scale(this *Vector2f, amount float) void
Scales a vector by a scalar.
-
func normalize(this *Vector2f) void
Normalizes a vector.
-
func cross(this *Vector2f, other Vector2f) float
Calculates the cross-product of two vectors.
-
func length(this *Vector2f) float
Calculates the length of a vector.
-
func dot(this *Vector2f, other Vector2f) float
Calculates the dot product of two vectors.
-
func lerp(this *Vector2f, other Vector2f, lerp float) void
Linearly interpolates between two vectors by
lerp
[0.0, 1.0] amount. -
func lerp(this *Vector2f, other Vector2f) void
Linearly interpolates halfway between two vectors.
-
func distance(this *Vector2f, other Vector2f) float
Calculates the distance between two points.
-
func toString(this *Vector2f) String
Converts a vector to a
String
. -
func print(this *Vector2f) void
Prints a vector to stdout.