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

C++ GClip_LinkEntity函数代码示例

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

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



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

示例1: SP_trigger_push

void SP_trigger_push( edict_t *self )
{
	InitTrigger( self );

	if( st.noise && Q_stricmp( st.noise, "default" ) )
	{
		if( Q_stricmp( st.noise, "silent" ) )
		{
			self->moveinfo.sound_start = trap_SoundIndex( st.noise );
			G_PureSound( st.noise );
		}
	}
	else
		self->moveinfo.sound_start = trap_SoundIndex( S_JUMPPAD );

	// gameteam field from editor
	if( st.gameteam >= TEAM_SPECTATOR && st.gameteam < GS_MAX_TEAMS )
		self->s.team = st.gameteam;
	else
		self->s.team = TEAM_SPECTATOR;

	self->touch = trigger_push_touch;
	self->think = trigger_push_setup;
	self->nextThink = level.time + 1;
	self->r.svflags &= ~SVF_NOCLIENT;
	self->s.type = ET_PUSH_TRIGGER;
	self->r.svflags |= SVF_TRANSMITORIGIN2;
	GClip_LinkEntity( self ); // ET_PUSH_TRIGGER gets exceptions at linking so it's added for prediction
	self->timeStamp = level.time;
	if( !self->wait )
		self->wait = MIN_TRIGGER_PUSH_REBOUNCE_TIME * 0.001f;
}
开发者ID:codetwister,项目名称:qfusion,代码行数:32,代码来源:g_trigger.cpp


示例2: ThrowDebris

void ThrowDebris( edict_t *self, int modelindex, float speed, vec3_t origin )
{
	edict_t	*chunk;
	vec3_t v;

	chunk = G_Spawn();
	VectorCopy( origin, chunk->s.origin );
	chunk->r.svflags &= ~SVF_NOCLIENT;
	chunk->s.modelindex = modelindex;
	v[0] = 100 *crandom();
	v[1] = 100 *crandom();
	v[2] = 100 + 100 *crandom();
	VectorMA( self->velocity, speed, v, chunk->velocity );
	chunk->movetype = MOVETYPE_BOUNCE;
	chunk->r.solid = SOLID_NOT;
	chunk->avelocity[0] = random()*600;
	chunk->avelocity[1] = random()*600;
	chunk->avelocity[2] = random()*600;
	chunk->think = G_FreeEdict;
	chunk->nextThink = level.time + 5000 + random()*5000;
	chunk->s.frame = 0;
	chunk->flags = 0;
	chunk->classname = "debris";
	chunk->takedamage = DAMAGE_YES;
	chunk->die = debris_die;
	chunk->r.owner = self;
	GClip_LinkEntity( chunk );
}
开发者ID:codetwister,项目名称:qfusion,代码行数:28,代码来源:g_misc.cpp


示例3: G_TeleportPlayer

/*
* G_TeleportPlayer
*/
void G_TeleportPlayer( edict_t *player, edict_t *dest )
{
	int i;
	vec3_t velocity;
	mat3_t axis;
	float speed;
	gclient_t *client = player->r.client;

	if( !dest ) {
		return;
	}
	if( !client ) {
		return;
	}

	// draw the teleport entering effect
	G_TeleportEffect( player, false );

	//
	// teleport the player
	//

	// from racesow - use old pmove velocity
	VectorCopy( client->old_pmove.velocity, velocity );

	velocity[2] = 0; // ignore vertical velocity
	speed = VectorLengthFast( velocity );

	AnglesToAxis( dest->s.angles, axis );
	VectorScale( &axis[AXIS_FORWARD], speed, client->ps.pmove.velocity );

	VectorCopy( dest->s.angles, client->ps.viewangles );
	VectorCopy( dest->s.origin, client->ps.pmove.origin );

	// set the delta angle
	for ( i = 0; i < 3; i++ )
		client->ps.pmove.delta_angles[i] = ANGLE2SHORT( client->ps.viewangles[i] ) - client->ucmd.angles[i];

	client->ps.pmove.pm_flags |= PMF_TIME_TELEPORT;
	client->ps.pmove.pm_time = 1; // force the minimum no control delay
	player->s.teleported = true;

	// update the entity from the pmove
	VectorCopy( client->ps.viewangles, player->s.angles );
	VectorCopy( client->ps.pmove.origin, player->s.origin );
	VectorCopy( client->ps.pmove.origin, player->s.old_origin );
	VectorCopy( client->ps.pmove.origin, player->olds.origin );
	VectorCopy( client->ps.pmove.velocity, player->velocity );

	// unlink to make sure it can't possibly interfere with KillBox
	GClip_UnlinkEntity( player );

	// kill anything at the destination
	KillBox( player );

	GClip_LinkEntity( player );

	// add the teleport effect at the destination
	G_TeleportEffect( player, true );
}
开发者ID:Clever-Boy,项目名称:qfusion,代码行数:63,代码来源:p_client.cpp


