Quake3World.com Forums
     Programming Discussion
        Making a projectile pass through glass yet leaving a mark


Post new topicReply to topic
Login | Profile | | FAQ | Search | IRC




Print view Previous topic | Next topic 
Topic Starter Topic: Making a projectile pass through glass yet leaving a mark

Grunt
Grunt
Joined: 28 Mar 2014
Posts: 59
PostPosted: 06-10-2014 08:52 AM           Profile Send private message  E-mail  Edit post Reply with quote


The goal is to get a projectile to pass through a nonsolid glass material on a plane or brush, yet leave a mark on it. A couple months ago I dabbled with getting a projectile to pass through a wall and leave a mark, and it was never totally successful. I figured I'd try this again but with only glass, that it should be easier somehow, yet it isn't. Right under where the game does the trace in g_runrocket or whatever, I added:

if ( tr.surfaceFlags & SURF_METAL ) {
G_AddEvent( ent, EV_MISSILE_MISS_GLASS, DirToByte( tr.plane.normal ) );
G_Printf( "work dammmit \n");
}

this is right above the part:
if ( tr.startsolid || tr.allsolid ) {

The idea is if the surface the trace touched is metal (yes surf_metal for now because of problems with adding new surfs), then add the event mostly for the CG effects to occur. In game this does nothing on either a brush or a plane with the glass texture. So back to the question: how would you get the game to detect the type of surface the projectile touched, and how would you tell it to place a mark on that surface while allowing the projectile to continue through it?




Top
                 

Cool #9
Cool #9
Joined: 01 Dec 2000
Posts: 44136
PostPosted: 06-10-2014 10:01 PM           Profile   Send private message  E-mail  Edit post Reply with quote


Isn't this just like a rocket leaving a mark on a wall when it explodes except for that it doesn't explode?




Top
                 

Grunt
Grunt
Joined: 28 Mar 2014
Posts: 59
PostPosted: 06-11-2014 05:22 PM           Profile Send private message  E-mail  Edit post Reply with quote


Yeah I guess that's another way of putting it. It just has to be surface flag specific and as it is it's like it completely disregards the surface type check. I wasn't sure about how to approach this one since my past attempts failed.

The other problem is that the surfaces I'm using are planes the game just ignores any type of collision with planes.




Top
                 
Quake3World.com | Forum Index | Programming Discussion


Post new topic Reply to topic


cron
Quake3World.com
© ZeniMax. Zenimax, QUAKE III ARENA, Id Software and associated trademarks are trademarks of the ZeniMax group of companies. All rights reserved.
This is an unofficial fan website without any affiliation with or endorsement by ZeniMax.
All views and opinions expressed are those of the author.