• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ PASSVEC3函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: UpdateChain

//
// Update_Chain - Repositions the chain links each frame. This single function
//                maintains the positions of all of the links. Only one link
//                is thinking every frame.
//
void UpdateChain()
{
    vec3_t t1, t2, t3;
    vec3_t temp;
    gedict_t *owner = PROG_TO_EDICT( self->s.v.owner ), *goal, *goal2;

    if (!owner->hook_out)
    {
        self->s.v.think     = (func_t) RemoveChain;
        self->s.v.nextthink = g_globalvars.time;
        return;
    }

    VectorSubtract(owner->hook->s.v.origin, owner->s.v.origin, temp);
    VectorScale(temp, 0.25, t1);
    VectorAdd(t1, owner->s.v.origin, t1);
    VectorScale(temp, 0.50, t2);
    VectorAdd(t2, owner->s.v.origin, t2);
    VectorScale(temp, 0.75, t3);
    VectorAdd(t3, owner->s.v.origin, t3);

    goal = PROG_TO_EDICT(self->s.v.goalentity);
    goal2 = PROG_TO_EDICT(goal->s.v.goalentity);
    // These numbers are correct assuming 3 links.
    // 4 links would be *20 *40 *60 and *80
    setorigin (self,  PASSVEC3(t1));
    setorigin (goal,  PASSVEC3(t2));
    setorigin (goal2, PASSVEC3(t3));

    self->s.v.nextthink = g_globalvars.time + 0.1;
}
开发者ID:JosephPecoraro,项目名称:ktx,代码行数:36,代码来源:grapple.c


示例2: FireSentryBulletsNEW

void FireSentryBulletsNEW( int shotcount, gedict_t * targ, float spread_x, float spread_y, float spread_z )
{
    vec3_t  src;
    vec3_t  dst;
    vec3_t  norm_dir;

    sgAimNew( self, targ, src, dst, norm_dir );

    ClearMultiDamage(  );
    traceline( PASSVEC3( src ), PASSVEC3( dst ), 0, self );

    VectorScale( norm_dir, 4, puff_org );
    VectorSubtract( g_globalvars.trace_endpos, puff_org, puff_org );

    for (  ; shotcount > 0  ; shotcount-- )
    {
        // для каждого выстрела определяем trace_ent trace_endpos
        // т.к.выстрелы могут убрать препятствия
        traceline( PASSVEC3( src ), PASSVEC3( dst ), 0, self );

        // TraceAttack требует нормализованый вектор для корректного определения blood_org
        if(g_globalvars.trace_fraction != 1)
            TraceAttack( 4, norm_dir ); 
    }
    ApplyMultiDamage(  );
    Multi_Finish(  );
}
开发者ID:angeld29,项目名称:TF2003-qvm,代码行数:27,代码来源:sentry.c


示例3: BotReport

void BotReport(  )
{
	gedict_t *te;


	for ( te = world; ( te = trap_find( te, FOFS( s.v.classname ), "player" ) ); )
	{
		if ( te->has_disconnected )
			continue;
		if ( te->isBot )
		{
                   G_bprint(3,"Bot: %s, state %d, menu %d flags %d velocity %3.0f\norigin [%.0f %.0f %.0f]\n",
                           te->s.v.netname,te->action,te->current_menu,
                           (int)(te->s.v.flags),
                           vlen(te->s.v.velocity),
                           PASSVEC3(te->s.v.origin)
                   );

                   if( te->wp )
                       G_bprint(3, "wp     [%.0f %.0f %.0f]\n", PASSVEC3(te->wp->origin));
                   else
                       G_bprint(3, "nowp\n");

                   if( te->end_wp )
                       G_bprint(3, "endwp  [%.0f %.0f %.0f]\n", PASSVEC3(te->end_wp->origin));

		}
	}
}
开发者ID:MrPnut,项目名称:QHome,代码行数:29,代码来源:ui.c


示例4: LightningDamage