示例4: AITools_DrawPath

//==========================================
// AITools_DrawPath
// Draws the current path (floods as hell also)
//==========================================
void AITools_DrawPath( edict_t *self, int node_to )
{
	static unsigned int drawnpath_timeout;
	int count = 0;
	int pos = 0;

	//don't draw it every frame (flood)
	if( level.time < drawnpath_timeout )
		return;

	drawnpath_timeout = level.time + 4 * game.snapFrameTime;

	if( self->ai->path.goalNode != node_to )
		return;

	pos = self->ai->path.numNodes;

	// Now set up and display the path
	while( self->ai->path.nodes[pos] != node_to && count < 32 && pos > 0 )
	{
		edict_t	*event;

		event = G_SpawnEvent( EV_GREEN_LASER, 0, nodes[self->ai->path.nodes[pos]].origin );
		event->r.svflags = SVF_TRANSMITORIGIN2;
		VectorCopy( nodes[self->ai->path.nodes[pos-1]].origin, event->s.origin2 );
		G_SetBoundsForSpanEntity( event, 8 );
		GClip_LinkEntity( event );

		pos--;
		count++;
	}
}
开发者ID:Clever-Boy,项目名称:qfusion,代码行数:36,代码来源:ai_tools.cpp


示例5: SetRespawn

void SetRespawn( edict_t *ent, int delay )
{
	if( !ent->item )
		return;

	if( delay < 0 )
	{
		G_FreeEdict( ent );
		return;
	}

	ent->r.svflags |= SVF_NOCLIENT;
	ent->r.solid = SOLID_NOT;
	ent->nextThink = level.time + delay;
	ent->think = DoRespawn;

	// megahealth is different
	if( ( ent->style & HEALTH_TIMED ) && ent->r.owner )
	{
		ent->think = MegaHealth_think;
		ent->nextThink = level.time + 1;
	}

	GClip_LinkEntity( ent );
}
开发者ID:hettoo,项目名称:racesow,代码行数:25,代码来源:g_items.c


示例6: G_GhostClient

/*
* G_GhostClient
*/
void G_GhostClient( edict_t *ent )
{
	G_DeathAwards( ent );

	ent->movetype = MOVETYPE_NONE;
	ent->r.solid = SOLID_NOT;

	memset( &ent->snap, 0, sizeof( ent->snap ) );
	memset( &ent->r.client->resp.snap, 0, sizeof( ent->r.client->resp.snap ) );
	memset( &ent->r.client->resp.chase, 0, sizeof( ent->r.client->resp.chase ) );
	memset( &ent->r.client->resp.awardInfo, 0, sizeof( ent->r.client->resp.awardInfo ) );
	ent->r.client->resp.next_drown_time = 0;
	ent->r.client->resp.old_waterlevel = 0;
	ent->r.client->resp.old_watertype = 0;

	ent->s.modelindex = ent->s.modelindex2 = ent->s.skinnum = 0;
	ent->s.effects = 0;
	ent->s.weapon = 0;
	ent->s.sound = 0;
	ent->s.light = 0;
	ent->viewheight = 0;
	ent->takedamage = DAMAGE_NO;

	// clear inventory
	memset( ent->r.client->ps.inventory, 0, sizeof( ent->r.client->ps.inventory ) );

	ent->r.client->ps.stats[STAT_WEAPON] = ent->r.client->ps.stats[STAT_PENDING_WEAPON] = WEAP_NONE;
	ent->r.client->ps.weaponState = WEAPON_STATE_READY;
	ent->r.client->ps.stats[STAT_WEAPON_TIME] = 0;

	G_SetPlayerHelpMessage( ent, 0 );

	GClip_LinkEntity( ent );
}
开发者ID:Clever-Boy,项目名称:qfusion,代码行数:37,代码来源:p_client.cpp


示例7: SP_light_mine

//QUAKED light_mine (0 1 0) (-2 -2 -12) (2 2 12)
void SP_light_mine( edict_t *ent )
{
	ent->movetype = MOVETYPE_NONE;
	ent->r.solid = SOLID_YES;
	ent->s.modelindex = trap_ModelIndex( "models/objects/minelite/light1/tris.md2" );
	GClip_LinkEntity( ent );
}
开发者ID:Racenet,项目名称:racesow,代码行数:8,代码来源:g_misc.c


示例8: BOT_SpawnBot

//==========================================
// BOT_SpawnBot
// Used Spawn the bot
//==========================================
void BOT_SpawnBot( const char *team_name )
{
	edict_t *spawner;
	int team;

	if( level.spawnedTimeStamp + 5000 > game.realtime || !level.canSpawnEntities )
		return;

	if( !nav.loaded )
	{
		Com_Printf( "AI: Can't spawn bots without a valid navigation file\n" );
		if( g_numbots->integer ) 
			trap_Cvar_Set( "g_numbots", "0" );
		return;
	}

	// create a entity which will call the bot spawn
	spawner = G_Spawn();
	spawner->think = BOT_SpawnerThink;

	team = GS_Teams_TeamFromName( team_name );
	if( team != -1 )
		spawner->s.team = team;

	spawner->nextThink = level.time + random() * 3000;
	spawner->movetype = MOVETYPE_NONE;
	spawner->r.solid = SOLID_NOT;
	spawner->r.svflags |= SVF_NOCLIENT;
	GClip_LinkEntity( spawner );

	game.numBots++;
}
开发者ID:MGXRace,项目名称:racesow,代码行数:36,代码来源:bot_spawn.cpp


示例9: SetRespawn

void SetRespawn( edict_t *ent, int delay )
{
	if( !ent->item )
		return;

	if( delay < 0 )
	{
		G_FreeEdict( ent );
		return;
	}

	ent->r.solid = SOLID_NOT;
	ent->nextThink = level.time + delay;
	ent->think = DoRespawn;
	if( GS_MatchState() == MATCH_STATE_WARMUP ) {
		ent->s.effects |= EF_GHOST;
	}
	else {
		ent->r.svflags |= SVF_NOCLIENT;
	}

	// megahealth is different
	if( ( ent->spawnflags & ITEM_TIMED ) && ent->r.owner )
	{
		if( ent->item->type == IT_HEALTH )
		{
			ent->think = MegaHealth_think;
			ent->nextThink = level.time + 1;
		}
	}

	GClip_LinkEntity( ent );
}
开发者ID:Clever-Boy,项目名称:qfusion,代码行数:33,代码来源:g_items.cpp


示例10: ThrowClientHead

void ThrowClientHead( edict_t *self, int damage )
{
	vec3_t vd;

	self->s.modelindex = 1;
	self->s.modelindex2 = 0;
	self->s.skinnum = 0;

	self->s.origin[2] += 32;
	self->s.frame = 0;

	VectorSet( self->r.mins, -16, -16, 0 );
	VectorSet( self->r.maxs, 16, 16, 16 );

	self->takedamage = DAMAGE_NO;
	self->r.solid = SOLID_NOT;
	self->s.type = ET_GIB;
	self->s.sound = 0;
	self->s.effects = 0;
	self->flags |= FL_NO_KNOCKBACK;

	self->movetype = MOVETYPE_BOUNCE;
	VelocityForDamage( max( damage, 50 ), vd );
	VectorAdd( self->velocity, vd, self->velocity );

	G_AddEvent( self, EV_GIB, 0, false );
	GClip_LinkEntity( self );
}
开发者ID:codetwister,项目名称:qfusion,代码行数:28,代码来源:g_misc.cpp


示例11: W_Fire_TossProjectile

/*
* W_Fire_Grenade
*/
edict_t *W_Fire_Grenade( edict_t *self, vec3_t start, vec3_t dir, int speed, float damage,
						 int minKnockback, int maxKnockback, int stun, int minDamage, float radius,
						 int timeout, int mod, int timeDelta ) {
	edict_t *grenade;

	if( GS_Instagib() ) {
		damage = 9999;
	}

	grenade = W_Fire_TossProjectile( self, start, dir, speed, damage, minKnockback, maxKnockback, stun, minDamage, radius, timeout, timeDelta );
	VectorClear( grenade->s.angles );
	grenade->style = mod;
	grenade->s.type = ET_GRENADE;
	grenade->movetype = MOVETYPE_BOUNCEGRENADE;
	grenade->touch = W_Touch_Grenade;
	grenade->use = NULL;
	grenade->think = W_Grenade_Explode;
	grenade->classname = "grenade";
	grenade->enemy = NULL;
	VectorSet( grenade->avelocity, 300, 300, 300 );

	if( mod == MOD_GRENADE_S ) {
		grenade->s.modelindex = trap_ModelIndex( PATH_GRENADE_STRONG_MODEL );
		grenade->s.effects |= EF_STRONG_WEAPON;
	} else {
		grenade->s.modelindex = trap_ModelIndex( PATH_GRENADE_WEAK_MODEL );
		grenade->s.effects &= ~EF_STRONG_WEAPON;
	}

	GClip_LinkEntity( grenade );

	return grenade;
}
开发者ID:Picmip,项目名称:qfusion,代码行数:36,代码来源:g_weapon.cpp


