/** * Reload is typically called whenever the OpenGL context needs to be restored. * All buffer data is re-uploaded and a new handle is obtained. * It is not recommended to call this function manually. */ public void reload() { if (mOriginalGeometry != null) { if (!mOriginalGeometry.isValid()) { mOriginalGeometry.reload(); } copyFromGeometry3D(mOriginalGeometry); } createBuffers(); }
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; }
material.setDiffuseMethod(new DiffuseMethod.Lambert()); material.addPlugin(new VertexAnimationMaterialPlugin()); mObject.getGeometry().copyFromGeometry3D(firstFrame.getGeometry()); mObject.setData(firstFrame.getGeometry().getVertexBufferInfo(), firstFrame.getGeometry() .getNormalBufferInfo(), mTextureCoords, null, mIndices, false);
public VertexAnimationObject3D clone(boolean copyMaterial) { VertexAnimationObject3D clone = new VertexAnimationObject3D(); clone.getGeometry().copyFromGeometry3D(mGeometry); clone.isContainer(mIsContainerOnly); clone.setMaterial(mMaterial); for (int i = 0; i < mNumFrames; ++i) { clone.addFrame(getFrame(i)); } clone.setRotation(getOrientation()); clone.setScale(getScale()); clone.setFps(mFps); clone.mElementsBufferType = GLES20.GL_UNSIGNED_INT; return clone; }
clone.setPosition(getPosition()); clone.setScale(getScale()); clone.getGeometry().copyFromGeometry3D(mGeometry); clone.isContainer(mIsContainerOnly); clone.setMaterial(mMaterial);
public SkeletalAnimationChildObject3D clone(boolean copyMaterial, boolean cloneChildren) { SkeletalAnimationChildObject3D clone = new SkeletalAnimationChildObject3D(); clone.setRotation(getOrientation()); clone.setPosition(getPosition()); clone.setScale(getScale()); clone.getGeometry().copyFromGeometry3D(mGeometry); clone.isContainer(mIsContainerOnly); 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; clone.setAnimationSequence(mSequence); clone.setSkeleton(mSkeleton); try { clone.setMaxBoneWeightsPerVertex(mMaxBoneWeightsPerVertex); } catch (SkeletalAnimationException e) { e.printStackTrace(); } clone.setSkeletonMeshData(mNumVertices, mVertices, 0, mWeights); clone.setInverseZScale(mInverseZScale); return clone; } }
/** * Reload is typically called whenever the OpenGL context needs to be restored. * All buffer data is re-uploaded and a new handle is obtained. * It is not recommended to call this function manually. */ public void reload() { if (mOriginalGeometry != null) { if (!mOriginalGeometry.isValid()) { mOriginalGeometry.reload(); } copyFromGeometry3D(mOriginalGeometry); } createBuffers(); }
protected void cloneTo(Object3D clone, boolean copyMaterial) { clone.setName(mName); clone.getGeometry().copyFromGeometry3D(mGeometry); clone.isContainer(mIsContainerOnly); if (copyMaterial) clone.setMaterial(mMaterial); clone.mElementsBufferType = mGeometry.areOnlyShortBuffersSupported() ? GLES20.GL_UNSIGNED_SHORT : 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; }
material.setDiffuseMethod(new DiffuseMethod.Lambert()); material.addPlugin(new VertexAnimationMaterialPlugin()); mObject.getGeometry().copyFromGeometry3D(firstFrame.getGeometry()); mObject.setData(firstFrame.getGeometry().getVertexBufferInfo(), firstFrame.getGeometry() .getNormalBufferInfo(), mTextureCoords, null, mIndices, false);
public VertexAnimationObject3D clone(boolean copyMaterial) { VertexAnimationObject3D clone = new VertexAnimationObject3D(); clone.getGeometry().copyFromGeometry3D(mGeometry); clone.isContainer(mIsContainerOnly); clone.setMaterial(mMaterial); for (int i = 0; i < mNumFrames; ++i) { clone.addFrame(getFrame(i)); } clone.setRotation(getOrientation()); clone.setScale(getScale()); clone.setFps(mFps); clone.mElementsBufferType = mGeometry.areOnlyShortBuffersSupported() ? GLES20.GL_UNSIGNED_SHORT : GLES20.GL_UNSIGNED_INT; return clone; }
clone.setPosition(getPosition()); clone.setScale(getScale()); clone.getGeometry().copyFromGeometry3D(mGeometry); clone.isContainer(mIsContainerOnly); clone.setMaterial(mMaterial);
clone.setPosition(getPosition()); clone.setScale(getScale()); clone.getGeometry().copyFromGeometry3D(mGeometry); clone.isContainer(mIsContainerOnly); clone.setMaterial(mMaterial);