/*
=================
LightningDamage
=================
*/
void LightningDamage( vec3_t p1, vec3_t p2, gedict_t * from, float damage )
{
	gedict_t       *e1, *e2;
	vec3_t          f;


	VectorSubtract( p2, p1, f );	// f = p2 - p1;
	VectorNormalize( f );	// normalize (f);

	f[0] = 0 - f[1];
	f[1] = f[0];
	f[2] = 0;
	VectorScale( f, 16, f );	//f = f*16;

	e1 = e2 = world;

	traceline( PASSVEC3( p1 ), PASSVEC3( p2 ), false, self );

	if ( PROG_TO_EDICT( g_globalvars.trace_ent )->s.v.takedamage )
	{
		LightningHit( from, damage );
		if ( streq( self->s.v.classname, "player" ) )
		{
			if ( streq( other->s.v.classname, "player" ) )
				PROG_TO_EDICT( g_globalvars.trace_ent )->s.v.
				    velocity[2] += 400;
		}
	}
	e1 = PROG_TO_EDICT( g_globalvars.trace_ent );

	//traceline (p1 + f, p2 + f, FALSE, self);
	traceline( p1[0] + f[0], p1[1] + f[1], p1[2] + f[2], p2[0] + f[0],
			p2[1] + f[1], p2[2] + f[2], false, self );
	if ( PROG_TO_EDICT( g_globalvars.trace_ent ) != e1
	     && PROG_TO_EDICT( g_globalvars.trace_ent )->s.v.takedamage )
	{
		LightningHit( from, damage );
	}
	e2 = PROG_TO_EDICT( g_globalvars.trace_ent );

	traceline( p1[0] - f[0], p1[1] - f[1], p1[2] - f[2], p2[0] - f[0],
			p2[1] - f[1], p2[2] - f[2], false, self );
	if ( PROG_TO_EDICT( g_globalvars.trace_ent ) != e1
	     && PROG_TO_EDICT( g_globalvars.trace_ent ) != e2
	     && PROG_TO_EDICT( g_globalvars.trace_ent )->s.v.takedamage )
	{
		LightningHit( from, damage );
	}
}
开发者ID:stayoutEE,项目名称:qwprogs-qvm,代码行数:54,代码来源:weapons.c


示例5: 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


示例6: Bot_CL_KeyMove

void Bot_CL_KeyMove(  )
{
	int     forwardmove = 0, sidemove = 0, upmove = 0;
	int     buttons = 0;

	buttons = ( ( self->s.v.button0 ) ? 1 : 0 ) + ( ( self->s.v.button2 ) ? 2 : 0 );

	sidemove += self->maxstrafespeed * CL_KeyState( KEY_MOVERIGHT );
	sidemove -= self->maxstrafespeed * CL_KeyState( KEY_MOVELEFT );

	upmove += 200 * CL_KeyState( KEY_MOVEUP );
	upmove -= 200 * CL_KeyState( KEY_MOVEDOWN );

	forwardmove += self->maxfbspeed * CL_KeyState( KEY_MOVEFORWARD );
	forwardmove -= self->maxfbspeed * CL_KeyState( KEY_MOVEBACK );

	if ( self->s.v.v_angle[0] > 80 )
		self->s.v.v_angle[0] = 80;
	else
	{
		if ( self->s.v.v_angle[0] < -70 )
			self->s.v.v_angle[0] = -70;
	}

	//self->s.v.v_angle[2] = 0;
	self->s.v.v_angle[1] = anglemod( self->s.v.v_angle[1] );

	trap_SetBotCMD( NUM_FOR_EDICT( self ), bot_frametime * 1000,
			PASSVEC3(self->s.v.v_angle),
			forwardmove, sidemove, upmove, buttons, self->s.v.impulse );
}
开发者ID:stayoutEE,项目名称:TF2003-qvm,代码行数:31,代码来源:qw.c


示例7: SpectatorImpulseCommand

/*
================
SpectatorImpulseCommand

Called by SpectatorThink if the spectator entered an impulse
================
*/
void SpectatorImpulseCommand()
{
	gedict_t       *goal;

	if ( self->s.v.impulse == 1 )
	{
		// teleport the spectator to the next spawn point
		// note that if the spectator is tracking, this doesn't do
		// much
		goal = PROG_TO_EDICT( self->s.v.goalentity );
		goal = find( goal, FOFS( s.v.classname ), "info_player_deathmatch" );
		if ( !goal )
			goal =
			    find( world, FOFS( s.v.classname ),
				  "info_player_deathmatch" );
		if ( goal )
		{
			setorigin( self, PASSVEC3( goal->s.v.origin ) );
			VectorCopy( goal->s.v.angles, self->s.v.angles );
			self->s.v.fixangle = true;	// turn this way immediately
		} else
			goal = world;
		self->s.v.goalentity = EDICT_TO_PROG( goal );
	}

	self->s.v.impulse = 0;
}
开发者ID:angeld29,项目名称:qwprogs-qvm,代码行数:34,代码来源:spectate.c


示例8: SP_trigger_teleport

