Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making width and height defeault for the bounds. #67

Closed
rgk opened this issue Feb 26, 2015 · 8 comments
Closed

Making width and height defeault for the bounds. #67

rgk opened this issue Feb 26, 2015 · 8 comments

Comments

@rgk
Copy link

rgk commented Feb 26, 2015

For example if I set the height and width of the render window to 1600 by 600 with the engine.create options, the bounds stay at 800 by 600 (which is the default). What you have to do is update the bounds. I just think for some it might be easier that the height and width defaults to the bounds unless you change it like below.

engine.world.bounds.max.x = 1600;
engine.world.bounds.max.y = 600;
@liabru
Copy link
Owner

liabru commented Mar 3, 2015

This is indeed an issue.

I'm likely going to remove world bounds very soon, as their main purpose was to disable out of world bodies to prevent the browser from locking up when simulations glitched in early development.

But if I decide to keep them, I'll add a fix for this. Thanks.

@simonbw
Copy link

simonbw commented Mar 26, 2015

Is there any issue currently with setting the world bounds to be Infinity and -Infinity?

@liabru
Copy link
Owner

liabru commented Mar 26, 2015

Yep that should work fine (or are you having an issue)?

@simonbw
Copy link

simonbw commented Mar 26, 2015

I was not having an issue, I was just asking in case it messed up some calculations somewhere that I might not know about. Thanks for the fast reply!

@kkambucha
Copy link

Hy. I mean what i have a same problem. I don't undersatand what i do wrong. For example - http://kroteg.com/boxes/ Objects sticks in center of canvas. How i can solved this?

@liabru
Copy link
Owner

liabru commented Apr 6, 2015

@jankovsky

engine.world.bounds.min.x = -Infinity;
engine.world.bounds.min.y = -Infinity;
engine.world.bounds.max.x = Infinity;
engine.world.bounds.max.y = Infinity;

@wokalek-work
Copy link

There is no chance to set the boundaries of the world with this:

this.engine = Engine.create()
this.engine.world.bounds = { min: { x: 0, y: 0 }, max: { x: s.width, y: s.height } }

It's just. Doesn't. Work. AT ALL

@liabru
Copy link
Owner

liabru commented Feb 13, 2021

@vostokwork what do you want worlds bounds to do? They don't really apply to anything in practice (they used to have a purpose, but are due to be removed). If you need collisions you should use static bodies like in the examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants