c# - Farseer physics mass/weight issue -
i have created platformer game using farseer physics player , objects etc having problem mass on objects.
the player composed wheel , torso connected joint , works when not setting mass on object. not using mass creates unstable simulation because when changing texture on object, mass increase or decrease strangely. when assigning correct mass , density nothing works supposed , don't know why. increase force , such correspond new weight on stuff when moving player slides , forth , kind of bounce sideways when stopping. , when picking object hacks on screen.
so know solution cause i'm stuck?
the thing have found far mass of body in farseer physics calculated density of fixtures. hence weight increase/decrease when changing texture. can't work when manually assigning weight.
taken box2d manual:
the fixture density used compute mass properties of parent body. density can 0 or positive. should use similar densities fixtures. improve stacking stability.
the mass of body not adjusted when set density. must call resetmassdata occur.
fixture->setdensity(5.0f); body->resetmassdata();
you may need reset mass data in order work properly.
Comments
Post a Comment