Vector3 class

3D column vector.

Implemented types

Constructors

Vector3(double x, double y, double z)
Construct a new vector with the specified values.
factory
Vector3.all(double value)
Splat value into all lanes of the vector.
factory
Vector3.array(List<double> array, [int offset = 0])
Initialized with values from array starting at offset.
factory
Vector3.copy(Vector3 other)
Copy of other.
factory
Vector3.fromBuffer(ByteBuffer buffer, int offset)
Constructs Vector3 with a storage that views given buffer starting at offset. offset has to be multiple of Float64List.bytesPerElement.
Vector3.fromFloat64List(Float64List _v3storage)
Constructs Vector3 with given Float64List as storage.
Vector3.random([Random? rng])
Generate random vector in the range (0, 0, 0) to (1, 1, 1). You can optionally pass your own random number generator.
factory
Vector3.zero()
Zero vector.

Properties

b double
getter/setter pair
bb Vector2
no setter
bbb Vector3
no setter
bbbb Vector4
no setter
bbbg Vector4
no setter
bbbr Vector4
no setter
bbg Vector3
no setter
bbgb Vector4
no setter
bbgg Vector4
no setter
bbgr Vector4
no setter
bbr Vector3
no setter
bbrb Vector4
no setter
bbrg Vector4
no setter
bbrr Vector4
no setter
bg Vector2
getter/setter pair
bgb Vector3
no setter
bgbb Vector4
no setter
bgbg Vector4
no setter
bgbr Vector4
no setter
bgg Vector3
no setter
bggb Vector4
no setter
bggg Vector4
no setter
bggr Vector4
no setter
bgr Vector3
getter/setter pair
bgrb Vector4
no setter
bgrg Vector4
no setter
bgrr Vector4
no setter
br Vector2
getter/setter pair
brb Vector3
no setter
brbb Vector4
no setter
brbg Vector4
no setter
brbr Vector4
no setter
brg Vector3
getter/setter pair
brgb Vector4
no setter
brgg Vector4
no setter
brgr Vector4
no setter
brr Vector3
no setter
brrb Vector4
no setter
brrg Vector4
no setter
brrr Vector4
no setter
g double
getter/setter pair
gb Vector2
getter/setter pair
gbb Vector3
no setter
gbbb Vector4
no setter
gbbg Vector4
no setter
gbbr Vector4
no setter
gbg Vector3
no setter
gbgb Vector4
no setter
gbgg Vector4
no setter
gbgr Vector4
no setter
gbr Vector3
getter/setter pair
gbrb Vector4
no setter
gbrg Vector4
no setter
gbrr Vector4
no setter
gg Vector2
no setter
ggb Vector3
no setter
ggbb Vector4
no setter
ggbg Vector4
no setter
ggbr Vector4
no setter
ggg Vector3
no setter
gggb Vector4
no setter
gggg Vector4
no setter
gggr Vector4
no setter
ggr Vector3
no setter
ggrb Vector4
no setter
ggrg Vector4
no setter
ggrr Vector4
no setter
gr Vector2
getter/setter pair
grb Vector3
getter/setter pair
grbb Vector4
no setter
grbg Vector4
no setter
grbr Vector4
no setter
grg Vector3
no setter
grgb Vector4
no setter
grgg Vector4
no setter
grgr Vector4
no setter
grr Vector3
no setter
grrb Vector4
no setter
grrg Vector4
no setter
grrr Vector4
no setter
hashCode int
The hash code for this object.
no setteroverride
isInfinite bool
True if any component is infinite.
no setter
isNaN bool
True if any component is NaN.
no setter
length double
Length.
getter/setter pair
length2 double
Length squared.
no setter
p double
getter/setter pair
pp Vector2
no setter
ppp Vector3
no setter
pppp Vector4
no setter
ppps Vector4
no setter
pppt Vector4
no setter
pps Vector3
no setter
ppsp Vector4
no setter
ppss Vector4
no setter
ppst Vector4
no setter
ppt Vector3
no setter
pptp Vector4
no setter
ppts Vector4
no setter
pptt Vector4
no setter
ps Vector2
getter/setter pair
psp Vector3
no setter
pspp Vector4
no setter
psps Vector4
no setter
pspt Vector4
no setter
pss Vector3
no setter
pssp Vector4
no setter
psss Vector4
no setter
psst Vector4
no setter
pst Vector3
getter/setter pair
pstp Vector4
no setter
psts Vector4
no setter
pstt Vector4
no setter
pt Vector2
getter/setter pair
ptp Vector3
no setter
ptpp Vector4
no setter
ptps Vector4
no setter
ptpt Vector4
no setter
pts Vector3
getter/setter pair
ptsp Vector4
no setter
ptss Vector4
no setter
ptst Vector4
no setter
ptt Vector3
no setter
pttp Vector4
no setter
ptts Vector4
no setter
pttt Vector4
no setter
r double
getter/setter pair
rb Vector2
getter/setter pair
rbb Vector3
no setter
rbbb Vector4
no setter
rbbg Vector4
no setter
rbbr Vector4
no setter
rbg Vector3
getter/setter pair
rbgb Vector4
no setter
rbgg Vector4
no setter
rbgr Vector4
no setter
rbr Vector3
no setter
rbrb Vector4
no setter
rbrg Vector4
no setter
rbrr Vector4
no setter
rg Vector2
getter/setter pair
rgb Vector3
getter/setter pair
rgbb Vector4
no setter
rgbg Vector4
no setter
rgbr Vector4
no setter
rgg Vector3
no setter
rggb Vector4
no setter
rggg Vector4
no setter
rggr Vector4
no setter
rgr Vector3
no setter
rgrb Vector4
no setter
rgrg Vector4
no setter
rgrr Vector4
no setter
rr Vector2
no setter
rrb Vector3
no setter
rrbb Vector4
no setter
rrbg Vector4
no setter
rrbr Vector4
no setter
rrg Vector3
no setter
rrgb Vector4
no setter
rrgg Vector4
no setter
rrgr Vector4
no setter
rrr Vector3
no setter
rrrb Vector4
no setter
rrrg Vector4
no setter
rrrr Vector4
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
s double
getter/setter pair
sp Vector2
getter/setter pair
spp Vector3
no setter
sppp Vector4
no setter
spps Vector4
no setter
sppt Vector4
no setter
sps Vector3
no setter
spsp Vector4
no setter
spss Vector4
no setter
spst Vector4
no setter
spt Vector3
getter/setter pair
sptp Vector4
no setter
spts Vector4
no setter
sptt Vector4
no setter
ss Vector2
no setter
ssp Vector3
no setter
sspp Vector4
no setter
ssps Vector4
no setter
sspt Vector4
no setter
sss Vector3
no setter
sssp Vector4
no setter
ssss Vector4
no setter
ssst Vector4
no setter
sst Vector3
no setter
sstp Vector4
no setter
ssts Vector4
no setter
sstt Vector4
no setter
st Vector2
getter/setter pair
storage Float64List
The components of the vector.
no setteroverride
stp Vector3
getter/setter pair
stpp Vector4
no setter
stps Vector4
no setter
stpt Vector4
no setter
sts Vector3
no setter
stsp Vector4
no setter
stss Vector4
no setter
stst Vector4
no setter
stt Vector3
no setter
sttp Vector4
no setter
stts Vector4
no setter
sttt Vector4
no setter
t double
getter/setter pair
tp Vector2
getter/setter pair
tpp Vector3
no setter
tppp Vector4
no setter
tpps Vector4
no setter
tppt Vector4
no setter
tps Vector3
getter/setter pair
tpsp Vector4
no setter
tpss Vector4
no setter
tpst Vector4
no setter
tpt Vector3
no setter
tptp Vector4
no setter
tpts Vector4
no setter
tptt Vector4
no setter
ts Vector2
getter/setter pair
tsp Vector3
getter/setter pair
tspp Vector4
no setter
tsps Vector4
no setter
tspt Vector4
no setter
tss Vector3
no setter
tssp Vector4
no setter
tsss Vector4
no setter
tsst Vector4
no setter
tst Vector3
no setter
tstp Vector4
no setter
tsts Vector4
no setter
tstt Vector4
no setter
tt Vector2
no setter
ttp Vector3
no setter
ttpp Vector4
no setter
ttps Vector4
no setter
ttpt Vector4
no setter
tts Vector3
no setter
ttsp Vector4
no setter
ttss Vector4
no setter
ttst Vector4
no setter
ttt Vector3
no setter
tttp Vector4
no setter
ttts Vector4
no setter
tttt Vector4
no setter
x double
getter/setter pair
xx Vector2
no setter
xxx Vector3
no setter
xxxx Vector4
no setter
xxxy Vector4
no setter
xxxz Vector4
no setter
xxy Vector3
no setter
xxyx Vector4
no setter
xxyy Vector4
no setter
xxyz Vector4
no setter
xxz Vector3
no setter
xxzx Vector4
no setter
xxzy Vector4
no setter
xxzz Vector4
no setter
xy Vector2
getter/setter pair
xyx Vector3
no setter
xyxx Vector4
no setter
xyxy Vector4
no setter
xyxz Vector4
no setter
xyy Vector3
no setter
xyyx Vector4
no setter
xyyy Vector4
no setter
xyyz Vector4
no setter
xyz Vector3
getter/setter pair
xyzx Vector4
no setter
xyzy Vector4
no setter
xyzz Vector4
no setter
xz Vector2
getter/setter pair
xzx Vector3
no setter
xzxx Vector4
no setter
xzxy Vector4
no setter
xzxz Vector4
no setter
xzy Vector3
getter/setter pair
xzyx Vector4
no setter
xzyy Vector4
no setter
xzyz Vector4
no setter
xzz Vector3
no setter
xzzx Vector4
no setter
xzzy Vector4
no setter
xzzz Vector4
no setter
y double
getter/setter pair
yx Vector2
getter/setter pair
yxx Vector3
no setter
yxxx Vector4
no setter
yxxy Vector4
no setter
yxxz Vector4
no setter
yxy Vector3
no setter
yxyx Vector4
no setter
yxyy Vector4
no setter
yxyz Vector4
no setter
yxz Vector3
getter/setter pair
yxzx Vector4
no setter
yxzy Vector4
no setter
yxzz Vector4
no setter
yy Vector2
no setter
yyx Vector3
no setter
yyxx Vector4
no setter
yyxy Vector4
no setter
yyxz Vector4
no setter
yyy Vector3
no setter
yyyx Vector4
no setter
yyyy Vector4
no setter
yyyz Vector4
no setter
yyz Vector3
no setter
yyzx Vector4
no setter
yyzy Vector4
no setter
yyzz Vector4
no setter
yz Vector2
getter/setter pair
yzx Vector3
getter/setter pair
yzxx Vector4
no setter
yzxy Vector4
no setter
yzxz Vector4
no setter
yzy Vector3
no setter
yzyx Vector4
no setter
yzyy Vector4
no setter
yzyz Vector4
no setter
yzz Vector3
no setter
yzzx Vector4
no setter
yzzy Vector4
no setter
yzzz Vector4
no setter
z double
getter/setter pair
zx Vector2
getter/setter pair
zxx Vector3
no setter
zxxx Vector4
no setter
zxxy Vector4
no setter
zxxz Vector4
no setter
zxy Vector3
getter/setter pair
zxyx Vector4
no setter
zxyy Vector4
no setter
zxyz Vector4
no setter
zxz Vector3
no setter
zxzx Vector4
no setter
zxzy Vector4
no setter
zxzz Vector4
no setter
zy Vector2
getter/setter pair
zyx Vector3
getter/setter pair
zyxx Vector4
no setter
zyxy Vector4
no setter
zyxz Vector4
no setter
zyy Vector3
no setter
zyyx Vector4
no setter
zyyy Vector4
no setter
zyyz Vector4
no setter
zyz Vector3
no setter
zyzx Vector4
no setter
zyzy Vector4
no setter
zyzz Vector4
no setter
zz Vector2
no setter
zzx Vector3
no setter
zzxx Vector4
no setter
zzxy Vector4
no setter
zzxz Vector4
no setter
zzy Vector3
no setter
zzyx Vector4
no setter
zzyy Vector4
no setter
zzyz Vector4
no setter
zzz Vector3
no setter
zzzx Vector4
no setter
zzzy Vector4
no setter
zzzz Vector4
no setter

