MoveEntity() with #PB_Absolute|#PB_World abnormal behaviour?

Just starting out? Need help? Post your questions and find answers here.
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

MoveEntity() with #PB_Absolute|#PB_World abnormal behaviour?

Post by Psychophanta »

Test this. Is about the combination between
#PB_Relative: relative move, from the current entity position (default).
#PB_Absolute: absolute move to the specified position.

with

#PB_Local : local move.
#PB_Parent: move relative to the parent position.
#PB_World : move relative to the world.

Almost sure it is a bug, but just in case post it here.

Is there correct that the Entity moves when pushing '1' ?

Code: Select all

InitEngine3D()
InitSprite():InitKeyboard():InitMouse()
OpenWindow(0,0,0,800,600,"tip",#PB_Window_BorderLess|#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0),0,0,800,600,0,0,0,#PB_Screen_WaitSynchronization)
Add3DArchive(#PB_Compiler_Home + "examples/3d/Data/Textures", #PB_3DArchive_FileSystem)
CreateLight(0,$EEEEEE,4,4,2,#PB_Light_Point)
CreateMaterial(0,LoadTexture(0,"soil_wall.jpg"))
CreateCube(0,0.5)
CreateEntity(0,MeshID(0),MaterialID(0),-0.1,0,0)
CreateCamera(0,0,0,100,100)
MoveCamera(0,0,0,12,#PB_Absolute)

Repeat
  WindowEvent()
  ExamineKeyboard()
  If KeyboardReleased(#PB_Key_1)
    x.f=EntityX(0,#PB_Absolute):y.f=EntityY(0,#PB_Absolute):z.f=EntityZ(0,#PB_Absolute)
    MoveEntity(0,x,y,z,#PB_Absolute|#PB_World)
  EndIf
  RenderWorld()
  FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape)
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
User avatar
DK_PETER
Addict
Addict
Posts: 904
Joined: Sat Feb 19, 2011 10:06 am
Location: Denmark
Contact:

Re: MoveEntity() with #PB_Absolute|#PB_World abnormal behavi

Post by DK_PETER »

You should stick to the 3D programming section for these questions.
Personally I don't think that this is a bug.

Code: Select all

InitEngine3D()
InitSprite():InitKeyboard():InitMouse()
OpenWindow(0,0,0,800,600,"tip",#PB_Window_BorderLess|#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0),0,0,800,600,0,0,0,#PB_Screen_WaitSynchronization)
Add3DArchive(#PB_Compiler_Home + "examples/3d/Data/Textures", #PB_3DArchive_FileSystem)
CreateLight(0,$EEEEEE,4,4,2,#PB_Light_Point)
CreateMaterial(0,LoadTexture(0,"soil_wall.jpg"))
CreateCube(0,0.5)
CreateEntity(0,MeshID(0),MaterialID(0),-0.1,0,0)
CreateCamera(0,0,0,100,100)
MoveCamera(0,0,0,12,#PB_Absolute)

Repeat
  WindowEvent()
  ExamineKeyboard()
  If KeyboardReleased(#PB_Key_1)
    x.f=EntityX(0,#PB_Absolute):y.f=EntityY(0,#PB_Absolute):z.f=EntityZ(0,#PB_Absolute)
;   #PB_Local : local move.
;   #PB_Parent: move relative To the parent position.
;   #PB_World : move relative To the world.
    MoveEntity(0,x,y,z, #PB_Absolute) ;We want an absolute position
    Debug x
  EndIf
  RenderWorld()
  FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape)
Current configurations:
Ubuntu 20.04/64 bit - Window 10 64 bit
Intel 6800K, GeForce Gtx 1060, 32 gb ram.
Amd Ryzen 9 5950X, GeForce 3070, 128 gb ram.
Post Reply