void CSDKPlayer::MoveToNextIntroCamera() { m_pIntroCamera = gEntList.FindEntityByClassname( m_pIntroCamera, "point_viewcontrol" ); // if m_pIntroCamera is NULL we just were at end of list, start searching from start again if(!m_pIntroCamera) m_pIntroCamera = gEntList.FindEntityByClassname(m_pIntroCamera, "point_viewcontrol"); // find the target CBaseEntity *Target = NULL; if( m_pIntroCamera ) { Target = gEntList.FindEntityByName( NULL, STRING(m_pIntroCamera->m_target) ); } // if we still couldn't find a camera, goto T spawn if(!m_pIntroCamera) m_pIntroCamera = gEntList.FindEntityByClassname(m_pIntroCamera, "info_player_terrorist"); SetViewOffset( vec3_origin ); // no view offset UTIL_SetSize( this, vec3_origin, vec3_origin ); // no bbox if( !Target ) //if there are no cameras(or the camera has no target, find a spawn point and black out the screen { if ( m_pIntroCamera.IsValid() ) SetAbsOrigin( m_pIntroCamera->GetAbsOrigin() + VEC_VIEW ); SetAbsAngles( QAngle( 0, 0, 0 ) ); m_pIntroCamera = NULL; // never update again return; } Vector vCamera = Target->GetAbsOrigin() - m_pIntroCamera->GetAbsOrigin(); Vector vIntroCamera = m_pIntroCamera->GetAbsOrigin(); VectorNormalize( vCamera ); QAngle CamAngles; VectorAngles( vCamera, CamAngles ); SetAbsOrigin( vIntroCamera ); SetAbsAngles( CamAngles ); SnapEyeAngles( CamAngles ); m_fIntroCamTime = gpGlobals->curtime + 6; }
//----------------------------------------------------------------------------- // Purpose: Orient the projectile along its velocity //----------------------------------------------------------------------------- void CBaseProjectile::FlyThink( void ) { QAngle angles; VectorAngles( -(GetAbsVelocity()), angles ); SetAbsAngles( angles ); SetNextThink( gpGlobals->curtime + 0.1f ); }
//----------------------------------------------------------------------------- // Purpose: // Input : *pOther - //----------------------------------------------------------------------------- void CRocket_Turret_Projectile::MissileTouch( CBaseEntity *pOther ) { Assert( pOther ); Vector vVel = GetAbsVelocity(); // Touched a launcher, and is heading towards that launcher if ( FClassnameIs( pOther, "npc_rocket_turret" ) ) { Dissolve( NULL, gpGlobals->curtime + 0.1f, false, ENTITY_DISSOLVE_NORMAL ); Vector vBounceVel = Vector( -vVel.x, -vVel.y, 200 ); SetAbsVelocity ( vBounceVel * 0.1f ); QAngle vBounceAngles; VectorAngles( vBounceVel, vBounceAngles ); SetAbsAngles ( vBounceAngles ); SetLocalAngularVelocity ( QAngle ( 180, 90, 45 ) ); UTIL_Remove ( m_hRocketTrail ); SetSolid ( SOLID_NONE ); if( m_hRocketTrail ) { m_hRocketTrail->SetLifetime(0.1f); m_hRocketTrail = NULL; } return; } // Don't touch triggers (but DO hit weapons) if ( pOther->IsSolidFlagSet(FSOLID_TRIGGER|FSOLID_VOLUME_CONTENTS) && pOther->GetCollisionGroup() != COLLISION_GROUP_WEAPON ) return; Explode(); }
void C_PortalGhostRenderable::PerFrameUpdate( void ) { if( m_pGhostedRenderable ) { SetModelName( m_pGhostedRenderable->GetModelName() ); SetModelIndex( m_pGhostedRenderable->GetModelIndex() ); SetEffects( m_pGhostedRenderable->GetEffects() | EF_NOINTERP ); m_flAnimTime = m_pGhostedRenderable->m_flAnimTime; if( m_bSourceIsBaseAnimating ) { C_BaseAnimating *pSource = (C_BaseAnimating *)m_pGhostedRenderable; SetCycle( pSource->GetCycle() ); SetSequence( pSource->GetSequence() ); m_nBody = pSource->m_nBody; m_nSkin = pSource->m_nSkin; } } // Set position and angles relative to the object it's ghosting Vector ptNewOrigin = m_matGhostTransform * m_pGhostedRenderable->GetAbsOrigin(); QAngle qNewAngles = TransformAnglesToWorldSpace( m_pGhostedRenderable->GetAbsAngles(), m_matGhostTransform.As3x4() ); SetAbsOrigin( ptNewOrigin ); SetAbsAngles( qNewAngles ); AddEffects( EF_NOINTERP ); RemoveFromInterpolationList(); g_pClientLeafSystem->RenderableChanged( RenderHandle() ); }
void CRotDoor :: OnClearParent( void ) { matrix4x4 parent = GetParentToWorldTransform(); matrix4x4 angle1 = parent.ConcatTransforms( matrix4x4( g_vecZero, m_vecAngle1 )); angle1.GetAngles( m_vecAngle1 ); // just recalc angle2 without transforms m_vecAngle2 = m_vecAngle1 + pev->movedir * m_flMoveDistance; // update angles if needed if( GetState() == STATE_ON ) SetAbsAngles( m_vecAngle2 ); else if( GetState() == STATE_OFF ) SetAbsAngles( m_vecAngle1 ); }
void CWateryDeathLeech::Spawn( void ) { Precache(); BaseClass::Spawn(); SetSolid ( SOLID_NONE ); SetMoveType( MOVETYPE_NONE ); AddEffects( EF_NOSHADOW ); SetModel( "models/leech.mdl" ); SetThink( &CWateryDeathLeech::LeechThink ); SetNextThink( gpGlobals->curtime + 0.1 ); m_flPlaybackRate = random->RandomFloat( 0.5, 1.5 ); SetCycle( random->RandomFloat( 0.0f, 0.9f ) ); QAngle vAngle; vAngle[YAW] = random->RandomFloat( 0, 360 ); SetAbsAngles( vAngle ); m_iFadeState = 1; SetRenderColorA( 1 ); }
void CPlantedC4::Init( CCSPlayer *pevOwner, Vector vecStart, QAngle vecAngles ) { SetMoveType( MOVETYPE_NONE ); SetSolid( SOLID_NONE ); SetModel( PLANTED_C4_MODEL ); // Change this to c4 model SetCollisionBounds( Vector( 0, 0, 0 ), Vector( 8, 8, 8 ) ); SetAbsOrigin( vecStart ); SetAbsAngles( vecAngles ); SetOwnerEntity( pevOwner ); // Detonate in "time" seconds SetThink( &CPlantedC4::C4Think ); SetNextThink( gpGlobals->curtime + 0.1f ); m_flTimerLength = mp_c4timer.GetInt(); m_flC4Blow = gpGlobals->curtime + m_flTimerLength; m_flNextDefuse = 0; m_bStartDefuse = false; m_bBombTicking = true; SetFriction( 0.9 ); m_flDefuseLength = 0.0f; SpawnControlPanels(); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void C_BaseEntity::PhysicsCustom() { PhysicsCheckWater(); // regular thinking if ( !PhysicsRunThink() ) return; // Moving upward, off the ground, or resting on something that isn't ground if ( m_vecVelocity[2] > 0 || !GetGroundEntity() || !GetGroundEntity()->IsStandable() ) { SetGroundEntity( NULL ); } // NOTE: The entity must set the position, angles, velocity in its custom movement Vector vecNewPosition = GetAbsOrigin(); if ( vecNewPosition == vec3_origin ) { // Shouldn't be at world origin Assert( 0 ); } Vector vecNewVelocity = m_vecVelocity; QAngle angNewAngles = GetAbsAngles(); QAngle angNewAngVelocity = m_vecAngVelocity; PerformCustomPhysics( &vecNewPosition, &vecNewVelocity, &angNewAngles, &angNewAngVelocity ); // Store off all of the new state information... m_vecVelocity = vecNewVelocity; SetAbsAngles( angNewAngles ); m_vecAngVelocity = angNewAngVelocity; Vector move; VectorSubtract( vecNewPosition, GetAbsOrigin(), move ); // move origin trace_t trace; PhysicsPushEntity( move, &trace ); PhysicsCheckVelocity(); if (trace.allsolid) { // entity is trapped in another solid // UNDONE: does this entity needs to be removed? VectorCopy (vec3_origin, m_vecVelocity); VectorCopy (vec3_angle, m_vecAngVelocity); return; } #if !defined( CLIENT_DLL ) if (pev->free) return; #endif // check for in water PhysicsCheckWaterTransition(); }
void CPropAPC2::Materialize( void ) { //trace_t tr; //UTIL_TraceHull( m_vOriginalSpawnOrigin, m_vOriginalSpawnOrigin, Vector(-38,-38,-38),Vector(38,38,38), MASK_SOLID, this, COLLISION_GROUP_NONE, &tr ); //if ( (tr.startsolid || tr.allsolid) && m_iSpawnTry<3 ) //{ // //Try again in a second. // SetContextThink(&QUA_Strider::Materialize, gpGlobals->curtime + 1.0f, "RESPAWNING" ); // SetNextThink( gpGlobals->curtime + 1.0f ); // m_iSpawnTry++; // return; //} SetAbsOrigin( InicialSpawn ); SetAbsAngles( InicialAngle ); KeyValue( "model", "models/combine_apc.mdl" ); KeyValue( "solid", "6" ); KeyValue( "targetname", "elapc" ); KeyValue( "vehiclescript", "scripts/vehicles/apc.txt" ); Teleport( &InicialSpawn, &InicialAngle, NULL ); Spawn(); Activate(); SetThink( &CPropAPC2::Think ); SetNextThink( gpGlobals->curtime); }
bool CBoneFollower::Init( CBaseEntity *pOwner, const char *pModelName, solid_t &solid, const Vector &position, const QAngle &orientation ) { SetOwnerEntity( pOwner ); UTIL_SetModel( this, pModelName ); m_fEffects |= EF_NODRAW; // invisible #if VISUALIZE_FOLLOWERS_BOUNDINGBOX m_debugOverlays |= OVERLAY_BBOX_BIT; #endif m_modelIndex = modelinfo->GetModelIndex( pModelName ); m_solidIndex = solid.index; SetAbsOrigin( position ); SetAbsAngles( orientation ); SetMoveType( MOVETYPE_PUSH ); SetSolid( SOLID_VPHYSICS ); SetCollisionGroup( pOwner->GetCollisionGroup() ); AddSolidFlags( FSOLID_CUSTOMRAYTEST | FSOLID_CUSTOMBOXTEST ); solid.params.pGameData = (void *)this; IPhysicsObject *pPhysics = VPhysicsInitShadow( false, false, &solid ); if ( !pPhysics ) return false; pPhysics->SetCallbackFlags( pPhysics->GetCallbackFlags() | CALLBACK_GLOBAL_TOUCH ); pPhysics->EnableGravity( false ); return true; }
//----------------------------------------------------------------------------- // Purpose: Performs a takeoff. Called via an animation event at the moment // our feet leave the ground. // Input : pGoalEnt - The entity that we are going to fly toward. //----------------------------------------------------------------------------- void CNPC_Crow::Takeoff( const Vector &vGoal ) { if ( vGoal != vec3_origin ) { // // Lift us off ground so engine doesn't instantly reset FL_ONGROUND. // UTIL_SetOrigin( this, GetAbsOrigin() + Vector( 0 , 0 , 1 )); // // Fly straight at the goal entity at our maximum airspeed. // Vector vecMoveDir = vGoal - GetAbsOrigin(); VectorNormalize( vecMoveDir ); // FIXME: pitch over time SetFlyingState( FlyState_Flying ); QAngle angles; VectorAngles( vecMoveDir, angles ); SetAbsAngles( angles ); SetAbsVelocity( vecMoveDir * CROW_TAKEOFF_SPEED ); } }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CNPC_VehicleDriver::PrescheduleThink( void ) { if ( !m_hVehicleEntity ) { m_pVehicleInterface = NULL; UTIL_Remove( this ); return; } // Keep up with my vehicle SetAbsOrigin( m_hVehicleEntity->WorldSpaceCenter() ); SetAbsAngles( m_hVehicleEntity->GetAbsAngles() ); BaseClass::PrescheduleThink(); if ( m_NPCState == NPC_STATE_IDLE ) { m_pVehicleInterface->NPC_Brake(); return; } // If we've been picked up by something (dropship probably), abort. if ( m_hVehicleEntity->GetParent() ) { SetState( NPC_STATE_IDLE ); ClearWaypoints(); SetGoalEnt( NULL ); return; } DriveVehicle(); }
//----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void CGrappleHook::FlyThink(void) { QAngle angNewAngles; VectorAngles(GetAbsVelocity(), angNewAngles); SetAbsAngles(angNewAngles); SetNextThink(gpGlobals->curtime + 0.1f); }
void CSpiral::Think( void ) { float time = gpGlobals->time - pev->dmgtime; while ( time > SPIRAL_INTERVAL ) { Vector position = GetAbsOrigin(); Vector direction = Vector( 0, 0, 1 ); float fraction = 1.0 / pev->speed; float radius = (pev->scale * pev->health) * fraction; position.z += (pev->health * pev->dmg) * fraction; Vector vecAngles = GetAbsAngles(); vecAngles.y = (pev->health * 360 * 8) * fraction; SetAbsAngles( vecAngles ); UTIL_MakeVectors( GetAbsAngles() ); position = position + gpGlobals->v_forward * radius; direction = (direction + gpGlobals->v_forward).Normalize(); StreakSplash( position, Vector(0,0,1), RANDOM_LONG(8,11), 20, RANDOM_LONG(50,150), 400 ); // Jeez, how many counters should this take ? :) pev->dmgtime += SPIRAL_INTERVAL; pev->health += SPIRAL_INTERVAL; time -= SPIRAL_INTERVAL; } pev->nextthink = gpGlobals->time; if ( pev->health >= pev->speed ) UTIL_Remove( this ); }
//----------------------------------------------------------------------------- // Purpose: This stops its motion in the skybox //----------------------------------------------------------------------------- void CEnvHeadcrabCanister::HeadcrabCanisterSkyboxOnlyThink( void ) { Vector vecEndPosition; QAngle vecEndAngles; m_Shared.GetPositionAtTime( gpGlobals->curtime, vecEndPosition, vecEndAngles ); UTIL_SetOrigin( this, vecEndPosition ); SetAbsAngles( vecEndAngles ); if ( !HasSpawnFlags( SF_NO_IMPACT_SOUND ) ) { CPASAttenuationFilter filter( this, ATTN_NONE ); EmitSound( filter, entindex(), "HeadcrabCanister.SkyboxExplosion" ); } if ( m_nSkyboxCannisterCount != 0 ) { if ( --m_nSkyboxCannisterCount <= 0 ) { SetThink( NULL ); return; } } float flRefireTime = random->RandomFloat( m_flMinRefireTime, m_flMaxRefireTime ) + ENV_HEADCRABCANISTER_TRAIL_TIME; SetThink( &CEnvHeadcrabCanister::HeadcrabCanisterSkyboxRestartThink ); SetNextThink( gpGlobals->curtime + flRefireTime ); }
//----------------------------------------------------------------------------- // Purpose: These will be useful for weapon_manhack //----------------------------------------------------------------------------- void CPropVehicleManhack::ForcePlayerIn(CBaseEntity *pOwner) { CBasePlayer *pPlayer = ToBasePlayer( pOwner ); if ( !pPlayer || m_hPlayer ) return; if (pPlayer->GetFlags() & FL_DUCKING) { m_bDriverDucked=true; DevMsg("Player ducking\n"); } else m_bDriverDucked=false; //TERO: Lets move the vehicle where we are standing QAngle vehicleStartAngle = QAngle(0, pPlayer->GetAbsAngles().y, 0); SetAbsAngles(vehicleStartAngle); SetAbsOrigin(pPlayer->GetAbsOrigin()); // Make sure we successfully got in the vehicle if ( pPlayer->GetInVehicle( GetServerVehicle(), VEHICLE_ROLE_DRIVER ) == false ) { // The player was unable to enter the vehicle and the output has failed // int falseGetInVehicle=0; Assert( 0 ); //muista vaihtaa tuohon nolla sitten kun poistat intin; return; } }
//----------------------------------------------------------------------------- // Purpose: This think function simulates (moves/collides) the HeadcrabCanister while in // the world. //----------------------------------------------------------------------------- void CEnvHeadcrabCanister::HeadcrabCanisterWorldThink( void ) { // Get the current time. float flTime = gpGlobals->curtime; Vector vecStartPosition = GetAbsOrigin(); // Update HeadcrabCanister position for swept collision test. Vector vecEndPosition; QAngle vecEndAngles; m_Shared.GetPositionAtTime( flTime, vecEndPosition, vecEndAngles ); if ( !m_bIncomingSoundStarted && !HasSpawnFlags( SF_NO_IMPACT_SOUND ) ) { float flDistSq = ENV_HEADCRABCANISTER_INCOMING_SOUND_TIME * m_Shared.m_flFlightSpeed; flDistSq *= flDistSq; if ( vecEndPosition.DistToSqr(m_vecImpactPosition) <= flDistSq ) { // Figure out if we're close enough to play the incoming sound EmitSound( "HeadcrabCanister.IncomingSound" ); m_bIncomingSoundStarted = true; } } TestForCollisionsAgainstEntities( vecEndPosition ); if ( m_Shared.DidImpact( flTime ) ) { if ( !m_bHasDetonated ) { Detonate(); m_bHasDetonated = true; } if ( !HasSpawnFlags( SF_REMOVE_ON_IMPACT ) ) { Landed(); } return; } // Always move full movement. SetAbsOrigin( vecEndPosition ); // Touch triggers along the way PhysicsTouchTriggers( &vecStartPosition ); SetNextThink( gpGlobals->curtime + 0.2f ); SetAbsAngles( vecEndAngles ); if ( !m_bHasDetonated ) { if ( vecEndPosition.DistToSqr( m_vecImpactPosition ) < BoundingRadius() * BoundingRadius() ) { Detonate(); m_bHasDetonated = true; } } }
//------------------------------------------------------------------------------ // Input values //------------------------------------------------------------------------------ void CBaseHelicopter::InputSetAngles( inputdata_t &inputdata ) { const char *pAngles = inputdata.value.String(); QAngle angles; UTIL_StringToVector( angles.Base(), pAngles ); SetAbsAngles( angles ); }
//----------------------------------------------------------------------------- // Compute position //----------------------------------------------------------------------------- void C_EnvHeadcrabCanister::ClientThink() { Vector vecEndPosition; QAngle vecEndAngles; m_Shared.GetPositionAtTime( gpGlobals->curtime, vecEndPosition, vecEndAngles ); SetAbsOrigin( vecEndPosition ); SetAbsAngles( vecEndAngles ); }
void CSpiral::Spawn( void ) { pev->movetype = MOVETYPE_NONE; pev->nextthink = gpGlobals->time; pev->solid = SOLID_NOT; UTIL_SetSize(pev, g_vecZero, g_vecZero ); pev->effects |= EF_NODRAW; SetAbsAngles( g_vecZero ); }
void CSpriteOriented::Spawn( void ) { // save a copy of the angles, CSprite swaps the yaw and roll QAngle angles = GetAbsAngles(); BaseClass::Spawn(); // ORIENTED sprites "forward" vector points in the players "view" direction, not the direction "out" from the sprite (gah) angles.y = anglemod( angles.y + 180 ); SetAbsAngles( angles ); }
virtual ActionResult<CTFBot> Update(CTFBot *actor, float dt) override { TRACE("[this: %08x] [actor: #%d]", (uintptr_t)this, ENTINDEX(actor)); if (this->m_hHint == nullptr) { return ActionResult<CTFBot>::Done("No hint entity"); } INextBot *nextbot = rtti_cast<INextBot *>(actor); if (nextbot->IsRangeGreaterThan(this->m_hHint->GetAbsOrigin(), 25.0f)) { TRACE_MSG("range_to_hint > 25: pathing\n"); if (this->m_ctRecomputePath.IsElapsed()) { TRACE_MSG("recomputing path\n"); this->m_ctRecomputePath.Start(RandomFloat(1.0f, 2.0f)); CTFBotPathCost cost_func(actor, FASTEST_ROUTE); this->m_PathFollower.Compute(nextbot, this->m_hHint->GetAbsOrigin(), cost_func, 0.0f, true); } this->m_PathFollower.Update(nextbot); if (!this->m_PathFollower.IsValid()) { return ActionResult<CTFBot>::Done("Path failed"); } return ActionResult<CTFBot>::Continue(); } TRACE_MSG("at hint: creating dispenser entity\n"); CBaseEntity *ent = CreateEntityByName("obj_dispenser"); if (ent == nullptr) { return ActionResult<CTFBot>::Done("Couldn't create entity"); } auto dispenser = rtti_cast<CObjectDispenser *>(ent); dispenser->SetName(this->m_hHint->GetEntityName()); dispenser->m_nDefaultUpgradeLevel = 2; dispenser->SetAbsOrigin(this->m_hHint->GetAbsOrigin()); dispenser->SetAbsAngles(this->m_hHint->GetAbsAngles()); dispenser->Spawn(); dispenser->StartPlacement(actor); suppress_speak = true; dispenser->StartBuilding(actor); suppress_speak = false; this->m_hHint->SetOwnerEntity(dispenser); actor->SpeakConceptIfAllowed(MP_CONCEPT_BUILDING_OBJECT, "objtype:dispenser"); return ActionResult<CTFBot>::Done("Built a dispenser"); }
void CNPC_Hydra::Spawn() { Precache(); BaseClass::Spawn(); SetModel( "models/Hydra.mdl" ); SetHullType(HULL_HUMAN); SetHullSizeNormal(); SetSolid( SOLID_BBOX ); AddSolidFlags( FSOLID_NOT_STANDABLE ); SetMoveType( MOVETYPE_STEP ); SetBloodColor( BLOOD_COLOR_RED ); ClearEffects(); m_iHealth = 20; m_flFieldOfView = -1.0;// indicates the width of this NPC's forward view cone ( as a dotproduct result ) m_NPCState = NPC_STATE_NONE; GetVectors( NULL, NULL, &m_vecOutward ); SetAbsAngles( QAngle( 0, 0, 0 ) ); m_vecChain.Set( 0, GetAbsOrigin( ) - m_vecOutward * 32 ); m_vecChain.Set( 1, GetAbsOrigin( ) + m_vecOutward * 16 ); m_vecHeadGoal = m_vecChain[1] + m_vecOutward * HYDRA_OUTWARD_BIAS; m_vecHeadDir = Vector( 0, 0, 1 ); // init bones HydraBone bone; bone.flActualLength = 0.0f; bone.vecGoalPos = Vector(0.0f, 0.0f, 0.0f); bone.vecPos = GetAbsOrigin( ) - m_vecOutward * HYDRA_INWARD_BIAS; m_body.AddToTail( bone ); bone.vecPos = m_vecChain[1]; m_body.AddToTail( bone ); bone.vecPos = m_vecHeadGoal; m_body.AddToTail( bone ); bone.vecPos = m_vecHeadGoal + m_vecHeadDir; m_body.AddToTail( bone ); m_idealSegmentLength = sv_hydraSegmentLength.GetFloat(); for (int i = 2; i < CHAIN_LINKS; i++) { m_vecChain.Set( i, m_vecChain[i-1] ); } m_seed = random->RandomFloat( 0.0, 2000.0 ); NPCInit(); m_takedamage = DAMAGE_NO; }
void CBoneFollower::VPhysicsUpdate( IPhysicsObject *pPhysics ) { Vector origin; QAngle angles; pPhysics->GetPosition( &origin, &angles ); SetAbsOrigin( origin ); SetAbsAngles( angles ); }
void CDODBaseRocket::FlyThink( void ) { QAngle angles; VectorAngles( GetAbsVelocity(), angles ); SetAbsAngles( angles ); SetNextThink( gpGlobals->curtime + 0.1f ); }
void CASW_Bait::LayFlat() { return; QAngle angFacing = GetAbsAngles(); if (angFacing[PITCH] > 0 && angFacing[PITCH] < 180.0f) angFacing[PITCH] = 90; else angFacing[PITCH] = 270; SetAbsAngles(angFacing); //Msg("Laying flat to %f, %f, %f\n", angFacing[PITCH], angFacing[YAW], angFacing[ROLL]); }
void QUA_helicopter::GiraIzquierda(void) { if(aclizq==0) return; // Aqui esto no tira, abra que mirarlo bien despues; QAngle angles = GetAbsAngles(); angles.y += 1*(aclizq/1); SetAbsAngles( angles ); /*}*/ }
void QUA_helicopter::GiraDerecha(void) { if(aclder==0) return; // Aqui esto no tira, abra que mirarlo bien despues; QAngle angles = GetAbsAngles(); angles.y -= 1*(aclder/1); SetAbsAngles( angles ); /*}*/ }
void CTFBaseRocket::Simulate( void ) { // Make sure the rocket is facing movement direction. if ( GetMoveType() == MOVETYPE_FLYGRAVITY ) { QAngle angForward; VectorAngles( GetAbsVelocity(), angForward ); SetAbsAngles( angForward ); } BaseClass::Simulate(); }
//----------------------------------------------------------------------------- // Purpose: // Input : flags - // Output : int //----------------------------------------------------------------------------- int C_PropCombineBall::DrawModel( int flags ) { if ( !m_bEmit ) return 0; // Make sure our materials are cached if ( !InitMaterials() ) { //NOTENOTE: This means that a material was not found for the combine ball, so it may not render! AssertOnce( 0 ); return 0; } // Draw the flickering overlay DrawFlicker(); // Draw the motion blur from movement if ( m_bHeld || m_bLaunched ) { DrawMotionBlur(); } // Draw the model if we're being held if ( m_bHeld ) { QAngle angles; VectorAngles( -CurrentViewForward(), angles ); // Always orient towards the camera! SetAbsAngles( angles ); BaseClass::DrawModel( flags ); } else { float color[3]; color[0] = color[1] = color[2] = 1.0f; float sinOffs = 1.0f * sin( gpGlobals->curtime * 25 ); float roll = SpawnTime(); // Draw the main ball body CMatRenderContextPtr pRenderContext( materials ); pRenderContext->Bind( m_pBodyMaterial, (C_BaseEntity*) this ); DrawHaloOriented( GetAbsOrigin(), m_flRadius + sinOffs, color, roll ); } m_vecLastOrigin = GetAbsOrigin(); return 1; }