Apr 14, 2013 at 6:00 PM
Edited Apr 14, 2013 at 7:14 PM
I have a ball created using Body factory and so i needed to specify density....but what if instead i wanted to specify mass primarily and have the density be calculated from the perceived "volume" (not sure how you find volume of a flat object).
i have its size as radius 1/2 meter and its mass i tried setting to 1kg ( body.Mass = 1f;) ...but when i apply a force of 300N (i assume our force is in newtons) it moves about 1/4 of a meter off the ground.......1KG experiencing 9.81 m/s^2 -j gravity getting
a + 300N force in the +j direction moving that little? I don't think that's right...
Player inherits from Entity class directly its constructor:
public Player(World world, Texture2D texture, float radius) : base(world, texture, radius)
body.FixtureList.OnCollision += Body_OnCollision;
player = new Player(world, Content.Load<Texture2D>("Ball"), 1/2f);
player.PixelPosition = new Vector2(GraphicsDevice.Viewport.Width/2f,GraphicsDevice.Viewport.Height/2f);
player.body.Friction = 1f;
player.body.Mass = 1f;
and back in player:
public void Control(PlayerIndex i)
if (GamePad.GetState(i).IsConnected == true)
if (GamePad.GetState(i).IsButtonDown(Buttons.A) && hasJumped == false)
hasJumped = true;
In addition to that torque makes sense...but Force doesnt....am i missing something?
do i have to specify a duration?
EDIT: Don't you hate that when yu finally et around to asking it you find the answer?
I was applying force during the world step dt duration..... thus 300N of force moved the object only a meter since the impulse was almost negligible...
although i still don't get the update() and Step() functions....not sure how to be able to calculate how much impulse i need ... with these timesteps and so on. for a 15kg ball i figured id maybe need about 25N of constant force for 1 second tog et it to move
about 1-2Meters. haven't done the math yet but not sure how with the whole world.Step(1/30f) factored in there...
just set mass to 1kg, applied Linear impulse of 50N in negative y direction...it went 127M in the air from rest....this does'nt make sense :P
made more calculations:
with mass at 1kg
Impusle: 10 15 20 25 ... 50
Displacement in Y direction: 5m 11m 20M 31 127M