I don't want to post the whole file because I really haven't changed
anything else and that would be massive, so here's the tidbit i'm
working with. The whole file is c_effects.cpp if you need to see the
rest.
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() < 99 )
{
if ( RandomInt( 0, 100 ) <
r_RainSplashPercentage.GetInt() )
{
trace_t trace;
UTIL_TraceLine(vOldPos, pParticle->m_Pos, MASK_ALL, NULL,
COLLISION_GROUP_NONE, &trace);
if( trace.fraction < 1 || trace.DidHit() )
{
if ( RandomInt( 0, 100 ) <= r_RainSplashPercentage.GetInt() )
DispatchParticleEffect( "rain_splash", 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;
}
On Wed, May 19, 2010 at 11:08 PM, Nick <[email protected]> wrote:
> post all of your code, that way we can help easier.
>
> On Wed, May 19, 2010 at 6:05 PM, James K <[email protected]> wrote:
>> Yup.
>>
>> On Wed, May 19, 2010 at 6:22 PM, Saul Rennison <[email protected]>
>> wrote:
>>> Just to make sure: the displacements DO have hull, ray and physics
>>> collisions enabled in Hammer, don't they?
>>>
>>> Thanks,
>>> - Saul.
>>>
>>>
>>> On 19 May 2010 21:41, James K <[email protected]> wrote:
>>>
>>>> It's still not working, even with this new code. This is really really
>>>> stupid.
>>>>
>>>> James
>>>>
>>>> On Wed, May 19, 2010 at 2:57 AM, Tony "omega" Sergi <[email protected]>
>>>> wrote:
>>>> > It also doesn't help that you're only doing the trace when the random
>>>> value
>>>> > is within the current limit.
>>>> > You need to do the check ALL the time, regardless of if it will actually
>>>> > spawn it or not.
>>>> > Displacements are a single plane, chances are you're repeatedly skipping
>>>> the
>>>> > actual check 99% of the time.
>>>> > Your original code was correct except for the order. ie: new code:
>>>> >
>>>> > trace_t trace;
>>>> > UTIL_TraceLine(vOldPos, pParticle->m_Pos, MASK_ALL, NULL,
>>>> > COLLISION_GROUP_NPC, &trace);
>>>> > if( trace.fraction < 1 || trace.DidHit() )
>>>> > {
>>>> > if ( RandomInt( 0, 100 ) <= r_RainSplashPercentage.GetInt() )
>>>> > DispatchParticleEffect( "spash", trace.endpos,
>>>> > trace.m_pEnt->GetAbsAngles() , NULL );
>>>> > }
>>>> >
>>>> > Also, you can verify it if you set r_RainSplashPercentage to 101 (because
>>>> > even if you set it to 100, it would never trace as it would HAVE to be
>>>> below
>>>> > the value.)
>>>> > -Tony
>>>> >
>>>> > On Wed, May 19, 2010 at 2:59 PM, Ryan Sheffer <[email protected]>
>>>> wrote:
>>>> >
>>>> >> Try shooting a trace right to the ground from the starting point and see
>>>> if
>>>> >> you can hit the displacment. You might be passing right through it on
>>>> your
>>>> >> checks.
>>>> >> I don't remember having problems tracing to displacements myself, so I
>>>> find
>>>> >> this sort of odd. Another thing to consider are the collision options
>>>> for
>>>> >> displacements.
>>>> >>
>>>> >> On Tue, May 18, 2010 at 4:08 PM, James K <[email protected]> wrote:
>>>> >>
>>>> >> > With the new code it will collide only with thick brushes. With the
>>>> >> > old code it collided with both.
>>>> >> >
>>>> >> > On Tue, May 18, 2010 at 6:54 PM, Tobias Kammersgaard
>>>> >> > <[email protected]> wrote:
>>>> >> > > Does it collide with thin brushes?
>>>> >> > >
>>>> >> > > Den 19/05/2010 00.38 skrev "James K" <[email protected]>:
>>>> >> > >
>>>> >> > > Still a no go with your code. Tried MASK_SOLID and
>>>> >> > > COLLISION_GROUP_NONE too, still not working.
>>>> >> > >
>>>> >> > > Blargh.
>>>> >> > >
>>>> >> > >
>>>> >> > > On Tue, May 18, 2010 at 12:33 AM, Ryan Sheffer <[email protected]
>>>> >
>>>> >> > wrote:
>>>> >> > >> Hmm, you could check ...
>>>> >> > > _______________________________________________
>>>> >> > > To unsubscribe, edit your list preferences, or view the list
>>>> archives,
>>>> >> > please visit:
>>>> >> > > http://list.valvesoftware.com/mailman/listinfo/hlcoders
>>>> >> > >
>>>> >> > >
>>>> >> >
>>>> >> > _______________________________________________
>>>> >> > To unsubscribe, edit your list preferences, or view the list archives,
>>>> >> > please visit:
>>>> >> > http://list.valvesoftware.com/mailman/listinfo/hlcoders
>>>> >> >
>>>> >> >
>>>> >>
>>>> >>
>>>> >> --
>>>> >> ~Ryan ( skidz )
>>>> >> _______________________________________________
>>>> >> To unsubscribe, edit your list preferences, or view the list archives,
>>>> >> please visit:
>>>> >> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>>>> >>
>>>> >>
>>>> >
>>>> >
>>>> > --
>>>> > -Tony
>>>> > _______________________________________________
>>>> > To unsubscribe, edit your list preferences, or view the list archives,
>>>> please visit:
>>>> > http://list.valvesoftware.com/mailman/listinfo/hlcoders
>>>> >
>>>> >
>>>>
>>>> _______________________________________________
>>>> To unsubscribe, edit your list preferences, or view the list archives,
>>>> please visit:
>>>> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>>>>
>>>>
>>> _______________________________________________
>>> To unsubscribe, edit your list preferences, or view the list archives,
>>> please visit:
>>> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>>>
>>>
>>
>> _______________________________________________
>> To unsubscribe, edit your list preferences, or view the list archives,
>> please visit:
>> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>>
>>
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives, please
> visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders