跳转到内容
查看源码

构造函数(construction)自动生成

构造向量与矩阵:vec2/vec3/vec4、ivec、mat 等。

返回 函数 需要能力
DMat2 dmat2 (c0: DVec2, c1: DVec2) +1 —
DMat3 dmat3 (c0: DVec3, c1: DVec3, c2: DVec3) +1 —
DMat4 dmat4 (c0: DVec4, c1: DVec4, c2: DVec4, c3: DVec4) +1 —
DVec2 dvec2 (x: Double, y: Double) —
DVec3 dvec3 (x: Double, y: Double, z: Double) +2 —
DVec4 dvec4 (x: Double, y: Double, z: Double, w: Double) +2 —
IVec2 ivec2 (x: Int, y: Int) —
IVec3 ivec3 (x: Int, y: Int, z: Int) +2 —
IVec4 ivec4 (x: Int, y: Int, z: Int, w: Int) +2 —
LVec2 lvec2 (x: Long, y: Long) +1 —
LVec3 lvec3 (x: Long, y: Long, z: Long) +2 —
Mat2 mat2 (c0: Vec2, c1: Vec2) +1 —
Mat3 mat3 (c0: Vec3, c1: Vec3, c2: Vec3) +1 —
Mat4 mat4 (c0: Vec4, c1: Vec4, c2: Vec4, c3: Vec4) +1 —
Vec2 vec2 (x: Float, y: Float) +1 —
Vec3 vec3 (x: Float, y: Float, z: Float) +3 —
Vec4 vec4 (x: Float, y: Float, z: Float, w: Float) +5 —
dmat2(c0: DVec2, c1: DVec2) -> DMat2
dmat2(diagonal: Double) -> DMat2

A matrix of doubles from its columns, or with one value down the diagonal; m[i] is a column, m * v applies it.


dmat3(c0: DVec3, c1: DVec3, c2: DVec3) -> DMat3
dmat3(diagonal: Double) -> DMat3

A matrix of doubles from its columns, or with one value down the diagonal; m[i] is a column, m * v applies it.


dmat4(c0: DVec4, c1: DVec4, c2: DVec4, c3: DVec4) -> DMat4
dmat4(diagonal: Double) -> DMat4

A matrix of doubles from its columns, or with one value down the diagonal; m[i] is a column, m * v applies it.


dvec2(x: Double, y: Double) -> DVec2

A vector of doubles from components or shorter vectors, any number widened; a written number is taken exact, so dvec2(0.1, 0.2) holds the doubles nearest a tenth and a fifth.


dvec3(x: Double, y: Double, z: Double) -> DVec3
dvec3(xy: DVec2, z: Double) -> DVec3
dvec3(v: Vec3) -> DVec3

A vector of doubles from components or shorter vectors, any number widened; a written number is taken exact.


dvec4(x: Double, y: Double, z: Double, w: Double) -> DVec4
dvec4(xyz: DVec3, w: Double) -> DVec4
dvec4(v: Vec4) -> DVec4

A vector of doubles from components or shorter vectors, any number widened; a written number is taken exact.


ivec2(x: Int, y: Int) -> IVec2

An integer vector from components: a cell, an offset; at and put take one as an address; v.yx and the like are swizzles.


ivec3(x: Int, y: Int, z: Int) -> IVec3
ivec3(xy: IVec2, z: Int) -> IVec3
ivec3(x: Int, yz: IVec2) -> IVec3

An integer vector from components or a shorter integer vector: a cell, an offset; at and put take one as an address.


ivec4(x: Int, y: Int, z: Int, w: Int) -> IVec4
ivec4(xyz: IVec3, w: Int) -> IVec4
ivec4(xy: IVec2, zw: IVec2) -> IVec4

An integer vector from components or shorter integer vectors, in order; v.wzyx and the like are swizzles.


lvec2(x: Long, y: Long) -> LVec2
lvec2(v: IVec2) -> LVec2

A vector of longs from components or shorter integer vectors, an Int widened.


lvec3(x: Long, y: Long, z: Long) -> LVec3
lvec3(xy: LVec2, z: Long) -> LVec3
lvec3(v: IVec3) -> LVec3

A vector of longs from components or shorter integer vectors, an Int widened.


mat2(c0: Vec2, c1: Vec2) -> Mat2
mat2(diagonal: Float) -> Mat2

A matrix from its columns, or with one value down the diagonal and zeros elsewhere; m[i] is a column, m * v applies it.


mat3(c0: Vec3, c1: Vec3, c2: Vec3) -> Mat3
mat3(diagonal: Float) -> Mat3

A matrix from its columns, or with one value down the diagonal and zeros elsewhere; m[i] is a column, m * v applies it.


mat4(c0: Vec4, c1: Vec4, c2: Vec4, c3: Vec4) -> Mat4
mat4(diagonal: Float) -> Mat4

A matrix from its columns, or with one value down the diagonal and zeros elsewhere; m[i] is a column, m * v applies it.


vec2(x: Float, y: Float) -> Vec2
vec2(x: Int, y: Int) -> Vec2

A vector from components, Float or Int (widened), in order; v.xy, v.yx and the like are swizzles.


vec3(x: Float, y: Float, z: Float) -> Vec3
vec3(x: Int, y: Int, z: Int) -> Vec3
vec3(xy: Vec2, z: Float) -> Vec3
vec3(x: Float, yz: Vec2) -> Vec3

A vector from components, Float, Int (widened) or shorter vectors, in order; v.xyz, v.zyx and the like are swizzles.


vec4(x: Float, y: Float, z: Float, w: Float) -> Vec4
vec4(x: Int, y: Int, z: Int, w: Int) -> Vec4
vec4(xyz: Vec3, w: Float) -> Vec4
vec4(xy: Vec2, zw: Vec2) -> Vec4
vec4(xy: Vec2, z: Float, w: Float) -> Vec4
vec4(x: Float, yzw: Vec3) -> Vec4

A vector from components, Float, Int (widened) or shorter vectors, in order; v.xyz, v.wzyx, c.rgb and the like are swizzles.