Collisions -sample code-

Archives Forums/Blitz3D Bug Reports/Collisions -sample code-

slenkar(Posted 2005) [#1]


the disc stops short of the other disc even though it should touch

the problem seems to be with the Y argument of the entityradius.


Beaker(Posted 2005) [#2]
See my reply here:
http://www.blitzbasic.com/Community/posts.php?topic=50255


slenkar(Posted 2005) [#3]
hmm, looks like Ill have to just re-design the game.....


Rottbott(Posted 2005) [#4]
I just came here to report this bug myself. It's a big problem. The collision works just fine if the Y-radius is larger than the X-radius, but not the other way round. Here's my test code:

Graphics3D 800, 600, 0, 2

CreateCamera()
CreateLight()

S = CreateSphere(12)
ScaleMesh S, 2, 1, 2
PositionEntity S, 0, -2, 8
EntityColor S, 0, 255, 0
EntityRadius S, 1, 2
EntityType S, 1

S = CreateSphere(12)
ScaleMesh S, 2, 1, 2
PositionEntity S, 0, 4, 8
EntityColor S, 0, 0, 255
EntityRadius S, 1, 2
EntityType S, 1

Collisions 1, 1, 1, 1

While Not KeyHit(1)

	If KeyDown(57) Then MoveEntity S, 0, -0.1, 0

	UpdateWorld
	RenderWorld
	Flip

Wend
End


I think that if this collision isn't going to work in all cases, then it should at least say so in the docs. I'm going to have to use box or polygon collision which is much slower.