Skip to content

Vector3f

IsaacShelton edited this page Nov 16, 2022 · 7 revisions

Vector3f

Vector3f represents the type of a three float vector.

Specifications

Type Size Memory Management Model File
Vector3f 12 bytes None 2.7/Vector3f.adept

Definition

struct Vector3f (x, y, z float)

Fields

Name Type Description
x float X Value
y float Y Value
z float Z Value

Overloads

  • func __add__(a POD Vector3f, b POD Vector3f) Vector3f
  • func __subtract__(a POD Vector3f, b POD Vector3f) Vector3f
  • func __multiply__(a POD Vector3f, b POD Vector3f) Vector3f
  • func __multiply__(a POD Vector3f, factor float) Vector3f

Functions

  • func Vector3f(x, y, z float) Vector3f

    Constructs a Vector3f.

    [view src]

  • func vector3f(x, y, z float) Vector3f

    Constructs a Vector3f.

    [view src]

Methods

  • func zero(this *Vector3f) void

    Sets all components of a vector to zero.

    [view src]

  • func set(this *Vector3f, x, y, z float) void

    Sets the components of a vector.

    [view src]

  • func set(this *Vector3f, other Vector3f) void

    Sets the components of a vector to those of another.

    [view src]

  • func add(this *Vector3f, other Vector3f) void

    Adds the components of a vector to another.

    [view src]

  • func subtract(this *Vector3f, other Vector3f) void

    Subtracts the components of a vector from another.

    [view src]

  • func multiply(this *Vector3f, other Vector3f) void

    Multiplies the components of a vector by another.

    [view src]

  • func negate(this *Vector3f) void

    Negates the components of a vector.

    [view src]

  • func negated(this *Vector3f) Vector3f

    Returns a negated copy of a vector.

    [view src]

  • func scale(this *Vector3f, amount float) void

    Scales a vector by a scalar.

    [view src]

  • func normalize(this *Vector3f) void

    Normalizes a vector.

    [view src]

  • func cross(this *Vector3f, other Vector3f) void

    Sets a Vector3f to the cross-product of it with another.

    [view src]

  • func crossed(this *Vector3f, other Vector3f) Vector3f

    Returns a the cross-product of a Vector3f with another.

    [view src]

  • func length(this *Vector3f) float

    Calculates the length of a vector.

    [view src]

  • func dot(this *Vector3f, other Vector3f) float

    Calculates the dot product of two vectors.

    [view src]

  • func direction(this *Vector3f, other Vector3f) void

    Sets a vector to a unit vector equal to the difference of it and another.

    [view src]

  • func lerp(this *Vector3f, other Vector3f, lerp float) void

    Linearly interpolates between two vectors by lerp [0.0, 1.0] amount.

    [view src]

  • func lerp(this *Vector3f, other Vector3f) void

    Linearly interpolates halfway between two vectors.

    [view src]

  • func distance(this *Vector3f, other Vector3f) float

    Calculates the distance between two points.

    [view src]

  • func toString(this *Vector3f) String

    Converts a vector to a String.

    [view src]

  • func print(this *Vector3f) void

    Prints a vector to stdout.

    [view src]

Clone this wiki locally