The command intersect object is too slow for my code. I'm attempting to build a collision function which checks all surrounding areas for a collision. If I set the cameraY position to a fix number then the code is fast enough, however when I attempt to loop through the Y position my FPS drops to almost nothing.
Basically I need another command/method than Intersect Object. Intersect Object is too slow to be looped roughly 75 times per sync.
Here's the segment code:
TIA
Basically I need another command/method than Intersect Object. Intersect Object is too slow to be looped roughly 75 times per sync.
Here's the segment code:
Code:
for x=0 to checks-1
chx#=newxvalue(cx#,x*angwidth,100)
chz#=newzvalue(cz#,x*angwidth,100)
ang#(x,1)=-10000 `So first tempang# is less than ang#
for chy#=cy#-150 to cy# step 2
tempang#=intersect object(currentCollisionObject,cx#,chy#,cz#,chx#,chy#,chz#)
if tempang# < ang#(x,1)
ang#(x,1) = tempang#
endif
next chy#
if ang#(x,1)=0 then ang#(x,1)=999999
ang#(x,2)=x*angwidth
sort#(x,1)=ang#(x,1)
sort#(x,2)=ang#(x,2)
next x
TIA