Hmm, you could check if its in a solid. int contents = enginetrace->GetPointContents( position ); if ( contents & CONTENTS_SOLID ) return false;
Also try other masks like MASK_SOLID and use COLLISION_GROUP_NONE. I imagine you are doing that trace per particle movement and that seems very expensive to me. I would probably do a trace to the ground on creation and get a z value and just have each particle have its own finishing z value. Checking against a vector per check instead of tracing, hull checking, etc is way better imo. I guess you want to make sure it can hit physical props as well, and there are ways of optimizing for that specifically. Anyway, good luck. :) On Mon, May 17, 2010 at 7:03 PM, James K <jimmy4...@gmail.com> wrote: > It's still not creating splashes on displacements. > > The code for creating splashes is found around line 331 in > c_effects.cpp. Here's my modded code for it: > ----------------------- > // 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_SOLID, NULL, > COLLISION_GROUP_PLAYER, &trace); > if( trace.fraction < 1 ) > { > 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; > } > ------------------ > > It's completely ignoring displacements, however. If you visualize the > tracers you can see them going right through the displacements and > hitting the surface below them. > > I'm so frustrated! > > On Mon, May 17, 2010 at 10:46 AM, Ryan Sheffer <darksk...@gmail.com> > wrote: > > Ignore Util_remove, it's specific to his code. The mask and collision > > group should work fine. If not, you need to post all your code. > > > > ~Ryan > > > > On May 16, 2010, at 12:58 PM, James K <jimmy4...@gmail.com> wrote: > > > >> UTIL_Remove is a server thing, isn't it? The code doesn't work because > >> it says it's undefined. > >> > >> I'm more concerned with making the tracer collide with displacements > >> and other dynamic entities, because no matter what I do it won't > >> recognize they're there. The skybox collision isn't a major issue yet. > >> > >> James > >> On Sun, May 16, 2010 at 7:51 AM, Jonathan White > >> <killermonke...@gmail.com> wrote: > >>> Hi James, > >>> > >>> I am going to offer this solution since I don't think you have > >>> nailed down > >>> your problem to exactly what is going on. My guess is that the > >>> trace is > >>> hitting the rain entity itself. I say this because you have not > >>> added the > >>> rain entity a the "ignored entity" and have allowed the trace to hit > >>> ANYTHING. > >>> > >>> Try this code: > >>> > >>> UTIL_TraceLine( vOldPos, pParticle->m_Pos, MASK_SOLID, this, > >>> COLLISION_GROUP_PLAYER, &tr ); > >>> > >>> if( tr.surface.flags & SURF_SKY ) > >>> { > >>> // Game Over, we hit the sky box, remove the mine from the > >>> world > >>> UTIL_Remove(this); > >>> return false; > >>> } > >>> > >>> Right before the collision group is "this" which if function call > >>> is called > >>> in the rain entity class will produce the desired results. > >>> Otherwise you > >>> might have to explicitly call on the rain particle entity > >>> (pParticle)? I am > >>> not sure of your setup at the moment or if you are even using > >>> entities, just > >>> wanted to throw it out there. > >>> > >>> Thanks > >>> Killermonkey > >>> _______________________________________________ > >>> 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 > > -- ~Ryan ( skidz ) _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders