/** * Constructs a new transform group with specified transform. * @param transform the transform; copied, not referenced. */ public TransformGroup(Matrix44 transform) { _transform = new Matrix44(transform); }
/** * Gets the transform for this group. * @return the transform; by copy, not by reference. */ public Matrix44 getTransform() { return new Matrix44(_transform); }
/** * Gets the cube-to-pixel transform for this canvas. * @return the cube-to-pixel transform; by copy, not by reference. */ public Matrix44 getCubeToPixel() { return new Matrix44(_cubeToPixel); }
/** * Gets the local-to-world transform. * @return the local-to-world transform. */ public Matrix44 getLocalToWorld() { return new Matrix44(_localToWorld); }
/** * Gets the local-to-pixel coordinate transform matrix. * @return the local-to-pixel coordinate transform matrix. */ public Matrix44 getLocalToPixel() { return new Matrix44(_localToPixel); }
/** * Gets the world-to-unit-sphere transform for this view. * @return the world-to-unit-sphere transform. */ public Matrix44 getWorldToUnitSphere() { return new Matrix44(_worldToUnitSphere); }
/** * Gets the world-to-pixel coordinate transform matrix. * @return the world-to-pixel coordinate transform matrix. */ public Matrix44 getWorldToPixel() { return new Matrix44(_worldToPixel); }
/** * Gets the cube-to-pixel transform. * @return the cube-to-pixel transform. */ public Matrix44 getCubeToPixel() { return new Matrix44(_cubeToPixel); }
/** * Gets the view-independent transform matrix for this handle. * This transform does not include the view-dependent scaling that is * applied to the handle's geometry <em>before</em> the transform. * @return the transform. */ public Matrix44 getTransform() { return new Matrix44(_transform); }
/** * Returns a new scaling matrix. * @param sx the x component of the scaling. * @param sy the y component of the scaling. * @param sz the z component of the scaling. * @return the scaling matrix. */ public static Matrix44 scale(double sx, double sy, double sz) { return (new Matrix44()).setScale(sx,sy,sz); }
/** * Returns a new rotation matrix. * The rotation is about the x axis. * @param ra the angle of rotation, in degrees. * @return the rotation matrix. */ public static Matrix44 rotateX(double ra) { return (new Matrix44()).setRotateX(ra); }
/** * Returns a new rotation matrix. * The rotation is about the y axis. * @param ra the angle of rotation, in degrees. * @return the rotation matrix. */ public static Matrix44 rotateY(double ra) { return (new Matrix44()).setRotateY(ra); }
/** * Returns a new translation matrix. * @param tv the translation vector. * @return the translation matrix. */ public static Matrix44 translate(Vector3 tv) { return (new Matrix44()).setTranslate(tv); }
/** * Returns a new rotation matrix. * The rotation is about a specified vector axis. * @param ra the angle of rotation, in degrees. * @param rv the vector axis of rotation. * @return the rotation matrix. */ public static Matrix44 rotate(double ra, Vector3 rv) { return (new Matrix44()).setRotate(ra,rv); }
/** * Returns a new rotation matrix. * The rotation is about the z axis. * @param ra the angle of rotation, in degrees. * @return the rotation matrix. */ public static Matrix44 rotateZ(double ra) { return (new Matrix44()).setRotateZ(ra); }
/** * Sets the transform for this group. * @param transform the transform; by copy, not by reference. */ public void setTransform(Matrix44 transform) { _transform = new Matrix44(transform); dirtyBoundingSphere(); }
/** * Sets the view-to-cube transform for this canvas. * Typically, the view sets the view-to-cube transform. * @param viewToCube the view-to-cube transform; copied, not referenced. */ public void setViewToCube(Matrix44 viewToCube) { _viewToCube = new Matrix44(viewToCube); repaint(); }
/** * Sets the cube-to-pixel transform for this canvas. * Typically, the view sets the cube-to-pixel transform. * @param cubeToPixel the cube-to-pixel transform; copied, not referenced. */ public void setCubeToPixel(Matrix44 cubeToPixel) { _cubeToPixel = new Matrix44(cubeToPixel); repaint(); }
/** * Saves the local-to-world transform before appending a transform. * The specified transform matrix is post-multiplied with the current * local-to-world transform, such that the specified transform is applied * first when transforming local coordinates to world coordinates. * @param transform the transform to append. */ public void pushLocalToWorld(Matrix44 transform) { _localToWorldStack.push(new Matrix44(_localToWorld)); _localToWorld.timesEquals(transform); }
/** * Sets the view-independent transform matrix for this handle. * This transform does not include the view-dependent scaling that is * applied to the handle's geometry <em>before</em> the transform. * @param transform the transform. */ public void setTransform(Matrix44 transform) { _transform = new Matrix44(transform); dirtyBoundingSphere(); dirtyDraw(); }