当前位置: 首页>>代码示例>>C++>>正文


C++ setmodel函数代码示例

本文整理汇总了C++中setmodel函数的典型用法代码示例。如果您正苦于以下问题:C++ setmodel函数的具体用法?C++ setmodel怎么用?C++ setmodel使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了setmodel函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: RegenFlags

// show/hide flag
void RegenFlags( qbool yes )
{
	gedict_t *flag;

	flag = find( world, FOFCLSN, "item_flag_team1" );

	if ( flag ) {
		if ( !yes ) {
			flag->s.v.touch = (func_t) SUB_Null;
			setmodel( flag, "" );
		}
		else
			RegenFlag( flag );
	}

	flag = find( world, FOFCLSN, "item_flag_team2" );

	if ( flag ) {
		if ( !yes ) {
			flag->s.v.touch = (func_t) SUB_Null;
			setmodel( flag, "" );
		}
		else
			RegenFlag( flag );
	}
}
开发者ID:JosephPecoraro,项目名称:ktx,代码行数:27,代码来源:ctf.c

示例2: spawn_item_flag

void spawn_item_flag()
{
	if ( k_ctf_custom_models )
		setmodel( self, "progs/flag.mdl" );

	self->s.v.noise = "misc/flagtk.wav";
	self->s.v.noise1 = "doors/runetry.wav";
	setsize( self, -16, -16, 0, 16, 16, 74);
	self->mdl = self->s.v.model;
	self->s.v.flags = FL_ITEM;
	self->s.v.solid = SOLID_TRIGGER;
	self->s.v.movetype = MOVETYPE_TOSS;
	SetVector( self->s.v.velocity, 0, 0, 0 );
	self->s.v.origin[2] += 6;
	self->s.v.think = (func_t) FlagThink;
	self->s.v.touch = (func_t) FlagTouch;
	self->s.v.nextthink = g_globalvars.time + 0.1;
	self->cnt = FLAG_AT_BASE;
	self->cnt2 = 0.0;
	VectorCopy( self->s.v.angles, self->mangle );
	self->s.v.effects = (int) self->s.v.effects | EF_DIMLIGHT;

	if ( !droptofloor( self ) )
		ent_remove( self );
	else
		VectorCopy( self->s.v.origin, self->s.v.oldorigin );

	if ( !isCTF() )
	{
		setmodel( self, "" );
		self->s.v.touch = (func_t) SUB_Null;
	}
}
开发者ID:JosephPecoraro,项目名称:ktx,代码行数:33,代码来源:ctf.c

示例3: while

// create a flame of a given type, maintaining the count for each type
gedict_t *FlameSpawn( int type, gedict_t * p_owner )
{
	if ( tf_data.cb_prematch_time > g_globalvars.time )
		return world;

/*	if ( type != 1 && !tf_data.lan_mode )
		return world;*/

	num_world_flames = num_world_flames + 1;
	while ( num_world_flames > FLAME_MAXWORLDNUM )
	{
		if ( !RemoveFlameFromQueue( type ) )
			return world;
	}
	newmis = spawn(  );
	// to keep track of the number of each type of flames
	switch ( type )
	{
	case 1:
		newmis->s.v.movetype = MOVETYPE_FLYMISSILE;
		newmis->s.v.solid = SOLID_BBOX;
		newmis->s.v.effects = 8;
		newmis->flame_id = "1";
		setmodel( newmis, "progs/flame2.mdl" );
		setsize( newmis, 0, 0, 0, 0, 0, 0 );
		break;
	case 2:
		newmis->s.v.movetype = MOVETYPE_BOUNCE;
		newmis->s.v.solid = SOLID_BBOX;
		newmis->flame_id = "2";
		setmodel( newmis, "progs/flame2.mdl" );
		newmis->s.v.frame = 1;
		setsize( newmis, 0, 0, 0, 0, 0, 0 );
		break;
	case 3:
		newmis->s.v.movetype = MOVETYPE_FLYMISSILE;
		newmis->s.v.solid = SOLID_BBOX;
		newmis->flame_id = "3";
		setmodel( newmis, "progs/flame2.mdl" );
		setsize( newmis, 0, 0, 0, 0, 0, 0 );
		break;
	case 4:
		newmis->s.v.movetype = MOVETYPE_FLYMISSILE;
		newmis->flame_id = "4";
		newmis->s.v.frame = 1;
		newmis->s.v.solid = SOLID_BBOX;
		setmodel( newmis, "progs/flame2.mdl" );
		setsize( newmis, 0, 0, 0, 0, 0, 0 );
		break;
	}
	newmis->s.v.owner = EDICT_TO_PROG( p_owner );
	return newmis;
}
开发者ID:MrPnut,项目名称:QHome,代码行数:54,代码来源:pyro.c

示例4: SG_Static

void SG_Static(  )
{
    if ( self->s.v.health == 0 )
    {
        setmodel( self, "progs/turrgun.mdl" );
        self->s.v.health = -1;
    } else
    {
        setmodel( self, "" );
        self->s.v.health = 0;
    }
    self->s.v.nextthink = g_globalvars.time + 0.5;
}
开发者ID:angeld29,项目名称:TF2003-qvm,代码行数:13,代码来源:sentry.c

