EntityRadius and ScaleEntity

Blitz3D Forums/Blitz3D Programming/EntityRadius and ScaleEntity

_PJ_(Posted 2003) [#1]
I need to know whether an entitiy's collision radii are scaled when ScaleEntity (or ScaleMesh) are called.

It's not easy to test this, because I have a lot of difficulty with collisions, and the code I am working on uses sch arbitrary values.

The reason I need this is because I am trying to incorporate this Laser code from the Archives into a party of my game..

The fact that the laser is scaled by a non-constant amount makes it very difficult to work out correct values (for me anyway!)


Ross C(Posted 2003) [#2]
here, try this. it shows that the entity radius doesn't get scaled with the entity.

up and down keys to scale the entity

left and right keys to move the entity

Graphics3D 800,600
SetBuffer BackBuffer()

camera=CreateCamera()
PositionEntity camera,0,0,-10

light=CreateLight()


sphere=CreateSphere()
PositionEntity sphere,5,0,0
EntityType sphere,1
EntityRadius sphere,1
scale#=1


sphere1=CreateSphere()
PositionEntity sphere1,-3,0,0
EntityType sphere1,2
EntityRadius sphere1,1


Collisions 1,2,1,1



While Not KeyHit(1)



If KeyDown(203) Then MoveEntity sphere,-0.1,0,0
If KeyDown(205) Then MoveEntity sphere,0.1,0,0
If KeyDown(200) Then scale=scale+0.1
If KeyDown(208) Then scale=scale-0.1


ScaleEntity sphere,scale,scale,scale

UpdateWorld
RenderWorld
Flip
Wend
End




_PJ_(Posted 2003) [#3]
Excellent!

Thanks!