BASIC

Author Topic: Box2d - 2D physics  (Read 65117 times)

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1634
  • Particle Hawk
    • View Profile
Re: Box2d - 2D physics
« Reply #15 on: 2009-Oct-01 »
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

ah ok i figgured it out. lol
I moved the folder in the box2d/platform to the glbasic/../platform, and voila.
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1634
  • Particle Hawk
    • View Profile
Re: Box2d - 2D physics
« Reply #16 on: 2009-Oct-01 »
Pretty cool,

Is this something you are currently working on KH?

Do you plan on adding all those Dynamics functions?
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10709
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Box2d - 2D physics
« Reply #17 on: 2009-Oct-01 »
Must I update the headers package!?

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5020
  • O Rly?
    • View Profile
Re: Box2d - 2D physics
« Reply #18 on: 2009-Oct-01 »
Yes, would be better Gernot ;)
I <3 DGArray's :D

PC:
AMD RYzen 7 1700 @3.9Ghz, 16GB HyperX Fury 2666Mhz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline neseir

  • Mc. Print
  • *
  • Posts: 21
    • View Profile
Re: Box2d - 2D physics
« Reply #19 on: 2009-Oct-03 »
Hi

This is cool. Have created something simular using require etc but I will rather use this implementation. One problem I encountered when I extended the program with the possibility to pick objects. It just freezes for a couple of seconds and then it continues like there have been no problems. Thought first I had messed up the mouse joint but adding some debug statement indicates it happens around the showscreen function. The changes I have done is in the Box2D.gbas and the test program main.gbas (NB have not added functionality to scale the pick function to find the World coordinates. It works in this example since the world is equal to the screen.....).

Tested the program on a different computer and it works fine. Got to be something with the other installation/GFX card driver or something (the one wich works is ATI and the other is NVidia. Have had some strange GL problems earlier on the PC with the NVidia card).

[EDIT]
Just updated the NVidia driver and now it works !  =D

BR
Eirik


[attachment deleted by admin]
« Last Edit: 2009-Oct-03 by neseir »

Offline freshworks

  • Mc. Print
  • *
  • Posts: 31
    • View Profile
Re: Box2d - 2D physics
« Reply #20 on: 2009-Oct-21 »
Hi,

Just found a blitzmax box2d wrapper, could things probaly make easier ?

http://maxmods.googlecode.com/files/box2d_1_03_src.zip

Cheers,
Freshworks

MrTAToad

  • Guest
Re: Box2d - 2D physics
« Reply #21 on: 2009-Oct-28 »
Hows it going for the iPhone ?  =D

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2626
    • View Profile
Re: Box2d - 2D physics
« Reply #22 on: 2009-Oct-29 »
Yes, is anyone working on an iPhone port?
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)

Offline trucidare

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1377
  • Bachelor of Fail
    • View Profile
Re: Box2d - 2D physics
« Reply #23 on: 2009-Oct-29 »
need a working example in glbasic for win to port correctly. Who wants?
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2626
    • View Profile
Re: Box2d - 2D physics
« Reply #24 on: 2009-Oct-30 »
Is anyone actually working on the iPhone port?  :whip: :P

Wish I could help more but my C++ skills are rubbish.

« Last Edit: 2009-Oct-30 by bigsofty »
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)

Offline codegit

  • Dr. Type
  • ****
  • Posts: 270
    • View Profile
Re: Box2d - 2D physics
« Reply #25 on: 2009-Oct-30 »
Guys, I have not tried it yet on the iPhone. But if it works under win32 it should also work on the iphone as from what I can see its mostly inline c++ code with nothing specific to any platform.  :good:   When I get a chance I will give a try and let everybody know how it pans out.  =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

Offline kaotiklabs

  • Dr. Type
  • ****
  • Posts: 313
  • Spain is diferent
    • View Profile
Re: Box2d - 2D physics
« Reply #26 on: 2009-Oct-30 »
Great mate, that would be awesome.  =D
Vote Cthulhu! Because the stars are right!!!!
Ia Ia Cthulhu F' tang!

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2626
    • View Profile
Re: Box2d - 2D physics
« Reply #27 on: 2009-Oct-30 »
Ooh that sounds promising!   :good:
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)

Offline freshworks

  • Mc. Print
  • *
  • Posts: 31
    • View Profile
Re: Box2d - 2D physics
« Reply #28 on: 2009-Nov-06 »
Hi,

i've tried the example within the "All entries section", but seems that it won't compile. Is there an out of the box sample that works, so i could test this on the iphone ?

http://www.glbasic.com/showroom.php?site=games&game=box2dinterfaceinglbasic&lang=en

When i try to compile the above example it will start with the following missing files (errors):

*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.7.098 SN:479d16c7 - 3D, NET
"glbox2d.gbas"(35) warning : probably unassigned variable : screenWidth
"glbox2d.gbas"(35) warning : probably unassigned variable : screenHeight
"glbox2d.gbas"(43) warning : probably unassigned variable : mbr
Wordcount:68 commands
compiling:
X:\Iphone\Box2D\sim_box2d.cpp:1:19: stdio.h: No such file or directory
X:\Iphone\Box2D\sim_box2d.cpp:2:20: stdlib.h: No such file or directory
In file included from X:\Iphone\Box2D\Box2D/Include/Box2D.h:34,
                 from X:\Iphone\Box2D\sim_box2d.cpp:4:
X:\Iphone\Box2D\Box2D/Include/../Source/Common/b2Settings.h:22:20: assert.h: No such file or directory
X:\Iphone\Box2D\Box2D/Include/../Source/Common/b2Settings.h:23:18: math.h: No such file or directory
In file included from X:\Iphone\Box2D\Box2D/Include/Box2D.h:34,
                 from X:\Iphone\Box2D\sim_box2d.cpp:4:
X:\Iphone\Box2D\Box2D/Include/../Source/Common/b2Settings.h: In function `float32 b2MixFriction(float32, float32)':
X:\Iphone\Box2D\Box2D/Include/../Source/Common/b2Settings.h:167: error: `sqrtf' was not declared in this scope
In file included from X:\Iphone\Box2D\Box2D/Include/../Source/Collision/Shapes/b2Shape.h:22,
                 from X:\Iphone\Box2D\Box2D/Include/../Source/Collision/Shapes/b2CircleShape.h:22,
                 from X:\Iphone\Box2D\Box2D/Include/Box2D.h:36,



Ettccc...........





Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5020
  • O Rly?
    • View Profile
Re: Box2d - 2D physics
« Reply #29 on: 2009-Nov-07 »
I can compile for Iphone ;)
Have to wrapp all that stuff into GLBasic so you can use it for each platform that GLBasic support :P
I <3 DGArray's :D

PC:
AMD RYzen 7 1700 @3.9Ghz, 16GB HyperX Fury 2666Mhz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard