B4J Physic Challenge

wonder

Expert
Licensed User
Longtime User
Hey, nice find! It looks really interesting!! :)

By "make" do you mean, make or just wrap it up? :D
I think the closest we could ever get would be a wrapped version of Box2D.

Just look at the people behind it: http://www.algoryx.se/company/about-algoryx/#team
They have scientists, developers and engineers!
 

ilan

Expert
Licensed User
Longtime User
They have scientists, developers and engineers!

yeah, but they dont have any ninjas ;)

what i was thinking is, i would like to open a competition.

the goal is to create a perfect physic engine including collision detecting and physic bodies.
collision also between circle, square and triangle.

so there should be an option to draw path via canvas and the collision will happen only if path was touched and not only square shape.

i would recommend to create the engine in a class module that should be reused also with b4i.


there will be also a reward.

1st place 100$
2nd and 3rd place a b4i or b4a license

who is in?
 

sorex

Expert
Licensed User
Longtime User
also... is there any accelation on IOS that can be used or is that used by default?
 

ilan

Expert
Licensed User
Longtime User
also... is there any accelation on IOS that can be used or is that used by default?

i think its default.

Did I win the 100$? :)
you deserve much more for your great libs, anyway @sorex is right, the main goal is to create a core only class to be able to use it in
b4i and also b4j. if box2d works on b4j then this is great news, i will need to try it out.

i think it should not be so hard to create a great physic engine (not like box2d). it only should have physic object and a good collision detecting method that will check
collision for different shape types and not only squares.

i will start work on it, maybe i will win those 100$ :D

anyway if there will be enough interest (at least 3 members that are ready to take part on this competition), then competition will start and i will be responsible for the rewards.

the competition could be also to create a great physic game/app but the physics and collision must be a class module that should be able to use also in b4i.
 

Informatix

Expert
Licensed User
Longtime User
i think its default.


you deserve much more for your great libs, anyway @sorex is right, the main goal is to create a core only class to be able to use it in
b4i and also b4j. if box2d works on b4j then this is great news, i will need to try it out.

i think it should not be so hard to create a great physic engine (not like box2d). it only should have physic object and a good collision detecting method that will check
collision for different shape types and not only squares.

i will start work on it, maybe i will win those 100$ :D

anyway if there will be enough interest (at least 3 members that are ready to take part on this competition), then competition will start and i will be responsible for the rewards.

the competition could be also to create a great physic game/app but the physics and collision must be a class module that should be able to use also in b4i.
In this case, the first thing to read is https://en.wikipedia.org/wiki/Collision_detection
 

sorex

Expert
Licensed User
Longtime User
it only should have physic object

what do you mean by this, Ilan?

a decade ago when you added the physics stuff in flash this only gave you extra parameters for acceleration (.vx, .vy ...) etc but that's just some variables and addition(al) math.

the poblem starts when using different shape types. if you say make a physics routine for 2 colliding circles then it would be easier than doing one for a circle, rectanlge and triangle.
 

wonder

Expert
Licensed User
Longtime User
Did you try my JBox2D library with B4J? It should work as it does not use the Android API.
Did I win the 100$? :)
Someone give this man 100$.

@ilan, in my opinion, while the physics simulation itself would be complex enough due to its very nature, the hardest part to program would be the collision detection/solver.

Have a look at these articles below. It's no "walk-in-the-part" to do something like this.
http://www.wildbunny.co.uk/blog/2011/04/20/collision-detection-for-dummies/
http://www.wildbunny.co.uk/blog/201...-continuous-collision-engine-approach-part-1/

He has the source code for sale, for the total price of $26, written in C#, if I'm not mistaken.
We could try to convert it into a class, but then again we already have Box2D...
 

ilan

Expert
Licensed User
Longtime User

to much letters for me :confused:, i wish i would have the patience to read so much

what do you mean by this, Ilan?

a decade ago when you added the physics stuff in flash this only gave you extra parameters for acceleration (.vx, .vy ...) etc but that's just some variables and addition(al) math.

the poblem starts when using different shape types. if you say make a physics routine for 2 colliding circles then it would be easier than doing one for a circle, rectanlge and triangle.

yes thats correct, but it can be solved. i have a great source code in VB i will try to convert it to b4j and if i will success then we will have almost box2d for b4i!!! (and b4j)

We could try to convert it into a class, but then again we already have Box2D...
we have box2d for b4a not for b4i...
 

wonder

Expert
Licensed User
Longtime User
then we will have almost box2d
I don't want to discourage anyone, as this topic is of high-interest to me, but Box2D is an on-going work-in-progress since 2005.
B4X:
Box2D Features: http://box2d.org/about/

COLLISION
- Continuous collision detection
- Contact callbacks: begin, end, pre-solve, post-solve
- Convex polyons and circles.
- Multiple shapes per body
- One-shot contact manifolds
- Dynamic tree broadphase
- Efficient pair management
- Fast broadphase AABB queries
- Collision groups and categories

PHYSICS
- Continuous physics with time of impact solver
- Persistent body-joint-contact graph
- Island solution and sleep management
- Contact, friction, and restitution
- Stable stacking with a linear-time solver
- Revolute, prismatic, distance, pulley, gear, mouse joint, and other joint types
- Joint limits, motors, and friction
- Momentum decoupled position correction
- Fairly accurate reaction forces/impulses

SYSTEM
- Small block and stack allocators
- Centralized tuning parameters
- Highly portable C++ with no use of STL containers
Did you try my JBox2D library with B4J? It should work as it does not use the Android API.
Since it doesn't depend on Android, what's stopping it form working with B4i? It's only maths, right?
 

ilan

Expert
Licensed User
Longtime User
@ilan, this engine is written in Objective-C and it claims to be faster than Box2D: https://chipmunk-physics.net
Maybe someone will be able to wrap it up into a B4i lib. :)

i will try to use my VB source and convert it to B4i (b4j) should be simple because its almost the same language.
i hope i will have soon a working code...

just thought to make a competition to make me more motivated...
 

Informatix

Expert
Licensed User
Longtime User
i will try to use my VB source and convert it to B4i (b4j) should be simple because its almost the same language.
i hope i will have soon a working code...

just thought to make a competition to make me more motivated...
Post your VB code and Wonder and me should be able to say if it's of some interest.
Note that you can find a lot of useful math functions to detect collisions here: https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/math/Intersector.java
Converting from Java should not be difficult.
 

ilan

Expert
Licensed User
Longtime User
Post your VB code and Wonder and me should be able to say if it's of some interest.

if you would sit on it you would do it in less then 30 minutes i believe, i would need few days :)

ok the writer of this code is Mahesh Kurmi. i spoked to him he is a very nice guy and also a physic teacher.
he like to code and he did it in pure VB code (no external libs) and the result is gorgeous

try it out, you can use VB 2010 Express for it.

https://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=8682&lngWId=10

NOTE: load the vehicle example, go to myproject and change the loading form to the frmdemo (if i remember correct)
 
Top