Hi,
I'm working on a space game (kind of like asteroids) but I'd like to
be able to adjust the mass of the ship. I can't, for the life of me,
figure out how.
My code sets the properties for a ship with:
def Ship(self, mass, pos, ship):
M = ode.Mass()
M.setSphere(mass, 0.05)
ship.setMass(M)
ship.setPosition(pos)
But how do I go back later, and adjust the mass? I've tried (using Pygame):
elif e.key == K_d:
#self.Ship(mass, position, ode.Body)
M = ode.Mass()
M.setSphere(2500, 0.05)
M.adjust(100)
print M
playerShip.setMass(M)
print playerShip.getMass(M)
Yet this does nothing, (as far as I know) to the existing ship (it's
velocity doesn't change). Am I creating a new Mass for the object
instead of modifying an existing one?
Thanks,
Joe
--
All Your Base Are Belong To Us!!! chown -r us ./base
"After three days without programming, life becomes meaningless.'' --
Tao of Programming Book 2
|