EgtGraphics 1.5b2 :

- aggiunta gestione ObjNewGraphics e ObjOldGraphics.
This commit is contained in:
Dario Sassi
2014-02-15 15:46:56 +00:00
parent 1636334642
commit 3e0e4e55a2
14 changed files with 497 additions and 32 deletions
+7 -5
View File
@@ -23,6 +23,7 @@ using namespace std ;
//--------------------------- Constants --------------------------------------
static const double MIN_EXTENSION = 50 ;
static const double MIN_ZCLIP_EXT = 5000 ;
//----------------------------------------------------------------------------
@@ -420,8 +421,8 @@ Scene::CalcClippingPlanesFromExtView( void)
if ( ! m_b3ExtView.GetCenterExtent( ptCenter, vtExtent))
return false ;
// ricavo la posizione dei piani di clipping sull'asse Z di vista
const double EXP_COEFF = 1.05 ;
double dExtent = __max( ( EXP_COEFF * vtExtent.z), MIN_EXTENSION) ;
const double EXP_COEFF = 1.1 ;
double dExtent = __max( ( EXP_COEFF * vtExtent.z), MIN_ZCLIP_EXT) ;
m_dZNear = - ( ptCenter.z + dExtent) ;
m_dZFar = - ( ptCenter.z - dExtent) ;
return true ;
@@ -496,9 +497,6 @@ Scene::Prepare( void)
bool
Scene::Draw( void)
{
// provvisorio
SetExtension( BBox3d( -1000, -1000, -1000, 1000, 1000, 1000)) ;
// imposto
if ( ! Prepare())
return false ;
@@ -581,6 +579,10 @@ Scene::UnProject( const Point3d& ptView, Point3d& ptWorld)
void
Scene::Destroy( void)
{
// cancellazione eventuali ObjEgrGraphics attaccati a oggetti geometrici
DeleteObjGraphicsGroup( GDB_ID_ROOT) ;
// cancellazione rendering context
wglMakeCurrent( nullptr, nullptr) ;
if ( m_hRC != nullptr) {
wglDeleteContext( m_hRC) ;