Setting Angular velocity of a child rigid body object

Hello,
I am rather new blender game engine. I am trying to assign Angular velocity of an object which is a child of an empty.

I realized that I had to change the objects type from static to dynamic/rigid-body to be able to set Angular velocity (which was some thing I was reluctant to do, since I only wanted to give it a desired Angular velocity and not any other characteristics of a rigid-body object… So I would be thank full if the community can show me a way to give the object a rotations/sec without converting it to a rigid body)… But my next issue is that even though I am able to apply desired Angular velocity to the rigid body object, once I set it as a child to an empty I am no longer able to assign a desired Angular velocity. The getAngularVelocity throws a (0,0,0) vector.

It is to be noted that I am implementing everything using python codes.

Thank you for the replies.

Physics objects:

  • rigid body
  • soft body
  • dynamic

These are objects hows movement is managed by the Physics engine. Any velocity belongs to this objects as itis a physics attribute.

When you parent a physics object to another object, you explicitely unbind it from physics turning it into a static object. The physics engine will ignore this object as any calculation would be overriden by the parent-child relationship.

Movement without physics means you explicitely set orientation and or position (which in terms of physics is teleporting).

Thank you for the reply Monster. That’s unfortunate for me as I would prefer to use rotation per sec information. In this case, could you tell me if there is an option to get the time step for the python code execution (I. E. The time difference between the current execution and the previous py code execution)?..

Thank you for the reply.

That’s actually quite unfortunate for me. I have only the rotations/sec information and would have been easier for me to implement.In which case, it would be a great help if you would also tell me a hint on how I could determine the difference (in sec) between the previous py code execution and the current execution. To be exact the time step of code excecution.

Thank you in advance

just as a warning, i believe setting angular velocity to (0,0,0) is broken in some recent old versions, maybe 2.75 and lower? but i know it works in 2.77, and does not work in 2.74 (the only two i use).

consider assigning the worldPosition instead of parenting, using an empty as a placeholder, and locking your physics object to that.

I only wanted to give it a desired Angular velocity and not any other characteristics of a rigid-body object…

Are there any specific characteristics you don’t want for the Rigid Body type physics? If you want, you can lock the x rotation, y rotation, z rotation, x location, y location, and/or z location of the object under the Physics menu (Physics -> Lock Translation/Lock Rotation), and you can even mess with damping values, etc. You can actually make the rigid body object behave very much like a static object (under some circumstances).

But my next issue is that even though I am able to apply desired Angular velocity to the rigid body object, once I set it as a child to an empty I am no longer able to assign a desired Angular velocity.

Not sure what you are looking for (the desired behaviour), but you can remove the object’s parent with object.removeParent(), and then apply physics calculations.

Oh, weird. I did not see kesvg90’s previous replies.

The default logic frame rate is 60 frames per second. This typically matches the render frame rate so you can see the result of the logic.

info: The animation frame rate is typically 24 frames per second. But it is played at render frame rate. This is possible as the animation system works with float frames (e.g. 2.6) rather than discrete values (2).

When you use logic bricks, such as the motion actuator (which does exactly what you are aiming for) you provide the parameters in BU/s (blender units per second) or deg/s (degree per second).