Ejemplo n.º 1
0
void CCCameraBase::update()
{
#if defined PROFILEON
    CCProfiler profile( "CCCameraBase::update()" );
#endif
    
    if( updatedPosition )
    {
        updatedPosition = false;
    }
    
    if( updateFOV )
    {
        updateFOV = false;
        scanFOVBounds();
    }
    
	CCMatrixLoadIdentity( modelViewMatrix );
    if( frameBufferID == -1 )
    {
        CCMatrixRotate( modelViewMatrix, CCAppManager::GetOrientation().current, 0.0f, 0.0f, 1.0f );
    }
    GluLookAt( modelViewMatrix,
			   rotatedPosition.x, rotatedPosition.y, rotatedPosition.z,	// Position
			   lookAt.x, lookAt.y, lookAt.z,                            // Looking At
			   0.0f, 1.0f, 0.0f );										// Up
	
    GLSetPushMatrix( modelViewMatrix );
	
    ExtractFrustum();
	
    updateVisibleObjects();
}
void CCCameraBase::update()
{
#if defined PROFILEON
    CCProfiler profile( "CCCameraBase::update()" );
#endif
    
    if( updatedPosition )
    {
        updatedPosition = false;
    }
    
    if( updateFOV )
    {
        updateFOV = false;
        scanFOVBounds();
    }
    
	CCMatrixLoadIdentity( modelViewMatrix );
    CCMatrixRotate( modelViewMatrix, gEngine->renderer->orientation.current, 0.0f, 0.0f, 1.0f );
    GluLookAt( modelViewMatrix,
			   rotatedPosition.x, rotatedPosition.y, rotatedPosition.z,	// Position
			   lookAt.x, lookAt.y, lookAt.z,                            // Looking At
			   0.0f, 1.0f, 0.0f );										// Up
	
    GLSetPushMatrix( modelViewMatrix );
	
    ExtractFrustum();
	
    updateVisibleObjects();
}