/** Sets this matrix to a scaling matrix * * @param vector The scaling vector * @return This matrix for chaining. */ public Matrix4 setToScaling (Vector3 vector) { idt(); val[M00] = vector.x; val[M11] = vector.y; val[M22] = vector.z; return this; }
/** Sets this matrix to a scaling matrix * * @param vector The scaling vector * @return This matrix for chaining. */ public Matrix4 setToScaling (Vector3 vector) { idt(); val[M00] = vector.x; val[M11] = vector.y; val[M22] = vector.z; return this; }
/** Sets this matrix to a translation matrix, overwriting it first by an identity matrix and then setting the 4th column to the * translation vector. * * @param vector The translation vector * @return This matrix for the purpose of chaining methods together. */ public Matrix4 setToTranslation (Vector3 vector) { idt(); val[M03] = vector.x; val[M13] = vector.y; val[M23] = vector.z; return this; }
/** Sets the transformation matrix to identity. */ public void identity () { transformMatrix.idt(); matrixDirty = true; }
/** Sets this matrix to a translation matrix, overwriting it first by an identity matrix and then setting the 4th column to the * translation vector. * * @param vector The translation vector * @return This matrix for the purpose of chaining methods together. */ public Matrix4 setToTranslation (Vector3 vector) { idt(); val[M03] = vector.x; val[M13] = vector.y; val[M23] = vector.z; return this; }
/** Sets the transformation matrix to identity. */ public void identity () { transformMatrix.idt(); matrixDirty = true; }
/** Sets this matrix to a scaling matrix * * @param x The x-component of the scaling vector * @param y The y-component of the scaling vector * @param z The z-component of the scaling vector * @return This matrix for chaining. */ public Matrix4 setToScaling (float x, float y, float z) { idt(); val[M00] = x; val[M11] = y; val[M22] = z; return this; }
/** Sets this matrix to a scaling matrix * * @param x The x-component of the scaling vector * @param y The y-component of the scaling vector * @param z The z-component of the scaling vector * @return This matrix for chaining. */ public Matrix4 setToScaling (float x, float y, float z) { idt(); val[M00] = x; val[M11] = y; val[M22] = z; return this; }
public static void build (MeshPartBuilder builder, float width, float height, float depth, int divisionsU, int divisionsV, float angleUFrom, float angleUTo, float angleVFrom, float angleVTo) { build(builder, matTmp1.idt(), width, height, depth, divisionsU, divisionsV, angleUFrom, angleUTo, angleVFrom, angleVTo); }
/** Sets the matrix to a rotation matrix around the given axis. * * @param axis The axis * @param radians The angle in radians * @return This matrix for the purpose of chaining methods together. */ public Matrix4 setToRotationRad (Vector3 axis, float radians) { if (radians == 0) { idt(); return this; } return set(quat.setFromAxisRad(axis, radians)); }
/** Sets the matrix to a rotation matrix around the given axis. * * @param axis The axis * @param radians The angle in radians * @return This matrix for the purpose of chaining methods together. */ public Matrix4 setToRotationRad (Vector3 axis, float radians) { if (radians == 0) { idt(); return this; } return set(quat.setFromAxisRad(axis, radians)); }
/** Sets the matrix to a rotation matrix around the given axis. * * @param axis The axis * @param degrees The angle in degrees * @return This matrix for the purpose of chaining methods together. */ public Matrix4 setToRotation (Vector3 axis, float degrees) { if (degrees == 0) { idt(); return this; } return set(quat.set(axis, degrees)); }
/** Sets the matrix to a rotation matrix around the given axis. * * @param axis The axis * @param degrees The angle in degrees * @return This matrix for the purpose of chaining methods together. */ public Matrix4 setToRotation (Vector3 axis, float degrees) { if (degrees == 0) { idt(); return this; } return set(quat.set(axis, degrees)); }
private void init () { // create the isometric transform isoTransform = new Matrix4(); isoTransform.idt(); // isoTransform.translate(0, 32, 0); isoTransform.scale((float)(Math.sqrt(2.0) / 2.0), (float)(Math.sqrt(2.0) / 4.0), 1.0f); isoTransform.rotate(0.0f, 0.0f, 1.0f, -45); // ... and the inverse matrix invIsotransform = new Matrix4(isoTransform); invIsotransform.inv(); }
private void init () { // create the isometric transform isoTransform = new Matrix4(); isoTransform.idt(); // isoTransform.translate(0, 32, 0); isoTransform.scale((float)(Math.sqrt(2.0) / 2.0), (float)(Math.sqrt(2.0) / 4.0), 1.0f); isoTransform.rotate(0.0f, 0.0f, 1.0f, -45); // ... and the inverse matrix invIsotransform = new Matrix4(isoTransform); invIsotransform.inv(); }
public Renderable getRenderable (final Renderable out, final Node node, final NodePart nodePart) { nodePart.setRenderable(out); if (nodePart.bones == null && transform != null) out.worldTransform.set(transform).mul(node.globalTransform); else if (transform != null) out.worldTransform.set(transform); else out.worldTransform.idt(); out.userData = userData; return out; }
public Renderable getRenderable (final Renderable out, final Node node, final NodePart nodePart) { nodePart.setRenderable(out); if (nodePart.bones == null && transform != null) out.worldTransform.set(transform).mul(node.globalTransform); else if (transform != null) out.worldTransform.set(transform); else out.worldTransform.idt(); out.userData = userData; return out; }
@Override public void setVertexTransform (Matrix4 transform) { vertexTransformationEnabled = transform != null; if (vertexTransformationEnabled) { positionTransform.set(transform); normalTransform.set(transform).inv().transpose(); } else { positionTransform.idt(); normalTransform.idt(); } }
@Override public void setVertexTransform (Matrix4 transform) { vertexTransformationEnabled = transform != null; if (vertexTransformationEnabled) { positionTransform.set(transform); normalTransform.set(transform).inv().transpose(); } else { positionTransform.idt(); normalTransform.idt(); } }
@Override protected void onLoaded () { if (currentlyLoading == null || currentlyLoading.length() == 0) return; final ModelInstance instance = new ModelInstance(assets.get(currentlyLoading, Model.class)); instance.transform = new Matrix4().idt(); instance.transform.setToTranslation(MathUtils.random(-10, 10), MathUtils.random(-10, 10), MathUtils.random(-10, 10)); instance.transform.rotate(Vector3.X, MathUtils.random(-180, 180)); instance.transform.rotate(Vector3.Y, MathUtils.random(-180, 180)); instance.transform.rotate(Vector3.Z, MathUtils.random(-180, 180)); instances.add(instance); }