void CCoreOriginProxy::OnBind( void *pRenderable ) { if( !pRenderable || !m_pSphereOriginTextureVar ) return; IClientRenderable *pRend = ( IClientRenderable* )pRenderable; if ( !pRend ) return; const Vector &origin = pRend->GetRenderOrigin(); m_pSphereOriginTextureVar->SetVecValue(origin[0], origin[1], origin[2], 1); }
//----------------------------------------------------------------------------- // Old-style muzzle flashes //----------------------------------------------------------------------------- void MuzzleFlashCallback( const CEffectData &data ) { Vector vecOrigin = data.m_vOrigin; QAngle vecAngles = data.m_vAngles; if ( data.entindex() > 0 ) { IClientRenderable *pRenderable = data.GetRenderable(); if ( !pRenderable ) return; if ( data.m_nAttachmentIndex ) { //FIXME: We also need to allocate these particles into an attachment space setup pRenderable->GetAttachment( data.m_nAttachmentIndex, vecOrigin, vecAngles ); } else { vecOrigin = pRenderable->GetRenderOrigin(); vecAngles = pRenderable->GetRenderAngles(); } } tempents->MuzzleFlash( vecOrigin, vecAngles, data.m_fFlags & (~MUZZLEFLASH_FIRSTPERSON), data.m_hEntity, (data.m_fFlags & MUZZLEFLASH_FIRSTPERSON) != 0 ); }