behdad / box2d

Automatically exported from code.google.com/p/box2d
2 stars 12 forks source link

Feature Request (Couldn't find any other way to make a request) #260

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Origin shifting as mentioned in this thread: 
http://www.box2d.org/forum/viewtopic.php?f=3&t=7938

Original issue reported on code.google.com by Kalee...@gmail.com on 9 Jan 2012 at 12:24

GoogleCodeExporter commented 9 years ago
I'm confused what exactly "origin shifting" means in this context...

Original comment by lel...@pickple.com on 9 Feb 2012 at 2:03

GoogleCodeExporter commented 9 years ago
Say your character starts at the origin (0,0) and your game world is very 
large. As your character moves away from the origin, Box2d will be performing 
calculations on larger and larger numbers because of the increasing distance 
from box2d's origin. This may potentially be a problem at very large distances 
(especially if the developer is trying to interpret and/or manipulate these 
numbers). So origin shifting in this context would mean being able to set 
Box2d's origin to any arbitrary point in your game world. For example when the 
player reaches a certain distance from the origin, or perhaps when the player 
reaches a particular area in the game world, Box2d's origin could be moved 
somewhere closer to the player's current location so that physics calculations 
are performed in a more localized context.  

Original comment by Kalee...@gmail.com on 9 Feb 2012 at 2:35

GoogleCodeExporter commented 9 years ago
Implemented issue 260. You can now shift (re-center) a world using 
b2World::ShiftOrigin. You can see this function in the testbed using CTRL + 
arrow key.

Completed: At revision: 246  

Original comment by erinca...@gmail.com on 18 Mar 2012 at 7:01