Vector3 class
Vector3, 3 components
- Inheritance
-
- Object
- RaylibStruct<
Vector3> - RaylibStructLiteral<
Vector3> - Vector3
Constructors
-
Vector3({StructPointer<
Vector3> ? op, double x = 0, double y = 0, double z = 0}) - Vector3.barycenter(Vector3 p, Vector3 a, Vector3 b, Vector3 c)
-
Computes the barycentric coordinates of point
prelative to triangle (a,b,c).factory - Vector3.normalized(num x, num y, num z)
-
Creates a vector from
x,y,zand immediately normalizes it.factory - Vector3.one()
-
factory
- Vector3.perpendicular(Vector3 o)
-
Returns a vector perpendicular to
oby crossing it with its least-aligned cardinal axis.factory - Vector3.vec3(num x, num y, num z)
-
factory
- Vector3.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<
Vector3> ? -
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
- structName → String
-
The Dart-side type name of this struct
no setterinherited
- 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(
Vector3 o) → Vector3 -
Returns a new vector that is the component-wise sum of this and
o. -
addValue(
num value) → Vector3 -
Returns a new vector with
valueadded to each component. -
angle(
Vector3 o) → double -
Angle between this vector and
oin radians, in the range[0, π]. -
clamp(
Vector3 min, Vector3 max) → Vector3 -
Clamps each component of this vector between the corresponding components of
minandmax. -
clampValue(
double min, double max) → Vector3 -
Clamps the length of this vector to the range
[min, max]. -
clone(
) → Vector3 -
Returns a deep copy of this instance, preserving op if present.
override
-
copy(
) → Vector3 -
Returns a deep copy of this instance without op.
inherited
-
crossProduct(
Vector3 o) → Vector3 -
Cross product of this vector and
o. -
cubicHermite(
Vector3 tangent1, Vector3 v2, Vector3 tangent2, double amount) → Vector3 -
Interpolates along a cubic Hermite spline between this and
v2. -
distance(
Vector3 o) → double -
Euclidean distance between this vector and
o. -
distanceSqr(
Vector3 o) → double -
Squared Euclidean distance between this vector and
o. -
div(
Vector3 o) → Vector3 -
Returns a new vector that is the component-wise quotient of this and
o. -
divideBy(
num o) → Vector3 -
Returns a new vector with all components divided by
o. -
dotProduct(
Vector3 o) → double -
Dot product of this vector and
o. -
equals(
Vector3 o) → bool -
Returns
trueif this vector is approximately equal too. -
format(
[int x0 = 0, int? y0, int? z0]) → String - Returns a formatted string representation of this vector.
-
getOp(
) → StructPointer< Vector3> -
Returns op, throwing a descriptive StateError if unavailable or this instance RaylibTempStructState.isDisposed.
inherited
-
getOpAndDispose(
) → StructPointer< Vector3> -
Returns op and immediately disposes this struct.
inherited
-
invert(
) → Vector3 -
Returns a new vector with each component replaced by its reciprocal (
1/x,1/y,1/z). -
lerp(
Vector3 o, double amount) → Vector3 -
Linear interpolation between this and
obyamount. -
max(
Vector3 o) → Vector3 -
Returns a new vector with each component being the component-wise maximum of this and
o. -
min(
Vector3 o) → Vector3 -
Returns a new vector with each component being the component-wise minimum of this and
o. -
moveTowards(
Vector3 target, double maxDistance) → Vector3 -
Moves this vector towards
targetby at mostmaxDistance. -
mul(
Vector3 o) → Vector3 -
Returns a new vector that is the component-wise product of this and
o. -
negate(
) → Vector3 - Returns a new vector with all components negated.
-
normalize(
) → Vector3 - Returns a normalized (unit-length) copy of this vector.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
orthoNormalize(
Vector3 o) → Vector3 -
Orthonormalizes this vector against
ousing the Gram-Schmidt process. -
project(
Vector3 o) → Vector3 -
Projects this vector onto
o. -
reflect(
Vector3 normal) → Vector3 -
Reflects this vector off a surface with the given
normal. -
refract(
Vector3 n, double r) → Vector3 -
Refracts this vector through a surface with normal
nand ratior. -
reject(
Vector3 o) → Vector3 -
Rejects
ofrom this vector. -
rotateByAxisAngle(
Vector3 axis, double angle) → Vector3 -
Rotates this vector around
axisbyangleradians. -
rotateByQuaternion(
Quaternion q) → Vector3 -
Returns a new vector with
thisrotated by quaternionq. -
scale(
num o) → Vector3 -
Returns a new vector with all components scaled by
o. -
set(
num x, num y, num z) → Vector3 - Sets all components at once.
-
setDart(
Vector3 o) → Vector3 -
Copies the fields of
ointo 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
tempunderkeyas needed.inherited -
structDispose(
) → void -
Marks this instance as disposed.
inherited
-
structOnOp(
void callback(StructPointer< Vector3> p)) → void -
Calls
callbackwith op if it is set, otherwise no-ops.inherited -
structReadFrom(
MemoryPointer< RType> p) → void -
override
-
structSetTag(
String newTag) → Vector3 -
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(
Vector3 o) → Vector3 -
Returns a new vector that is the component-wise difference of this and
o. -
subValue(
num value) → Vector3 -
Returns a new vector with
valuesubtracted from each component. -
toArray(
) → List< double> - Returns the components as a new double list.
-
toFloatV(
) → float3 - Returns the components as a float3.
-
toString(
) → String -
A string representation of this object.
inherited
-
transform(
Matrix o) → Vector3 -
Transforms this vector by matrix
o. -
unproject(
Matrix projection, Matrix view) → Vector3 - Unprojects this screen-space vector back into world space.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
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<
Vector3> -
Describes the raw memory layout, construction, and pointer representation
of this struct type.
final
-
structLayout
→ StructLayout<
Vector3Field> -
Raw memory layout of this object.
final