Quake3World.com Forums
     Programming Discussion
        Using CG_Trace


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




Print view Previous topic | Next topic 
Topic Starter Topic: Using CG_Trace

Warrior
Warrior
Joined: 16 Jun 2005
Posts: 76
PostPosted: 10-29-2005 10:57 PM           Profile Send private message  E-mail  Edit post Reply with quote


Code:
void   CG_Trace( trace_t *result, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end,  int skipNumber, int mask ) {

I think I understand the rest, but what do the mins and maxs parameters do?



_________________
Smokin' Guns
Monster Browser


Top
                 

Gomu Gomu no.....
Gomu Gomu no.....
Joined: 07 Aug 2003
Posts: 1902
PostPosted: 10-30-2005 04:33 AM           Profile Send private message  E-mail  Edit post Reply with quote


It specifies the width of the trace, rather than trace using a line, you can trace with a particular size, and if the sides hit whatever you are tracing for, it will stop.



_________________
-It is not the fall that kills you. It's the sudden stop at the end. (Douglas Adams)-

-An eyeful a day is bloody fantastic!-


Top
                 

Mentor
Mentor
Joined: 12 Mar 2005
Posts: 3958
PostPosted: 10-30-2005 06:09 AM           Profile Send private message  E-mail  Edit post Reply with quote


Think of it as doing a sweep with a bounding box.




Top
                 

Warrior
Warrior
Joined: 16 Jun 2005
Posts: 76
PostPosted: 10-30-2005 04:41 PM           Profile Send private message  E-mail  Edit post Reply with quote


I figured that mins and maxs would specify a box, but I'm not quite sure exactly how. Could someone draw me some ascii art to show?



_________________
Smokin' Guns
Monster Browser


Top
                 

Mentor
Mentor
Joined: 12 Mar 2005
Posts: 3958
PostPosted: 10-31-2005 03:38 AM           Profile Send private message  E-mail  Edit post Reply with quote


Think of the player's bounding box, which is 32x32x64 or (-16, -16, -32)-(16, 16, 32). If you run in a straight line, you're bound to bump into something solid sooner or later. Now that's exactly what CG_Trace() does.




Top
                 

Warrior
Warrior
Joined: 16 Jun 2005
Posts: 76
PostPosted: 10-31-2005 06:46 PM           Profile Send private message  E-mail  Edit post Reply with quote


Thanks. Somehow it didn't occur to me that mins and maxs are actually vectors, not single values. Think I've got it now. :)



_________________
Smokin' Guns
Monster Browser


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.