Exemple #1
0
/*
================
idClipModel::~idClipModel
================
*/
idClipModel::~idClipModel( void ) {
	// make sure the clip model is no longer linked
	Unlink();
	if ( traceModelIndex != -1 ) {
		FreeTraceModel( traceModelIndex );
	}
}
Exemple #2
0
/*
================
idClipModel::LoadModel
================
*/
void idClipModel::LoadModel( const idTraceModel &trm ) {
	collisionModelHandle = 0;
	renderModelHandle = -1;
	if ( traceModelIndex != -1 ) {
		FreeTraceModel( traceModelIndex );
	}
	traceModelIndex = AllocTraceModel( trm );
	bounds = trm.bounds;
}
Exemple #3
0
/*
================
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;
}
Exemple #4
0
/*
================
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;
	}
}
Exemple #5
0
/*
================
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;
	}
}