Methods

absolute() → void
Absolute value.
absoluteError(Vector3 correct) double
Absolute error between this and correct
add(Vector3 arg) → void
Add arg to this.
addScaled(Vector3 arg, double factor) → void
Add arg scaled by factor to this.
angleTo(Vector3 other) double
Returns the angle between this vector and other in radians.
angleToSigned(Vector3 other, Vector3 normal) double
Returns the signed angle between this and other around normal in radians.
applyAxisAngle(Vector3 axis, double angle) → void
Applies a rotation specified by axis and angle.
applyMatrix3(Matrix3 arg) → void
Multiplies this by arg.
applyMatrix4(Matrix4 arg) → void
Multiplies this by a 4x3 subset of arg. Expects arg to be an affine transformation matrix.
applyProjection(Matrix4 arg) → void
Projects this using the projection matrix arg
applyQuaternion(Quaternion arg) → void
Applies a quaternion transform.
ceil() → void
Ceil entries in this.
clamp(Vector3 min, Vector3 max) → void
Clamp each entry n in this in the range [minn]-[maxn].
clampScalar(double min, double max) → void
Clamp entries in this in the range min-max.
clone() Vector3
Clone of this.
copyFromArray(List<double> array, [int offset = 0]) → void
Copies elements from array into this starting at offset.
copyInto(Vector3 arg) Vector3
Copy this into arg.
copyIntoArray(List<double> array, [int offset = 0]) → void
Copies this into array starting at offset.
cross(Vector3 other) Vector3
Cross product.
crossInto(Vector3 other, Vector3 out) Vector3
Cross product. Stores result in out.
distanceTo(Vector3 arg) double
Distance from this to arg
distanceToSquared(Vector3 arg) double
Squared distance from this to arg
divide(Vector3 arg) → void
Divide entries in this with entries in arg.
dot(Vector3 other) double
Inner product.
floor() → void
Floor entries in this.
multiply(Vector3 arg) → void
Multiply entries in this with entries in arg.
negate() → void
Negate this.
normalize() double
Normalizes this.
normalized() Vector3
Normalizes copy of this.
normalizeInto(Vector3 out) Vector3
Normalize vector into out.
normalizeLength() double
Normalize this. Returns length of vector before normalization. DEPRCATED: Use normalize.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
postmultiply(Matrix3 arg) → void
Transforms this into the product of this as a row vector, postmultiplied by matrix, arg. If arg is a rotation matrix, this is a computational shortcut for applying, the inverse of the transformation.
reflect(Vector3 normal) → void
Reflect this.
reflected(Vector3 normal) Vector3
Reflected copy of this.
relativeError(Vector3 correct) double
Relative error between this and correct
round() → void
Round entries in this.
roundToZero() → void
Round entries in this towards zero.
scale(double arg) → void
Scale this.
scaled(double arg) Vector3
Create a copy of this and scale it by arg.
setFrom(Vector3 other) → void
Set the values by copying them from other.
setValues(double x, double y, double z) → void
Set the values of the vector.
setZero() → void
Zero vector.
splat(double arg) → void
Splat arg into all lanes of the vector.
sub(Vector3 arg) → void
Subtract arg from this.
toString() String
Returns a printable string
override

Operators

operator *(double scale) Vector3
Scale by scale.
operator +(Vector3 other) Vector3
Add two vectors.
operator -(Vector3 other) Vector3
Subtract two vectors.
operator /(double scale) Vector3
Scale.
operator ==(Object other) bool
Check if two vectors are the same.
override
operator [](int i) double
Access the component of the vector at the index i.
operator []=(int i, double v) → void
Set the component of the vector at the index i.
operator unary-() Vector3
Negate

Static Methods

max(Vector3 a, Vector3 b, Vector3 result) → void
Set the values of result to the maximum of a and b for each line.
min(Vector3 a, Vector3 b, Vector3 result) → void
Set the values of result to the minimum of a and b for each line.
mix(Vector3 min, Vector3 max, double a, Vector3 result) → void
Interpolate between min and max with the amount of a using a linear interpolation and store the values in result.