示例12: SP_func_object

void SP_func_object( edict_t *self )
{
	G_InitMover( self );

	self->r.mins[0] += 1;
	self->r.mins[1] += 1;
	self->r.mins[2] += 1;
	self->r.maxs[0] -= 1;
	self->r.maxs[1] -= 1;
	self->r.maxs[2] -= 1;

	if( !self->dmg )
		self->dmg = 100;

	if( self->spawnflags == 0 )
	{
		self->r.solid = SOLID_YES;
		self->movetype = MOVETYPE_PUSH;
		self->think = func_object_release;
		self->nextThink = level.time + self->wait * 1000;
		self->r.svflags &= ~SVF_NOCLIENT;
	}
	else
	{
		self->r.solid = SOLID_NOT;
		self->movetype = MOVETYPE_PUSH;
		self->use = func_object_use;
		self->r.svflags |= SVF_NOCLIENT;
	}

	self->r.clipmask = MASK_MONSTERSOLID;

	GClip_LinkEntity( self );
}
开发者ID:codetwister,项目名称:qfusion,代码行数:34,代码来源:g_misc.cpp


示例13: SP_func_static

void SP_func_static( edict_t *ent )
{
	G_InitMover( ent );
	ent->movetype = MOVETYPE_NONE;
	ent->r.svflags = SVF_BROADCAST;
	GClip_LinkEntity( ent );
}
开发者ID:codetwister,项目名称:qfusion,代码行数:7,代码来源:g_misc.cpp


示例14: body_ready

/*
* body_ready
*/
static void body_ready( edict_t *body )
{
	body->takedamage = DAMAGE_YES;
	body->r.solid = SOLID_YES;
	body->think = body_think; // body self destruction countdown
	body->nextThink = level.time + g_deadbody_autogib_delay->integer + ( crandom() * g_deadbody_autogib_delay->value * 0.25f ) ;
	GClip_LinkEntity( body );
}
开发者ID:Clever-Boy,项目名称:qfusion,代码行数:11,代码来源:p_client.cpp


示例15: func_explosive_spawn

static void func_explosive_spawn( edict_t *self, edict_t *other, edict_t *activator )
{
	self->r.solid = SOLID_YES;
	self->r.svflags &= ~SVF_NOCLIENT;
	self->use = NULL;
	KillBox( self );
	GClip_LinkEntity( self );
}
开发者ID:codetwister,项目名称:qfusion,代码行数:8,代码来源:g_misc.cpp


示例16: AITools_DrawLine

//==========================================
// AITools_DrawLine
// Just so I don't hate to write the event every time
//==========================================
void AITools_DrawLine( vec3_t origin, vec3_t dest )
{
	edict_t	*event;

	event = G_SpawnEvent( EV_GREEN_LASER, 0, origin );
	event->r.svflags = SVF_TRANSMITORIGIN2;
	VectorCopy( dest, event->s.origin2 );
	G_SetBoundsForSpanEntity( event, 8 );
	GClip_LinkEntity( event );
}
开发者ID:Clever-Boy,项目名称:qfusion,代码行数:14,代码来源:ai_tools.cpp


示例17: SP_func_wall

void SP_func_wall( edict_t *self )
{
	G_InitMover( self );
	self->s.solid = SOLID_NOT;

	// just a wall
	if( ( self->spawnflags & 7 ) == 0 )
	{
		self->r.solid = SOLID_YES;
		GClip_LinkEntity( self );
		return;
	}

	// it must be TRIGGER_SPAWN
	if( !( self->spawnflags & 1 ) )
	{
		//		G_Printf ("func_wall missing TRIGGER_SPAWN\n");
		self->spawnflags |= 1;
	}

	// yell if the spawnflags are odd
	if( self->spawnflags & 4 )
	{
		if( !( self->spawnflags & 2 ) )
		{
			if( developer->integer )
				G_Printf( "func_wall START_ON without TOGGLE\n" );
			self->spawnflags |= 2;
		}
	}

	self->use = func_wall_use;
	if( self->spawnflags & 4 )
	{
		self->r.solid = SOLID_YES;
	}
	else
	{
		self->r.solid = SOLID_NOT;
		self->r.svflags |= SVF_NOCLIENT;
	}
	GClip_LinkEntity( self );
}
开发者ID:codetwister,项目名称:qfusion,代码行数:43,代码来源:g_misc.cpp


