//--------------------------------------------------------------
void ofVboByteColor::updateMesh(const ofMesh & mesh){
	ofMesh * nonconstMesh = (ofMesh*)&mesh;
	if(nonconstMesh->haveVertsChanged()) updateVertexData(mesh.getVerticesPointer(),mesh.getNumVertices());
	if(nonconstMesh->haveColorsChanged()) updateColorData(mesh.getColorsPointer(),mesh.getNumColors());
	if(nonconstMesh->haveNormalsChanged()) updateNormalData(mesh.getNormalsPointer(),mesh.getNumNormals());
	if(nonconstMesh->haveTexCoordsChanged()) updateTexCoordData(mesh.getTexCoordsPointer(),mesh.getNumTexCoords());
}
Beispiel #2
0
 //-----------------------------------------------------------------------
 void Frustum::getRenderOperation(RenderOperation& op) 
 {
     updateVertexData();
     op.operationType = RenderOperation::OT_LINE_LIST;
     op.useIndexes = false;
     op.vertexData = &mVertexData;
 }
Beispiel #3
0
void SubGeometry::fromVectors(float* vertices, float* normals, float* tangents, float* uvs, float* secondaryUVs, int numVertices)
{
	updateVertexData(vertices, numVertices);
	updateVertexNormalData(normals, numVertices);
	updateVertexTangentData(tangents, numVertices);
	updateUVData(uvs, numVertices);
	updateSecondaryUVData(secondaryUVs, numVertices);
}
 //-----------------------------------------------------------------------
 void Frustum::getRenderOperation(RenderOperation& op) 
 {
     updateVertexData();
     op.operationType = RenderOperation::OT_LINE_LIST;
     op.useIndexes = false;
     op.useGlobalInstancingVertexBufferIsAvailable = false;
     op.vertexData = &mVertexData;
 }
	void DTerrainPage::update()
	{
		if (mVertexBufferDirty.get() == true)
		{
			updateVertexData();
			mVertexBufferDirty.set(false);
		}
	}
Beispiel #6
0
    //------------------------------------------------------------------------
    void TerrainBatch::checkAndUpdateGpuVertexBackupData()
    {
        if ( mGpuVertexData )
        {
            HardwareVertexBufferSharedPtr destPosbuf = mGpuVertexData->vertexBufferBinding->getBuffer(TerrainTileRender::POSITION_BUFFER);
            if ( destPosbuf.isNull() == false )
            {
                destPosbuf->createSystemMemoryBuffer();

                {
                    updateVertexData( mVertexRectInTile );
                }

                destPosbuf->freeSystemMemoryBuffer();
            }
        }
    }
Beispiel #7
0
    //------------------------------------------------------------------------
    void TerrainBatch::load()
    {
        if ( mRenderEnable && !mIsLoaded )
        {
            //////////////////////////////////

            createGpuVertexData();
            createGpuIndexData();

            loadChilds();

            loadRenderableObject();

            updateVertexData( mVertexRectInTile );

            if ( EngineMain::getInstance().getMode() != EM_EDITOR )
            {
                destroyGpuVertexBackupData();
                destroyGpuIndexBackupData();
            }
            
            mIsLoaded = true;
        }
    }
//--------------------------------------------------------------
void ofVboByteColor::updateVertexData(const ofVec2f * verts, int total) {
	updateVertexData(&verts[0].x,total);
}
Beispiel #9
0
//--------------------------------------------------------------
void ofVbo::updateVertexData(const ofVec3f * verts, int total) {
	updateVertexData(&verts[0].x,total);
}