Posted: 4th Dec 2011 0:28
The documentation makes reference to a "center of rotation" in addition to center of mass, as if they were different.

ie:

"Setting it to 0,0 will put the COM on the sprite's offset point (and center of rotation)."

Please excuse me... but what in Hades is the "center of rotation"???

Can it be set? Can it be, ah... get?

It seems to me that the center of mass should be the center of rotation... yes?
Posted: 4th Dec 2011 2:02
The center of mass is well I suppose the point where an object is symetrical in mass in every direction. The center of rotation is...well pretty self explanetory if you ask me. I think however the center of rotation can be moved as you desire. Take a knife for instance. The center of mass will always be in one place but you could change the center of rotation to be at the tip of the blade, the center of the knife or at the end of the handle. It might not even have to be on the knife it could be external to it as well. Changing the center of rotation simply changes how the object rotates. Well that's my understanding of it atleast.
Posted: 4th Dec 2011 3:59
Right, so if you apply a force to an object off of it's center of mass... it will begin to rotate around the center of mass (unless otherwise constrained)

So that makes the concept of some different "center of rotation" somewhat of a mystery...

You mention that you think the center of rotation can be moved... are you aware of any commands to do this?

Thanks.
Posted: 4th Dec 2011 10:12
If you set the angle of a sprite it's angle will be set about the top left corner of the sprite unless you use "setSpriteAngleByOffset", this will rotate it around the offset point (COM on a physics sprite).

COM is the offset point of a physics sprite that it is rotated about.

In other words the Centre of Rotation is the Centre of Mass on a physics sprite. On a none physics sprite this is the top left corner of the sprite unless you use "setSpriteOffset".
Posted: 4th Dec 2011 17:57
Ahh... I see... two different methods for two different states!

So really there is no distinct "center of rotation" at all... just the COM and the sprite offset.

So perhaps the documentation, instead of saying this:
"Setting it to 0,0 will put the COM on the sprite's offset point (and center of rotation)."

Should say this:
"Setting it to 0,0 will put the COM on the sprite's offset point."
Posted: 4th Dec 2011 18:02
@baxslash

I just tested SetSpriteAngle() on both a physics sprite and a non physics sprite, and it seems to behave differently than your description.

On a physics sprite, it rotates about the COM (as expected)

On a non physics sprite, it doesn't rotate about the top left... it rotates about the offset.

I don't see that there is a SetSpriteAngleByOffset() command.

Regards,
SMS
Posted: 4th Dec 2011 20:09
No you're right I'm remembering it wrong. There is only one "setSpriteAngle" command. When there's no offset applied a normal sprite would just rotate around it's top left.
Posted: 4th Dec 2011 20:12
Right... though I *think* there is always an offset... it's just that before it is set by the user, it is at 0,0.
Posted: 4th Dec 2011 21:26
When there's no offset applied a normal sprite would just rotate around it's top left.

...that's effectively an offset of 0,0. I could argue that an offset of zero is actually not an offset but I won't do that... damn, just did
Posted: 4th Dec 2011 21:40
One could argue that zero is not a number