Wintermute Engine > Bug reports

Mega bug with rotation

(1/1)

2.0:
Hello!

When I rotate the entity (for example, clock hand) with, for example


--- Code: WME Script ---on "LeftClick"{    this.Rotate = this.Rotate + SomeValue; } 
the visible image of the entiny is rotates, but the "logical" image is not rotated! I.e a can't click the image of the entity to rotate it again. It's necessary to click on that place where the object was initially.
So I have a question - in what place of sourses there was this detachment into two images - visible and logical?.


Mnemonic:
This is a know limitation.

A "fix" would be non-trivial. Currently whenever an interactive entity is painted, it also registers an active rectangle on screen (using Game->m_Renderer->m_RectList.Add()). When the mouse-over is tested, it first checks what active rectangle is under the mouse pointer, and if it's a sprite, it calculates the pixel in it's texture to see if it's transparent (see CBRenderer::GetObjectAt()). To properly handle rotations, the active rectangle would need to store the rotation, then later when the mouse-over is evaluated, you'd need to apply a reverse rotation to get the proper texture coordinate.

The 2D engine in WME2 does it properly, but it's quite different from WME1 code, so it probably won't help you much.

2.0:
Thanks for the answer. Fixing trouble in sources looks pretty difficult, you're right.
I've bypassed this problem by using the auxiliary region entity with per-point rotate transformation in script.

And looking forward for WME2, of course. If it includes strengths of WME (without it small faults), it will be a masterpiece :)

Navigation

[0] Message Index

Go to full version