Esempio n. 1
0
/*
================
sdClientAnimated::Hide
================
*/
void sdClientAnimated::Hide( void ) {

	if ( !animatedFlags.hidden ) {
		FreeModelDef();
		animatedFlags.hidden = true;
	}
}
/*
================
idBrittleFracture::~idBrittleFracture
================
*/
idBrittleFracture::~idBrittleFracture( void ) {
	int i;
	for( i = 0; i < shards.Num(); i++ ) {
		shards[i]->decals.DeleteContents( true );
		delete shards[i];
	}
	// make sure the render entity is freed before the model is freed
	FreeModelDef();
	renderModelManager->FreeModel( renderEntity.hModel );
}
Esempio n. 3
0
/*
=====================
sdClientAnimated::SetModel
=====================
*/
void sdClientAnimated::SetModel( const char* modelName ) {
	FreeModelDef();

	renderEntity.hModel = animator.SetModel( modelName );
	if ( renderEntity.hModel == NULL ) {
		SetStaticModel( modelName );
		return;
	}

	gameEdit->RefreshRenderEntity( spawnArgs, renderEntity );

	if ( renderEntity.customSkin != NULL ) {
		renderEntity.customSkin = animator.ModelDef()->GetDefaultSkin();
	}

	// set the callback to update the joints
	renderEntity.callback = sdClientAnimated::ModelCallback;
	animator.GetJoints( &renderEntity.numJoints, &renderEntity.joints );
	animator.GetBounds( gameLocal.time, renderEntity.bounds );

	UpdateModel();
}
Esempio n. 4
0
/*
=====================
sdClientAnimated::SetStaticModel
=====================
*/
void sdClientAnimated::SetStaticModel( const char* modelName ) {
	assert( modelName );

	FreeModelDef();

	renderEntity.hModel = renderModelManager->FindModel( modelName );

	if ( renderEntity.hModel ) {
		renderEntity.hModel->Reset();
	}

	renderEntity.callback = NULL;
	renderEntity.numJoints = 0;
	renderEntity.joints = NULL;
	if ( renderEntity.hModel ) {
		renderEntity.bounds = renderEntity.hModel->Bounds( &renderEntity );
	} else {
		renderEntity.bounds.Zero();
	}

	UpdateModel();
}
Esempio n. 5
0
/*
=====================
sdClientAnimated::CleanUp
=====================
*/
void sdClientAnimated::CleanUp( void ) {
	FreeModelDef();

	sdClientScriptEntity::CleanUp();
}