/*QUAKED trigger_teleport (.5 .5 .5) ? PLAYER_ONLY SILENT
Any object touching this will be transported to the corresponding info_teleport_destination entity. You must set the "target" field, and create an object with a "targetname" field that matches.

If the trigger_teleport has a targetname, it will only teleport entities when it has been fired.
*/
void SP_trigger_teleport(  )
{
	vec3_t  o;

	if ( !CheckExistence(  ) )
	{
		dremove( self );
		return;
	}
	InitTrigger(  );
	self->s.v.touch = ( func_t ) teleport_touch;
	// find the destination 
	if ( !self->s.v.target )
		G_Error( "no target" );
	self->s.v.use = ( func_t ) teleport_use;

	if ( !( ( int ) ( self->s.v.spawnflags ) & SILENT ) )
	{
		trap_precache_sound( "ambience/hum1.wav" );
		VectorAdd( self->s.v.mins, self->s.v.maxs, o );
		VectorScale( o, 0.5, o );
		//o = (self.mins + self.maxs)*0.5;
		trap_ambientsound( PASSVEC3( o ), "ambience/hum1.wav", 0.5, ATTN_STATIC );
	}
}
开发者ID:stayoutEE,项目名称:TF2003-qvm,代码行数:30,代码来源:triggers.c


示例9: 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


示例10: FlagThink

void FlagThink()
{
	if ( !isCTF() )
		return;

	self->s.v.nextthink = g_globalvars.time + 0.1;

	if (self->cnt == FLAG_AT_BASE)
		return;

	if (self->cnt == FLAG_DROPPED)
	{
		self->cnt2 += 0.1;
		if ( g_globalvars.time > self->super_time )
		{
			RegenFlag( self );
			G_bprint( 2, "The %s flag has been returned\n", redtext( ( (int) self->s.v.items & IT_KEY1) ? "BLUE" : "RED" ) );
		}
		return;
	}

	if (self->cnt == FLAG_RETURNED)
	{
		setorigin( self, PASSVEC3(self->s.v.oldorigin) );
		self->cnt = FLAG_AT_BASE;
		return;
	}

	self->cnt2 += 0.1;
}
开发者ID:JosephPecoraro,项目名称:ktx,代码行数:30,代码来源:ctf.c


示例11: fb_spawn_door

static void fb_spawn_door(gedict_t* ent) {
	gedict_t* original = ent;
	vec3_t position;

	VectorScale (original->s.v.mins, 0.5, position);
	VectorMA (position, 0.5, original->s.v.maxs, position);
	position[2] = min (original->s.v.mins[2], original->s.v.maxs[2]) + 24;
	ent = CreateMarker(PASSVEC3(position));
	ent->classname = "door_marker";
	ent->fb.door_entity = original;
	ent->s.v.solid = SOLID_NOT;     // this will be set to SOLID_TRIGGER if MARKER_DOOR_TOUCHABLE flag set

	if (ent->fb.wait < 0) {
		// TODO: ?
		return;
	}
	else if ((int)ent->s.v.spawnflags & SECRET_OPEN_ONCE) {
		// TODO: ?
		return;
	}
	else {
		if (ent->s.v.health) {
			//Add_takedamage(ent);
		}

		adjust_view_ofs_z(ent);
		//BecomeMarker(ent);
	}
}
开发者ID:deurk,项目名称:ktx,代码行数:29,代码来源:bot_loadmap.c


示例12: Laser_Touch

void Laser_Touch(  )
{
	vec3_t  org;

	if ( other == PROG_TO_EDICT( self->s.v.owner ) )
		return;		// don't explode on owner

	if ( trap_pointcontents( PASSVEC3( self->s.v.origin ) ) == CONTENT_SKY )
	{
		ent_remove( self );
		return;
	}

	sound( self, CHAN_WEAPON, "enforcer/enfstop.wav", 1, ATTN_STATIC );

	normalize( self->s.v.velocity, org );
	VectorScale( org, 8, org );
	VectorSubtract( self->s.v.origin, org, org );
	//org = self->s.v.origin - 8*normalize(self->s.v.velocity);

	if ( other->s.v.health )
	{
		SpawnBlood( org, 15 );
		TF_T_Damage( other, self, PROG_TO_EDICT( self->s.v.owner ), 15, 0, TF_TD_ELECTRICITY );
	} else
	{
        TempEffectCount( org, TE_GUNSHOT, 5);
	}

	dremove( self );
}
开发者ID:angeld29,项目名称:TF2003-qvm,代码行数:31,代码来源:misc.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: 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


示例15: FireAmbient

