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 atoffset
.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 atoffset
.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
-
read / write
- bb → Vector2
-
read-only
- bbb → Vector3
-
read-only
- bbbb → Vector4
-
read-only
- bbbg → Vector4
-
read-only
- bbbr → Vector4
-
read-only
- bbg → Vector3
-
read-only
- bbgb → Vector4
-
read-only
- bbgg → Vector4
-
read-only
- bbgr → Vector4
-
read-only
- bbr → Vector3
-
read-only
- bbrb → Vector4
-
read-only
- bbrg → Vector4
-
read-only
- bbrr → Vector4
-
read-only
- bg ↔ Vector2
-
read / write
- bgb → Vector3
-
read-only
- bgbb → Vector4
-
read-only
- bgbg → Vector4
-
read-only
- bgbr → Vector4
-
read-only
- bgg → Vector3
-
read-only
- bggb → Vector4
-
read-only
- bggg → Vector4
-
read-only
- bggr → Vector4
-
read-only
- bgr ↔ Vector3
-
read / write
- bgrb → Vector4
-
read-only
- bgrg → Vector4
-
read-only
- bgrr → Vector4
-
read-only
- br ↔ Vector2
-
read / write
- brb → Vector3
-
read-only
- brbb → Vector4
-
read-only
- brbg → Vector4
-
read-only
- brbr → Vector4
-
read-only
- brg ↔ Vector3
-
read / write
- brgb → Vector4
-
read-only
- brgg → Vector4
-
read-only
- brgr → Vector4
-
read-only
- brr → Vector3
-
read-only
- brrb → Vector4
-
read-only
- brrg → Vector4
-
read-only
- brrr → Vector4
-
read-only
- g ↔ double
-
read / write
- gb ↔ Vector2
-
read / write
- gbb → Vector3
-
read-only
- gbbb → Vector4
-
read-only
- gbbg → Vector4
-
read-only
- gbbr → Vector4
-
read-only
- gbg → Vector3
-
read-only
- gbgb → Vector4
-
read-only
- gbgg → Vector4
-
read-only
- gbgr → Vector4
-
read-only
- gbr ↔ Vector3
-
read / write
- gbrb → Vector4
-
read-only
- gbrg → Vector4
-
read-only
- gbrr → Vector4
-
read-only
- gg → Vector2
-
read-only
- ggb → Vector3
-
read-only
- ggbb → Vector4
-
read-only
- ggbg → Vector4
-
read-only
- ggbr → Vector4
-
read-only
- ggg → Vector3
-
read-only
- gggb → Vector4
-
read-only
- gggg → Vector4
-
read-only
- gggr → Vector4
-
read-only
- ggr → Vector3
-
read-only
- ggrb → Vector4
-
read-only
- ggrg → Vector4
-
read-only
- ggrr → Vector4
-
read-only
- gr ↔ Vector2
-
read / write
- grb ↔ Vector3
-
read / write
- grbb → Vector4
-
read-only
- grbg → Vector4
-
read-only
- grbr → Vector4
-
read-only
- grg → Vector3
-
read-only
- grgb → Vector4
-
read-only
- grgg → Vector4
-
read-only
- grgr → Vector4
-
read-only
- grr → Vector3
-
read-only
- grrb → Vector4
-
read-only
- grrg → Vector4
-
read-only
- grrr → Vector4
-
read-only
- hashCode → int
-
The hash code for this object. [...]
read-only, override
- isInfinite → bool
-
True if any component is infinite.
read-only
- isNaN → bool
-
True if any component is NaN.
read-only
- length ↔ double
-
Length.
read / write
- length2 → double
-
Length squared.
read-only
- p ↔ double
-
read / write
- pp → Vector2
-
read-only
- ppp → Vector3
-
read-only
- pppp → Vector4
-
read-only
- ppps → Vector4
-
read-only
- pppt → Vector4
-
read-only
- pps → Vector3
-
read-only
- ppsp → Vector4
-
read-only
- ppss → Vector4
-
read-only
- ppst → Vector4
-
read-only
- ppt → Vector3
-
read-only
- pptp → Vector4
-
read-only
- ppts → Vector4
-
read-only
- pptt → Vector4
-
read-only
- ps ↔ Vector2
-
read / write
- psp → Vector3
-
read-only
- pspp → Vector4
-
read-only
- psps → Vector4
-
read-only
- pspt → Vector4
-
read-only
- pss → Vector3
-
read-only
- pssp → Vector4
-
read-only
- psss → Vector4
-
read-only
- psst → Vector4
-
read-only
- pst ↔ Vector3
-
read / write
- pstp → Vector4
-
read-only
- psts → Vector4
-
read-only
- pstt → Vector4
-
read-only
- pt ↔ Vector2
-
read / write
- ptp → Vector3
-
read-only
- ptpp → Vector4
-
read-only
- ptps → Vector4
-
read-only
- ptpt → Vector4
-
read-only
- pts ↔ Vector3
-
read / write
- ptsp → Vector4
-
read-only
- ptss → Vector4
-
read-only
- ptst → Vector4
-
read-only
- ptt → Vector3
-
read-only
- pttp → Vector4
-
read-only
- ptts → Vector4
-
read-only
- pttt → Vector4
-
read-only
- r ↔ double
-
read / write
- rb ↔ Vector2
-
read / write
- rbb → Vector3
-
read-only
- rbbb → Vector4
-
read-only
- rbbg → Vector4
-
read-only
- rbbr → Vector4
-
read-only
- rbg ↔ Vector3
-
read / write
- rbgb → Vector4
-
read-only
- rbgg → Vector4
-
read-only
- rbgr → Vector4
-
read-only
- rbr → Vector3
-
read-only
- rbrb → Vector4
-
read-only
- rbrg → Vector4
-
read-only
- rbrr → Vector4
-
read-only
- rg ↔ Vector2
-
read / write
- rgb ↔ Vector3
-
read / write
- rgbb → Vector4
-
read-only
- rgbg → Vector4
-
read-only
- rgbr → Vector4
-
read-only
- rgg → Vector3
-
read-only
- rggb → Vector4
-
read-only
- rggg → Vector4
-
read-only
- rggr → Vector4
-
read-only
- rgr → Vector3
-
read-only
- rgrb → Vector4
-
read-only
- rgrg → Vector4
-
read-only
- rgrr → Vector4
-
read-only
- rr → Vector2
-
read-only
- rrb → Vector3
-
read-only
- rrbb → Vector4
-
read-only
- rrbg → Vector4
-
read-only
- rrbr → Vector4
-
read-only
- rrg → Vector3
-
read-only
- rrgb → Vector4
-
read-only
- rrgg → Vector4
-
read-only
- rrgr → Vector4
-
read-only
- rrr → Vector3
-
read-only
- rrrb → Vector4
-
read-only
- rrrg → Vector4
-
read-only
- rrrr → Vector4
-
read-only
- s ↔ double
-
read / write
- sp ↔ Vector2
-
read / write
- spp → Vector3
-
read-only
- sppp → Vector4
-
read-only
- spps → Vector4
-
read-only
- sppt → Vector4
-
read-only
- sps → Vector3
-
read-only
- spsp → Vector4
-
read-only
- spss → Vector4
-
read-only
- spst → Vector4
-
read-only
- spt ↔ Vector3
-
read / write
- sptp → Vector4
-
read-only
- spts → Vector4
-
read-only
- sptt → Vector4
-
read-only
- ss → Vector2
-
read-only
- ssp → Vector3
-
read-only
- sspp → Vector4
-
read-only
- ssps → Vector4
-
read-only
- sspt → Vector4
-
read-only
- sss → Vector3
-
read-only
- sssp → Vector4
-
read-only
- ssss → Vector4
-
read-only
- ssst → Vector4
-
read-only
- sst → Vector3
-
read-only
- sstp → Vector4
-
read-only
- ssts → Vector4
-
read-only
- sstt → Vector4
-
read-only
- st ↔ Vector2
-
read / write
- storage → Float64List
-
The components of the vector.
read-only, override
- stp ↔ Vector3
-
read / write
- stpp → Vector4
-
read-only
- stps → Vector4
-
read-only
- stpt → Vector4
-
read-only
- sts → Vector3
-
read-only
- stsp → Vector4
-
read-only
- stss → Vector4
-
read-only
- stst → Vector4
-
read-only
- stt → Vector3
-
read-only
- sttp → Vector4
-
read-only
- stts → Vector4
-
read-only
- sttt → Vector4
-
read-only
- t ↔ double
-
read / write
- tp ↔ Vector2
-
read / write
- tpp → Vector3
-
read-only
- tppp → Vector4
-
read-only
- tpps → Vector4
-
read-only
- tppt → Vector4
-
read-only
- tps ↔ Vector3
-
read / write
- tpsp → Vector4
-
read-only
- tpss → Vector4
-
read-only
- tpst → Vector4
-
read-only
- tpt → Vector3
-
read-only
- tptp → Vector4
-
read-only
- tpts → Vector4
-
read-only
- tptt → Vector4
-
read-only
- ts ↔ Vector2
-
read / write
- tsp ↔ Vector3
-
read / write
- tspp → Vector4
-
read-only
- tsps → Vector4
-
read-only
- tspt → Vector4
-
read-only
- tss → Vector3
-
read-only
- tssp → Vector4
-
read-only
- tsss → Vector4
-
read-only
- tsst → Vector4
-
read-only
- tst → Vector3
-
read-only
- tstp → Vector4
-
read-only
- tsts → Vector4
-
read-only
- tstt → Vector4
-
read-only
- tt → Vector2
-
read-only
- ttp → Vector3
-
read-only
- ttpp → Vector4
-
read-only
- ttps → Vector4
-
read-only
- ttpt → Vector4
-
read-only
- tts → Vector3
-
read-only
- ttsp → Vector4
-
read-only
- ttss → Vector4
-
read-only
- ttst → Vector4
-
read-only
- ttt → Vector3
-
read-only
- tttp → Vector4
-
read-only
- ttts → Vector4
-
read-only
- tttt → Vector4
-
read-only
- x ↔ double
-
read / write
- xx → Vector2
-
read-only
- xxx → Vector3
-
read-only
- xxxx → Vector4
-
read-only
- xxxy → Vector4
-
read-only
- xxxz → Vector4
-
read-only
- xxy → Vector3
-
read-only
- xxyx → Vector4
-
read-only
- xxyy → Vector4
-
read-only
- xxyz → Vector4
-
read-only
- xxz → Vector3
-
read-only
- xxzx → Vector4
-
read-only
- xxzy → Vector4
-
read-only
- xxzz → Vector4
-
read-only
- xy ↔ Vector2
-
read / write
- xyx → Vector3
-
read-only
- xyxx → Vector4
-
read-only
- xyxy → Vector4
-
read-only
- xyxz → Vector4
-
read-only
- xyy → Vector3
-
read-only
- xyyx → Vector4
-
read-only
- xyyy → Vector4
-
read-only
- xyyz → Vector4
-
read-only
- xyz ↔ Vector3
-
read / write
- xyzx → Vector4
-
read-only
- xyzy → Vector4
-
read-only
- xyzz → Vector4
-
read-only
- xz ↔ Vector2
-
read / write
- xzx → Vector3
-
read-only
- xzxx → Vector4
-
read-only
- xzxy → Vector4
-
read-only
- xzxz → Vector4
-
read-only
- xzy ↔ Vector3
-
read / write
- xzyx → Vector4
-
read-only
- xzyy → Vector4
-
read-only
- xzyz → Vector4
-
read-only
- xzz → Vector3
-
read-only
- xzzx → Vector4
-
read-only
- xzzy → Vector4
-
read-only
- xzzz → Vector4
-
read-only
- y ↔ double
-
read / write
- yx ↔ Vector2
-
read / write
- yxx → Vector3
-
read-only
- yxxx → Vector4
-
read-only
- yxxy → Vector4
-
read-only
- yxxz → Vector4
-
read-only
- yxy → Vector3
-
read-only
- yxyx → Vector4
-
read-only
- yxyy → Vector4
-
read-only
- yxyz → Vector4
-
read-only
- yxz ↔ Vector3
-
read / write
- yxzx → Vector4
-
read-only
- yxzy → Vector4
-
read-only
- yxzz → Vector4
-
read-only
- yy → Vector2
-
read-only
- yyx → Vector3
-
read-only
- yyxx → Vector4
-
read-only
- yyxy → Vector4
-
read-only
- yyxz → Vector4
-
read-only
- yyy → Vector3
-
read-only
- yyyx → Vector4
-
read-only
- yyyy → Vector4
-
read-only
- yyyz → Vector4
-
read-only
- yyz → Vector3
-
read-only
- yyzx → Vector4
-
read-only
- yyzy → Vector4
-
read-only
- yyzz → Vector4
-
read-only
- yz ↔ Vector2
-
read / write
- yzx ↔ Vector3
-
read / write
- yzxx → Vector4
-
read-only
- yzxy → Vector4
-
read-only
- yzxz → Vector4
-
read-only
- yzy → Vector3
-
read-only
- yzyx → Vector4
-
read-only
- yzyy → Vector4
-
read-only
- yzyz → Vector4
-
read-only
- yzz → Vector3
-
read-only
- yzzx → Vector4
-
read-only
- yzzy → Vector4
-
read-only
- yzzz → Vector4
-
read-only
- z ↔ double
-
read / write
- zx ↔ Vector2
-
read / write
- zxx → Vector3
-
read-only
- zxxx → Vector4
-
read-only
- zxxy → Vector4
-
read-only
- zxxz → Vector4
-
read-only
- zxy ↔ Vector3
-
read / write
- zxyx → Vector4
-
read-only
- zxyy → Vector4
-
read-only
- zxyz → Vector4
-
read-only
- zxz → Vector3
-
read-only
- zxzx → Vector4
-
read-only
- zxzy → Vector4
-
read-only
- zxzz → Vector4
-
read-only
- zy ↔ Vector2
-
read / write
- zyx ↔ Vector3
-
read / write
- zyxx → Vector4
-
read-only
- zyxy → Vector4
-
read-only
- zyxz → Vector4
-
read-only
- zyy → Vector3
-
read-only
- zyyx → Vector4
-
read-only
- zyyy → Vector4
-
read-only
- zyyz → Vector4
-
read-only
- zyz → Vector3
-
read-only
- zyzx → Vector4
-
read-only
- zyzy → Vector4
-
read-only
- zyzz → Vector4
-
read-only
- zz → Vector2
-
read-only
- zzx → Vector3
-
read-only
- zzxx → Vector4
-
read-only
- zzxy → Vector4
-
read-only
- zzxz → Vector4
-
read-only
- zzy → Vector3
-
read-only
- zzyx → Vector4
-
read-only
- zzyy → Vector4
-
read-only
- zzyz → Vector4
-
read-only
- zzz → Vector3
-
read-only
- zzzx → Vector4
-
read-only
- zzzy → Vector4
-
read-only
- zzzz → Vector4
-
read-only
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
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 byfactor
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
aroundnormal
in radians. -
applyAxisAngle(
Vector3 axis, double angle) → void -
Applies a rotation specified by
axis
andangle
. -
applyMatrix3(
Matrix3 arg) → void -
Multiplies this by
arg
. -
applyMatrix4(
Matrix4 arg) → void -
Multiplies this by a 4x3 subset of
arg
. Expectsarg
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 [min
n
]-[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 atoffset
. -
copyInto(
Vector3 arg) → Vector3 -
Copy this into
arg
. -
copyIntoArray(
List< double> array, [ int offset = 0 ]) → void -
Copies this into
array
starting atoffset
. -
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.
-
postmultiply(
Matrix3 arg) → void -
Transforms this into the product of this as a row vector,
postmultiplied by matrix,
arg
. Ifarg
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
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
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 ofa
andb
for each line. -
min(
Vector3 a, Vector3 b, Vector3 result) → void -
Set the values of
result
to the minimum ofa
andb
for each line. -
mix(
Vector3 min, Vector3 max, double a, Vector3 result) → void -
Interpolate between
min
andmax
with the amount ofa
using a linear interpolation and store the values inresult
.