Skip to content

Vector

final class Vector
Package: dev.joid.lib.render.transform · Module: core · Source: Vector.java

A 3D offset or pivot of a Transformation, in design pixels, fixed or read from suppliers.

Each coordinate is read each time the transformation is applied.

ReturnsSignatureSummary
Vectorcreate() factoryCreates the vector (0, 0, 0).
Vectorcreate(double x, double y) factoryCreates the vector x, y, with z at 0D.
Vectorcreate(double x, double y, double z) factoryCreates the vector x, y, z.
Vectorcreate(Supplier xSupplier, Supplier ySupplier) factoryCreates a vector whose x and y are read from the suppliers, with z at 0D.
Vectorcreate(Supplier xSupplier, Supplier ySupplier, Supplier zSupplier) factoryCreates a vector whose coordinates are read from the suppliers.

PropertyTypeDefaultSummary
x signaldouble0DThe X coordinate: getX() reads it, x(double) fixes it, x(Supplier) reads it from a supplier.
y signaldouble0DThe Y coordinate, down: getY() reads it, y(double) fixes it, y(Supplier) reads it from a supplier.
z signaldouble0DThe Z coordinate: getZ() reads it, z(double) fixes it, z(Supplier) reads it from a supplier.

ReturnsSignatureSummary
thisadd(double x, double y, double z) fluentAdds x, y, z to the coordinates; a coordinate read from a supplier keeps following it, plus the offset.
thisadd(Supplier xSupplier, Supplier ySupplier, Supplier zSupplier) fluentAdds the values of the suppliers to the coordinates, read each time.
Supplier<Double>getXSupplier()Returns the supplier of the X coordinate.
Supplier<Double>getYSupplier()Returns the supplier of the Y coordinate.
Supplier<Double>getZSupplier()Returns the supplier of the Z coordinate.

Vector create() factory

Creates the vector (0, 0, 0).

Vector create(double x, double y) factory

Creates the vector x, y, with z at 0D.

Vector create(double x, double y, double z) factory

Creates the vector x, y, z.

Vector create(Supplier<Double> xSupplier, Supplier<Double> ySupplier) factory

Creates a vector whose x and y are read from the suppliers, with z at 0D.

Vector create(Supplier<Double> xSupplier, Supplier<Double> ySupplier, Supplier<Double> zSupplier) factory

Creates a vector whose coordinates are read from the suppliers.

  • this x(double x) fluent
  • this x(Supplier<Double> xSupplier) fluent signal
  • double getX()

Default: 0D

The X coordinate: getX() reads it, x(double) fixes it, x(Supplier) reads it from a supplier.

  • this y(double y) fluent
  • this y(Supplier<Double> ySupplier) fluent signal
  • double getY()

Default: 0D

The Y coordinate, down: getY() reads it, y(double) fixes it, y(Supplier) reads it from a supplier.

  • this z(double z) fluent
  • this z(Supplier<Double> zSupplier) fluent signal
  • double getZ()

Default: 0D

The Z coordinate: getZ() reads it, z(double) fixes it, z(Supplier) reads it from a supplier.

this add(double x, double y, double z) fluent

Adds x, y, z to the coordinates; a coordinate read from a supplier keeps following it, plus the offset.

this add(Supplier<Double> xSupplier, Supplier<Double> ySupplier, Supplier<Double> zSupplier) fluent

Adds the values of the suppliers to the coordinates, read each time.

Supplier<Double> getXSupplier()

Returns the supplier of the X coordinate.

Supplier<Double> getYSupplier()

Returns the supplier of the Y coordinate.

Supplier<Double> getZSupplier()

Returns the supplier of the Z coordinate.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page