void FireAmbient()
{
	trap_precache_sound( "ambience/fire1.wav" );
// attenuate fast
	trap_ambientsound( PASSVEC3( self->s.v.origin ), "ambience/fire1.wav", 0.5,
			   ATTN_STATIC );
}
开发者ID:deurk,项目名称:ktx,代码行数:7,代码来源:misc.c


示例16: bubble_split

void bubble_split(  )
{
	gedict_t *bubble;

	bubble = spawn(  );
	setmodel( bubble, "progs/s_bubble.spr" );
	setorigin( bubble, PASSVEC3( self->s.v.origin ) );

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

	VectorCopy( self->s.v.velocity, bubble->s.v.velocity );

	bubble->s.v.nextthink = g_globalvars.time + 0.5;
	bubble->s.v.think = ( func_t ) bubble_bob;
	bubble->s.v.touch = ( func_t ) bubble_remove;
	bubble->s.v.classname = "bubble";
	bubble->s.v.frame = 1;
	bubble->cnt = 10;

	setsize( bubble, -8, -8, -8, 8, 8, 8 );

	self->s.v.frame = 1;
	self->cnt = 10;

	if ( self->s.v.waterlevel != 3 )
		ent_remove( self );
}
开发者ID:angeld29,项目名称:TF2003-qvm,代码行数:28,代码来源:misc.c


示例17: SUB_regen

void SUB_regen()
{
	self->s.v.model = self->mdl;	// restore original model
	self->s.v.solid = SOLID_TRIGGER;	// allow it to be touched again
	sound( self, CHAN_VOICE, "items/itembk2.wav", 1, ATTN_NORM );	// play respawn sound
	setorigin( self, PASSVEC3( self->s.v.origin ) );
}
开发者ID:angeld29,项目名称:qwprogs-qvm,代码行数:7,代码来源:items.c


示例18: SP_misc_explobox2

void SP_misc_explobox2(  )
{
	float   oldz;

	if ( !CheckExistence(  ) )
	{
		dremove( self );
		return;
	}

	self->s.v.solid = SOLID_BBOX;
	self->s.v.movetype = MOVETYPE_NONE;

	trap_precache_model( "maps/b_exbox2.bsp" );
	setmodel( self, "maps/b_exbox2.bsp" );
	setsize( self, 0, 0, 0, 32, 32, 32 );
	trap_precache_sound( "weapons/r_exp3.wav" );

	self->s.v.health = 20;
	self->th_die = barrel_explode;
	self->s.v.takedamage = DAMAGE_AIM;

	self->s.v.origin[2] += 2;
	oldz = self->s.v.origin[2];

	droptofloor( self );

	if ( oldz - self->s.v.origin[2] > 250 )
	{
		G_dprintf( "item fell out of level at '%f %f %f'\n", PASSVEC3( self->s.v.origin ) );
		ent_remove( self );
	}
}
开发者ID:angeld29,项目名称:TF2003-qvm,代码行数:33,代码来源:misc.c


示例19: infront

/*
=============
visible

returns 1 if the entity is visible to self, even if not infront ()
=============
*/
float visible( gedict_t *targ )
{
	vec3_t	spot1, spot2;

	VectorAdd( self->s.v.origin, self->s.v.view_ofs, spot1 );
	VectorAdd( targ->s.v.origin, targ->s.v.view_ofs, spot2 );

	traceline( PASSVEC3( spot1 ), PASSVEC3( spot2 ), true, self ); // see through other monsters

	if ( g_globalvars.trace_inopen && g_globalvars.trace_inwater )
		return false;			// sight line crossed contents

	if ( g_globalvars.trace_fraction == 1 )
		return true;

	return false;
}
开发者ID:JosephPecoraro,项目名称:ktx,代码行数:24,代码来源:sp_ai.c


示例20: CheckBelowBuilding

void CheckBelowBuilding( gedict_t * bld )
{
    vec3_t below;

    VectorCopy( bld->s.v.origin, below );
    if ( streq( bld->s.v.classname, "detpack" ) )
	below[2] = below[2] - 8;
    else
	below[2] = below[2] - 24;
    traceline( PASSVEC3( bld->s.v.origin ), PASSVEC3( below ), 1, bld );
    if ( g_globalvars.trace_fraction == 1 )
    {
	bld->s.v.movetype = MOVETYPE_TOSS;
	bld->s.v.flags = ( int ) bld->s.v.flags - ( ( int ) bld->s.v.flags & FL_ONGROUND );
    }

}
开发者ID:MrPnut,项目名称:QHome,代码行数:17,代码来源:engineer.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ PATTERN函数代码示例发布时间:2022-05-30
下一篇:
C++ PASSERT函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap