Vector4Base<V4 extends Vector4Base<V4, Q, M, V3> , Q extends QuaternionBase<Q, M, V3, V4> , M extends MatrixBase<M, V3, Q, V4> , V3 extends Vector3Base<V3, M, Q, V4> > mixin
Backend-agnostic contract for Vector4Base structs.
Must be mixed into every concrete platform implementation of a Raylib type to ensure a unified API surface across different backends.
A 4D vector with x, y, z, and w components.
Also serves as the underlying representation for QuaternionBase; see toQuaternion.
- Superclass constraints
Properties
- $state → RaylibTempStructState
-
Per-instance allocation state tracking slot keys, disposal, and identity.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- length → double
-
Euclidean length (magnitude) of this vector.
no setter
- lengthSqr → double
-
Squared length of this vector.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- structName → String
-
The Dart-side type name of this struct
no setterinherited
- w ↔ double
-
W component
getter/setter pair
- x ↔ double
-
X component
getter/setter pair
- y ↔ double
-
Y component
getter/setter pair
- z ↔ double
-
Z component
getter/setter pair
Methods
-
add(
V4 o) → V4 -
Returns a new vector that is the component-wise sum of this and
o. -
addValue(
num value) → V4 -
Returns a new vector with
valueadded to each component. -
clone(
) → V4 -
Returns a deep copy of this instance, preserving RaylibStructBase.originalPointer if present.
inherited
-
copy(
) → V4 -
Returns a deep copy of this instance without RaylibStructBase.originalPointer.
inherited
-
distance(
V4 o) → double -
Euclidean distance between this vector and
o. -
distanceSqr(
V4 o) → double -
Squared Euclidean distance between this vector and
o. -
div(
V4 o) → V4 -
Returns a new vector that is the component-wise quotient of this and
o. -
divideBy(
num o) → V4 -
Returns a new vector with all components divided by
o. -
dotProduct(
V4 o) → double -
Dot product of this vector and
o. -
equals(
V4 o) → bool -
Returns
trueif this vector is approximately equal too. -
format(
[int x0 = 0, int? y0, int? z0, int? w0]) → String - Returns a formatted string representation of this vector.
-
invert(
) → V4 - Returns a new vector with each component replaced by its reciprocal.
-
lerp(
V4 o, double amount) → V4 -
Linear interpolation between this and
obyamount. -
max(
V4 o) → V4 -
Returns a new vector with each component being the component-wise maximum of this and
o. -
min(
V4 o) → V4 -
Returns a new vector with each component being the component-wise minimum of this and
o. -
moveTowards(
V4 target, double maxDistance) → V4 -
Moves this vector towards
targetby at mostmaxDistance. -
mul(
V4 o) → V4 -
Returns a new vector that is the component-wise product of this and
o. -
negate(
) → V4 - Returns a new vector with all components negated.
-
normalize(
) → V4 - Returns a normalized (unit-length) copy of this vector.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
scale(
num o) → V4 -
Returns a new vector with all components scaled by
o. -
set(
num x, num y, num z, num w) → V4 - Sets all components at once.
-
setD(
V4 o) → V4 -
Copies the fields of
ointo this instance and returnsthis.inherited -
signature(
) → String -
Returns a human-readable representation of this struct.
override
-
sub(
V4 o) → V4 -
Returns a new vector that is the component-wise difference of this and
o. -
subValue(
num value) → V4 -
Returns a new vector with
valuesubtracted from each component. -
toArray(
) → List< double> - Returns the components as a new double list.
-
toQuaternion(
) → Q -
Converts this vector to a quaternion with the same
(x, y, z, w)components. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited