类型转换(conversion)自动生成
在 Float、Int、Double、Long 之间转换,向量与矩阵逐分量转换。
| 返回 | 函数 | 需要能力 |
|---|---|---|
Double |
double (x: Float) +14 |
— |
Float |
float (x: Int) +14 |
— |
Int |
int (x: Float) +11 |
— |
Long |
long (x: Float) +9 |
— |
double
Section titled “double”double(x: Float) -> Doubledouble(x: Int) -> Doubledouble(x: Bool) -> Doubledouble(x: Vec2) -> DVec2double(x: Vec3) -> DVec3double(x: Vec4) -> DVec4double(x: IVec2) -> DVec2double(x: IVec3) -> DVec3double(x: IVec4) -> DVec4double(x: Mat2) -> DMat2double(x: Mat3) -> DMat3double(x: Mat4) -> DMat4double(x: Long) -> Doubledouble(x: LVec2) -> DVec2double(x: LVec3) -> DVec3A Float, an Int, a Long, or a Bool as 0 or 1, as a Double; a vector or matrix componentwise.
float(x: Int) -> Floatfloat(x: Bool) -> Floatfloat(x: IVec2) -> Vec2float(x: IVec3) -> Vec3float(x: IVec4) -> Vec4float(x: Double) -> Floatfloat(x: Long) -> Floatfloat(x: DVec2) -> Vec2float(x: DVec3) -> Vec3float(x: DVec4) -> Vec4float(x: LVec2) -> Vec2float(x: LVec3) -> Vec3float(x: DMat2) -> Mat2float(x: DMat3) -> Mat3float(x: DMat4) -> Mat4An Int, a Double, a Long, or a Bool as 0 or 1, as a Float; a vector or matrix componentwise.
int(x: Float) -> Intint(x: Bool) -> Intint(x: Vec2) -> IVec2int(x: Vec3) -> IVec3int(x: Vec4) -> IVec4int(x: Double) -> Intint(x: Long) -> Intint(x: DVec2) -> IVec2int(x: DVec3) -> IVec3int(x: DVec4) -> IVec4int(x: LVec2) -> IVec2int(x: LVec3) -> IVec3A float truncated toward zero, a Long wrapped to 32 bits, or a Bool as 0 or 1, as an Int; a vector componentwise.
long(x: Float) -> Longlong(x: Int) -> Longlong(x: Bool) -> Longlong(x: Vec2) -> LVec2long(x: Vec3) -> LVec3long(x: IVec2) -> LVec2long(x: IVec3) -> LVec3long(x: Double) -> Longlong(x: DVec2) -> LVec2long(x: DVec3) -> LVec3A float truncated toward zero, an Int, or a Bool as 0 or 1, as a Long; a vector componentwise.

