Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - deathAwaits

Pages: [1]
1
General / Re: Box2D and SFML integration problems
« on: May 04, 2016, 11:21:10 pm »
I still didn't figure it out, I didn't have much time anyway.
Is there anyone willing to help me a little?

2
General / Re: Box2D and SFML integration problems
« on: April 26, 2016, 11:36:28 pm »
#EDIT

Still can't get it to work properly, tho.

I don't get it, when I set a 0.0f y gravity, my dynamic object still moves.
Another weird thing... If I remove the static body (ground) the object behaves normally.
It falls as it should, but for an infinite amout of time, which is understandable with no ground being there.

Changing the gravity y from let's say 1.0f to -1.0f doesn't change anything at all.
First 25 y positions of my moving object are:
http://screenshot.sh/mMdFPYd7mpWwp (gravity is -1.0f)
http://screenshot.sh/mGx7UA0DJj7Fv (gravity is 1.0f)

But I had put the ground on -10.0f (so I guess thats 10 meters = 640 pixes in my SFML world).
I included the inversion of y axis betweend box2D and SFML coordinate system,
but the falling never stops.


If someone could change the code to make it work, I'd be really happy.
Or even some pointers at what I'm doing wrong.

Code here:

(click to show/hide)

3
General / Box2D and SFML integration problems
« on: April 26, 2016, 09:06:38 pm »
Hello.

Today I've downloaded Box2D and wanted to test it out a little bit, just to see how it works with SFML.
I wrote a really, really simple code just to see if everything works properly, but I'm getting strange results.
My box, that should be dynamic, is dynamic indeeed, but it behaves strangely.
When I add a solid ground to my world, the dynamic box flies upwards (instead downwards) to something about y=-275, which I dont understand.

When I remove the solid ground, the simulation is quite all right, the box falls just as it should fall.
Anyway, here's the code:

(click to show/hide)

Does anyone know a solution? Because I bet I did something wrong.

Thank you.

Pages: [1]
anything