View Single Post
Garey
Member
Join Date: Feb 2008
Location: Russian Federation
Old 09-12-2018 , 16:17   Re: ROG - A better random origin generator[UPDATED]
Reply With Quote #21

About steep surfaces: You always can do something like that:
PHP Code:
         //Detect the floor, so we don't spawn the player in air
        
FloorOrigin[0] = RandomOrigin[0]
        
FloorOrigin[1] = RandomOrigin[1]
        
FloorOrigin[2] = -8192.0
        
        engfunc
(EngFunc_TraceLineRandomOriginFloorOriginDONT_IGNORE_MONSTERS00)
        
get_tr2(0TR_vecEndPosRandomOrigin)
        
get_tr2(0TR_vecPlaneNormalplaneNormal)
        
// If we hit a steep plane
        
if(planeNormal[2] < 0.7)
            continue; 
__________________
Sorry for my bad english
Garey is offline
Send a message via ICQ to Garey