Struct Vec
struct Vec(T, ulong N)
if (N > 0 && isNumeric!T);
Constructors
Name | Description |
---|---|
this
(comps)
|
Build a vector from its components Can be called with any combination of scalar or vectors, as long as the total number of scalar fit with length |
this
(arr)
|
Build a vector from an array. |
this
(comp)
|
Build a vector with all components assigned to one value |
Fields
Name | Type | Description |
---|---|---|
_rep
|
T[N] |
Properties
Name | Type | Description |
---|---|---|
array [get]
|
T[length] | All components in a static array |
data [get]
|
inout(T)[] | Return the data of the array |
opDispatch [get]
|
T | Access the component by name. |
opDispatch [set]
|
T | Assign the component by name. |
opDispatch [get]
|
auto | Access the components by swizzling. |
opDispatch [set]
|
Vec!(U,num) | Assign the components by swizzling. |
tup [get]
|
Tuple!CompSeq | All components in a tuple |
Methods
Name | Description |
---|---|
correctSlice
(slice)
|
|
opApply
(dg)
|
Foreach support. |
opBinary
(oth)
|
Perform a term by term operation on the vector. |
opBinary
(val)
|
Perform a scalar operation on the vector. |
opBinaryRight
(val)
|
Perform a scalar operation on the vector. |
opCast
()
|
Cast the vector to another type of component |
opDollar
()
|
End of the vector. |
opIndex
(index)
|
Index a vector component. |
opIndex
(slice)
|
Slicing support |
opIndexAssign
(val, index)
|
Assign a vector component. |
opIndexAssign
(val, slice)
|
Slicing support |
opIndexOpAssign
(val, index)
|
Assign a vector component. |
opIndexOpAssign
(val, slice)
|
Slicing support |
opIndexOpAssign
(val, slice)
|
Term by term sliced assignement operation. |
opOpAssign
(oth)
|
Perform a term by term assignment operation on the vector. |
opOpAssign
(val)
|
Perform a scalar assignment operation on the vector. |
opSlice
(start, end)
|
Slicing support |
opUnary
()
|
Unary "+" operation. |
opUnary
()
|
Unary "-" operation. |
toString
()
|
Aliases
Name | Description |
---|---|
Component
|
The type of a vector component |
CompSeq
|
Alias to a type sequence holding all components |