Giter VIP home page Giter VIP logo

box2d-lite's People

Contributors

erincatto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

box2d-lite's Issues

FeaturePair.value not set correctly?

Hi Erin, Thank you for your great illustrative code, it is very good for learning rigid body dynamics.

From Arbiter::Update,

Contact* cNew = newContacts + i;
int k = -1;
for (int j = 0; j < numContacts; ++j)
{
Contact* cOld = contacts + j;
if (cNew->feature.value == cOld->feature.value)
{
k = j;
break;
}
}

I think FeaturePair.value is used to distinguish contacts. While in Collide.cpp where contacts are computed, the only place to set value is in ClipVertex's constructor which set value=0.
struct ClipVertex
{
ClipVertex() { fp.value = 0; }
Vec2 v;
FeaturePair fp;
};

Does it seem like this value is not correctly assigned for its purpose?

Thank you.

Collide separation name conflict

Hello, I'm trying to study it and try to rewrite box2dlite in c #, but I have a little problem I'm not sure in which Collide method used in the separation, you can show or put under "float separation = Dot (frontNormal, clipPoints2 [I] v) - front;" Change the name? Thank you very much! // I'm sorry I don't speak English so the above is from Google

repeated line on Arbiter.cpp

Hi Erin. Thank you for sharing your great articles for physics.
I'm studying game physics based on your articles

I found one repeated line on Arbiter.cpp

This is first calculation on 137

Vec2 dv = b2->velocity + Cross(b2->angularVelocity, c->r2) - b1->velocity - Cross(b1->angularVelocity, c->r1);

However, it is repeated on 166

dv = b2->velocity + Cross(b2->angularVelocity, c->r2) - b1->velocity - Cross(b1->angularVelocity, c->r1);

Question on order of bodies in arbiter code

In the Arbiter code, there is a comparison of less than in the body pointers for body 1 and 2. Why is this there? Why is this necessary?

Arbiter::Arbiter(Body* b1, Body* b2)
{
if (b1 < b2)
{
body1 = b1;
body2 = b2;
}
else
{
body1 = b2;
body2 = b1;
}

I am porting this code to other language, and I am trying to figure some bugs that are appearing, and in this language, I can't do this type of comparisons on references, so I am just curious if I need to figure something to replicate this. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.