src/computesim/vectors

Search:
Group by:
Source   Edit  

Types

BVec2 = TVec2[bool]
Source   Edit  
BVec3 = TVec3[bool]
Source   Edit  
BVec4 = TVec4[bool]
Source   Edit  
DVec2 = TVec2[float64]
Source   Edit  
DVec3 = TVec3[float64]
Source   Edit  
DVec4 = TVec4[float64]
Source   Edit  
IVec2 = TVec2[int32]
Source   Edit  
IVec3 = TVec3[int32]
Source   Edit  
IVec4 = TVec4[int32]
Source   Edit  
TVec[N; T] = object
Source   Edit  
TVec2[T] = TVec[2, T]
Source   Edit  
TVec3[T] = TVec[3, T]
Source   Edit  
TVec4[T] = TVec[4, T]
Source   Edit  
UVec2 = TVec2[uint32]
Source   Edit  
UVec3 = TVec3[uint32]
Source   Edit  
UVec4 = TVec4[uint32]
Source   Edit  
Vec2 = TVec2[float32]
Source   Edit  
Vec3 = TVec3[float32]
Source   Edit  
Vec4 = TVec4[float32]
Source   Edit  

Procs

proc `$`[T](v: TVec2[T]): string
Source   Edit  
proc `$`[T](v: TVec3[T]): string
Source   Edit  
proc `$`[T](v: TVec4[T]): string
Source   Edit  
proc `[]`[N, T](v: TVec[N, T]; i: int): T {.inline.}
Source   Edit  
proc `[]=`[N, T](v: var TVec[N, T]; i: int; val: T) {.inline.}
Source   Edit  
proc bvec2(v`gensym0: bool): BVec2 {....raises: [], tags: [], forbids: [].}
Constructs Vec2 with the same value for both components Source   Edit  
proc bvec2(v`gensym0: BVec3): BVec2 {....raises: [], tags: [], forbids: [].}
Constructs Vec2 from first two components of Vec3 Source   Edit  
proc bvec2(v`gensym0: BVec4): BVec2 {....raises: [], tags: [], forbids: [].}
Constructs Vec2 from first two components of Vec4 Source   Edit  
proc bvec2(x`gensym0, y`gensym0: bool): BVec2 {....raises: [], tags: [],
    forbids: [].}
Constructs Vec2 from two components Source   Edit  
proc bvec3(v`gensym5: bool): BVec3 {....raises: [], tags: [], forbids: [].}
Constructs Vec3 with the same value for all components Source   Edit  
proc bvec3(v`gensym5: BVec2; z`gensym5: bool): BVec3 {....raises: [], tags: [],
    forbids: [].}
Constructs Vec3 from Vec2 and a z component Source   Edit  
proc bvec3(v`gensym5: BVec4): BVec3 {....raises: [], tags: [], forbids: [].}
Constructs Vec3 from first three components of Vec4 Source   Edit  
proc bvec3(x`gensym5, y`gensym5, z`gensym5: bool): BVec3 {....raises: [], tags: [],
    forbids: [].}
Constructs Vec3 from three components Source   Edit  
proc bvec4(v`gensym11: bool): BVec4 {....raises: [], tags: [], forbids: [].}
Constructs Vec4 with the same value for all components Source   Edit  
proc bvec4(v`gensym11: BVec2; z`gensym11, w`gensym11: bool): BVec4 {....raises: [],
    tags: [], forbids: [].}
Constructs Vec4 from Vec2 and z, w components Source   Edit  
proc bvec4(v`gensym11: BVec3; w`gensym11: bool): BVec4 {....raises: [], tags: [],
    forbids: [].}
Constructs Vec4 from Vec3 and w component Source   Edit  
proc bvec4(x`gensym11, y`gensym11, z`gensym11, w`gensym11: bool): BVec4 {.
    ...raises: [], tags: [], forbids: [].}
Constructs Vec4 from four components Source   Edit  
proc bvec4(xy`gensym11: BVec2; zw`gensym11: BVec2): BVec4 {....raises: [],
    tags: [], forbids: [].}
Constructs Vec4 from two Vec2 components Source   Edit  
proc dvec2(v`gensym84: DVec3): DVec2 {....raises: [], tags: [], forbids: [].}
Constructs Vec2 from first two components of Vec3 Source   Edit  
proc dvec2(v`gensym84: DVec4): DVec2 {....raises: [], tags: [], forbids: [].}
Constructs Vec2 from first two components of Vec4 Source   Edit  
proc dvec2(v`gensym84: float64): DVec2 {....raises: [], tags: [], forbids: [].}
Constructs Vec2 with the same value for both components Source   Edit  
proc dvec2(x`gensym84, y`gensym84: float64): DVec2 {....raises: [], tags: [],
    forbids: [].}
Constructs Vec2 from two components Source   Edit  
proc dvec3(v`gensym89: DVec2; z`gensym89: float64): DVec3 {....raises: [],
    tags: [], forbids: [].}
Constructs Vec3 from Vec2 and a z component Source   Edit  
proc dvec3(v`gensym89: DVec4): DVec3 {....raises: [], tags: [], forbids: [].}
Constructs Vec3 from first three components of Vec4 Source   Edit  
proc dvec3(v`gensym89: float64): DVec3 {....raises: [], tags: [], forbids: [].}
Constructs Vec3 with the same value for all components Source   Edit  
proc dvec3(x`gensym89, y`gensym89, z`gensym89: float64): DVec3 {....raises: [],
    tags: [], forbids: [].}
