|
@@ -1009,28 +1009,32 @@ namespace Mat4 {
|
|
|
return Math.sqrt(Math.max(scaleXSq, scaleYSq, scaleZSq))
|
|
|
}
|
|
|
|
|
|
+ const xAxis = Vec3.create(1, 0, 0)
|
|
|
+ const yAxis = Vec3.create(1, 0, 0)
|
|
|
+ const zAxis = Vec3.create(1, 0, 0)
|
|
|
+
|
|
|
/** Rotation matrix for 90deg around x-axis */
|
|
|
- export const rotX90: ReadonlyMat4 = Mat4.fromRotation(Mat4.identity(), degToRad(90), Vec3.create(1, 0, 0))
|
|
|
+ export const rotX90: ReadonlyMat4 = Mat4.fromRotation(Mat4(), degToRad(90), xAxis)
|
|
|
/** Rotation matrix for 180deg around x-axis */
|
|
|
- export const rotX180: ReadonlyMat4 = Mat4.fromRotation(Mat4.identity(), degToRad(180), Vec3.create(1, 0, 0))
|
|
|
+ export const rotX180: ReadonlyMat4 = Mat4.fromRotation(Mat4(), degToRad(180), xAxis)
|
|
|
/** Rotation matrix for 90deg around y-axis */
|
|
|
- export const rotY90: ReadonlyMat4 = Mat4.fromRotation(Mat4.identity(), degToRad(90), Vec3.create(0, 1, 0))
|
|
|
+ export const rotY90: ReadonlyMat4 = Mat4.fromRotation(Mat4(), degToRad(90), yAxis)
|
|
|
/** Rotation matrix for 180deg around y-axis */
|
|
|
- export const rotY180: ReadonlyMat4 = Mat4.fromRotation(Mat4.identity(), degToRad(180), Vec3.create(0, 1, 0))
|
|
|
+ export const rotY180: ReadonlyMat4 = Mat4.fromRotation(Mat4(), degToRad(180), yAxis)
|
|
|
/** Rotation matrix for 90deg around z-axis */
|
|
|
- export const rotZ90: ReadonlyMat4 = Mat4.fromRotation(Mat4.identity(), degToRad(90), Vec3.create(0, 0, 1))
|
|
|
+ export const rotZ90: ReadonlyMat4 = Mat4.fromRotation(Mat4(), degToRad(90), zAxis)
|
|
|
/** Rotation matrix for 180deg around z-axis */
|
|
|
- export const rotZ180: ReadonlyMat4 = Mat4.fromRotation(Mat4.identity(), degToRad(180), Vec3.create(0, 0, 1))
|
|
|
+ export const rotZ180: ReadonlyMat4 = Mat4.fromRotation(Mat4(), degToRad(180), zAxis)
|
|
|
/** Rotation matrix for 90deg around first x-axis and then y-axis */
|
|
|
- export const rotXY90: ReadonlyMat4 = Mat4.mul(Mat4.identity(), rotX90, rotY90)
|
|
|
+ export const rotXY90: ReadonlyMat4 = Mat4.mul(Mat4(), rotX90, rotY90)
|
|
|
/** Rotation matrix for 90deg around first z-axis and then y-axis */
|
|
|
- export const rotZY90: ReadonlyMat4 = Mat4.mul(Mat4.identity(), rotZ90, rotY90)
|
|
|
+ export const rotZY90: ReadonlyMat4 = Mat4.mul(Mat4(), rotZ90, rotY90)
|
|
|
/** Rotation matrix for 90deg around first z-axis and then y-axis and then z-axis */
|
|
|
- export const rotZYZ90: ReadonlyMat4 = Mat4.mul(Mat4.identity(), rotZY90, rotZ90)
|
|
|
+ export const rotZYZ90: ReadonlyMat4 = Mat4.mul(Mat4(), rotZY90, rotZ90)
|
|
|
/** Rotation matrix for 90deg around first z-axis and then 180deg around x-axis */
|
|
|
- export const rotZ90X180: ReadonlyMat4 = Mat4.mul(Mat4.identity(), rotZ90, rotX180)
|
|
|
+ export const rotZ90X180: ReadonlyMat4 = Mat4.mul(Mat4(), rotZ90, rotX180)
|
|
|
/** Rotation matrix for 90deg around first y-axis and then 180deg around z-axis */
|
|
|
- export const rotY90Z180: ReadonlyMat4 = Mat4.mul(Mat4.identity(), rotY90, rotZ180)
|
|
|
+ export const rotY90Z180: ReadonlyMat4 = Mat4.mul(Mat4(), rotY90, rotZ180)
|
|
|
}
|
|
|
|
|
|
export default Mat4
|