← Standard library

float3

struct float3

Available 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.

Vectors.wax:247

Members

xfield

public float x

The x component.

Vectors.wax:251

yfield

public float y

The y component.

Vectors.wax:255

zfield

public float z

The z component.

Vectors.wax:259

constructorconstructor

public constructor (float x, float y, float z)

Stores the supplied components in order.

Vectors.wax:264

FromScalarconstructor

public constructor FromScalar (float value)

Copies the same scalar into every component.

Vectors.wax:273

From2constructor

public constructor From2 (float2 xy, float z)

Copies the supplied vector components and any remaining scalar/vector components in order.

Vectors.wax:282

From4constructor

public constructor From4 (float4 v)

Copies the leading components, discarding the unused trailing components.

Vectors.wax:291

Zerogetter

public static get Zero() : float3

The all-zero vector.

Vectors.wax:301

Onegetter

public static get One() : float3

The all-one vector.

Vectors.wax:308

UnitXgetter

public static get UnitX() : float3

The unit vector along the X axis; all other components are zero.

Vectors.wax:315

UnitYgetter

public static get UnitY() : float3

The unit vector along the Y axis; all other components are zero.

Vectors.wax:322

UnitZgetter

public static get UnitZ() : float3

The unit vector along the Z axis; all other components are zero.

Vectors.wax:329

lengthSquaredgetter

public get lengthSquared() : float

Returns the sum of squared components without taking a square root.

Vectors.wax:337

lengthgetter

public get length() : float

Returns the Euclidean magnitude.

Vectors.wax:344

normalizedgetter

public get normalized() : float3

Divides by the Euclidean magnitude. A zero magnitude returns the zero vector.

Vectors.wax:351

isZerogetter

public get isZero() : bool

Tests whether every component is exactly zero; uses no tolerance.

Vectors.wax:362

Dotmethod

public static fn Dot(float3 a, float3 b) : float

Returns the sum of component-wise products.

Vectors.wax:370

Crossmethod

public static fn Cross(float3 a, float3 b) : float3

Returns the right-handed cross product of two 3D vectors.

Vectors.wax:377

Distancemethod

public static fn Distance(float3 a, float3 b) : float

Returns the Euclidean distance between vectors.

Vectors.wax:388

DistanceSquaredmethod

public static fn DistanceSquared(float3 a, float3 b) : float

Returns squared Euclidean distance, avoiding a square root.

Vectors.wax:398

Lerpmethod

public static fn Lerp(float3 a, float3 b, float t) : float3

Interpolates component-wise as a + t*(b-a). Does not clamp t.

Vectors.wax:408

Reflectmethod

public static fn Reflect(float3 v, float3 normal) : float3

Reflects v around the supplied unit normal. Does not normalize normal.

Vectors.wax:419

Minmethod

public static fn Min(float3 a, float3 b) : float3

Takes the scalar Math.Min of each component pair, including its NaN and signed-zero rules.

Vectors.wax:427

Maxmethod

public static fn Max(float3 a, float3 b) : float3

Takes the scalar Math.Max of each component pair, including its NaN and signed-zero rules.

Vectors.wax:438

Absmethod

public static fn Abs(float3 v) : float3

Takes the absolute value of every component.

Vectors.wax:449

Clampmethod

public static fn Clamp(float3 v, float3 lo, float3 hi) : float3

Clamps each component between the corresponding ordered lo and hi bounds.

Vectors.wax:460

SmoothStepmethod

public static fn SmoothStep(float3 a, float3 b, float t) : float3

Clamps t to [0, 1], applies the cubic tt(3-2*t), and interpolates between a and b.

Vectors.wax:471

MoveTowardsmethod

public static fn MoveTowards(float3 current, float3 target, float maxDistanceDelta) : float3

Moves toward target by at most maxDistanceDelta in Euclidean distance without overshooting. Supply a nonnegative delta.

Vectors.wax:484

xxgetter

public get xx() : float2

Vectors.wax:501

xygetter

public get xy() : float2

Vectors.wax:502

xysetter

public set xy(float2 value) : void

Vectors.wax:503

xzgetter

public get xz() : float2

Vectors.wax:504

xzsetter

public set xz(float2 value) : void

Vectors.wax:505

yxgetter

public get yx() : float2

Vectors.wax:506

yxsetter

public set yx(float2 value) : void

Vectors.wax:507

yygetter

public get yy() : float2

