zRotate method
dynamic
zRotate(
- dynamic point,
- dynamic angle
Rotate camera around its direction axis passing by a given point by a given angle @param {Vector3} point The point where the rotation axis is passing trough @param {Number} angle Angle in radians @returns The computed transormation matix
Implementation
zRotate(point, angle) {
_rotationMatrix.makeRotationAxis(_rotationAxis, angle);
_translationMatrix.makeTranslation(-point.x, -point.y, -point.z);
_m4_1.makeTranslation(point.x, point.y, point.z);
_m4_1.multiply(_rotationMatrix);
_m4_1.multiply(_translationMatrix);
_v3_1.setFromMatrixPosition(_gizmoMatrixState).sub(point); //vector from rotation center to gizmos position
_v3_2.copy(_v3_1).applyAxisAngle(_rotationAxis, angle); //apply rotation
_v3_2.sub(_v3_1);
_m4_2.makeTranslation(_v3_2.x, _v3_2.y, _v3_2.z);
setTransformationMatrices(_m4_1, _m4_2);
return _transformation;
}