/** * 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(); }
/** * Change a specific subset of the buffer's data at the given offset to the given length. * * @param bufferInfo * @param newData * @param index */ public void changeBufferData(BufferInfo bufferInfo, Buffer newData, int index) { this.changeBufferData(bufferInfo, newData, index, false); }
/** * Enables auto-enforcement of look at target, and orients to look at the current target. */ public void enableLookAt() { mLookAtEnabled = true; resetToLookAt(); }
protected void cloneTo(Object3D clone, boolean copyMaterial) { clone.setName(mName); clone.getGeometry().copyFromGeometry3D(mGeometry); clone.isContainer(mIsContainerOnly); if (copyMaterial) { clone.setMaterial(mMaterial); } clone.mElementsBufferType = GLES20.GL_UNSIGNED_INT; clone.mTransparent = this.mTransparent; clone.mEnableBlending = this.mEnableBlending; clone.mBlendFuncSFactor = this.mBlendFuncSFactor; clone.mBlendFuncDFactor = this.mBlendFuncDFactor; clone.mEnableDepthTest = this.mEnableDepthTest; clone.mEnableDepthMask = this.mEnableDepthMask; }
/** * Executed before the rendering process starts */ protected void preRender() { mGeometry.validateBuffers(); }
public void setData(float[] vertices, int verticesUsage, float[] normals, int normalsUsage, float[] textureCoords, int textureCoordsUsage, float[] colors, int colorsUsage, int[] indices, int indicesUsage, boolean createVBOs) { mGeometry.setData(vertices, verticesUsage, normals, normalsUsage, textureCoords, textureCoordsUsage, colors, colorsUsage, indices, indicesUsage, createVBOs); mIsContainerOnly = false; mElementsBufferType = GLES20.GL_UNSIGNED_INT; }
/** * Use this together with the alpha channel when calling BaseObject3D.setColor(): 0xaarrggbb. So for 50% transparent * red, set transparent to true and call: * <code>setColor(0x7fff0000);</code> * * @param value */ public void setTransparent(boolean value) { mTransparent = value; mEnableBlending = value; setBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA); mEnableDepthMask = !value; }
public CoalesceConfig(ASpiral3D spiral, ATransformable3D object, ATransformable3D coalesceAround, double endProximity) { this.spiral = spiral; this.object = object; this.coalesceAroundObject = coalesceAround; this.coalesceAroundPoint = coalesceAroundObject.getPosition(); this.endProximity = endProximity; }
/** * Rotates this object 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. */ public void rotateAround(Vector3 axis, double angle) { rotateAround(axis, angle, true); }
/** * Creates a buffer and assumes the buffer will be used for static drawing only. * * @param bufferInfo * @param type * @param target */ public void createBuffer(BufferInfo bufferInfo, BufferType type, int target) { createBuffer(bufferInfo, type, target, bufferInfo.usage); }
public AMeshLoader(Resources resources, TextureManager textureManager, int resourceId) { super(resources, resourceId); mTextureManager = textureManager; mRootObject = new Object3D(); }
/** * Gets the current orientation of this {@link ATransformable3D} object. * * @return A scratch {@link Quaternion} containing the orientation. Copy this * value immediately. */ public Quaternion getOrientation() { return getOrientation(mTmpOrientation); }
/** * 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; }
/** * Renders the object with no parent matrix. * * @param camera The camera * @param vpMatrix {@link Matrix4} The view-projection matrix * @param projMatrix {@link Matrix4} The projection matrix * @param vMatrix {@link Matrix4} The view matrix * @param sceneMaterial The scene-wide Material to use, if any. */ public void render(Camera camera, final Matrix4 vpMatrix, final Matrix4 projMatrix, final Matrix4 vMatrix, Material sceneMaterial) { render(camera, vpMatrix, projMatrix, vMatrix, null, sceneMaterial); }
public void setShowBoundingVolume(boolean showBoundingVolume) { if (showBoundingVolume) { getBoundingBox(); } this.mShowBoundingVolume = showBoundingVolume; }
/** * 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(); }
/** * Change a specific subset of the buffer's data at the given offset to the given length. * * @param bufferInfo * @param newData * @param index * @param size */ public void changeBufferData(BufferInfo bufferInfo, Buffer newData, int index, int size) { this.changeBufferData(bufferInfo, newData, index, size, false); }
/** * Resets the orientation of this {@link ATransformable3D} object to look at its look at * target and use the current up 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 resetToLookAt() { resetToLookAt(mUpAxis); 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(); }