Constructs Vec3 from three components Source   Edit  
proc dvec4(v`gensym95: DVec2; z`gensym95, w`gensym95: float64): DVec4 {.
    ...raises: [], tags: [], forbids: [].}
Constructs Vec4 from Vec2 and z, w components Source   Edit  
proc dvec4(v`gensym95: DVec3; w`gensym95: float64): DVec4 {....raises: [],
    tags: [], forbids: [].}
Constructs Vec4 from Vec3 and w component Source   Edit  
proc dvec4(v`gensym95: float64): DVec4 {....raises: [], tags: [], forbids: [].}
Constructs Vec4 with the same value for all components Source   Edit  
proc dvec4(x`gensym95, y`gensym95, z`gensym95, w`gensym95: float64): DVec4 {.
    ...raises: [], tags: [], forbids: [].}
Constructs Vec4 from four components Source   Edit  
proc dvec4(xy`gensym95: DVec2; zw`gensym95: DVec2): DVec4 {....raises: [],
    tags: [], forbids: [].}
Constructs Vec4 from two Vec2 components Source   Edit  
proc ivec2(v`gensym21: int32): IVec2 {....raises: [], tags: [], forbids: [].}
Constructs Vec2 with the same value for both components Source   Edit  
proc ivec2(v`gensym21: IVec3): IVec2 {....raises: [], tags: [], forbids: [].}
Constructs Vec2 from first two components of Vec3 Source   Edit  
proc ivec2(v`gensym21: IVec4): IVec2 {....raises: [], tags: [], forbids: [].}
Constructs Vec2 from first two components of Vec4 Source   Edit  
proc ivec2(x`gensym21, y`gensym21: int32): IVec2 {....raises: [], tags: [],
    forbids: [].}
Constructs Vec2 from two components Source   Edit  
proc ivec3(v`gensym26: int32): IVec3 {....raises: [], tags: [], forbids: [].}
Constructs Vec3 with the same value for all components Source   Edit  
proc ivec3(v`gensym26: IVec2; z`gensym26: int32): IVec3 {....raises: [], tags: [],
    forbids: [].}
Constructs Vec3 from Vec2 and a z component Source   Edit  
proc ivec3(v`gensym26: IVec4): IVec3 {....raises: [], tags: [], forbids: [].}
Constructs Vec3 from first three components of Vec4 Source   Edit  
proc ivec3(x`gensym26, y`gensym26, z`gensym26: int32): IVec3 {....raises: [],
    tags: [], forbids: [].}
Constructs Vec3 from three components Source   Edit  
proc ivec4(v`gensym32: int32): IVec4 {....raises: [], tags: [], forbids: [].}
Constructs Vec4 with the same value for all components Source   Edit  
proc ivec4(v`gensym32: IVec2; z`gensym32, w`gensym32: int32): IVec4 {.
    ...raises: [], tags: [], forbids: [].}
Constructs Vec4 from Vec2 and z, w components Source   Edit  
proc ivec4(v`gensym32: IVec3; w`gensym32: int32): IVec4 {....raises: [], tags: [],
    forbids: [].}
Constructs Vec4 from Vec3 and w component Source   Edit  
proc ivec4(x`gensym32, y`gensym32, z`gensym32, w`gensym32: int32): IVec4 {.
    ...raises: [], tags: [], forbids: [].}
Constructs Vec4 from four components Source   Edit  
proc ivec4(xy`gensym32: IVec2; zw`gensym32: IVec2): IVec4 {....raises: [],
    tags: [], forbids: [].}
Constructs Vec4 from two Vec2 components Source   Edit  
proc uvec2(v`gensym42: uint32): UVec2 {....raises: [], tags: [], forbids: [].}
Constructs Vec2 with the same value for both components Source   Edit  
proc uvec2(v`gensym42: UVec3): UVec2 {....raises: [], tags: [], forbids: [].}
Constructs Vec2 from first two components of Vec3 Source   Edit  
proc uvec2(v`gensym42: UVec4): UVec2 {....raises: [], tags: [], forbids: [].}
Constructs Vec2 from first two components of Vec4 Source   Edit  
proc uvec2(x`gensym42, y`gensym42: uint32): UVec2 {....raises: [], tags: [],
    forbids: [].}
Constructs Vec2 from two components Source   Edit  
proc uvec3(v`gensym47: uint32): UVec3 {....raises: [], tags: [], forbids: [].}
Constructs Vec3 with the same value for all components Source   Edit  
proc uvec3(v`gensym47: UVec2; z`gensym47: uint32): UVec3 {....raises: [], tags: [],
    forbids: [].}
