/* ================ idClipModel::~idClipModel ================ */ idClipModel::~idClipModel( void ) { // make sure the clip model is no longer linked Unlink(); if ( traceModelIndex != -1 ) { FreeTraceModel( traceModelIndex ); } }
/* ================ idClipModel::LoadModel ================ */ void idClipModel::LoadModel( const idTraceModel &trm ) { collisionModelHandle = 0; renderModelHandle = -1; if ( traceModelIndex != -1 ) { FreeTraceModel( traceModelIndex ); } traceModelIndex = AllocTraceModel( trm ); bounds = trm.bounds; }
/* ================ idClipModel::LoadModel ================ */ void idClipModel::LoadModel( const idTraceModel& trm, bool persistantThroughSave ) { collisionModelHandle = 0; renderModelHandle = -1; if( traceModelIndex != -1 ) { FreeTraceModel( traceModelIndex ); } traceModelIndex = AllocTraceModel( trm, persistantThroughSave ); bounds = trm.bounds; }
/* ================ idClipModel::LoadModel ================ */ void idClipModel::LoadModel( const int renderModelHandle ) { collisionModelHandle = 0; this->renderModelHandle = renderModelHandle; if ( renderModelHandle != -1 ) { const renderEntity_t *renderEntity = gameRenderWorld->GetRenderEntity( renderModelHandle ); if ( renderEntity ) { bounds = renderEntity->bounds; } } if ( traceModelIndex != -1 ) { FreeTraceModel( traceModelIndex ); traceModelIndex = -1; } }
/* ================ idClipModel::LoadModel ================ */ bool idClipModel::LoadModel( const char *name ) { renderModelHandle = -1; if ( traceModelIndex != -1 ) { FreeTraceModel( traceModelIndex ); traceModelIndex = -1; } collisionModelHandle = collisionModelManager->LoadModel( name, false ); if ( collisionModelHandle ) { collisionModelManager->GetModelBounds( collisionModelHandle, bounds ); collisionModelManager->GetModelContents( collisionModelHandle, contents ); return true; } else { bounds.Zero(); return false; } }