示例5: viewthing

void viewthing()
{
	self->s.v.movetype = MOVETYPE_NONE;
	self->s.v.solid = SOLID_NOT;
	trap_precache_model( "progs/player.mdl" );
	setmodel( self, "progs/player.mdl" );
}
开发者ID:deurk,项目名称:ktx,代码行数:7,代码来源:misc.c

示例6: fire_fly

void fire_fly()
{
	gedict_t       *fireball;

	fireball = spawn();
	fireball->s.v.solid = SOLID_TRIGGER;
	fireball->s.v.movetype = MOVETYPE_TOSS;
	fireball->isMissile = true; // well, you can really treat fireball as missilie, nothing bad gonna heppen.
	SetVector( fireball->s.v.velocity,
		   ( g_random() * 100 ) - 50,
		   ( g_random() * 100 ) - 50, self->speed + ( g_random() * 200 ) );

	fireball->classname = "fireball";

	setmodel( fireball, "progs/lavaball.mdl" );
	setsize( fireball, 0, 0, 0, 0, 0, 0 );
	setorigin( fireball, PASSVEC3( self->s.v.origin ) );

	fireball->s.v.nextthink = g_globalvars.time + 5;
	fireball->think = ( func_t ) SUB_Remove;
	fireball->touch = ( func_t ) fire_touch;

	self->s.v.nextthink = g_globalvars.time + ( g_random() * 5 ) + 3;
	self->think = ( func_t ) fire_fly;
}
开发者ID:deurk,项目名称:ktx,代码行数:25,代码来源:misc.c

示例7: SP_light_flame_small_white

/*QUAKED light_flame_small_white (0 1 0) (-10 -10 -40) (10 10 40) START_OFF
Small white flame ball
*/
void SP_light_flame_small_white()
{
	trap_precache_model( "progs/flame2.mdl" );
	setmodel( self, "progs/flame2.mdl" );
	FireAmbient( self );
	makestatic( self );
}
开发者ID:deurk,项目名称:ktx,代码行数:10,代码来源:misc.c

示例8: SP_light_torch_small_walltorch

/*QUAKED light_torch_small_walltorch (0 .5 0) (-10 -10 -20) (10 10 20)
Short wall torch
Default light value is 200
Default style is 0
*/
void SP_light_torch_small_walltorch()
{
	trap_precache_model( "progs/flame.mdl" );
	setmodel( self, "progs/flame.mdl" );
	FireAmbient( self );
	makestatic( self );
}
开发者ID:deurk,项目名称:ktx,代码行数:12,代码来源:misc.c

示例9: LaunchLaser

void LaunchLaser( vec3_t org, vec3_t vec )
{

	if ( !strcmp( self->s.v.classname, "monster_enforcer" ) )
		sound( self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM );

	normalize( vec, vec );

	newmis = spawn(  );
	g_globalvars.newmis = EDICT_TO_PROG( newmis );
	newmis->s.v.owner = EDICT_TO_PROG( self );
	newmis->s.v.movetype = MOVETYPE_FLY;
	newmis->s.v.solid = SOLID_BBOX;
	newmis->s.v.effects = EF_DIMLIGHT;

	setmodel( newmis, "progs/laser.mdl" );
	setsize( newmis, 0, 0, 0, 0, 0, 0 );

	setorigin( newmis, PASSVEC3( org ) );

	//newmis->s.v.velocity = vec * 600;
	VectorScale( vec, 600, newmis->s.v.velocity );

	vectoangles( newmis->s.v.velocity, newmis->s.v.angles );

	newmis->s.v.nextthink = g_globalvars.time + 5;
	newmis->s.v.think = ( func_t ) SUB_Remove;
	newmis->s.v.touch = ( func_t ) Laser_Touch;
}
开发者ID:angeld29,项目名称:TF2003-qvm,代码行数:29,代码来源:misc.c

示例10: DeathBubblesSpawn

void DeathBubblesSpawn()
{
	gedict_t       *bubble;

	if ( PROG_TO_EDICT( self->s.v.owner )->s.v.waterlevel != 3 )
		return;
	bubble = spawn();
	setmodel( bubble, "progs/s_bubble.spr" );
	setorigin( bubble, PROG_TO_EDICT( self->s.v.owner )->s.v.origin[0],
			PROG_TO_EDICT( self->s.v.owner )->s.v.origin[1],
			PROG_TO_EDICT( self->s.v.owner )->s.v.origin[2] + 24 );

	bubble->s.v.movetype = MOVETYPE_NOCLIP;
	bubble->s.v.solid = SOLID_NOT;

	SetVector( bubble->s.v.velocity, 0, 0, 15 );

	bubble->s.v.nextthink = g_globalvars.time + 0.5;
	bubble->think = ( func_t ) bubble_bob;
	bubble->classname = "bubble";
	bubble->s.v.frame = 0;
	bubble->cnt = 0;
	
	setsize( bubble, -8, -8, -8, 8, 8, 8 );

	self->s.v.nextthink = g_globalvars.time + 0.1;
	self->think = ( func_t ) DeathBubblesSpawn;
	self->air_finished = self->air_finished + 1;

	if ( self->air_finished >= self->bubble_count )
		ent_remove( self );
}
开发者ID:deurk,项目名称:ktx,代码行数:32,代码来源:player.c

