您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GClip_LinkEntity函数代码示例

51自学网 2021-06-01 20:49:38
  C++
这篇教程C++ GClip_LinkEntity函数代码示例写得很实用,希望能帮到您。

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

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


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例21: hurt_use

static void hurt_use( edict_t *self, edict_t *other, edict_t *activator ){	if( self->r.solid == SOLID_NOT )		self->r.solid = SOLID_TRIGGER;	else		self->r.solid = SOLID_NOT;	GClip_LinkEntity( self );	if( !( self->spawnflags & 2 ) )		self->use = NULL;}
开发者ID:codetwister,项目名称:qfusion,代码行数:11,


示例22: SV_PushEntity

/** SV_PushEntity** Does not change the entities velocity at all*/static trace_t SV_PushEntity( edict_t *ent, vec3_t push ) {	trace_t trace;	vec3_t start;	vec3_t end;	int mask;	VectorCopy( ent->s.origin, start );	VectorAdd( start, push, end );retry:	if( ent->r.clipmask ) {		mask = ent->r.clipmask;	} else {		mask = MASK_SOLID;	}	G_Trace4D( &trace, start, ent->r.mins, ent->r.maxs, end, ent, mask, ent->timeDelta );	if( ent->movetype == MOVETYPE_PUSH || !trace.startsolid ) {		VectorCopy( trace.endpos, ent->s.origin );	}	GClip_LinkEntity( ent );	if( trace.fraction < 1.0 ) {		SV_Impact( ent, &trace );		// if the pushed entity went away and the pusher is still there		if( !game.edicts[trace.ent].r.inuse && ent->movetype == MOVETYPE_PUSH && ent->r.inuse ) {			// move the pusher back and try again			VectorCopy( start, ent->s.origin );			GClip_LinkEntity( ent );			goto retry;		}	}	if( ent->r.inuse ) {		GClip_TouchTriggers( ent );	}	return trace;}
开发者ID:Picmip,项目名称:qfusion,代码行数:46,


示例23: G_ProjectileDistancePrestep

/** G_ProjectileDistancePrestep*/static void G_ProjectileDistancePrestep( edict_t *projectile, float distance ){	float speed;	vec3_t dir, dest;	int mask, i;	trace_t	trace;#ifdef PLASMAHACK	vec3_t plasma_hack_start;#endif	if( projectile->movetype != MOVETYPE_TOSS 		&& projectile->movetype != MOVETYPE_LINEARPROJECTILE		&& projectile->movetype != MOVETYPE_BOUNCE 		&& projectile->movetype != MOVETYPE_BOUNCEGRENADE )		return;	if( !distance )		return;	if( ( speed = VectorNormalize2( projectile->velocity, dir ) ) == 0.0f )		return;	mask = ( projectile->r.clipmask ) ? projectile->r.clipmask : MASK_SHOT; // race trick should come set up inside clipmask	if( projectile->movetype == MOVETYPE_LINEARPROJECTILE )		VectorCopy( projectile->s.origin2, projectile->s.origin );#ifdef PLASMAHACK	VectorCopy( projectile->s.origin, plasma_hack_start );#endif	VectorMA( projectile->s.origin, distance, dir, dest );	G_Trace4D( &trace, projectile->s.origin, projectile->r.mins, projectile->r.maxs, dest, projectile->r.owner, mask, projectile->timeDelta );	for( i = 0; i < 3; i++ )		projectile->s.origin[i] = projectile->s.origin2[i] = projectile->olds.origin[i] = projectile->olds.origin2[i] = trace.endpos[i];	GClip_LinkEntity( projectile );	SV_Impact( projectile, &trace );	// set initial water state	if( !projectile->r.inuse )		return;	projectile->waterlevel = ( G_PointContents4D( projectile->s.origin, projectile->timeDelta ) & MASK_WATER ) ? qtrue : qfalse;	// ffs : hack for the plasmagun#ifdef PLASMAHACK	if( projectile->s.type == ET_PLASMA )		if (trap_Cvar_Get( "rs_plasma_hack", "1", CVAR_ARCHIVE )->integer==1)//racesow			W_Plasma_Backtrace( projectile, plasma_hack_start );#endif}
开发者ID:j0ki,项目名称:racesow,代码行数:56,


示例24: trap_Cvar_Get

/** W_Fire_Grenade*/edict_t *W_Fire_Grenade( edict_t *self, vec3_t start, vec3_t angles, int speed, float damage,						int minKnockback, int maxKnockback, int stun, int minDamage, float radius,						int timeout, int mod, int timeDelta, qboolean aim_up ){	edict_t	*grenade;	static cvar_t *g_grenade_gravity = NULL;	if( GS_Instagib() )		damage = 9999;	if( !g_grenade_gravity )		g_grenade_gravity = trap_Cvar_Get( "g_grenade_gravity", "1.3", CVAR_DEVELOPER );	if( aim_up )	{		angles[PITCH] -= 10; // aim some degrees upwards from view dir		// clamp to front side of the player		angles[PITCH] += -90; // rotate to make easier the check		while( angles[PITCH] < -360 ) angles[PITCH] += 360;		clamp( angles[PITCH], -180, 0 );		angles[PITCH] += 90;		while( angles[PITCH] > 360 ) angles[PITCH] -= 360;	}	grenade = W_Fire_TossProjectile( self, start, angles, 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->gravity = g_grenade_gravity->value;	grenade->enemy = NULL;	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:Kaperstone,项目名称:warsow,代码行数:55,


示例25: GClip_SetBrushModel

/** GClip_SetBrushModel* * Also sets mins and maxs for inline bmodels*/void GClip_SetBrushModel( edict_t *ent, char *name ){	struct cmodel_s *cmodel;	if( !name )	{		//racesow		G_Printf( "Warning: GClip_SetBrushModel: NULL model in '%s'", ent->classname ? ent->classname : "no classname/n" );		GClip_UnlinkEntity( ent );		G_FreeEdict( ent );		return;		//!racesow	}	if( !name[0] )	{		ent->s.modelindex = 0;		return;	}	if( name[0] != '*' )	{		ent->s.modelindex = trap_ModelIndex( name );		return;	}	// if it is an inline model, get the size information for it	// world model is special	if( !strcmp( name, "*0" ) )	{		ent->s.modelindex = 0;		cmodel = trap_CM_InlineModel( 0 );		trap_CM_InlineModelBounds( cmodel, ent->r.mins, ent->r.maxs );		return;	}	// racesow: THIS IS A VERY DIRTY "FIX": it assigns normally unreachable models (the ones over MAX_MODELS) to unrelated models..	// normally this only affects buggy maps that otherwise wouldn't load (like amt-freestyle3)	// brush model	//ent->s.modelindex = trap_ModelIndex( name ); // <- This is the unmodified version 	ent->s.modelindex = atoi( name+1 );	// !racesow	assert( ent->s.modelindex == (unsigned int)atoi( name + 1 ) );	cmodel = trap_CM_InlineModel( ent->s.modelindex );	trap_CM_InlineModelBounds( cmodel, ent->r.mins, ent->r.maxs );	GClip_LinkEntity( ent );}
开发者ID:hettoo,项目名称:racesow,代码行数:53,


示例26: SP_path_corner

void SP_path_corner( edict_t *self ){	if( !self->targetname )	{		if( developer->integer )			G_Printf( "path_corner with no targetname at %s/n", vtos( self->s.origin ) );		G_FreeEdict( self );		return;	}	self->r.solid = SOLID_TRIGGER;	self->touch = path_corner_touch;	VectorSet( self->r.mins, -8, -8, -8 );	VectorSet( self->r.maxs, 8, 8, 8 );	self->r.svflags |= SVF_NOCLIENT;	GClip_LinkEntity( self );}
开发者ID:codetwister,项目名称:qfusion,代码行数:17,


示例27: GClip_SetBrushModel

/** GClip_SetBrushModel* * Also sets mins and maxs for inline bmodels*/void GClip_SetBrushModel( edict_t *ent, const char *name ){	struct cmodel_s *cmodel;	if( !name )	{		G_Error( "GClip_SetBrushModel: NULL model in '%s'", 		ent->classname ? ent->classname : "no classname" );		// racesow		GClip_UnlinkEntity( ent );		G_FreeEdict( ent );		return;		// !racesow	}	if( !name[0] )	{		ent->s.modelindex = 0;		return;	}	if( name[0] != '*' )	{		ent->s.modelindex = trap_ModelIndex( name );		return;	}	// if it is an inline model, get the size information for it	// world model is special	if( !strcmp( name, "*0" ) )	{		ent->s.modelindex = 0;		cmodel = trap_CM_InlineModel( 0 );		trap_CM_InlineModelBounds( cmodel, ent->r.mins, ent->r.maxs );		return;	}	// brush model	ent->s.modelindex = trap_ModelIndex( name );	assert( ent->s.modelindex == (unsigned int)atoi( name + 1 ) );	cmodel = trap_CM_InlineModel( ent->s.modelindex );	trap_CM_InlineModelBounds( cmodel, ent->r.mins, ent->r.maxs );	GClip_LinkEntity( ent );}
开发者ID:futurepneu,项目名称:racesow,代码行数:50,


示例28: _FindOrSpawnLaser

/** W_Fire_Lasergun*/edict_t	*W_Fire_Lasergun( edict_t *self, vec3_t start, vec3_t angles, float damage, int knockback, int stun, int range, int mod, int timeDelta ){	edict_t	*laser;	qboolean newLaser;	trace_t	tr;	vec3_t dir;	if( GS_Instagib() )		damage = 9999;	laser = _FindOrSpawnLaser( self, ET_LASERBEAM, &newLaser );	if( newLaser )	{		// the quad start sound is added from the server		if( self->r.client && self->r.client->ps.inventory[POWERUP_QUAD] > 0 )			G_Sound( self, CHAN_AUTO, trap_SoundIndex( S_QUAD_FIRE ), ATTN_NORM );	}	laser_damage = damage;	laser_knockback = knockback;	laser_stun = stun;	laser_attackerNum = ENTNUM( self );	laser_mod = mod;	laser_missed = qtrue;	GS_TraceLaserBeam( &tr, start, angles, range, ENTNUM( self ), timeDelta, _LaserImpact );	laser->r.svflags |= SVF_FORCEOWNER;	VectorCopy( start, laser->s.origin );	AngleVectors( angles, dir, NULL, NULL );	VectorMA( laser->s.origin, range, dir, laser->s.origin2 );	laser->think = G_Laser_Think;	laser->nextThink = level.time + 100;	if( laser_missed && self->r.client )		G_AwardPlayerMissedLasergun( self, mod );	// calculate laser's mins and maxs for linkEntity	G_SetBoundsForSpanEntity( laser, 8 );	GClip_LinkEntity( laser );	return laser;}
开发者ID:Kaperstone,项目名称:warsow,代码行数:48,



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


C++ GDALCheckDatasetDimensions函数代码示例
C++ GC_printf函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。