/** * Sets the scale of this {@link ATransformable3D} object. If this is part of a scene graph, * the graph will be notified of the change. * * @param scale double The scaling factor on the x axis. * * @return A reference to this {@link ATransformable3D} to facilitate chaining. */ public ATransformable3D setScaleX(double scale) { mScale.x = scale; markModelMatrixDirty(); return this; }
/** * Sets the scale of this {@link ATransformable3D} object. If this is part of a scene graph, * the graph will be notified of the change. * * @param scale double The scaling factor on the z axis. * * @return A reference to this {@link ATransformable3D} to facilitate chaining. */ public ATransformable3D setScaleZ(double scale) { mScale.z = scale; markModelMatrixDirty(); return this; }
/** * Sets the scale of this {@link ATransformable3D} object. If this is part of a scene graph, * the graph will be notified of the change. * * @param scale double The scaling factor on the y axis. * * @return A reference to this {@link ATransformable3D} to facilitate chaining. */ public ATransformable3D setScaleY(double scale) { mScale.y = scale; markModelMatrixDirty(); return this; }
/** * Sets the scale of this {@link ATransformable3D} object. If this is part of a scene graph, * the graph will be notified of the change. * * @param scale double The scaling factor on axes. * * @return A reference to this {@link ATransformable3D} to facilitate chaining. */ public ATransformable3D setScale(double scale) { mScale.x = scale; mScale.y = scale; mScale.z = scale; markModelMatrixDirty(); return this; }
/** * Sets the y component of the position for this {@link ATransformable3D}. * If this is part of a scene graph, the graph will be notified of the change. * * @param y double The new y component for the position. */ public void setY(double y) { mPosition.y = y; if (mLookAtEnabled && mLookAtValid) resetToLookAt(); markModelMatrixDirty(); }
/** * Sets the x component of the position for this {@link ATransformable3D}. * If this is part of a scene graph, the graph will be notified of the change. * * @param x double The new x component for the position. */ public void setX(double x) { mPosition.x = x; if (mLookAtEnabled && mLookAtValid) resetToLookAt(); markModelMatrixDirty(); }
/** * Sets the z component of the position for this {@link ATransformable3D}. * If this is part of a scene graph, the graph will be notified of the change. * * @param z double The new z component for the position. */ public void setZ(double z) { mPosition.z = z; if (mLookAtEnabled && mLookAtValid) resetToLookAt(); markModelMatrixDirty(); }
/** * Sets the scale of this {@link ATransformable3D} object. If this is part of a scene graph, * the graph will be notified of the change. * * @param scale {@link Vector3} Containing the scaling factor in each axis. * * @return A reference to this {@link ATransformable3D} to facilitate chaining. */ public ATransformable3D setScale(Vector3 scale) { mScale.setAll(scale); markModelMatrixDirty(); return this; }
/** * Rotates this {@link ATransformable3D} by the rotation described by the provided * {@link Quaternion}. If this is part of a scene graph, the graph will be notified * of the change. * * @param quat {@link Quaternion} describing the additional rotation. * * @return A reference to this {@link ATransformable3D} to facilitate chaining. */ public ATransformable3D rotate(final Quaternion quat) { mOrientation.multiply(quat); mLookAtValid = false; markModelMatrixDirty(); return this; }
/** * Sets the rotation of this {@link ATransformable3D} by the rotation described by the * provided {@link Matrix4}. If this is part of a scene graph, the graph will be notified of * the change. * * @param matrix {@link Matrix4} describing the rotation to apply. * * @return A reference to this {@link ATransformable3D} to facilitate chaining. */ public ATransformable3D setRotation(final Matrix4 matrix) { mOrientation.fromMatrix(matrix); mLookAtValid = false; markModelMatrixDirty(); return this; }
/** * Sets the orientation of this {@link ATransformable3D} object. * * @param quat {@link Quaternion} to copy the orientation from. The values of this * object are copied and the passed object is not retained. * * @return A reference to this {@link ATransformable3D} to facilitate chaining. */ public ATransformable3D setOrientation(Quaternion quat) { mOrientation.setAll(quat); mLookAtValid = false; markModelMatrixDirty(); return this; }
/** * Sets the rotation of this {@link ATransformable3D} by the rotation described by * the provided {@link Vector3} axis and angle of rotation. If this is part of a scene * graph, the graph will be notified of the change. * * @param axis {@link Vector3} The axis of rotation. * @param angle double The angle of rotation in degrees. * * @return A reference to this {@link ATransformable3D} to facilitate chaining. */ public ATransformable3D setRotation(final Vector3 axis, double angle) { mOrientation.fromAngleAxis(axis, angle); mLookAtValid = false; markModelMatrixDirty(); return this; }
/** * Sets the rotation of this {@link ATransformable3D} by the rotation described by * the provided {@link Quaternion}. If this is part of a scene graph, the graph will * be notified of the change. * * @param quat {@link Quaternion} describing the additional rotation. * * @return A reference to this {@link ATransformable3D} to facilitate chaining. */ public ATransformable3D setRotation(final Quaternion quat) { mOrientation.setAll(quat); mLookAtValid = false; markModelMatrixDirty(); return this; }
/** * Sets the position of this {@link ATransformable3D}. If this is * part of a scene graph, the graph will be notified of the change. * * @param position {@link Vector3} The new position. This is copied * into an internal store and can be used after this method returns. */ public void setPosition(Vector3 position) { mPosition.setAll(position); if (mLookAtEnabled && mLookAtValid) resetToLookAt(); markModelMatrixDirty(); }
/** * Sets the position of this {@link ATransformable3D}. If this is * part of a scene graph, the graph will be notified of the change. * * @param x double The x coordinate new position. * @param y double The y coordinate new position. * @param z double The z coordinate new position. */ public void setPosition(double x, double y, double z) { mPosition.setAll(x, y, z); if (mLookAtEnabled && mLookAtValid) resetToLookAt(); markModelMatrixDirty(); }
/** * Sets the up axis for this {@link ATransformable3D} object. If this is part of a scene * graph, the graph will be notified of the change. * * @param upAxis {@link Vector3} The new up axis. * * @return A reference to this {@link ATransformable3D} to facilitate chaining. */ public ATransformable3D setUpAxis(Vector3 upAxis) { mUpAxis.setAll(upAxis); if (mLookAtEnabled && mLookAtValid) { mOrientation.lookAt(mLookAt, mUpAxis); markModelMatrixDirty(); } return this; }
/** * Sets the up axis for this {@link ATransformable3D} object. If this is part of a scene * graph, the graph will be notified of the change. * * @param upAxis {@link Vector3.Axis} The new up axis. * * @return A reference to this {@link ATransformable3D} to facilitate chaining. */ public ATransformable3D setUpAxis(Vector3.Axis upAxis) { mUpAxis.setAll(upAxis); if (mLookAtEnabled && mLookAtValid) { mOrientation.lookAt(mLookAt, mUpAxis); markModelMatrixDirty(); } return this; }
/** * Rotates this {@link ATransformable3D} by the rotation described by the provided * {@link Vector3.Axis} cardinal axis and angle of rotation. If this is part of a scene graph, * the graph will be notified of the change. * * @param axis {@link Vector3.Axis} The axis of rotation. * @param angle double The angle of rotation in degrees. * * @return A reference to this {@link ATransformable3D} to facilitate chaining. */ public ATransformable3D rotate(final Vector3.Axis axis, double angle) { mOrientation.multiply(mTmpOrientation.fromAngleAxis(axis, angle)); mLookAtValid = false; markModelMatrixDirty(); return this; }
/** * Resets the up axis for this {@link ATransformable3D} object to the +Y axis. * If this is part of a scene graph, the graph will be notified of the change. * * @return A reference to this {@link ATransformable3D} to facilitate chaining. */ public ATransformable3D resetUpAxis() { mUpAxis.setAll(Vector3.getAxisVector(Vector3.Axis.Y)); if (mLookAtEnabled && mLookAtValid) { mOrientation.lookAt(mLookAt, mUpAxis); markModelMatrixDirty(); } return this; }
/** * Rotates this object (optionally from its initial orientation) around the provided axis by the specified angle. * * @param axis {@link Vector3} The axis or rotation. * @param angle {@code double} The angle of rotation. * @param append {@code boolean} If true, the rotation is applied to the current orientation. */ public void rotateAround(Vector3 axis, double angle, boolean append) { if (append) { mTmpOrientation.fromAngleAxis(axis, angle); mOrientation.multiply(mTmpOrientation); } else { mOrientation.fromAngleAxis(axis, angle); } markModelMatrixDirty(); }