/** * Copies another Geometry3D's BufferInfo objects. This means that it * doesn't copy or clone the actual data. It will just use the pointers * to the other Geometry3D's buffers. * * @param geom * * @see BufferInfo */ public void copyFromGeometry3D(Geometry3D geom) { this.mNumIndices = geom.getNumIndices(); this.mNumVertices = geom.getNumVertices(); mBuffers.add(VERTEX_BUFFER_KEY, geom.getVertexBufferInfo()); mBuffers.add(NORMAL_BUFFER_KEY, geom.getNormalBufferInfo()); mBuffers.add(TEXTURE_BUFFER_KEY, geom.getTexCoordBufferInfo()); if (mBuffers.get(COLOR_BUFFER_KEY).buffer == null) { mBuffers.add(COLOR_BUFFER_KEY, geom.getColorBufferInfo()); } mBuffers.add(INDEX_BUFFER_KEY, geom.getIndexBufferInfo()); this.mOriginalGeometry = geom; this.mHasNormals = geom.hasNormals(); this.mHasTextureCoordinates = geom.hasTextureCoordinates(); }
@Test public void testGetNumVertices() { assertEquals(0, geometry.getNumVertices()); }
/** * Calculate the length of the TriangleBlock that will be written. * * @param geom * @return */ private int awdGetGeomLength(Geometry3D geom) { return 24 + (geom.getNumIndices() * 2) + (geom.getNumVertices() * 4) + (geom.getNormals().limit() * 4) + (geom.getTextureCoords().limit() * 4); }
/** * Copies another Geometry3D's BufferInfo objects. This means that it * doesn't copy or clone the actual data. It will just use the pointers * to the other Geometry3D's buffers. * @param geom * @see BufferInfo */ public void copyFromGeometry3D(Geometry3D geom) { this.mNumIndices = geom.getNumIndices(); this.mNumVertices = geom.getNumVertices(); this.mVertexBufferInfo = geom.getVertexBufferInfo(); this.mIndexBufferInfo = geom.getIndexBufferInfo(); this.mTexCoordBufferInfo = geom.getTexCoordBufferInfo(); this.mOnlyShortBufferSupported = geom.areOnlyShortBuffersSupported(); if (mColors == null) this.mColorBufferInfo = geom.getColorBufferInfo(); this.mNormalBufferInfo = geom.getNormalBufferInfo(); this.mOriginalGeometry = geom; this.mHasNormals = geom.hasNormals(); this.mHasTextureCoordinates = geom.hasTextureCoordinates(); }