本文整理汇总了C++中GClip_LinkEntity函数的典型用法代码示例。如果您正苦于以下问题:C++ GClip_LinkEntity函数的具体用法?C++ GClip_LinkEntity怎么用?C++ GClip_LinkEntity使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GClip_LinkEntity函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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 );
}
示例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 );
}
示例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++;
}
}
示例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 );
}
示例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 );
}
示例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 );
}
示例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++;
}
示例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 );
}
示例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 );
}
示例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;
}
示例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 );
}
示例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 );
}
示例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 );
}
示例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 );
}