lfnetwork.com mark read register faq members calendar

Thread: Complete Explanation of trap_Trace Results...
Thread Tools Display Modes
Post a new thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Prev Previous Post   Next Post Next
Old 03-22-2010, 12:30 AM   #1
JaedenRuiner
Rookie
 
Join Date: Apr 2004
Posts: 19
Complete Explanation of trap_Trace Results...

Okay,

I've been working on a mode for some time now, and it is almost ready to be published. The biggest problem i have is that occasionally while moving an item with the force it gets stuck inside the floor or the wall, and my trap_Trace() function is not determining the correct result, thus the sound engine keeps playing the *bounce* sound as if the item is bouncing, but it isn't, it ricocheting back and forth off the top and bottom of the inside of the map face.

So. I would like it if someone could explain in full detail the results of the trap_Trace function (basically what is stored in the trace_t structure)

Like for example:
My predictive trap_trace looks forward along the movement trajectory 24 units. i set the mins to -ITEM_RADIUS and the maxs to ITEM_RADIUS

trap_Trace(&tr, oldOrigin, mins, maxs, compareOrigin, movingEntityNum, MASK_PLAYERSOLID);

in this i check for tr.Fraction !=1 || tr.startsolid || tr.allsolid
however, in some circumstances the startsolid is ill-flagged in this attempts so I do a second trace:
trap_Trace(&tr, oldOrigin, NULL, NULL, compareOrigin, movingEntityNum, MASK_PLAYERSOLID);

If the tr.startsolid is still true, i should cancel the move, meaning i've hit something.

However, this code is not working very well, as you can tell by my posting here and asking about this function. So, could anyone please provide a clear explanation of the results of trap_Trace so that I can understand exactly how to set the mins,maxs bounding boxes for the trace, as well as interpreting:

My object will hit a wall, the floor, the ceiling, a box, a crate, a ledge, a mover, a player, a vehicle, a you-name-it-something-can-not-move-through-this. *smile*

Thanks
Jaeden "Sifo Dyas" al'Raec Ruiner


Jaeden "Sifo Dyas" al'Raec Ruiner
http://www.wayoftheleaf.net
JaedenRuiner is offline   you may: quote & reply,
Post a new thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > JediKnight Series > Editing Central > JA Coding > Complete Explanation of trap_Trace Results...

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:34 AM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.