Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
fixtone
Gnoblar
Posts: 19 Joined: Tue Jan 24, 2012 1:32 pm
Location: Barcelona
x 2
Quote
0
login to like this post
Post
by fixtone » Mon Jul 16, 2012 11:16 pm
Hello,
I have a problem with OIS mouse moved.
The mouse moved works backwards, I use LandScape Right in info.plist file.
This is the video.
[youtube]HEqDyF8hl2M[/youtube]
In the function touchMoved call:
Code: Select all
m_pTrayMgr-> injectMouseMove (evt)
I am using Xcode 4.3, IOS 5.1 and ogre 1.8
P.D: If I use SetOrientation method of viewport produce an Exception es not suported.
Thanks
Last edited by
fixtone on Tue Jul 24, 2012 8:22 am, edited 1 time in total.
masterfalcon
OGRE Retired Team Member
Posts: 4270 Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:
Quote
0
login to like this post
Post
by masterfalcon » Tue Jul 17, 2012 6:34 am
SetOrientation was only supported for OGRE 1.7. You'll see that we transform the touch coordinates somewhere in the sample code(not sure where it is right now). You may need to do the same.
fixtone
Gnoblar
Posts: 19 Joined: Tue Jan 24, 2012 1:32 pm
Location: Barcelona
x 2
Quote
0
login to like this post
Post
by fixtone » Tue Jul 17, 2012 7:54 am
Thank you very much masterfalcon.
Just one question: how to transform the touch coordinates?
Can you show me an example?
masterfalcon
OGRE Retired Team Member
Posts: 4270 Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:
Quote
0
login to like this post
Post
by masterfalcon » Tue Jul 17, 2012 8:02 am
Yeah, see the implementation of transformInputState in SampleContext.h
fixtone
Gnoblar
Posts: 19 Joined: Tue Jan 24, 2012 1:32 pm
Location: Barcelona
x 2
Quote
0
login to like this post
Post
by fixtone » Tue Jul 17, 2012 7:23 pm
Thanks masterfalcon,
But I have a question, I can't modify the evt.state because is read only read-only.
I let my code to know how to fix it.
Code: Select all
bool MenuState::touchMoved(const OIS::MultiTouchEvent &evt)
{
OIS::MultiTouchState state = evt.state;
AdvancedOgreFramework::getSingletonPtr()->transformInputState(state);
if(AdvancedOgreFramework::getSingletonPtr()->m_pTrayMgr->injectMouseMove(evt)) return true;
return true;
}
AdvancedOgreFramework.cpp (Only LandScape Right)
Code: Select all
// Variation based upon device orientation for use with a view controller
void AdvancedOgreFramework::transformInputState(OIS::MultiTouchState &state)
{
int w = m_pRenderWnd->getViewport(0)->getActualWidth();
int h = m_pRenderWnd->getViewport(0)->getActualHeight();
int absX = state.X.abs;
int absY = state.Y.abs;
int relX = state.X.rel;
int relY = state.Y.rel;
state.X.abs = w - absY;
state.Y.abs = absX;
state.X.rel = -relY;
state.Y.rel = relX;
}
I hope your answer. Thank you very much;
fixtone
Gnoblar
Posts: 19 Joined: Tue Jan 24, 2012 1:32 pm
Location: Barcelona
x 2
Quote
0
login to like this post
Post
by fixtone » Wed Jul 18, 2012 10:02 pm
Please Help!
I'm doing a study to determine the feasibility of using OGRE at work.
fixtone
Gnoblar
Posts: 19 Joined: Tue Jan 24, 2012 1:32 pm
Location: Barcelona
x 2
Quote
0
login to like this post
Post
by fixtone » Tue Jul 24, 2012 8:21 am
I've solved the problem, then show the solution to someone helps.
Code: Select all
bool MenuState::touchMoved(const OIS::MultiTouchEvent &evt)
{
OIS::MultiTouchState state = evt.state;
AdvancedOgreFramework::getSingletonPtr()->transformInputState(state);
Ogre::OverlayContainer* o = AdvancedOgreFramework::getSingletonPtr()->m_pTrayMgr->getCursorContainer();
o->setPosition(state.X.abs,state.Y.abs);
return true;
}
Only for Right Landscape
Code: Select all
void AdvancedOgreFramework::transformInputState(OIS::MultiTouchState &state)
{
int w = m_pRenderWnd->getViewport(0)->getActualWidth();
int h = m_pRenderWnd->getViewport(0)->getActualHeight();
int absX = state.X.abs;
int absY = state.Y.abs;
int relX = state.X.rel;
int relY = state.Y.rel;
state.X.abs = absY;
state.Y.abs = h - absX;
state.X.rel = relY;
state.Y.rel = -relX;
}
Thank you very much for the help masterfalcon.