To test, first run the code below (last tested with: PureBasic 6.00 LTS (Windows - x64)). For me, it throws an error complaining about an incorrect number of parameters used, even though the number of parameters should be correct. If I remove two of the last three characters (see the commented-out 'CreateEntityBody' line) then it runs fine, even though this should be incorrect.
PureBasic's 3D library seems to be rife with these problems. You don't have to dive too deep to find one - which makes it a constant two steps forwards, two steps backward proposition.
Code: Select all
InitEngine3D()
InitSprite()
If OpenWindow( 0, 0, 0, 800, 600, "Test", #PB_Window_BorderLess ) = 0 : Debug "Unable To create the main window." : End : EndIf
If OpenWindowedScreen( WindowID( 0 ), 0, 0, 800, 600 ) = 0 : Debug "Unable to create the screen." : End: EndIf ; Note that VSYNC will be enabled by default.
; -- Create test player.
test_player_mesh = CreateCapsule( #PB_Any, 0.5, 0.85 )
test_player_ent = CreateEntity( #PB_Any, MeshID( test_player_mesh ), #PB_Material_None, 0.0, 3.0, 0.0 )
CreateEntityBody( test_player_ent, #PB_Entity_CapsuleBody, 100.0, 0.5, 0.1, 1.0, 1.85, 1.0 ) ; This throws an error, even though it should be correct.
;CreateEntityBody( test_player_ent, #PB_Entity_CapsuleBody, 100.0, 0.5, 0.1, 1.0, 1.85, 1.0, 1.0, 1.0, 1.0 ) ; This throws an error, even though it should be correct.
;CreateEntityBody( test_player_ent, #PB_Entity_CapsuleBody, 100.0, 0.5, 0.1, 1.0 ) ; This works, even though it should be incorrect.
; >>> The capsule body should allow x, y, z values at the end to set the bounding volume of the capsule. It only seems to allow one value after the friction value, however.