It is currently Fri May 31, 2024 6:16 am




void CClient_Precipitation::ClientThink()
{
Simulate( gpGlobals->frametime );
PrecacheParticleSystem("rain_impact");
}inline bool CClient_Precipitation::SimulateRain( CPrecipitationParticle* pParticle, float dt )
{
if (GetRemainingLifetime( pParticle ) < 0.0f)
return false;
Vector vOldPos = pParticle->m_Pos;
// Update position
VectorMA( pParticle->m_Pos, dt, pParticle->m_Velocity,
pParticle->m_Pos );
// wind blows rain around
for ( int i = 0 ; i < 2 ; i++ )
{
if ( pParticle->m_Velocity[i] < s_WindVector[i] )
{
pParticle->m_Velocity[i] += ( 5 / pParticle->m_Mass );
// clamp
if ( pParticle->m_Velocity[i] > s_WindVector[i] )
pParticle->m_Velocity[i] = s_WindVector[i];
}
else if (pParticle->m_Velocity[i] > s_WindVector[i] )
{
pParticle->m_Velocity[i] -= ( 5 / pParticle->m_Mass );
// clamp.
if ( pParticle->m_Velocity[i] < s_WindVector[i] )
pParticle->m_Velocity[i] = s_WindVector[i];
}
}
/*
// No longer in the air? punt.
if ( !IsInAir( pParticle->m_Pos ) )
{
// Possibly make a splash if we hit a water surface and it's in front of the view.
if ( m_Splashes.Count() < 20 )
{
if ( RandomInt( 0, 100 ) < r_RainSplashPercentage.GetInt() )
{
trace_t trace;
UTIL_TraceLine(vOldPos, pParticle->m_Pos, MASK_WATER, NULL, C COLLISION_GROUP_NONE, &trace);
if( trace.fraction < 1 )
{
m_Splashes.AddToTail( trace.endpos );
}
}
}
// Tell the framework it's time to remove the particle from the list
return false;
}*/
/*Tony; the traceline replaces the IsInAir check.
you also don't want the random's to be around the traceline either, or it will only check SOMETIMES. it needs to check _all_ the time.
you also probably want to do some radius checking of the particles position (ignoring z) for if it's in range of the local player to run this code or not
otherwise you will have traces for every particle all over the place even if there's no way that the player can see it
so when the player is out of that radius, you would only use if ( !IsInAir( pParticle->m_Pos ) { return false; }
probably also need to check to make sure that it doesn't splash on sky, too.
*/
trace_t trace;
UTIL_TraceLine(vOldPos, pParticle->m_Pos, MASK_SOLID, this, COLLISION_GROUP_INTERACTIVE, &trace); //Gary; now rain will collide with everything!
if( trace.fraction < 1 || trace.DidHit() )
{
if ( RandomInt( 0, 100 ) <= r_RainSplashPercentage.GetInt() )
DispatchParticleEffect( "rain_impact", trace.endpos,trace.m_pEnt->GetAbsAngles() , NULL );
// Tell the framework it's time to remove the particle from the list
return false;
}
// We still want this particle
return true;
}





jangalomph wrote:Well ASW is alot more supportive in particles. l4d2 uses same engine version "from what i know" and that's how such great FPS is achieved. Their particle system is Newer and much better than our modifiable version. Plus it doesn't matter that we have all source code to ASW because we can't do crap with it.











Gary wrote:Is it not missing all the view model code?
Also, if it were not that difficult to port a HL2 mod to ASW, then why have we not seen someone playing HL2 on the ASW engine?
I'm sure shader support is right behind EP3.


Users browsing this forum: No registered users