Raised This Month: $63 Target: $400
 15% 

Solved Test for a Hit with the Skybox?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DJPlaya
Senior Member
Join Date: Nov 2014
Location: Germany
Old 10-08-2019 , 19:10   Test for a Hit with the Skybox?
Reply With Quote #1

In AMX we where able to use if (PointContents(origin) == -6), but in the Source 2007 they changed that i guess "CONTENTS_SKY doesn't exist in the new engine".

Does someone have an Idea how to realize this properly in SP?


REF
__________________
Free hosting 4 interesting Projects

Last edited by DJPlaya; 10-14-2019 at 09:04.
DJPlaya is offline
Send a message via Skype™ to DJPlaya
Pelipoika
Veteran Member
Join Date: May 2012
Location: Inside
Old 10-08-2019 , 19:47   Re: Test for a Hit with the Skybox?
Reply With Quote #2

Code:
	public bool IsOutside()
	{
		TR_TraceRayFilter(GetAbsOrigin(this.index), view_as<float>( { -90.0, -90.0, -90.0 } ), MASK_SOLID, RayType_Infinite, FilterBaseActorsAndData, this.index);
		
		return !!(TR_GetSurfaceFlags() & SURF_SKY);
	}
__________________
Pelipoika is offline
DJPlaya
Senior Member
Join Date: Nov 2014
Location: Germany
Old 10-09-2019 , 09:47   Re: Test for a Hit with the Skybox?
Reply With Quote #3

Thanks, what a fine Piece of Code.

Say, whats the Difference to SURF_SKY2D? The Description isent that good

SURF_SKY // don't draw, but add to skybox
SURF_SKY2D // don't draw, indicates we should skylight + draw 2d sky but not draw the 3D skybox
__________________
Free hosting 4 interesting Projects

Last edited by DJPlaya; 10-09-2019 at 17:44.
DJPlaya is offline
Send a message via Skype™ to DJPlaya
Reply


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 On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:00.


Powered by vBulletin®
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Theme made by Freecode