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

Vector2 Math #2

Open
implicit-invocation opened this issue Jun 16, 2017 · 0 comments
Open

Vector2 Math #2

implicit-invocation opened this issue Jun 16, 2017 · 0 comments
Assignees
Labels

Comments

@implicit-invocation
Copy link

implicit-invocation commented Jun 16, 2017

https://github.com/aloisdeniel/Humper/blob/master/Sources/Humper/Hit.cs#L350

Is the math here correct? origin was modified before calculating thanDistance
I tried to load this TMX and build some walls. But my body always goes through wall#13 and stick to the bottom side of wall#9

<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" tiledversion="1.0.1" orientation="orthogonal" renderorder="right-down" width="10" height="10" tilewidth="32" tileheight="32" nextobjectid="14">
 <objectgroup name="Obstacles">
  <object id="7" x="46.6667" y="-6.66667" width="32" height="162.667"/>
  <object id="9" x="-6" y="11.3333" width="250" height="32"/>
  <object id="10" x="5.33333" y="54.6667" width="62.6667" height="63.3333"/>
  <object id="13" x="120" y="110.667" width="138" height="43.3333"/>
 </objectgroup>
</map>
map = new TmxMap("test.tmx");
world = new World(map.Width, map.Height);
body = world.Create(100, 100, 20, 20);

foreach(var obj in map.ObjectGroups["Obstacles"].Objects) {
  walls.Add(world.Create((float)obj.X, (float)obj.Y, (float)obj.Width, (float)obj.Height));
}
@aloisdeniel aloisdeniel self-assigned this Jun 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants