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 - Orobu

Pages: [1]
1
General / Re: SFML and Box2D meters per pixel efficiency
« on: June 10, 2012, 02:06:24 am »
So I keep box2D as it is and scale all my graphics so it fits my chosen scaling factor?

I suppose that means I will have to zoom the sf::View as well, or how will I handle the sprite scaling with SFML?

2
General / Re: SFML and Box2D meters per pixel efficiency
« on: June 09, 2012, 08:27:22 pm »
Sorry if my post was unclear.

I was merely wondering what would be the best way to mix SFML and Box2D so they work together. for example if I have a box at 128x128 pixels, and I want to create a fixture for a body in Box2D to match with it. What would be the best way to do this?

EDIT: I currently have all Box2D boxes scaled to pixels but this is causing some performance issues and the physics isn't bheaving as it should. how would I go about to scale it with view?


3
General / SFML and Box2D meters per pixel efficiency
« on: June 09, 2012, 06:01:52 pm »
Hello :)

I am working on a game in SFML and Box2D and was wondering what you think is the best way to combat the "meters per pixel" (or pixels per meter) issue with Box2D. I have searched around the forum and seen that many people seem to use a (for example) "#define PIXELS_PER_METER 64.0f" and then pass that into Box2D's constructor when creating a box shape.

Correct me if I'm wrong but won't that create VERY large objects? which in it's own turn will cause strange physics simulation and/or bad performance?

I made a game previously with SDL/OpenGL and Box2D and there we scaled the entire world with glScale and adapted accordingly. needles to say, it was horrible...

Is there any way to do this efficiently?

4
SFML projects / Re: SFML Light System - Let There Be Light
« on: June 09, 2012, 12:59:36 am »
thanks for your quick reply!

I tried what you described and it is indeed stretched properly in the window. Only problem is that the lights are not properly scaled, meaning that if I create a light with a radius at 200 it will be the same size no matter the window resolution.

5
SFML projects / Re: SFML Light System - Let There Be Light
« on: June 08, 2012, 07:20:21 pm »
I have a question regarding viewport scaling. I'm currently working on a game were you can switch resolution and the viewport is scaling accordingly.

I'm trying to get this working with Let there be light as well but so far I haven't been able to get it to scale correctly if the window and viewport resolution does not match. this is how my viewport looks when the internal reoslution is 1600x900 and the window is 1024x600. How would I go about to make it correctly scale to my viewport?


[attachment deleted by admin]

Pages: [1]
anything