/** Sets the quaternion components from the given axis and angle around that axis. * * @param axis The axis * @param angle The angle in degrees * @return This quaternion for chaining. */ public Quaternion set (Vector3 axis, float angle) { return setFromAxis(axis.x, axis.y, axis.z, angle); }
/** Sets the quaternion components from the given axis and angle around that axis. * * @param axis The axis * @param angle The angle in degrees * @return This quaternion for chaining. */ public Quaternion set (Vector3 axis, float angle) { return setFromAxis(axis.x, axis.y, axis.z, angle); }
/** Sets the quaternion components from the given axis and angle around that axis. * * @param axis The axis * @param degrees The angle in degrees * @return This quaternion for chaining. */ public Quaternion setFromAxis (final Vector3 axis, final float degrees) { return setFromAxis(axis.x, axis.y, axis.z, degrees); }
/** Sets the quaternion components from the given axis and angle around that axis. * * @param axis The axis * @param degrees The angle in degrees * @return This quaternion for chaining. */ public Quaternion setFromAxis (final Vector3 axis, final float degrees) { return setFromAxis(axis.x, axis.y, axis.z, degrees); }
/** Postmultiplies this matrix with a (counter-clockwise) rotation matrix. Postmultiplication is also used by OpenGL ES' 1.x * glTranslate/glRotate/glScale * @param axisX The x-axis component of the vector to rotate around. * @param axisY The y-axis component of the vector to rotate around. * @param axisZ The z-axis component of the vector to rotate around. * @param degrees The angle in degrees * @return This matrix for the purpose of chaining methods together. */ public Matrix4 rotate (float axisX, float axisY, float axisZ, float degrees) { if (degrees == 0) return this; quat.setFromAxis(axisX, axisY, axisZ, degrees); return rotate(quat); }
/** Postmultiplies this matrix with a (counter-clockwise) rotation matrix. Postmultiplication is also used by OpenGL ES' 1.x * glTranslate/glRotate/glScale * @param axisX The x-axis component of the vector to rotate around. * @param axisY The y-axis component of the vector to rotate around. * @param axisZ The z-axis component of the vector to rotate around. * @param degrees The angle in degrees * @return This matrix for the purpose of chaining methods together. */ public Matrix4 rotate (float axisX, float axisY, float axisZ, float degrees) { if (degrees == 0) return this; quat.setFromAxis(axisX, axisY, axisZ, degrees); return rotate(quat); }
/** Sets the matrix to a rotation matrix around the given axis. * * @param axisX The x-component of the axis * @param axisY The y-component of the axis * @param axisZ The z-component of the axis * @param degrees The angle in degrees * @return This matrix for the purpose of chaining methods together. */ public Matrix4 setToRotation (float axisX, float axisY, float axisZ, float degrees) { if (degrees == 0) { idt(); return this; } return set(quat.setFromAxis(axisX, axisY, axisZ, degrees)); }
/** Sets the matrix to a rotation matrix around the given axis. * * @param axisX The x-component of the axis * @param axisY The y-component of the axis * @param axisZ The z-component of the axis * @param degrees The angle in degrees * @return This matrix for the purpose of chaining methods together. */ public Matrix4 setToRotation (float axisX, float axisY, float axisZ, float degrees) { if (degrees == 0) { idt(); return this; } return set(quat.setFromAxis(axisX, axisY, axisZ, degrees)); }
trForward.translation.set(0, 0, 8f); trBackward.translation.set(0, 0, -8f); trLeft.rotation.setFromAxis(Vector3.Y, 90); trRight.rotation.setFromAxis(Vector3.Y, -90);
/** Sets the quaternion components from the given axis and angle around that axis. * * @param axis The axis * @param angle The angle in degrees * @return This quaternion for chaining. */ public Quaternion set (Vector3 axis, float angle) { return setFromAxis(axis.x, axis.y, axis.z, angle); }
/** Sets the quaternion components from the given axis and angle around that axis. * * @param axis The axis * @param degrees The angle in degrees * @return This quaternion for chaining. */ public Quaternion setFromAxis (final Vector3 axis, final float degrees) { return setFromAxis(axis.x, axis.y, axis.z, degrees); }
/** Sets the quaternion components from the given axis and angle around that axis. * * @param axis The axis * @param degrees The angle in degrees * @return This quaternion for chaining. */ public Quaternion setFromAxis (final Vector3 axis, final float degrees) { return setFromAxis(axis.x, axis.y, axis.z, degrees); }
/** Sets the quaternion components from the given axis and angle around that axis. * * @param axis The axis * @param angle The angle in degrees * @return This quaternion for chaining. */ public Quaternion set (Vector3 axis, float angle) { return setFromAxis(axis.x, axis.y, axis.z, angle); }
/** Postmultiplies this matrix with a (counter-clockwise) rotation matrix. Postmultiplication is also used by OpenGL ES' 1.x * glTranslate/glRotate/glScale * @param axisX The x-axis component of the vector to rotate around. * @param axisY The y-axis component of the vector to rotate around. * @param axisZ The z-axis component of the vector to rotate around. * @param degrees The angle in degrees * @return This matrix for the purpose of chaining methods together. */ public Matrix4 rotate (float axisX, float axisY, float axisZ, float degrees) { if (degrees == 0) return this; quat.setFromAxis(axisX, axisY, axisZ, degrees); return rotate(quat); }
/** Postmultiplies this matrix with a (counter-clockwise) rotation matrix. Postmultiplication is also used by OpenGL ES' 1.x * glTranslate/glRotate/glScale * @param axisX The x-axis component of the vector to rotate around. * @param axisY The y-axis component of the vector to rotate around. * @param axisZ The z-axis component of the vector to rotate around. * @param degrees The angle in degrees * @return This matrix for the purpose of chaining methods together. */ public Matrix4 rotate (float axisX, float axisY, float axisZ, float degrees) { if (degrees == 0) return this; quat.setFromAxis(axisX, axisY, axisZ, degrees); return rotate(quat); }
/** Sets the matrix to a rotation matrix around the given axis. * * @param axisX The x-component of the axis * @param axisY The y-component of the axis * @param axisZ The z-component of the axis * @param degrees The angle in degrees * @return This matrix for the purpose of chaining methods together. */ public Matrix4 setToRotation (float axisX, float axisY, float axisZ, float degrees) { if (degrees == 0) { idt(); return this; } return set(quat.setFromAxis(axisX, axisY, axisZ, degrees)); }
/** Sets the matrix to a rotation matrix around the given axis. * * @param axisX The x-component of the axis * @param axisY The y-component of the axis * @param axisZ The z-component of the axis * @param degrees The angle in degrees * @return This matrix for the purpose of chaining methods together. */ public Matrix4 setToRotation (float axisX, float axisY, float axisZ, float degrees) { if (degrees == 0) { idt(); return this; } return set(quat.setFromAxis(axisX, axisY, axisZ, degrees)); }
public void throwStick() { GameScreen.screen.engine.addEntity(stick); stick.body.setLinearVelocity(Vector3.Zero); stick.body.setAngularVelocity(Vector3.Zero); Vector3 rightHandPos = getBoneMidpointWorldPosition(HumanArmature.RIGHT_HAND.id, TMP_V1); stick.modelTransform.setToRotation(Vector3.Z, 90); stick.modelTransform.rotate(Constants.V3_UP, getOrientation() * MathUtils.radiansToDegrees); stick.modelTransform.setTranslation(rightHandPos); stick.body.setWorldTransform(stick.modelTransform); Vector3 humanDirection = getDirection(TMP_V1); TMP_Q.setFromAxis(TMP_V2.set(humanDirection).crs(Constants.V3_UP), STICK_THROW_ANGLE); Vector3 impulse = TMP_Q.transform(humanDirection).nor(); impulse.scl(STICK_THROW_IMPULSE_SCL); stick.body.applyImpulse(impulse, TMP_V2.set(Constants.V3_UP).scl(0.005f)); stick.hasLanded = false; hasStick = false; }