[Done] Still Attach bug persist around versions of PB, please fix it

All bugs related to the 3D engine
User avatar
Psychophanta
Addict
Addict
Posts: 4997
Joined: Wed Jun 11, 2003 9:33 pm
Location: Lípetsk, Russian Federation
Contact:

[Done] Still Attach bug persist around versions of PB, please fix it

Post by Psychophanta »

Tip is this.
Just check and see, then fix it. :) :( :o :shock: :? 8) :mrgreen:

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)
CreateCamera(0,0,0,100,100):CameraProjectionMode(0,#PB_Camera_Perspective)
MoveCamera(0,0,0,12,#PB_Absolute)
CreateMaterial(0,LoadTexture(0,"soil_wall.jpg"))

CreateCube(0,0.5)
CreateEntity(0,MeshID(0),MaterialID(0),-0.256,0.488,0)
CreateNode(0,-0.7,0.3436,0):RotateNode(0,0,0,-43,#PB_Absolute)
CreateSphere(1,0.2,5,5):CreateEntity(1,MeshID(1),MaterialID(0)):AttachNodeObject(0,EntityID(1)); <- node position

Repeat
  While WindowEvent():Wend
  ExamineKeyboard()
  If KeyboardReleased(#PB_Key_Space)
    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)

Last edited by Psychophanta on Sat Apr 13, 2024 4:18 pm, edited 2 times in total.
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB :mrgreen:
juergenkulow
Enthusiast
Enthusiast
Posts: 556
Joined: Wed Sep 25, 2019 10:18 am

Re: Still Attach bug persist around versions of PB, please fix it

Post by juergenkulow »

Code: Select all

// MoveEntity(0,x,y,z,#PB_Absolute | #PB_World)
integer r32=PB_MoveEntity2(0LL,v_x,v_y,v_z,8LL);
x:-0.2560000122 y:0.4880000055 z:0
x:-0.5120000243 y:0.976000011 z:0   ;Should be: x:-0.2560000122 y:0.4880000055 z:0
x:-1.0240000486 y:1.9520000219 z:0  ;Should be: x:-0.2560000122 y:0.4880000055 z:0
x:-2.0480000973 y:3.9040000439 z:0  ;Should be: x:-0.2560000122 y:0.4880000055 z:0
x:-4.0960001945 y:7.8080000877 z:0  ;Should be: x:-0.2560000122 y:0.4880000055 z:0
x:-8.1920003891 y:15.6160001755 z:0 ;Should be: x:-0.2560000122 y:0.4880000055 z:0
// MoveEntity(0,x,y,z,#PB_Relative|#PB_World)
integer r32=PB_MoveEntity2(0LL,v_x,v_y,v_z,9LL);
x:-0.2560000122 y:0.4880000055 z:0
x:-0.5120000243 y:0.976000011 z:0
x:-1.0240000486 y:1.9520000219 z:0
x:-2.0480000973 y:3.9040000439 z:0
x:-4.0960001945 y:7.8080000877 z:0
x:-8.1920003891 y:15.6160001755 z:0
User avatar
pf shadoko
Enthusiast
Enthusiast
Posts: 296
Joined: Thu Jul 09, 2015 9:07 am

Re: Still Attach bug persist around versions of PB, please fix it

Post by pf shadoko »

yes, there's a bug, but nothing to do with nodes
(entity 0 is not attached to the node!)
it's MoveEntity's #PB_World parameter that causes the bug
(world is the default, so it's useless)
I'll have a look

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)
CreateCamera(0,0,0,100,100):CameraProjectionMode(0,#PB_Camera_Perspective)
MoveCamera(0,0,0,12,#PB_Absolute)
CreateMaterial(0,LoadTexture(0,"soil_wall.jpg"))

CreateCube(0,0.5)
CreateEntity(0,MeshID(0),MaterialID(0),-0.256,0.488,0)
;CreateNode(0,-0.7,0.3436,0):RotateNode(0,0,0,-43,#PB_Absolute)
;CreateSphere(1,0.2,5,5):CreateEntity(1,MeshID(1),MaterialID(0)):AttachNodeObject(0,EntityID(1)); <- node position

Repeat
  While WindowEvent():Wend
  ExamineKeyboard()
  If KeyboardReleased(#PB_Key_Space)
    x.f=EntityX(0,#PB_Absolute):y.f=EntityY(0,#PB_Absolute):z.f=EntityZ(0,#PB_Absolute)
    Debug ""+x+"  "+y+"  "+z
    MoveEntity(0,x,y,z,#PB_Absolute)
  EndIf
  RenderWorld()
  FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape)
juergenkulow
Enthusiast
Enthusiast
Posts: 556
Joined: Wed Sep 25, 2019 10:18 am

Re: Still Attach bug persist around versions of PB, please fix it

Post by juergenkulow »

Please also check #PB_Local|#PB_Absolute and #PB_Parent|#PB_Absolute.
User avatar
Psychophanta
Addict
Addict
Posts: 4997
Joined: Wed Jun 11, 2003 9:33 pm
Location: Lípetsk, Russian Federation
Contact:

Re: Still Attach bug persist around versions of PB, please fix it

Post by Psychophanta »

juergenkulow wrote: Thu Oct 26, 2023 12:56 pm Please also check #PB_Local|#PB_Absolute and #PB_Parent|#PB_Absolute.
+10 :idea:
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB :mrgreen:
User avatar
pf shadoko
Enthusiast
Enthusiast
Posts: 296
Joined: Thu Jul 09, 2015 9:07 am

[FIXED] Still Attach bug persist around versions of PB, please fix it

Post by pf shadoko »

[FIXED]
User avatar
Psychophanta
Addict
Addict
Posts: 4997
Joined: Wed Jun 11, 2003 9:33 pm
Location: Lípetsk, Russian Federation
Contact:

Re: Still Attach bug persist around versions of PB, please fix it

Post by Psychophanta »

pf shadoko wrote: Thu Oct 26, 2023 11:07 am it's MoveEntity's #PB_World parameter that causes the bug
(world is the default, so it's useless)
Not fixed in PB6.10B7
Please fix.
If #PB_World is useless for MoveEntity() then what is the sense? :? :o
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB :mrgreen:
Post Reply