Widget rotation, pivot point

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

kiske1
Just popping in
Just popping in
Posts: 17
Joined: Fri May 20, 2016 11:53

Widget rotation, pivot point

Postby kiske1 » Mon Sep 05, 2016 14:52

Hello,

I'm rotating a window around z axis, so 2D rotation only, using Element::setRotation. I'm creating the quaternion like this:
w:1.0
x:0.0
y:0.0
z:desired angle

This rotates the window around it's center point, is it possible to rotate the window around an arbitrary pivot point (say for example the lower left corner)?

YaronCT
CEGUI Team
Posts: 448
Joined: Fri Jun 19, 2015 12:18
Location: Kiryat-Bialik, Israel

Re: Widget rotation, pivot point

Postby YaronCT » Mon Sep 05, 2016 15:34

@kiske1: No, but it's easy to implement. I implement it and will let u know when it's ready (prolly won't take long).

kiske1
Just popping in
Just popping in
Posts: 17
Joined: Fri May 20, 2016 11:53

Re: Widget rotation, pivot point

Postby kiske1 » Mon Sep 05, 2016 16:33

Thank you very much! :D

YaronCT
CEGUI Team
Posts: 448
Joined: Fri Jun 19, 2015 12:18
Location: Kiryat-Bialik, Israel

Re: Widget rotation, pivot point

Postby YaronCT » Wed Sep 07, 2016 10:08

@kiske1:

NP :D

I've pushed an implementation to a branch "pivot". I've broken ABI so it's based on branch "v0" (which is API-compatible but not ABI-compatible with cegui releases 0.8.x or the cegui dev branch "v0-8"). Plz test it.

The pivot point is defined by a UVector3 (aka Vector3<UDim>), so u can use relative dimensions as well is arbitrary z values. The depth of a widget is considered to b 0, so it currently only makes sense to use an absolute dimension in z.

kiske1
Just popping in
Just popping in
Posts: 17
Joined: Fri May 20, 2016 11:53

Re: Widget rotation, pivot point

Postby kiske1 » Fri Sep 30, 2016 13:15

Hi @YaronCT, I haven't got the time to check this out, but I haven't forgotten it, and I'll test as soon as possible.

YaronCT
CEGUI Team
Posts: 448
Joined: Fri Jun 19, 2015 12:18
Location: Kiryat-Bialik, Israel

Re: Widget rotation, pivot point

Postby YaronCT » Fri Sep 30, 2016 19:35

@kiske1: Alright, do note though that the longer u wait, the more difficult it becomes for me to continue working on the issue coz I need to recall the details. And certainly while u don't test it it won't increase my motivation to start helping u on a new issue, that I now see you've asked, which also makes me wonder how it is u don't have time to check this out.

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Widget rotation, pivot point

Postby Ident » Fri Sep 30, 2016 19:39

Seems like you have no choice but to test is, kiske.
CrazyEddie: "I don't like GUIs"

kiske1
Just popping in
Just popping in
Posts: 17
Joined: Fri May 20, 2016 11:53

Re: Widget rotation, pivot point

Postby kiske1 » Tue Oct 11, 2016 14:13

Hello!

I got commissioned to other projects, this is why I can only dedicate much less time that I'd like to this project which uses CEGUI. I feel really sorry if I seemed to be "ungrateful", it was not my intenction...

Today I got the time to test the pivot branch and it does exactly what I needed! Do you plan to include this in the 0-8 branch?

YaronCT
CEGUI Team
Posts: 448
Joined: Fri Jun 19, 2015 12:18
Location: Kiryat-Bialik, Israel

Re: Widget rotation, pivot point

Postby YaronCT » Thu Oct 13, 2016 07:36

@kiske1: No, it breaks ABI therefore it's implemented in branch "v0", and that's where I'll merge it. That branch is API compatible with cegui 0.8.x so u should b able to use it without changing your code.

YaronCT
CEGUI Team
Posts: 448
Joined: Fri Jun 19, 2015 12:18
Location: Kiryat-Bialik, Israel

Re: Widget rotation, pivot point

Postby YaronCT » Sat Oct 22, 2016 10:31

@kiske1: I've merged it into branches "v0" and "default".


Return to “Help”

Who is online

Users browsing this forum: No registered users and 6 guests