Inside3D!
     

Not Detecting CONTENT_SOLID With Pointcontents

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
Junrall



Joined: 21 Sep 2009
Posts: 136
Location: North West Oregon, USA

PostPosted: Fri Feb 05, 2010 4:47 am    Post subject: Not Detecting CONTENT_SOLID With Pointcontents Reply with quote

Hello fellow QC'ers,

I'm starting a traceline at waist height and ending at 5 units below self.mins_z and using pointcontents(trace_endpos) to detect contents.
I'm able to get pointcontents to return the values for CONTENT_WATER, CONTENT_SLIME, and CONTENT_LAVA... however, when ever it touches the floor it returns CONTENT_EMPTY instead of CONTENT_SOLID.
Am I using pointcontents improperly? Or should I just use trace_fraction != 1.0?

Thank you in advance!
_________________
Good God! You shot my leg off!
Back to top
View user's profile Send private message
Sajt



Joined: 16 Oct 2004
Posts: 1026

PostPosted: Fri Feb 05, 2010 7:26 pm    Post subject: Reply with quote

.mins and .maxs are relative to the entity's origin. You should add it with the origin, or just use absmin/absmax instead. Although based on your results with water already, I guess you already took care of that.

You're checking pointcontents at the impact position, which in the case of impact is just "on" the surface, which could go either way based on floating-point error and how the engine works. You should push the pointcontents position a little into the surface.

traceline(self.origin, self.absmin - '0 0 5', FALSE, self);
if (trace_fraction < 1)
trace_end_pos = trace_end_pos - '0 0 1';

pointcontents(trace_end_pos) ...
_________________
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Back to top
View user's profile Send private message
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Fri Feb 05, 2010 9:26 pm    Post subject: Reply with quote

traces end 1/32th of a quake unit away from where they hit, so testing such a point will nearly always be empty. There's a veeery slight chance that you can get solid, but it ain't gonna happen until someone else reports it as a bug :P
so yeah, what sajt said
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
Junrall



Joined: 21 Sep 2009
Posts: 136
Location: North West Oregon, USA

PostPosted: Sat Feb 06, 2010 2:34 am    Post subject: Reply with quote

Right on! That was the problem... there are so many little things like this that aren't documented anywhere... well, this one is now documented here on the forums.Wink

Thanks for the tip... and hope that I can return the favor sometime in the future.
_________________
Good God! You shot my leg off!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group