Page 1 of 1
Widget rotation, pivot point
Posted: Mon Sep 05, 2016 14:52
by kiske1
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)?
Re: Widget rotation, pivot point
Posted: Mon Sep 05, 2016 15:34
by YaronCT
@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).
Re: Widget rotation, pivot point
Posted: Mon Sep 05, 2016 16:33
by kiske1
Thank you very much!
Re: Widget rotation, pivot point
Posted: Wed Sep 07, 2016 10:08
by YaronCT
@kiske1:
NP
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.
Re: Widget rotation, pivot point
Posted: Fri Sep 30, 2016 13:15
by kiske1
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.
Re: Widget rotation, pivot point
Posted: Fri Sep 30, 2016 19:35
by YaronCT
@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.
Re: Widget rotation, pivot point
Posted: Fri Sep 30, 2016 19:39
by Ident
Seems like you have no choice but to test is, kiske.
Re: Widget rotation, pivot point
Posted: Tue Oct 11, 2016 14:13
by kiske1
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?
Re: Widget rotation, pivot point
Posted: Thu Oct 13, 2016 07:36
by YaronCT
@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.
Re: Widget rotation, pivot point
Posted: Sat Oct 22, 2016 10:31
by YaronCT
@kiske1: I've merged it into branches "v0" and "default".