safon007 / gamekit

Automatically exported from code.google.com/p/gamekit
0 stars 0 forks source link

transformInputState iOS #289

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.download r1912
2.build
3.test scene:getPickRay() and mouse-over brick

What is the expected output? What do you see instead?
the scene ray is not correct...

What version of the product are you using? On what operating system?
r1912 : iOS 5 : ipod4g

Please provide any additional information below.

aside from transforming by DeviceOrientation input shall be scaled like this

void gkWindowIOS::transformInputState(OIS::MultiTouchState& state)
{
    GK_ASSERT(m_rwindow && m_rwindow->getViewport(0));

    Ogre::Viewport* viewport = m_rwindow->getViewport(0);
    float screenScale = [[UIScreen mainScreen] scale];
    int w = viewport->getActualWidth();
    int h = viewport->getActualHeight();
    int absX = state.X.abs*screenScale;
    int absY = state.Y.abs*screenScale;
    int relX = state.X.rel*screenScale;
    int relY = state.Y.rel*screenScale;
    UIDeviceOrientation orientation =[UIDevice currentDevice].orientation;

......switch axes by current deviceOrientation
}

to receive the correct ray for your "mouse"

have fun...

thank you

Original issue reported on code.google.com by nolteme...@googlemail.com on 30 Nov 2012 at 11:08

GoogleCodeExporter commented 8 years ago
Thx, nevertheless plz provide always patches. No matter if it is just one line 
to change or more...

Original comment by thomas.t...@googlemail.com on 1 Dec 2012 at 1:37

GoogleCodeExporter commented 8 years ago
ok ... i will do that.

i try not to change the design to much, but rather help to fix issues...
i have for example extended the lua-api for some functions i need and changed 
OGRE_NO_VIEWPORT_ORIENTATIONMODE to 1 etc. , thus possibly collide with your 
plans/work/design. this makes it a little cumbersome for me to make a patch 
from my branch...

how is this group coordinated?

well, i will keep a second branch closer to trunk...

Original comment by nolteme...@googlemail.com on 1 Dec 2012 at 6:52

GoogleCodeExporter commented 8 years ago
The group is organized that people that want to extend gamekit, extend it in a 
way that it won't break anything or only with a very detailed description about 
why and what.... Then commit a patch, a committer checks that and commits it if 
ok...after a couple of patches you can get write-access.   

Usually simple...
but since you are only working on iOS-stuff that I actually can't check 
immediately it is a bit more complicated...I can't commit those without 
testing...

...extending the lua-api is perfectly fine. There is no real plan behind this. 
Add what you need. But make sure to set everything so that the desktop-version 
still compiles. (Digging into cmake is important for that if not already done) 
Someday we need to clean up for an API2.0 or such.

Actually it would be great to have someone who maintains the iOS-Version...

To set orientation-mode have a look at the cmake scripts. 

Original comment by thomas.t...@googlemail.com on 2 Dec 2012 at 3:39