/** * Gets the world scale vector. * * @return the world scale */ public ReadOnlyVector3 getWorldScale() { return _worldTransform.getScale(); }
/** * Gets the local scale vector. * * @return the scale */ public ReadOnlyVector3 getScale() { return _localTransform.getScale(); }
/** * Gets the local scale vector. * * @return the scale */ public ReadOnlyVector3 getScale() { return _localTransform.getScale(); }
/** * Gets the world scale vector. * * @return the world scale */ public ReadOnlyVector3 getWorldScale() { return _worldTransform.getScale(); }
/** get width in world units */ public float getWidth() { return (_size.getXf() * _worldTransform.getScale().getXf()); }
/** get height in world units */ public float getHeight() { return (_size.getYf() * _worldTransform.getScale().getYf()); }
/** get height in world units */ public float getHeight() { return (_size.getYf() * _worldTransform.getScale().getYf()); }
/** get width in world units */ public float getWidth() { return (_size.getXf() * _worldTransform.getScale().getXf()); }
@Override public void drawTo(final BufferedImage image, final ReadOnlyTransform localTransform, final int clipmapLevel) { // apply the two transforms together and then use result to scale/translate and rotate image final Transform trans = new Transform(); localTransform.multiply(getTransform(), trans); // grab a copy of the graphics so we don't bleed state to next image final Graphics2D g2d = (Graphics2D) image.getGraphics().create(); // apply hints for (final RenderingHints.Key key : hints.keySet()) { g2d.setRenderingHint(key, hints.get(key)); } // set transform g2d.translate(trans.getTranslation().getX(), trans.getTranslation().getY()); g2d.rotate(trans.getMatrix().toAngles(null)[2]); // rotation about z g2d.scale(trans.getScale().getX(), trans.getScale().getY()); // set composite if (_compositeOverride != null) { g2d.setComposite(_compositeOverride); } // draw the image g2d.drawImage(_image, 0, 0, null); } }
@Override public void drawTo(final BufferedImage image, final ReadOnlyTransform localTransform, final int clipmapLevel) { // apply the two transforms together and then use result to scale/translate and rotate image final Transform trans = new Transform(); localTransform.multiply(getTransform(), trans); // grab a copy of the graphics so we don't bleed state to next image final Graphics2D g2d = (Graphics2D) image.getGraphics().create(); // apply hints for (final RenderingHints.Key key : hints.keySet()) { g2d.setRenderingHint(key, hints.get(key)); } // set transform g2d.translate(trans.getTranslation().getX(), trans.getTranslation().getY()); g2d.rotate(trans.getMatrix().toAngles(null)[2]); // rotation about z g2d.scale(trans.getScale().getX(), trans.getScale().getY()); // set composite if (_compositeOverride != null) { g2d.setComposite(_compositeOverride); } // draw the image g2d.drawImage(_image, 0, 0, null); } }
/** * * @param cam */ public void correctTransform(final Camera cam) { updateWorldTransform(false); if (_autoRotate) { // Billboard rotation _look.set(cam.getDirection()); _left.set(cam.getLeft()).negateLocal(); _rot.fromAxes(_left, _look, cam.getUp()); if (_rot.isOrthonormal()) { _worldTransform.setRotation(_rot); } else { logger.warning("BMText: non-orthonormal rotation matrix :" + getName()); } } _worldTransform.setScale(_localTransform.getScale()); }
/** * * @param cam */ public void correctTransform(final Camera cam) { updateWorldTransform(false); if (_autoRotate) { // Billboard rotation _look.set(cam.getDirection()); _left.set(cam.getLeft()).negateLocal(); _rot.fromAxes(_left, _look, cam.getUp()); _worldTransform.setRotation(_rot); } _worldTransform.setScale(_localTransform.getScale()); }
@Override public void applyFilter(final InteractManager manager) { final ReadOnlyVector3 oldScale = manager.getSpatialTarget().getScale(); final SpatialState state = manager.getSpatialState(); final ReadOnlyVector3 scale = state.getTransform().getScale(); state.getTransform().setScale( // _xAxis ? scale.getX() : oldScale.getX(), // _yAxis ? scale.getY() : oldScale.getY(), // _zAxis ? scale.getZ() : oldScale.getZ()); }
@Override public void applyFilter(final InteractManager manager) { final SpatialState state = manager.getSpatialState(); final ReadOnlyVector3 scale = state.getTransform().getScale(); final double x = MathUtils.clamp(scale.getX(), _minScale.getX(), _maxScale.getX()); final double y = MathUtils.clamp(scale.getY(), _minScale.getY(), _maxScale.getY()); final double z = MathUtils.clamp(scale.getZ(), _minScale.getZ(), _maxScale.getZ()); state.getTransform().setScale(x, y, z); }
assertTrue(true == immutable.isUniformScale()); assertEquals(new Matrix3().applyRotationX(MathUtils.QUARTER_PI), immutable.getMatrix()); assertEquals(new Vector3(0, -1, -2), immutable.getScale()); assertEquals(new Vector3(1, 2, 3), immutable.getTranslation()); assertEquals(Vector3.ONE, trans.getScale()); assertEquals(new Vector3(1, 2, 3), trans.getScale()); assertEquals(new Vector3(-1, 5, -3), trans.getScale());
final Matrix3 worldMatrix = Matrix3.fetchTempInstance().set(_worldTransform.getMatrix()); final ReadOnlyVector3 scale = _worldTransform.getScale(); _left.divideLocal(scale);
p.getPosition().divideLocal(_emitterTransform.getScale());
p.getPosition().divideLocal(_emitterTransform.getScale());