示例18: G_Spawn

/*
* W_Fire_LinearProjectile - Spawn a generic linear projectile without a model, touch func, sound nor mod
*/
static edict_t *W_Fire_LinearProjectile( edict_t *self, vec3_t start, vec3_t angles, int speed,
										float damage, int minKnockback, int maxKnockback, int stun, int minDamage, int radius, int timeout, int timeDelta )
{
	edict_t	*projectile;
	vec3_t dir;

	projectile = G_Spawn();
	VectorCopy( start, projectile->s.origin );
	VectorCopy( start, projectile->s.old_origin );
	VectorCopy( start, projectile->olds.origin );

	VectorCopy( angles, projectile->s.angles );
	AngleVectors( angles, dir, NULL, NULL );
	VectorScale( dir, speed, projectile->velocity );
	GS_SnapVelocity( projectile->velocity );

	projectile->movetype = MOVETYPE_LINEARPROJECTILE;
	projectile->s.linearProjectile = qtrue;

	projectile->r.solid = SOLID_YES;
	projectile->r.clipmask = ( !GS_RaceGametype() ) ? MASK_SHOT : MASK_SOLID;

	projectile->r.svflags = SVF_PROJECTILE;
	// enable me when drawing exception is added to cgame
	projectile->r.svflags |= SVF_TRANSMITORIGIN2;
	VectorClear( projectile->r.mins );
	VectorClear( projectile->r.maxs );
	projectile->s.modelindex = 0;
	projectile->r.owner = self;
	projectile->s.ownerNum = ENTNUM( self );
	projectile->touch = W_Touch_Projectile; //generic one. Should be replaced after calling this func
	projectile->nextThink = level.time + timeout;
	projectile->think = G_FreeEdict;
	projectile->classname = NULL; // should be replaced after calling this func.
	projectile->style = 0;
	projectile->s.sound = 0;
	projectile->timeStamp = level.time;
	projectile->s.linearProjectileTimeStamp = game.serverTime;
	projectile->timeDelta = timeDelta;

	projectile->projectileInfo.minDamage = min( minDamage, damage );
	projectile->projectileInfo.maxDamage = damage;
	projectile->projectileInfo.minKnockback = min( minKnockback, maxKnockback );
	projectile->projectileInfo.maxKnockback = maxKnockback;
	projectile->projectileInfo.stun = stun;
	projectile->projectileInfo.radius = radius;

	GClip_LinkEntity( projectile );

	// update some data required for the transmission
	VectorCopy( projectile->velocity, projectile->s.linearProjectileVelocity );
	projectile->s.team = self->s.team;
	projectile->s.modelindex2 = ( abs( timeDelta ) > 255 ) ? 255 : (unsigned int)abs( timeDelta );
	return projectile;
}
开发者ID:Kaperstone,项目名称:warsow,代码行数:58,代码来源:g_weapon.c


示例19: SP_misc_portal_camera

void SP_misc_portal_camera( edict_t *ent )
{
	VectorClear( ent->r.mins );
	VectorClear( ent->r.maxs );
	GClip_LinkEntity( ent );

	ent->r.svflags = SVF_NOCLIENT;
	ent->count = (int)( st.roll / 360.0f * 256.0f );
	if( st.noents )
		ent->speed = 1;
}
开发者ID:codetwister,项目名称:qfusion,代码行数:11,代码来源:g_misc.cpp


示例20: AITools_DrawColorLine

//==========================================
// AITools_DrawColorLine
// Just so I don't hate to write the event every time
//==========================================
void AITools_DrawColorLine( vec3_t origin, vec3_t dest, int color, int parm )
{
	edict_t	*event;

	event = G_SpawnEvent( EV_PNODE, parm, origin );
	event->s.colorRGBA = color;
	event->r.svflags = SVF_TRANSMITORIGIN2;
	VectorCopy( dest, event->s.origin2 );
	G_SetBoundsForSpanEntity( event, 8 );
	GClip_LinkEntity( event );
}
开发者ID:Clever-Boy,项目名称:qfusion,代码行数:15,代码来源:ai_tools.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GDALCheckDatasetDimensions函数代码示例发布时间:2022-05-30
下一篇:
C++ GC_printf函数代码示例发布时间: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