/** * Sets the world rotation quaternion. * * @param rotation * the new world rotation */ public void setWorldRotation(final ReadOnlyQuaternion rotation) { _worldTransform.setRotation(rotation); }
/** * Sets the world rotation matrix. * * @param rotation * the new world rotation */ public void setWorldRotation(final ReadOnlyMatrix3 rotation) { _worldTransform.setRotation(rotation); }
/** * Sets the world rotation matrix. * * @param rotation * the new world rotation */ public void setWorldRotation(final ReadOnlyMatrix3 rotation) { _worldTransform.setRotation(rotation); }
/** * Sets the world rotation quaternion. * * @param rotation * the new world rotation */ public void setWorldRotation(final ReadOnlyQuaternion rotation) { _worldTransform.setRotation(rotation); }
/** * Sets the type of rotation this BillboardNode will have. The alignment can be ScreenAligned, CameraAligned, AxialY * or AxialZ. Invalid alignments will assume no billboard rotation. */ public void setAlignment(final BillboardAlignment alignment) { _alignment = alignment; _worldTransform.setRotation(Matrix3.IDENTITY); }
/** * Sets the rotation of this spatial. This marks the spatial as DirtyType.Transform. * * @param rotation * the new rotation of this spatial * @see Transform#setRotation(Matrix3) */ public void setRotation(final ReadOnlyMatrix3 rotation) { _localTransform.setRotation(rotation); markDirty(DirtyType.Transform); }
@Override public ValidatingTransform setRotation(final ReadOnlyMatrix3 rotation) { super.setRotation(rotation); validate(); return this; }
/** * Sets the rotation of this spatial. This marks the spatial as DirtyType.Transform. * * @param rotation * the new rotation of this spatial * @see Transform#setRotation(Matrix3) */ public void setRotation(final ReadOnlyMatrix3 rotation) { _localTransform.setRotation(rotation); markDirty(DirtyType.Transform); }
/** * Sets the rotation of this spatial. This marks the spatial as DirtyType.Transform. * * @param rotation * the new rotation of this spatial * @see Transform#setRotation(Quaternion) */ public void setRotation(final ReadOnlyQuaternion rotation) { _localTransform.setRotation(rotation); markDirty(DirtyType.Transform); }
@Override public ValidatingTransform setRotation(final ReadOnlyQuaternion rotation) { super.setRotation(rotation); validate(); return this; }
/** * Sets the rotation of this spatial. This marks the spatial as DirtyType.Transform. * * @param rotation * the new rotation of this spatial * @see Transform#setRotation(Quaternion) */ public void setRotation(final ReadOnlyQuaternion rotation) { _localTransform.setRotation(rotation); markDirty(DirtyType.Transform); }
@Override public ValidatingTransform setRotation(final ReadOnlyQuaternion rotation) { super.setRotation(rotation); validate(); return this; }
@Override public ValidatingTransform setRotation(final ReadOnlyMatrix3 rotation) { super.setRotation(rotation); validate(); return this; }
private void rotateNone() { if(_localRot != null) { _orient.set(getRotation()); _orient.multiplyLocal(_localRot); _worldTransform.setRotation(_orient); } }
public void applyTo(final Transform transform) { transform.setIdentity(); transform.setRotation(getRotation()); transform.setScale(getScale()); transform.setTranslation(getTranslation()); }
public void applyTo(final Transform transform) { transform.setIdentity(); transform.setRotation(getRotation()); transform.setScale(getScale()); transform.setTranslation(getTranslation()); }
public ReadOnlyTransform getValue() { final Transform t = new Transform(); t.setTranslation(_translationX.getDoubleValue(), _translationY.getDoubleValue(), 0); final double val = _rotation.getDoubleValue() * MathUtils.DEG_TO_RAD; final Matrix3 mat = Matrix3.fetchTempInstance().fromAngles(0, 0, val); t.setRotation(mat); Matrix3.releaseTempInstance(mat); t.setScale(_scale.getDoubleValue()); return t; }
/** * Rotate the billboard so it points directly opposite the direction the camera's facing */ private void rotateScreenAligned() { final Camera camera = Camera.getCurrentCamera(); _look.set(camera.getDirection()).negateLocal(); _left.set(camera.getLeft()).negateLocal(); _orient.fromAxes(_left, camera.getUp(), _look); if(_localRot != null) _orient.multiplyLocal(_localRot); _worldTransform.setRotation(_orient); }
public ReadOnlyTransform getValue() { final Transform t = new Transform(); t.setTranslation(_translation.getValue()); final Vector3 val = _rotation.getValue().multiplyLocal(MathUtils.DEG_TO_RAD); final Matrix3 mat = Matrix3.fetchTempInstance().fromAngles(val.getX(), val.getY(), val.getZ()); t.setRotation(mat); Matrix3.releaseTempInstance(mat); t.setScale(_scale.getValue()); return t; }
@Test public void testInvert() { final Transform trans1 = new Transform(); trans1.setRotation(new Matrix3().applyRotationZ(3 * MathUtils.QUARTER_PI)); final Transform trans2 = trans1.invert(null); assertEquals(Transform.IDENTITY, trans1.multiply(trans2, null)); trans1.setIdentity().invert(trans1); assertEquals(Transform.IDENTITY, trans1); }