Skip to content

Std geom vec4

std:std.geom.Vec4

Struct Vec4#

The generic Vec4 type provides support for 4 component vectors.

Unless otherwise noted, methods and operators always return a new vec4 containing the result, without modifying any parameters or 'self'.

This allows you to chain operators together easily just like 'real' expressions.

Fields
w The vector w coordinate.
x The vector x coordinate.
y The vector y coordinate.
z The vector z coordinate.
Constructors
New
Properties
Length Returns the length of the vec4. (read only)
W The Y coordinate of the vec4.
X The X coordinate of the vec4.
XY The XY components as a vec2.
XYZ The XYZ components as a vec3.
Y The Y coordinate of the vec4.
Z The Y coordinate of the vec4.
Methods
Operator * Multiplies the vec4 by another vec4.
Operator + Adds the vec4 to another vec4.
Operator - Negates the vec4.
Operator / Divides the vec4 by another vec4.
Blend
Dot Returns the dot product of the vec4 with another vec4.
Normalize Normalizes the vec4.
ToString
Operator To Converts the vec4 to a vec4 of a different type or a printable string.