ScaleEntity bug

Blitz3D Forums/Blitz3D Bug Reports/ScaleEntity bug

ScaleEntity seems to ignore the Y value setting. If you use a value like 'ScaleEntity ball, 2,3' it treats it like 'ScaleEntity ball, 2,2'. Run this code for an example:

Graphics3D 800,600,32,2


camera = CreateCamera() 
PositionEntity camera, 0,0,-100
CameraZoom camera,15

ball1 = CreateSphere()
ScaleEntity ball1, 2,2,2
EntityRadius ball1, 2,2
PositionEntity ball1, -4,0,0
EntityType ball1,1

ball2 = CreateSphere()
ScaleEntity ball2, 2,3,2
EntityRadius ball2, 2,3
PositionEntity ball2, 4,0,0
EntityType ball2,1

pointer = CreateCube()
EntityColor pointer,255,0,0
EntityAlpha pointer,.5
EntityType pointer,2

Collisions 2,1,1,1

While Not KeyDown(1)
	If KeyDown(203) Then MoveEntity pointer,-.1,0,0
	If KeyDown(205) Then MoveEntity pointer,.1,0,0
	If KeyDown(200) Then MoveEntity pointer,0,.1,0	
	If KeyDown(208) Then MoveEntity pointer,0,-.1,0	

UpdateWorld 
RenderWorld

Text 70,100, "ScaleEntity ball1, 2,2,2"
Text 70,120, "EntityRadius ball1, 2,2"
Text 550,60, "ScaleEntity ball2, 2,3,2"
Text 550,80, "EntityRadius ball2, 2,3"
Text 10,500, "Using the arrow keys, move the box against sides of spheres.  The 'hit' indicates collision.  
Text 10,520, "But on the top/bottom of the oval sphere blitz ignores the 'EntityRadius ball2, 2,3' setting"
Text 10,540, "And treats it like the seeting is 'EntityRadius ball2, 2,2' instead."
Text 10,560, "Why is EntityRadius igoring the y value?!?!?!?!"

If CountCollisions(pointer) > 0 Then Text 10,10,"hit!"
	
Flip
	
Wend


This probably doesnt't help you, but..
I think this is because ellipsoids were an afterthought designed to work in the special case of character/object colliding with environment *mesh* only.

See this works:
Graphics3D 800,600,32,2


camera = CreateCamera() 
PositionEntity camera, 0,0,-100
CameraZoom camera,15

ball1 = CreateSphere()
ScaleEntity ball1, 2,2,2
EntityRadius ball1, 2,2
PositionEntity ball1, -4,0,0
EntityType ball1,1

ball2 = CreateSphere()
ScaleEntity ball2, 2,3,2
EntityRadius ball2, 2,3
PositionEntity ball2, 4,0,0
EntityType ball2,3

pointer = CreateCube()
EntityColor pointer,255,0,0
EntityAlpha pointer,.5
EntityType pointer,2

Collisions 2,1,3,1
Collisions 3,2,2,1

While Not KeyDown(1)
	If KeyDown(203) Then MoveEntity ball2 ,-.1,0,0
	If KeyDown(205) Then MoveEntity ball2 ,.1,0,0
	If KeyDown(200) Then MoveEntity ball2 ,0,.1,0	
	If KeyDown(208) Then MoveEntity ball2 ,0,-.1,0	

UpdateWorld 
RenderWorld

Text 70,100, "ScaleEntity ball1, 2,2,2"
Text 70,120, "EntityRadius ball1, 2,2"
Text 550,60, "ScaleEntity ball2, 2,3,2"
Text 550,80, "EntityRadius ball2, 2,3"
Text 10,500, "Using the arrow keys, move the box against sides of spheres.  The 'hit' indicates collision.  
Text 10,520, "But on the top/bottom of the oval sphere blitz ignores the 'EntityRadius ball2, 2,3' setting"
Text 10,540, "And treats it like the seeting is 'EntityRadius ball2, 2,2' instead."
Text 10,560, "Why is EntityRadius igoring the y value?!?!?!?!"

If CountCollisions(pointer) > 0 Then Text 10,10,"hit!"
	
Flip
	
Wend


It's rather the 2nd parameter of EntityRadius that causes the problem, than ScaleEntity.

As mentioned in the "Collisions sample code" report.