Vectors.wax:508

yzgetter

public get yz() : float2

Vectors.wax:509

yzsetter

public set yz(float2 value) : void

Vectors.wax:510

zxgetter

public get zx() : float2

Vectors.wax:511

zxsetter

public set zx(float2 value) : void

Vectors.wax:512

zygetter

public get zy() : float2

Vectors.wax:513

zysetter

public set zy(float2 value) : void

Vectors.wax:514

zzgetter

public get zz() : float2

Vectors.wax:515

xxxgetter

public get xxx() : float3

Vectors.wax:516

xxygetter

public get xxy() : float3

Vectors.wax:517

xxzgetter

public get xxz() : float3

Vectors.wax:518

xyxgetter

public get xyx() : float3

Vectors.wax:519

xyygetter

public get xyy() : float3

Vectors.wax:520

xyzgetter

public get xyz() : float3

Vectors.wax:521

xyzsetter

public set xyz(float3 value) : void

Vectors.wax:522

xzxgetter

public get xzx() : float3

Vectors.wax:523

xzygetter

public get xzy() : float3

Vectors.wax:524

xzysetter

public set xzy(float3 value) : void

Vectors.wax:525

xzzgetter

public get xzz() : float3

Vectors.wax:526

yxxgetter

public get yxx() : float3

Vectors.wax:527

yxygetter

public get yxy() : float3

Vectors.wax:528

yxzgetter

public get yxz() : float3

Vectors.wax:529

yxzsetter

public set yxz(float3 value) : void

Vectors.wax:530

yyxgetter

public get yyx() : float3

Vectors.wax:531

yyygetter

public get yyy() : float3

Vectors.wax:532

yyzgetter

public get yyz() : float3

Vectors.wax:533

yzxgetter

public get yzx() : float3

Vectors.wax:534

yzxsetter

public set yzx(float3 value) : void

Vectors.wax:535

yzygetter

public get yzy() : float3

Vectors.wax:536

yzzgetter

public get yzz() : float3

Vectors.wax:537

zxxgetter

public get zxx() : float3

Vectors.wax:538

zxygetter

public get zxy() : float3

Vectors.wax:539

zxysetter

public set zxy(float3 value) : void

Vectors.wax:540

zxzgetter

public get zxz() : float3

Vectors.wax:541

zyxgetter

public get zyx() : float3

Vectors.wax:542

zyxsetter

public set zyx(float3 value) : void

Vectors.wax:543

zyygetter

public get zyy() : float3

Vectors.wax:544

zyzgetter

public get zyz() : float3

Vectors.wax:545

zzxgetter

public get zzx() : float3

Vectors.wax:546

zzygetter

public get zzy() : float3

Vectors.wax:547

zzzgetter

public get zzz() : float3

Vectors.wax:548

xxxxgetter

public get xxxx() : float4

Vectors.wax:549

xxxygetter

public get xxxy() : float4

Vectors.wax:550

xxxzgetter

public get xxxz() : float4

Vectors.wax:551

xxyxgetter

public get xxyx() : float4

Vectors.wax:552

xxyygetter

public get xxyy() : float4

Vectors.wax:553

xxyzgetter

public get xxyz() : float4

Vectors.wax:554

xxzxgetter

public get xxzx() : float4

Vectors.wax:555

xxzygetter

public get xxzy() : float4

Vectors.wax:556

xxzzgetter

public get xxzz() : float4

Vectors.wax:557

xyxxgetter

public get xyxx() : float4

Vectors.wax:558

xyxygetter

public get xyxy() : float4

Vectors.wax:559

xyxzgetter

public get xyxz() : float4

Vectors.wax:560

xyyxgetter

public get xyyx() : float4

Vectors.wax:561

xyyygetter

public get xyyy() : float4

Vectors.wax:562

xyyzgetter

public get xyyz() : float4

Vectors.wax:563

xyzxgetter

public get xyzx() : float4

Vectors.wax:564

xyzygetter

public get xyzy() : float4

Vectors.wax:565

xyzzgetter

public get xyzz() : float4

Vectors.wax:566

xzxxgetter

public get xzxx() : float4

Vectors.wax:567

xzxygetter

public get xzxy() : float4

Vectors.wax:568

xzxzgetter

public get xzxz() : float4

Vectors.wax:569

xzyxgetter

public get xzyx() : float4

Vectors.wax:570

xzyygetter

public get xzyy() : float4

Vectors.wax:571

xzyzgetter

public get xzyz() : float4

Vectors.wax:572

xzzxgetter

public get xzzx() : float4

Vectors.wax:573

xzzygetter

public get xzzy() : float4

Vectors.wax:574

xzzzgetter

public get xzzz() : float4

Vectors.wax:575

yxxxgetter

public get yxxx() : float4

Vectors.wax:576

yxxygetter

public get yxxy() : float4

Vectors.wax:577

yxxzgetter

public get yxxz() : float4

Vectors.wax:578

yxyxgetter

public get yxyx() : float4

Vectors.wax:579

yxyygetter

public get yxyy() : float4

Vectors.wax:580

yxyzgetter

public get yxyz() : float4

Vectors.wax:581

yxzxgetter

public get yxzx() : float4

Vectors.wax:582

yxzygetter

public get yxzy() : float4

Vectors.wax:583

yxzzgetter

public get yxzz() : float4

Vectors.wax:584

yyxxgetter

public get yyxx() : float4

Vectors.wax:585

yyxygetter

public get yyxy() : float4

Vectors.wax:586

yyxzgetter

public get yyxz() : float4

Vectors.wax:587

yyyxgetter

public get yyyx() : float4

Vectors.wax:588

yyyygetter

public get yyyy() : float4

Vectors.wax:589

yyyzgetter

public get yyyz() : float4

Vectors.wax:590

yyzxgetter

public get yyzx() : float4

Vectors.wax:591

yyzygetter

public get yyzy() : float4

Vectors.wax:592

yyzzgetter

public get yyzz() : float4

Vectors.wax:593

yzxxgetter

public get yzxx() : float4

Vectors.wax:594

yzxygetter

public get yzxy() : float4

Vectors.wax:595

yzxzgetter

public get yzxz() : float4

Vectors.wax:596

yzyxgetter

public get yzyx() : float4

Vectors.wax:597

yzyygetter

public get yzyy() : float4

Vectors.wax:598

yzyzgetter

public get yzyz() : float4

Vectors.wax:599

yzzxgetter

public get yzzx() : float4

Vectors.wax:600

yzzygetter

public get yzzy() : float4

Vectors.wax:601

yzzzgetter

public get yzzz() : float4

Vectors.wax:602

zxxxgetter

public get zxxx() : float4

Vectors.wax:603

zxxygetter

public get zxxy() : float4

Vectors.wax:604

zxxzgetter

public get zxxz() : float4

Vectors.wax:605

zxyxgetter

public get zxyx() : float4

Vectors.wax:606

zxyygetter

public get zxyy() : float4

Vectors.wax:607

zxyzgetter

public get zxyz() : float4

Vectors.wax:608

zxzxgetter

public get zxzx() : float4

Vectors.wax:609

zxzygetter

public get zxzy() : float4

Vectors.wax:610

zxzzgetter

public get zxzz() : float4

Vectors.wax:611

zyxxgetter

public get zyxx() : float4

Vectors.wax:612

zyxygetter

public get zyxy() : float4

Vectors.wax:613

zyxzgetter

public get zyxz() : float4

Vectors.wax:614

zyyxgetter

public get zyyx() : float4

Vectors.wax:615

zyyygetter

public get zyyy() : float4

Vectors.wax:616

zyyzgetter

public get zyyz() : float4

Vectors.wax:617

zyzxgetter

public get zyzx() : float4

Vectors.wax:618

zyzygetter

public get zyzy() : float4

Vectors.wax:619

zyzzgetter

public get zyzz() : float4

Vectors.wax:620

zzxxgetter

public get zzxx() : float4

Vectors.wax:621

zzxygetter

public get zzxy() : float4

Vectors.wax:622

zzxzgetter

public get zzxz() : float4

Vectors.wax:623

zzyxgetter

public get zzyx() : float4

Vectors.wax:624

zzyygetter

public get zzyy() : float4

Vectors.wax:625

zzyzgetter

public get zzyz() : float4

Vectors.wax:626

zzzxgetter

public get zzzx() : float4

Vectors.wax:627

zzzygetter

public get zzzy() : float4

Vectors.wax:628

zzzzgetter

public get zzzz() : float4

Vectors.wax:629

ToStringmethod

public fn ToString() : string

Provided by the compiler.

ToStringBuffermethod

public fn ToStringBuffer(StringBuilder builder) : int32

Provided by the compiler.