Search found 518 matches

by pTymN
Tue Aug 19, 2014 8:31 am
Forum: General Discussion
Topic: Common causes for SolveTOI freeze issues?
Replies: 1
Views: 858

Re: Common causes for SolveTOI freeze issues?

I bet if you put assert(!isnan(someFloatArgBeingSentToBox2D)); and assert(!isinf(someFloat)); you'll find that one of those gets hit. It was a long process for me, as there were many subtle ways my own code was sending Box2D bad float values, and some of those causes rarely happened in my code.
by pTymN
Thu Jul 24, 2014 6:27 am
Forum: iPhone
Topic: Beziere Curve movement
Replies: 1
Views: 2410

Re: Beziere Curve movement

You need to take an account of the old position to determine the offset between positions in order to decide the velocity needed. TSBody* gameObject = (TSBody*)body->GetUserData(); if(gameObject) { gameObject->update(time); const b2Transform& transform = body->GetTransform(); b2Vec2 currentPosit...
by pTymN
Tue Jul 22, 2014 9:25 am
Forum: Bugs, Requests, and Feedback
Topic: Storing collision filter masks in b2DynamicTree?
Replies: 2
Views: 1267

Re: Storing collision filter masks in b2DynamicTree?

I agree, this seems useful. My TSLayer class added a mask to raycasts and aabb queries just like what you described. It is easy to update the collision mask each frame to reflect various object states that might change its collision types.
by pTymN
Tue Jun 03, 2014 7:32 pm
Forum: General Discussion
Topic: Optimizing physics calculations
Replies: 11
Views: 2128

Re: Optimizing physics calculations

To properly implement animated motion for b2_dynamicBody type objects with collision, I recommend instead of SetTransform (teleports) something like this: TSBody* gameObject = (TSBody*)body->GetUserData(); if(gameObject) { gameObject->update(time); const b2Transform& transform = body->GetTransfo...
by pTymN
Tue Mar 25, 2014 9:35 am
Forum: Bugs, Requests, and Feedback
Topic: ApplyForce isn't working as I expect. Is somethong wrong?
Replies: 17
Views: 5345

Re: ApplyForce isn't working as I expect. Is somethong wrong

I think there is a flag on b2World for resetting forces at the end of a Step.
by pTymN
Thu Mar 20, 2014 12:48 pm
Forum: General Discussion
Topic: How to include Box2D in visual studio 2012
Replies: 1
Views: 1571

Re: How to include Box2D in visual studio 2012

I like to include Box2D right into my project, rather than build as a separate lib. Add BOX2DINSTALLPATH\Box2D to your project includes, and then recursively add the Box2D cpp (and h if you want to see them in VS) files in that path into your project. I usually make a new filter in the solution so t...
by pTymN
Mon Mar 03, 2014 5:45 pm
Forum: General Discussion
Topic: Calling b2Body::SetLinearVelocity during contact callback
Replies: 2
Views: 1192

Re: Calling b2Body::SetLinearVelocity during contact callbac

Regarding b2Body velocity, it appears that: b2ContactListener::PreSolve always gives the same velocity as the b2Body had entering b2World::Step b2ContactListener::PostSolve always gives the velocity as adjusted by resolving contact constraints I'm not sure what would happen with joints in the mix, s...
by pTymN
Mon Mar 03, 2014 11:50 am
Forum: General Discussion
Topic: Calling b2Body::SetLinearVelocity during contact callback
Replies: 2
Views: 1192

Calling b2Body::SetLinearVelocity during contact callback

Does calling b2Body::SetLinearVelocity during a contact callback do anything interesting to the contact resolution, or should I only modify the b2ManifoldPoint's normal and tangent impulses to accomplish the desired effect? I wonder, because it seems that a body's transform and velocity are not lock...
by pTymN
Sat Feb 22, 2014 10:09 am
Forum: General Discussion
Topic: Cnst. speed ball and static like collisions with dynamic obj
Replies: 2
Views: 1322

Re: Cnst. speed ball and static like collisions with dynamic

For non physical physics where you have mostly scripted object behaviors and just want the no-overlap aspect: 1) Carefully set physics properties. (e.g. fixed rotation, no friction) 2) Between each b2World::Step, adjust object motion to reflect desired non physical behavior. Generally speaking, you ...
by pTymN
Fri Feb 14, 2014 1:47 am
Forum: Bugs, Requests, and Feedback
Topic: Subtyping Body
Replies: 1
Views: 1046

Re: Subtyping Body

What kinds of methods are you trying to add? The typical approach, and pretty flexible one, is to just hook into b2Body through the userData. You can create your own game object class hierarchy and also route the contact listener calls to those same classes. What's nice about this, it keeps Box2D ve...

Go to advanced search