MVector3 class

Implemented types

Constructors

MVector3(double x, double y, double z)
Create a new vector with the given values.
MVector3.all(double value)
Create a new vector with all components set to value.
MVector3.cast(num x, num y, num z)
Create a new vector from x, y, and z, cast to doubles.
factory
MVector3.copy(Vector3 other)
Create a new vector as a copy of other.
factory
MVector3.zero()
Create a new vector with all components set to zero.

Properties

hashCode → int
The hash code for this object.
no setterinherited
isInfinite → bool
True if any component is infinite.
no setterinherited
isNaN → bool
True if any component is NaN.
no setterinherited
isZero → bool
True if all components are zero.
no setterinherited
length → double
The length of the vector.
no setterinherited
length2 → double
The squared length of the vector.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
x ↔ double
The x component.
getter/setter pairoverride-getter
y ↔ double
The y component.
getter/setter pairoverride-getter
z ↔ double
The z component.
getter/setter pairoverride-getter

Methods

absolute() → void
Sets this to the component-wise absolute value of itself.
absoluteError(Vector3 correct) → double
Returns the absolute error between this and correct.
inherited
add(Vector3 other) → void
Adds other to this.
addScaled(Vector3 other, double value) → void
Adds other scaled by value to this.
angleTo(Vector3 other) → double
Returns the angle between this and other in radians.
inherited
angleToSigned(Vector3 other, Vector3 normal) → double
Returns the signed angle between this and other around normal in radians.
inherited
ceil() → void
Ceils each component of this.
ceiled() → Vector3
Ceiled copy of this.
inherited
clamp(Vector2 range) → void
Clamps each component of this between range.x and range.y.
clampBetween(Vector3 min, Vector3 max) → void
Clamps each component of this between the matching components of min and max.
clamped(Vector2 range) → Vector3
Copy of this with each component clamped between range.x and range.y.
inherited
clampedBetween(Vector3 min, Vector3 max) → Vector3
Copy of this with each component clamped between the matching components of min and max.
inherited
clampedTo(double min, double max) → Vector3
Copy of this with each component clamped between min and max.
inherited
clampedToX(double min, double max) → Vector3
Copy of this with the x component clamped between min and max.
inherited
clampedToY(double min, double max) → Vector3
Copy of this with the y component clamped between min and max.
inherited
clampedToZ(double min, double max) → Vector3
Copy of this with the z component clamped between min and max.
inherited
clampedX(Vector2 range) → Vector3
Copy of this with the x component clamped between range.x and range.y.
inherited
clampedY(Vector2 range) → Vector3
Copy of this with the y component clamped between range.x and range.y.
inherited
clampedZ(Vector2 range) → Vector3
Copy of this with the z component clamped between range.x and range.y.
inherited
clampTo(double min, double max) → void
Clamps each component of this between min and max.
clampToX(double min, double max) → void
Clamps the x component of this between min and max.
clampToY(double min, double max) → void
Clamps the y component of this between min and max.
clampToZ(double min, double max) → void
Clamps the z component of this between min and max.
clampX(Vector2 range) → void
Clamps the x component of this between range.x and range.y.
clampY(Vector2 range) → void
Clamps the y component of this between range.x and range.y.
clampZ(Vector2 range) → void
Clamps the z component of this between range.x and range.y.
clone() → MVector3
Clone of this.
override
cross(Vector3 other) → Vector3
Cross product.
inherited
distance(Vector3 other) → double
Distance from this to other.
inherited
distance2(Vector3 other) → double
Squared distance from this to other.
inherited
divide(Vector3 other) → void
Divides each component of this by the matching component of other.
divided(Vector3 other) → Vector3
Copy of this divided by other.
inherited
dot(Vector3 other) → double
Inner product.
inherited
floor() → void
Floors each component of this.
floored() → Vector3
Floored copy of this.
inherited
max(Vector3 other) → void
Sets this to the component-wise maximum of this and other.
override
min(Vector3 other) → void
Sets this to the component-wise minimum of this and other.
override
mix(Vector3 other, double amount) → void
Sets this to the linear interpolation from this to other by amount.
override
multiplied(Vector3 other) → Vector3
Copy of this multiplied by other.
inherited
multiply(Vector3 other) → void
Multiplies each component of this by the matching component of other.
negate() → void
Negates this.
normalize() → double
Normalizes this. Returns the length of the vector before normalization.
normalized() → Vector3
Normalized copy of this.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
postmultiplied(Matrix3 matrix) → Vector3
Returns this, as a row vector, multiplied by matrix. Note the order. If matrix is a rotation matrix, this is a computational shortcut for applying the inverse of the transformation.
inherited
postmultiply(Matrix3 matrix) → void
Sets this to this, as a row vector, multiplied by matrix. Note the order. If matrix is a rotation matrix, this is a computational shortcut for applying the inverse of the transformation.
premultiplied(Matrix3 matrix) → Vector3
Returns matrix multiplied by this. Note the order.
inherited
premultiply(Matrix3 matrix) → void
Sets this to matrix multiplied by this. Note the order.
reflect(Vector3 normal) → void
Reflects this.
reflected(Vector3 normal) → Vector3
Reflected copy of this.
inherited
relativeError(Vector3 correct) → double
Returns the relative error between this and correct.
inherited
rotate(Matrix4 matrix) → void
Rotates this by the upper-left 3x3 of matrix, ignoring translation.
rotated(Matrix4 matrix) → Vector3
Rotates this by the upper-left 3x3 of matrix, ignoring translation, and returns the result.
inherited
round() → void
Rounds each component of this.
rounded() → Vector3
Rounded copy of this.
inherited
roundedToZero() → Vector3
Copy of this, rounded towards zero.
inherited
roundToZero() → void
Rounds each component of this towards zero.
scale(double value) → void
Scales this by value.
scaled(double value) → Vector3
Scaled copy of this.
inherited
setFrom(Vector3 other) → void
Sets the values of this by copying them from other.
setValues(double x, double y, double z) → void
Sets the values of this.
setZero() → void
Sets all components of this to zero.
splat(double value) → void
Sets all components of this to value.
subtract(Vector3 other) → void
Subtracts other from this.
toString() → String
Returns a printable string.
inherited
transform(Matrix4 matrix) → void
Transforms this by matrix.
transformed(Matrix4 matrix) → Vector3
Transforms this by matrix and returns the result.
inherited

Operators

operator *(double value) → Vector3
Scaled copy of this.
inherited
operator +(Vector3 other) → Vector3
Add two vectors.
inherited
operator -(Vector3 other) → Vector3
Subtract two vectors.
inherited
operator /(double value) → Vector3
Copy of this scaled by the inverse of value.
inherited
operator ==(Object other) → bool
Check if two vectors are the same.
inherited
operator [](int index) → double
Access the component of the vector at the index index.
inherited
operator []=(int index, double value) → void
Sets the component of the vector at the index index.
operator unary-() → Vector3
Negated copy of this.
inherited