Zeroing out angular velocity of Dynamic object not possible

### edited after realizing that damping in the .blend demo was not set to Zero! ###

Dear all,

maybe is just my inexperience or maybe I’ve missed something during the learning process, but I’ve got a huge problem with setAngularVelocity() and setLinearVelocity().
I can’t use this methods to set a GameObject angular or linear velocity to Zero (null vector).

Please see the .blend file attached

This behavior is preventing me to easily implement rudimentary control loops based on thresholds

I hope someone could help

Thank you

Attachments

problem_v1.blend (481 KB)

Iirc. The setter methods consider null vectors as false input. Try using the angular velocity and linear velocity attributes instead

Thank you agoose, I will look into that. In the meantime i’ve edited the .blend file in my previous post because I realized it was not showing my problem correctly.

By the way, I’ve just realized that in the problem.blend file the Cube stops (with delay) not because of

cube.setAngularVelocity([0.0,0.0,0.0])

but because the Motion actuator de-activation

I think I’ll need some more time to feature out what exactly my problem is…

You need at least a small amount on any of the axis. I suggest 0.0002 on Z as it has the least impact. Btw. you can do this with the MotionActuator too.

Ok guys, I was freacking out because I didn’t set damping to ZERO in the problem demo! Of course this caused all sorts of “strange” behaviors that i couldn’t understand. Now I’m back on track :evilgrin:

So, I’ve tried with angular and linear velocity attributes to, as suggested by agoose, but it didn’t work (please see attached)

You need at least a small amount on any of the axis. I suggest 0.0002 on Z as it has the least impact. Btw. you can do this with the MotionActuator too.

Does this mean it is NEVER possible to set velocities to Zero? No metter how?

This is really bad for me…

I’ve already thought about using very small velocity values, but this doesn’t fit my purpose very well. I really would like the object that is rotating to STOP if I tell it so…

I’m aware I could use Motion actuator, but this is not going to make any difference when trying to set velocity to null vector, isn’t it?

Attachments

problem_v2.blend (484 KB)

Um monster, aren’t you forgetting:


obj.worldLinearVelcoty = [0,0,0]

99% sure this works.

I’m sorry, that should have been tested in the previous post attachment, but I’ve picked the wrong file. Now it’s correct.
Anyway, it doesn’t work.
I’ve tested .worldAngularVelocity = [0,0,0] and not .worldLinearVelcoty = [0,0,0], but i don’t think this makes any difference (further confirmation coming soon)

You are right. The small values are for the actuator.

angular and linear velocities are different thinks with different effects.

setting linear velocity to Zero with

obj.worldLinearVelcoty = [0,0,0]

EDIT: working!!!

(see attached)

Attachments

problem_v3.blend (484 KB)

It works for me (2.71, 64bit Win7)

You are absolutely RIGHT. Don’t ask me why I said it was not :smiley:

So, this leaves only

obj.worldAngularVelcoty = [0,0,0]
not working…

Right??

Someone please confirm, obviously I’m not thinking straight anymore!!! :spin: :smiley:

Angular velocity is the rotation, it will stop it rotating.

I’m pretty sure NiV87 is correct. You don’t appear to be able to set an object’s angular velocity to zero. I tried multiple different ways:

obj.worldAngularVelocity = [0, 0, 0]
obj.worldAngularVelocity.magnitude = 0
obj.worldAngularVelocity.zero()
obj.worldAngularVelocity.x = 0
obj.worldAngularVelocity.y = 0
obj.worldAngularVelocity.z = 0

None of these worked. The best you can do is make the vector’s magnitude really small.

obj.worldAngularVelocity.magnitude = .000001

own.worldAngularVelocity*=0

??

mobius is right, you can’t set it to zero,

looks like a bug.

Angular velocity is the rotation, it will stop it rotating.

I know! But it won’t!

own.worldAngularVelocity*=0

Not working either…

looks like a bug.

If not a bug, I would call this “something that needs to be changed”.
It’s pretty obvious that, eventually, someone will need to setAngularVelocity() to [0,0,0]. Unfortunately that’s me right now! :frowning:

I tested with these versions: 2.71, 2.70a, 2.70, 2.65a, 2.57b. It seems that all versions have this bug with worldAngularVelocity. It might be a good idea to report this if not reported already.

Edit: reported as T41943 Zeroing out angular velocity not possible.

Thank you!