float3
struct float3Available without an import.
A three-component floating-point vector with x, y, and z fields. Arithmetic is component-wise. Swizzle getters select two to four components in their written order and may repeat them. Swizzles with no repeated component also have setters; assigning yxz writes value.x to y, value.y to x, and value.z to z.
Members
xfield
public float xThe x component.
yfield
public float yThe y component.
zfield
public float zThe z component.
constructorconstructor
public constructor (float x, float y, float z)Stores the supplied components in order.
FromScalarconstructor
public constructor FromScalar (float value)Copies the same scalar into every component.
From2constructor
public constructor From2 (float2 xy, float z)Copies the supplied vector components and any remaining scalar/vector components in order.
From4constructor
public constructor From4 (float4 v)Copies the leading components, discarding the unused trailing components.
Zerogetter
public static get Zero() : float3The all-zero vector.
Onegetter
public static get One() : float3The all-one vector.
UnitXgetter
public static get UnitX() : float3The unit vector along the X axis; all other components are zero.
UnitYgetter
public static get UnitY() : float3The unit vector along the Y axis; all other components are zero.
UnitZgetter
public static get UnitZ() : float3The unit vector along the Z axis; all other components are zero.
lengthSquaredgetter
public get lengthSquared() : floatReturns the sum of squared components without taking a square root.
lengthgetter
public get length() : floatReturns the Euclidean magnitude.
normalizedgetter
public get normalized() : float3Divides by the Euclidean magnitude. A zero magnitude returns the zero vector.
isZerogetter
public get isZero() : boolTests whether every component is exactly zero; uses no tolerance.
Dotmethod
public static fn Dot(float3 a, float3 b) : floatReturns the sum of component-wise products.
Crossmethod
public static fn Cross(float3 a, float3 b) : float3Returns the right-handed cross product of two 3D vectors.
Distancemethod
public static fn Distance(float3 a, float3 b) : floatReturns the Euclidean distance between vectors.
DistanceSquaredmethod
public static fn DistanceSquared(float3 a, float3 b) : floatReturns squared Euclidean distance, avoiding a square root.
Lerpmethod
public static fn Lerp(float3 a, float3 b, float t) : float3Interpolates component-wise as a + t*(b-a). Does not clamp t.
Reflectmethod
public static fn Reflect(float3 v, float3 normal) : float3Reflects v around the supplied unit normal. Does not normalize normal.
Minmethod
public static fn Min(float3 a, float3 b) : float3Takes the scalar Math.Min of each component pair, including its NaN and signed-zero rules.
Maxmethod
public static fn Max(float3 a, float3 b) : float3Takes the scalar Math.Max of each component pair, including its NaN and signed-zero rules.
Absmethod
public static fn Abs(float3 v) : float3Takes the absolute value of every component.
Clampmethod
public static fn Clamp(float3 v, float3 lo, float3 hi) : float3Clamps each component between the corresponding ordered lo and hi bounds.
SmoothStepmethod
public static fn SmoothStep(float3 a, float3 b, float t) : float3Clamps t to [0, 1], applies the cubic tt(3-2*t), and interpolates between a and b.
MoveTowardsmethod
public static fn MoveTowards(float3 current, float3 target, float maxDistanceDelta) : float3Moves toward target by at most maxDistanceDelta in Euclidean distance without overshooting. Supply a nonnegative delta.
xxgetter
public get xx() : float2xygetter
public get xy() : float2xysetter
public set xy(float2 value) : voidxzgetter
public get xz() : float2xzsetter
public set xz(float2 value) : voidyxgetter
public get yx() : float2yxsetter
public set yx(float2 value) : voidyygetter
public get yy() : float2yzgetter
public get yz() : float2yzsetter
public set yz(float2 value) : voidzxgetter
public get zx() : float2zxsetter
public set zx(float2 value) : voidzygetter
public get zy() : float2zysetter
public set zy(float2 value) : voidzzgetter
public get zz() : float2xxxgetter
public get xxx() : float3xxygetter
public get xxy() : float3xxzgetter
public get xxz() : float3xyxgetter
public get xyx() : float3xyygetter
public get xyy() : float3xyzgetter
public get xyz() : float3xyzsetter
public set xyz(float3 value) : voidxzxgetter
public get xzx() : float3xzygetter
public get xzy() : float3xzysetter
public set xzy(float3 value) : voidxzzgetter
public get xzz() : float3yxxgetter
public get yxx() : float3yxygetter
public get yxy() : float3yxzgetter
public get yxz() : float3yxzsetter
public set yxz(float3 value) : voidyyxgetter
public get yyx() : float3yyygetter
public get yyy() : float3yyzgetter
public get yyz() : float3yzxgetter
public get yzx() : float3yzxsetter
public set yzx(float3 value) : voidyzygetter
public get yzy() : float3yzzgetter
public get yzz() : float3zxxgetter
public get zxx() : float3zxygetter
public get zxy() : float3zxysetter
public set zxy(float3 value) : voidzxzgetter
public get zxz() : float3zyxgetter
public get zyx() : float3zyxsetter
public set zyx(float3 value) : voidzyygetter
public get zyy() : float3zyzgetter
public get zyz() : float3zzxgetter
public get zzx() : float3zzygetter
public get zzy() : float3zzzgetter
public get zzz() : float3xxxxgetter
public get xxxx() : float4xxxygetter
public get xxxy() : float4xxxzgetter
public get xxxz() : float4xxyxgetter
public get xxyx() : float4xxyygetter
public get xxyy() : float4xxyzgetter
public get xxyz() : float4xxzxgetter
public get xxzx() : float4xxzygetter
public get xxzy() : float4xxzzgetter
public get xxzz() : float4xyxxgetter
public get xyxx() : float4xyxygetter
public get xyxy() : float4xyxzgetter
public get xyxz() : float4xyyxgetter
public get xyyx() : float4xyyygetter
public get xyyy() : float4xyyzgetter
public get xyyz() : float4xyzxgetter
public get xyzx() : float4xyzygetter
public get xyzy() : float4xyzzgetter
public get xyzz() : float4xzxxgetter
public get xzxx() : float4xzxygetter
public get xzxy() : float4xzxzgetter
public get xzxz() : float4xzyxgetter
public get xzyx() : float4xzyygetter
public get xzyy() : float4xzyzgetter
public get xzyz() : float4xzzxgetter
public get xzzx() : float4xzzygetter
public get xzzy() : float4xzzzgetter
public get xzzz() : float4yxxxgetter
public get yxxx() : float4yxxygetter
public get yxxy() : float4yxxzgetter
public get yxxz() : float4yxyxgetter
public get yxyx() : float4yxyygetter
public get yxyy() : float4yxyzgetter
public get yxyz() : float4yxzxgetter
public get yxzx() : float4yxzygetter
public get yxzy() : float4yxzzgetter
public get yxzz() : float4yyxxgetter
public get yyxx() : float4yyxygetter
public get yyxy() : float4yyxzgetter
public get yyxz() : float4yyyxgetter
public get yyyx() : float4yyyygetter
public get yyyy() : float4yyyzgetter
public get yyyz() : float4yyzxgetter
public get yyzx() : float4yyzygetter
public get yyzy() : float4yyzzgetter
public get yyzz() : float4yzxxgetter
public get yzxx() : float4yzxygetter
public get yzxy() : float4yzxzgetter
public get yzxz() : float4yzyxgetter
public get yzyx() : float4yzyygetter
public get yzyy() : float4yzyzgetter
public get yzyz() : float4yzzxgetter
public get yzzx() : float4yzzygetter
public get yzzy() : float4yzzzgetter
public get yzzz() : float4zxxxgetter
public get zxxx() : float4zxxygetter
public get zxxy() : float4zxxzgetter
public get zxxz() : float4zxyxgetter
public get zxyx() : float4zxyygetter
public get zxyy() : float4zxyzgetter
public get zxyz() : float4zxzxgetter
public get zxzx() : float4zxzygetter
public get zxzy() : float4zxzzgetter
public get zxzz() : float4zyxxgetter
public get zyxx() : float4zyxygetter
public get zyxy() : float4zyxzgetter
public get zyxz() : float4zyyxgetter
public get zyyx() : float4zyyygetter
public get zyyy() : float4zyyzgetter
public get zyyz() : float4zyzxgetter
public get zyzx() : float4zyzygetter
public get zyzy() : float4zyzzgetter
public get zyzz() : float4zzxxgetter
public get zzxx() : float4zzxygetter
public get zzxy() : float4zzxzgetter
public get zzxz() : float4zzyxgetter
public get zzyx() : float4zzyygetter
public get zzyy() : float4zzyzgetter
public get zzyz() : float4zzzxgetter
public get zzzx() : float4zzzygetter
public get zzzy() : float4zzzzgetter
public get zzzz() : float4ToStringmethod
public fn ToString() : stringProvided by the compiler.
ToStringBuffermethod
public fn ToStringBuffer(StringBuilder builder) : int32Provided by the compiler.