Constructs Vec3 from Vec2 and a z component Source   Edit  
proc uvec3(v`gensym47: UVec4): UVec3 {....raises: [], tags: [], forbids: [].}
Constructs Vec3 from first three components of Vec4 Source   Edit  
proc uvec3(x`gensym47, y`gensym47, z`gensym47: uint32): UVec3 {....raises: [],
    tags: [], forbids: [].}
Constructs Vec3 from three components Source   Edit  
proc uvec4(v`gensym53: uint32): UVec4 {....raises: [], tags: [], forbids: [].}
Constructs Vec4 with the same value for all components Source   Edit  
proc uvec4(v`gensym53: UVec2; z`gensym53, w`gensym53: uint32): UVec4 {.
    ...raises: [], tags: [], forbids: [].}
Constructs Vec4 from Vec2 and z, w components Source   Edit  
proc uvec4(v`gensym53: UVec3; w`gensym53: uint32): UVec4 {....raises: [], tags: [],
    forbids: [].}
Constructs Vec4 from Vec3 and w component Source   Edit  
proc uvec4(x`gensym53, y`gensym53, z`gensym53, w`gensym53: uint32): UVec4 {.
    ...raises: [], tags: [], forbids: [].}
Constructs Vec4 from four components Source   Edit  
proc uvec4(xy`gensym53: UVec2; zw`gensym53: UVec2): UVec4 {....raises: [],
    tags: [], forbids: [].}
Constructs Vec4 from two Vec2 components Source   Edit  
proc vec2(v`gensym63: float32): Vec2 {....raises: [], tags: [], forbids: [].}
Constructs Vec2 with the same value for both components Source   Edit  
proc vec2(v`gensym63: Vec3): Vec2 {....raises: [], tags: [], forbids: [].}
Constructs Vec2 from first two components of Vec3 Source   Edit  
proc vec2(v`gensym63: Vec4): Vec2 {....raises: [], tags: [], forbids: [].}
Constructs Vec2 from first two components of Vec4 Source   Edit  
proc vec2(x`gensym63, y`gensym63: float32): Vec2 {....raises: [], tags: [],
    forbids: [].}
Constructs Vec2 from two components Source   Edit  
proc vec3(v`gensym68: float32): Vec3 {....raises: [], tags: [], forbids: [].}
Constructs Vec3 with the same value for all components Source   Edit  
proc vec3(v`gensym68: Vec2; z`gensym68: float32): Vec3 {....raises: [], tags: [],
    forbids: [].}
Constructs Vec3 from Vec2 and a z component Source   Edit  
proc vec3(v`gensym68: Vec4): Vec3 {....raises: [], tags: [], forbids: [].}
Constructs Vec3 from first three components of Vec4 Source   Edit  
proc vec3(x`gensym68, y`gensym68, z`gensym68: float32): Vec3 {....raises: [],
    tags: [], forbids: [].}
Constructs Vec3 from three components Source   Edit  
proc vec4(v`gensym74: float32): Vec4 {....raises: [], tags: [], forbids: [].}
Constructs Vec4 with the same value for all components Source   Edit  
proc vec4(v`gensym74: Vec2; z`gensym74, w`gensym74: float32): Vec4 {....raises: [],
    tags: [], forbids: [].}
Constructs Vec4 from Vec2 and z, w components Source   Edit  
proc vec4(v`gensym74: Vec3; w`gensym74: float32): Vec4 {....raises: [], tags: [],
    forbids: [].}
Constructs Vec4 from Vec3 and w component Source   Edit  
proc vec4(x`gensym74, y`gensym74, z`gensym74, w`gensym74: float32): Vec4 {.
    ...raises: [], tags: [], forbids: [].}
Constructs Vec4 from four components Source   Edit  
proc vec4(xy`gensym74: Vec2; zw`gensym74: Vec2): Vec4 {....raises: [], tags: [],
    forbids: [].}
Constructs Vec4 from two Vec2 components Source   Edit  

Templates

template defineVec2Constructors(Vec2Type, Vec3Type, Vec4Type: typedesc;
                                baseType: typedesc; constructorName: untyped)
Source   Edit  
template defineVec3Constructors(Vec2Type, Vec3Type, Vec4Type: typedesc;
                                baseType: typedesc; constructorName: untyped)
Source   Edit  
template defineVec4Constructors(Vec2Type, Vec3Type, Vec4Type: typedesc;
                                baseType: typedesc; constructorName: untyped)
Source   Edit  
template w[N, T](v: TVec[N, T]): T
Source   Edit  
template w=[N, T](v: TVec[N, T]; val: T)
Source   Edit  
template x[N, T](v: TVec[N, T]): T
Source   Edit  
template x=[N, T](v: TVec[N, T]; val: T)
Source   Edit  
template y[N, T](v: TVec[N, T]): T
Source   Edit  
template y=[N, T](v: TVec[N, T]; val: T)
Source   Edit  
template z[N, T](v: TVec[N, T]): T
Source   Edit  
template z=[N, T](v: TVec[N, T]; val: T)
Source   Edit