positionentity bug

BlitzMax Forums/MiniB3D Module/positionentity bug

slenkar(Posted 2008) [#1]
When I set collisions for an entity I cant position it at 0,0,0 again


Import sidesign.minib3d
Strict

SeedRnd MilliSecs()
Graphics3D 800,600,16,2,0

Global light:Tlight=CreateLight()
Global player:Tentity=CreateSphere(8)
EntityType player,2
EntityRadius player,2
Global map_cam:Tcamera=CreateCamera()
'Global cam2:Tcamera=CreateCamera(player)
'HideEntity cam2
PositionEntity map_cam,0,200,0

TurnEntity map_cam,90,0,0
Local maze:Tentity=LoadAnimMesh("maze.b3d")

For Local x=1 To CountChildren(maze)
Local ent:Tentity=GetChild (maze,x)
EntityType ent,1
Next


Collisions 2,1,2,2

While Not KeyHit(KEY_1)
Cls
If KeyDown(KEY_UP)
MoveEntity player,0,0,1
EndIf

If KeyDown(KEY_LEFT)
TurnEntity player,0,2,0
EndIf
If KeyDown(key_right)
TurnEntity player,0,-2,0
EndIf

If KeyHit(KEY_ESCAPE)
PositionEntity player,0,-3,0
EndIf


UpdateWorld
RenderWorld
Flip
Wend
End



It seems like collisions are being taken into account when positioning, I dont know if this is normal


slenkar(Posted 2008) [#2]
doing resetentity after I position it works


simonh(Posted 2008) [#3]
Yes, use ResetEntity after PositionEntity. The collisions system uses sweep collisions, so anything between the current and previous position is checked for collisions.


slenkar(Posted 2008) [#4]
thanks