Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: Vec3

[17:7] extends: FxObj

Wraps FXGL's Vec3 (com.almasb.fxgl.core.math.Vec3), a 3D float vector used throughout the FXGL 3D scene API and pathfinding. Companion to the existing Vec2 wrapper. Methods that mutate (set, addLocal, subLocal, mulLocal, negateLocal, setZero) return this for fluent chaining. Vec3 fields are floats; values come back to Aussom as doubles because Aussom does not have a separate float type.

Methods

  • Vec3 (double X = 0.0, double Y = 0.0, double Z = 0.0)

    Creates a new Vec3 with the given X, Y, Z components.

    • @p X is a double X component.
    • @p Y is a double Y component.
    • @p Z is a double Z component.
  • adopt (object Ajo)

    Wraps an existing Vec3 AussomJavaObject as a Vec3 wrapper.

    • @p Ajo is an AussomJavaObject around a Vec3.
    • @r A new wrapper.
  • getX ()

    Returns the X component as a double.

  • getY ()

    Returns the Y component as a double.

  • getZ ()

    Returns the Z component as a double.

  • set (double X, double Y, double Z)

    Sets all three components.

    • @r this object
  • setVec (object Other)

    Copies another Vec3 into this one in place.

    • @r this object
  • addLocal (object Other)

    Adds Other to this vector in place.

    • @r this object
  • subLocal (object Other)

    Subtracts Other from this vector in place.

    • @r this object
  • mulLocal (double Scalar)

    Multiplies this vector by Scalar in place.

    • @r this object
  • negateLocal ()

    Negates this vector in place.

    • @r this object
  • setZero ()

    Zeros all components in place.

    • @r this object
  • copy ()

    Returns a fresh copy of this Vec3.

    • @r A new Vec3 wrapper.
  • dot (object A, object B)

    Static helper: returns the dot product of two Vec3s.

    • @p A is a Vec3 wrapper.
    • @p B is a Vec3 wrapper.
    • @r A double.
  • cross (object A, object B)

    Static helper: returns the cross product of two Vec3s as a new Vec3 wrapper.

    • @p A is a Vec3 wrapper.
    • @p B is a Vec3 wrapper.
    • @r A new Vec3 wrapper.