Does anyone know if there’s a method in python that can get the linear and angular acceleration of an object? I haven’t found anything that could work, and I’d rather not have to manually account for all the forces on an object. I basically just need the net force and torque. Thanks.
object.getLinearVelocity?
I’m pretty sure there isn’t a built in method to get an object’s acceleration. However, it’s easy to do this yourself.
Just have two velocity values for your object, say velOld and velNew. Each frame, you can get the object’s acceleration with the following.
velOld = velNew
velNew = object.getLinearVelocity()
accel = velNew - velOld
agoose77: I thought about that, and I could get the average acceleration from the velocities in two subsequent frames, but I would like to be able to get the instantaneous acceleration in a single frame. If only there was something like object.getNetForce…
This isn’t possible. Purely because, there isn’t a place that i know of where an object can be in two places at once.
However, it is easy to say that at frame 1, the accelleration = velocity / 60 (assuming frame rate = 60)
then store the current velocity, and use it as the comparison for the next frame.
That method is not yet implemented, as stated there.
That is almost what I’m looking for. I haven’t tried that, but the python api on blender.org says that isn’t implemented yet. And it looks like it only returns the linear force acting on the object center, there’s no specified point so it won’t give you the torque. I’d like to get both the net force and net torque on an object. Might have to just use the average acceleration to approximate it.