示例11: show_specs_wizards

void show_specs_wizards ()
{
	gedict_t *p;

	for( p = world; (p = find( p, FOFCLSN, "spectator_wizard" )); )
		setmodel (p, "progs/wizard.mdl");
}
开发者ID:devrac,项目名称:ktx,代码行数:7,代码来源:spectate.c

示例12: SP_func_ctf_wall

// would love to know what a ctf wall is :O!
void SP_func_ctf_wall()
{
	SetVector( self->s.v.angles, 0, 0, 0 );
	self->s.v.movetype = MOVETYPE_PUSH;
	self->s.v.solid = SOLID_BSP;
	setmodel( self, self->s.v.model ); 
}
开发者ID:JosephPecoraro,项目名称:ktx,代码行数:8,代码来源:ctf.c

示例13: fire_fly

void fire_fly(  )
{
	gedict_t *fireball;

	fireball = spawn(  );
	newmis = fireball;
	g_globalvars.newmis = EDICT_TO_PROG( newmis );
	fireball->s.v.solid = SOLID_TRIGGER;
	fireball->s.v.movetype = MOVETYPE_TOSS;
	SetVector( fireball->s.v.velocity,
		   ( g_random(  ) * 100 ) - 50, ( g_random(  ) * 100 ) - 50, self->speed + ( g_random(  ) * 200 ) );

	fireball->s.v.classname = "fireball";

	setmodel( fireball, "progs/lavaball.mdl" );
	setsize( fireball, 0, 0, 0, 0, 0, 0 );
	setorigin( fireball, PASSVEC3( self->s.v.origin ) );

	fireball->s.v.nextthink = g_globalvars.time + 5;
	fireball->s.v.think = ( func_t ) SUB_Remove;
	fireball->s.v.touch = ( func_t ) fire_touch;

	self->s.v.nextthink = g_globalvars.time + ( g_random(  ) * 5 ) + 3;
	self->s.v.think = ( func_t ) fire_fly;
}
开发者ID:angeld29,项目名称:TF2003-qvm,代码行数:25,代码来源:misc.c

示例14: DropRing

void DropRing( float timeleft )
{
	gedict_t       *item;

	item = spawn();
	VectorCopy( self->s.v.origin, item->s.v.origin );
	//item.origin = self.origin;

	item->s.v.velocity[2] = 300;
	item->s.v.velocity[0] = -100 + ( g_random() * 200 );
	item->s.v.velocity[1] = -100 + ( g_random() * 200 );

	item->s.v.flags = FL_ITEM;
	item->s.v.solid = SOLID_TRIGGER;
	item->s.v.movetype = MOVETYPE_TOSS;
	item->s.v.noise = "items/inv1.wav";

	setmodel( item, "progs/invisibl.mdl" );
	setsize( item, -16, -16, -24, 16, 16, 32 );

	item->cnt = g_globalvars.time + timeleft;
	item->s.v.touch = ( func_t ) r_touch;
	item->s.v.nextthink = g_globalvars.time + timeleft;	// remove after 30 seconds
	item->s.v.think = ( func_t ) SUB_Remove;
}
开发者ID:angeld29,项目名称:qwprogs-qvm,代码行数:25,代码来源:items.c

示例15: SpawnMeatSpray

/*
================
SpawnMeatSpray
================
*/
void SpawnMeatSpray( vec3_t org, vec3_t vel )
{
	gedict_t       *missile;

	//vec3_t  org;

	missile = spawn();
	missile->s.v.owner = EDICT_TO_PROG( self );
	missile->s.v.movetype = MOVETYPE_BOUNCE;
	missile->s.v.solid = SOLID_NOT;

	makevectors( self->s.v.angles );

	VectorCopy( vel, missile->s.v.velocity );
// missile->s.v.velocity = vel;
	missile->s.v.velocity[2] = missile->s.v.velocity[2] + 250 + 50 * g_random();

	SetVector( missile->s.v.avelocity, 3000, 1000, 2000 );
// missile.avelocity = '3000 1000 2000';

// set missile duration
	missile->s.v.nextthink = g_globalvars.time + 1;
	missile->s.v.think = ( func_t ) SUB_Remove;

	setmodel( missile, "progs/zom_gib.mdl" );
	setsize( missile, 0, 0, 0, 0, 0, 0 );
	setorigin( missile, PASSVEC3( org ) );
}
开发者ID:stayoutEE,项目名称:qwprogs-qvm,代码行数:33,代码来源:weapons.c


注:本文中的setmodel函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。