javascript - Why gravity acceleration is 0.0004 in PhysicsJS? -
or, perhaps, better, mean?
what units supposed be?
if i'm trying simulate friction against "background", this:
return .velocitydirection .mult(mu * this.mass * g) .negate();
i expect use g 9.80665 m/s^2. working way before physicsjs:
var frictionforce; frictionforce = vec2.create(); vec2.scale( frictionforce, vec2.negate( frictionforce, this.velocitydirection ), mu * this.mass * g ); return frictionforce;
was using glmatrix linear algebra.
i considering mass in kilograms , forces in newtons (etc) in physicsjs doesn't seem work that. (for example: if have circle body radius 1, it's 1 what? cause it'll make difference when have use value else, , when "converting" pixels on screen)
now i'm using physics library feel i'm missing of physics...
i hope can point me in right direction understand better. i'm going through api docs right , learning lot not i'm finding answers i'm wishing for.
update
i received straightforward answer. let interested know did then...
thanks jasper , dandelany came understand how of physicsjs works much better. achieve "dream" of using inputs in newtons, metres per second squared (etc) in physicsjs (and have configurable pixels per metre ratio) decided create integrator.
it's slight variation of original (and default) verlet integrator. explain it, more or less, @ (crude) article metres, seconds , newtons in physicsjs
the units pixels distance, , milliseconds time.
so acceleration 0.0004
pixels/ms/ms
using meters doesn't make sense variety of reasons. number of pixels per inch changes depending on device. also, if did conversion, acceleration of 9.8 m/s/s appear fast because computer simulations want give appearance of looking @ distance... wouldn't want meter on screen correspond meter in simulation.
Comments
Post a Comment