Box2d - 2D physics

Previous topic - Next topic

Kitty Hello

OK, here's Schranz0r's port of Box2D. I extended it a bit so you can debug the shapes, too.

Also, at the very bottom of the file, there's an example ("b_WakeUp") that should get you started how to extend the wrapper. You might need the get/set acceleration and velocity functions as well as the add impact functions. A "is point in shape" function would be handy for picking, too.
It's all there, just wrap it. Ask here if you need help.

You propably need the header pack (which I should update, btw.)
@Schranz0r - where is the header pack?!

Bugfix: b_DestroyBody didn't set pointer to NULL.

[edit]
Updated version 13 oct 2011
Re-Uploaded zip on 2020-06-19

Schranz0r

I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

codegit

This is soooooooooo cooooooooool ....thanks guys.  :good: :good: :good:
------------------------------------------
1 X Acer TravelMate 4270, laptop, XP PRO
1 X Dell Studio 17 laptop, Windows 7
1 X MacBook Pro 2,2 GHz Core 2 Duo, 2 GB RAM, 160 GB HDD, 9400M
2 X iTouch
1 X HTC Desire (Android 2.1)
iPad soon to be added

Schranz0r

I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

bigsofty

well done guys!  :good:

P.S. Will this work on the iPhone?
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

Hemlos

My EditorE.exe is version: GLBasic IDE, Version: 7.115
GLBasic had a long list of errors on the first compile.
So, I installed the header pack.
After installing the header pack, i get a new error message:
Code (glbasic) Select
*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.7.045 SN:ee90b650 - 3D, NET
Wordcount:52 commands
compiling:
*** create process failed
*** FATAL ERROR - Please post this output in the forum
_______________________________________
*** Finished ***
Elapsed: 0.5 sec. Time: 21:08
Build: 0 succeeded.
*** 1 FAILED ***


BTW, this looks really cool.  :good:
Bing ChatGpt is pretty smart :O

Kitty Hello

oh dear. Shut down, reboot and try again. That sounds really bad.

Schranz0r

#7
I hope you put all into   "C:\Program Files\GLBasic\Compiler\platform" ?

EDIT:

Look at this, thats cool:

http://www.youtube.com/watch?v=_k87Ybaz8tY
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

Hemlos

@Gernot:
I rebooted, it didnt help.

@Schranz0r:
Well yes, I installed the files and allowed overwriting of directories, it asked for each platform.
Afterwards, the error with a long list didnt happen anymore.
A new error message, the one i posted in my last post, is what i get now.
Bing ChatGpt is pretty smart :O

neseir

I have the same version but did not update the header files. Works fine here. What are the changes in the header files and why should I install them ?

(From compilation of the Box2D project)

Quote
_______________________________________
*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.7.045 SN:eb010adf - 3D, NET
Wordcount:52 commands
compiling:

linking:
success
_______________________________________
*** Finished ***
Elapsed: 13.2 sec. Time: 14:19
Build: 1 succeeded.

codegit

#10
I replaced the headers and I still get the following errors.  :'( :'( I would be thankful for any suggestions.  O_O

Code (glbasic) Select

In file included from C:/glbasicProjects/GLBasic/Box2D/Source/Common/b2BlockAllocator.cpp:20,
                from C:\Temp\glbasic\gpc_temp1.cpp:37:
C:/Program Files/GLBasic/Compiler/platform/Win32/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/cstdlib:49:28: bits/c++config.h: No such file or directory
In file included from C:/Program Files/GLBasic/Compiler/platform/Win32/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/bits/stl_algobase.h:70,
                from C:/Program Files/GLBasic/Compiler/platform/Win32/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/memory:54,
                from C:/glbasicProjects/GLBasic/Box2D/Source/Common/b2BlockAllocator.cpp:21,
                from C:\Temp\glbasic\gpc_temp1.cpp:37:
C:/Program Files/GLBasic/Compiler/platform/Win32/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/iosfwd:46:29: bits/c++locale.h: No such file or directory
C:/Program Files/GLBasic/Compiler/platform/Win32/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/iosfwd:47:25: bits/c++io.h: No such file or directory
In file included from C:/Program Files/GLBasic/Compiler/platform/Win32/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/memory:55,
                from C:/glbasicProjects/GLBasic/Box2D/Source/Common/b2BlockAllocator.cpp:21,
                from C:\Temp\glbasic\gpc_temp1.cpp:37:
C:/Program Files/GLBasic/Compiler/platform/Win32/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/bits/allocator.h:52:31: bits/c++allocator.h: No such file or directory
In file included from C:/Program Files/GLBasic/Compiler/platform/Win32/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/memory:55,
                from C:/glbasicProjects/GLBasic/Box2D/Source/Common/b2BlockAllocator.cpp:21,
                from C:\Temp\glbasic\gpc_temp1.cpp:37:
C:/Program Files/GLBasic/Compiler/platform/Win32/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/bits/allocator.h:80: error: expected template-name before '<' token
C:/Program Files/GLBasic/Compiler/platform/Win32/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/bits/allocator.h:80: error: expected `{' before '<' token
C:/Program Files/GLBasic/Compiler/platform/Win32/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/bits/allocator.h:80: error: expected unqualified-id before '<' token
*** FATAL ERROR - Please post this output in the forum
------------------------------------------
1 X Acer TravelMate 4270, laptop, XP PRO
1 X Dell Studio 17 laptop, Windows 7
1 X MacBook Pro 2,2 GHz Core 2 Duo, 2 GB RAM, 160 GB HDD, 9400M
2 X iTouch
1 X HTC Desire (Android 2.1)
iPad soon to be added

Schranz0r

#11
Copy all files from -> C:\Program Files\GLBasic\Compiler\platform\Win32\Include\mingw32\bits

To -> C:\Program Files\GLBasic\Compiler\platform\Win32\Include\bits

Hope it fix it!

Or see attachment and place it on -> C:\Program Files\GLBasic\Compiler\platform\Win32

[attachment deleted by admin]
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

kaotiklabs

Quote from: Schranz0r on 2009-Sep-30
Copy all files from -> C:\Program Files\GLBasic\Compiler\platform\Win32\Include\mingw32\bits
To -> C:\Program Files\GLBasic\Compiler\platform\Win32\Include\bits

Mine was fixed with this. Thanks!
Vote Cthulhu! Because the stars are right!!!!
Ia Ia Cthulhu F' tang!

codegit

MIne also fixed. Thank you, thank you, thank you very much.  =D
------------------------------------------
1 X Acer TravelMate 4270, laptop, XP PRO
1 X Dell Studio 17 laptop, Windows 7
1 X MacBook Pro 2,2 GHz Core 2 Duo, 2 GB RAM, 160 GB HDD, 9400M
2 X iTouch
1 X HTC Desire (Android 2.1)
iPad soon to be added

Moru