Vector4D class

Vector4, 4 components

Inheritance

Constructors

Vector4D({StructPointer<Vector4D>? op, double x = 0, double y = 0, double z = 0, double w = 0})
Vector4D.colorNormalize(ColorD color)
Converts color RGBA channels from 0–255 to normalized 0.0–1.0 components.
factory
Vector4D.fromAxisAngle(Vector3D axis, double angle)
Creates a quaternion from an axis and rotation angle (in radians).
factory
Vector4D.fromQuaternion(QuaternionD q)
Creates a Vector4D from the raw XYZW components of q.
factory
Vector4D.one()
factory
Vector4D.vec4(num x, num y, num z, num w)
factory
Vector4D.zero()
factory

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
op ↔ StructPointer<Vector4D>?
The C-owned or RaylibTemp-owned typed pointer for this struct, if any.
getter/setter pairinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
structIsDisposed → bool
Whether structMarkDisposed has been called on this instance.
no setterinherited
structName → String
The Dart-side type name of this struct
no setterinherited
w ↔ double
Vector w component
getter/setter pair
x ↔ double
Vector x component
getter/setter pair
y ↔ double
Vector y component
getter/setter pair
z ↔ double
Vector z component
getter/setter pair

Methods

add(Vector4D o) → Vector4D
Returns a new vector that is the component-wise sum of this and o.
addValue(num value) → Vector4D
Returns a new vector with value added to each component.
clone() → Vector4D
Returns a deep copy of this instance, preserving op if present.
override
copy() → Vector4D
Returns a deep copy of this instance without op.
inherited
distance(Vector4D o) → double
Euclidean distance between this vector and o.
distanceSqr(Vector4D o) → double
Squared Euclidean distance between this vector and o.
div(Vector4D o) → Vector4D
Returns a new vector that is the component-wise quotient of this and o.
divideBy(num o) → Vector4D
Returns a new vector with all components divided by o.
dotProduct(Vector4D o) → double
Dot product of this vector and o.
equals(Vector4D o) → bool
Returns true if this vector is approximately equal to o.
format([int x0 = 0, int? y0, int? z0, int? w0]) → String
Returns a formatted string representation of this vector.
getOp() → StructPointer<Vector4D>
Returns op, throwing a descriptive StateError if unavailable or this instance RaylibTempStructState.isDisposed.
inherited
getOpAndDispose() → StructPointer<Vector4D>
Returns op and immediately disposes this struct.
inherited
invert() → Vector4D
Returns a new vector with each component replaced by its reciprocal.
lerp(Vector4D o, double amount) → Vector4D
Linear interpolation between this and o by amount.
max(Vector4D o) → Vector4D
Returns a new vector with each component being the component-wise maximum of this and o.
min(Vector4D o) → Vector4D
Returns a new vector with each component being the component-wise minimum of this and o.
moveTowards(Vector4D target, double maxDistance) → Vector4D
Moves this vector towards target by at most maxDistance.
mul(Vector4D o) → Vector4D
Returns a new vector that is the component-wise product of this and o.
negate() → Vector4D
Returns a new vector with all components negated.
normalize() → Vector4D
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) → Vector4D
Returns a new vector with all components scaled by o.
set(num x, num y, num z, num w) → Vector4D
Sets all components at once.
setDart(Vector4D o) → Vector4D
Copies the fields of o into this instance.
override
signature() → String
Returns a human-readable representation of this struct.
override
structAllocateInto(RaylibTemp<RaylibBase> temp, MemoryPointer<RType> p, String key) → void
Allocates nested pointers into temp under key as needed.
inherited
structMarkDisposed() → void
Marks this instance as disposed and clears op.
inherited
structOnOp(void callback(StructPointer<Vector4D> p)) → void
Calls callback with op if it is set, otherwise no-ops.
inherited
structReadFrom(MemoryPointer<RType> p) → void
override
structSetTag(String newTag) → Vector4D
Sets RaylibTempStructState.tag to newTag.
inherited
structSyncFromMemory() → void
Syncs all fields from the memory. Requires op.
inherited
structSyncToMemory() → void
Syncs all fields to the memory. Requires op.
inherited
structWriteInto(MemoryPointer<RType> p) → void
override
sub(Vector4D o) → Vector4D
Returns a new vector that is the component-wise difference of this and o.
subValue(num value) → Vector4D
Returns a new vector with value subtracted from each component.
toArray() → List<double>
Returns the components as a new double list.
toQuaternion() → QuaternionD
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

Static Properties

field_w → StructValueField<double, RFloat>
Field descriptor for w.
final
field_x → StructValueField<double, RFloat>
Field descriptor for x.
final
field_y → StructValueField<double, RFloat>
Field descriptor for y.
final
field_z → StructValueField<double, RFloat>
Field descriptor for z.
final
struct → StructType<Vector4D>
Describes the raw memory layout, construction, and pointer representation of this struct type.
final
structLayout → StructLayout<Vector4Field>
Raw memory layout of this object.
final