Collision Inconsistency in Debug Mode

Archives Forums/Blitz3D Bug Reports/Collision Inconsistency in Debug Mode

Matty(Posted 2005) [#1]
I just realised upon working out how to reproduce this bug that I am not using the command as it was meant to be used BUT there is an inconsistency with the way Blitz handles this issue between debug and non debug mode.

Try the following code NOT in debug mode, then try it in debug mode:
Graphics3D 800,600,32,2
camera=CreateCamera()
plane=CreatePlane()
MoveEntity plane,0,-10,0
EntityColor plane,0,255,0
ball=CreateSphere()
MoveEntity camera,0,0,-20
EntityType ball,1
EntityType plane,2
EntityRadius ball,0.25
Collisions 1,2,2,1

Repeat
TranslateEntity ball,0,vely#,0

vely#=vely#-0.05
For colid=1 To CountCollisions(ball)
	If EntityCollided(ball,2)=CollisionEntity(ball,colid) Then 

	vely#=vely#*-0.7
	
	newx#=CollisionX(ball,colid)+CollisionNX(ball,colid)*0.25
	newy#=CollisionY(ball,colid)+CollisionNY(ball,colid)*0.25
	newz#=CollisionZ(ball,colid)+CollisionNZ(ball,colid)*0.25
	
	EntityType ball,0
	
	;The next line causes program execution to stop in debug mode but not in 'release' mode
	PositionEntity ball,CollisionX(ball,colid)+CollisionNX(ball,colid)*0.25,CollisionY(ball,colid)+CollisionNY(ball,colid)*0.25,CollisionZ(ball,colid)+CollisionNZ(ball,colid)*0.25
	;positionentity ball,newx,newy,newz
	EntityType ball,1


	EndIf 
Next

UpdateWorld
RenderWorld
Flip


Until KeyDown(1)

End 


As you can see - when I change the entitytype of the ball to zero (so that I can move it without generating any collision information briefly) in debug mode it loses the collision list information for the ball. However when not in debug mode it behaves differently - there is no error. I realise that the better way to do what I intended with that sort of code is to use positionentity with the x,y,z values calculated before I set the entitytype to 0.