AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Solved Test for a Hit with the Skybox? (https://forums.alliedmods.net/showthread.php?t=319071)

DJPlaya 10-08-2019 18:10

Test for a Hit with the Skybox?
 
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

Pelipoika 10-08-2019 18:47

Re: Test for a Hit with the Skybox?
 
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);
        }


DJPlaya 10-09-2019 08:47

Re: Test for a Hit with the Skybox?
 
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


All times are GMT -4. The time now is 04:17.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.