Irrlitch on the IPhone
-
- Posts: 63
- Joined: Sat Sep 12, 2009 6:08 pm
- Contact:
Irrlitch on the IPhone
JUST RELEASED
My Rocket Pod,
for the iphone, using irrlicht with custom additions for iphone accelerometer and touch control
this is a virtual toy app,no timers, no hi scores, just fling and landing for fuel(or crashing) on a lunar obsticle course. 3D version of a lunar lander style game with a 3rd person chase cam aka tomb raider.
if any one wants a free copy reply or PM me ill send a voucher code for the iStore (48 available)
valid for US costomers only
My Rocket Pod,
for the iphone, using irrlicht with custom additions for iphone accelerometer and touch control
this is a virtual toy app,no timers, no hi scores, just fling and landing for fuel(or crashing) on a lunar obsticle course. 3D version of a lunar lander style game with a 3rd person chase cam aka tomb raider.
if any one wants a free copy reply or PM me ill send a voucher code for the iStore (48 available)
valid for US costomers only
I concur, code samples would be nice!
Especially around touch handling. I myself have a running iphone app using irrlicht, but touch support does not work yet - eaglview does not trigger them.
I would be curious about your setup...
** EDIT **
Figured it out - was trying to create my own eagl view while irrlicht iphone device was already creating a uiview, which does respond to touch events... Touch handling now finally working.
I am using Rockfish (John Hatch) addon for injecting touches into irrlicht event receiver, which works like a charm with minor modifs against irrlicht ogles svn branch. Thank you Rockfish for the great time saver.
Especially around touch handling. I myself have a running iphone app using irrlicht, but touch support does not work yet - eaglview does not trigger them.
I would be curious about your setup...
** EDIT **
Figured it out - was trying to create my own eagl view while irrlicht iphone device was already creating a uiview, which does respond to touch events... Touch handling now finally working.
I am using Rockfish (John Hatch) addon for injecting touches into irrlicht event receiver, which works like a charm with minor modifs against irrlicht ogles svn branch. Thank you Rockfish for the great time saver.
L/
Can you elaborate, what kind of problem?
For instance, do you have issues around integrating the code, compiling, setting up the xib file, responding to touch events, ...?
I integrated Rockfish's code into irrlicht itself as per the package instructions, and recompiled.
You need to attach the irrlicht delegate to your view if that is not already the case in the latest ogles branch, then you should be able to trace the events getting fire and caught inside the delegate code.
For instance, do you have issues around integrating the code, compiling, setting up the xib file, responding to touch events, ...?
I integrated Rockfish's code into irrlicht itself as per the package instructions, and recompiled.
You need to attach the irrlicht delegate to your view if that is not already the case in the latest ogles branch, then you should be able to trace the events getting fire and caught inside the delegate code.
L/
Thanks for replying acroroc.
The problem I was initially having was that I couldn't seem to workout where the event was being received.
I spotted that I hadn't correct implemented the rockfish patch and the entries in CIrrDeviceIphone were not in place.
I then added the patch files and initially there was about 42 errors. I worked out that this was due to changes in Irrlicht 1.7.1 that wasn't supported by the rockfish patch. I made changes to the rockfish files and managed to get the everything down to 2 errors.
The error was related to _createdDeviceEx existing in both the irrlicht.h file and the CIrrDeviceIphone.cpp file.
After many hour of messing with these files to try and get them to build into the libirrlichtdev.a file I managed to find a version in someones google svn repository that had been updated in June 2010 to add support for multitouch. I implemented these files and I can now successfully build the library.
now I'm not sure how to implement the event system so I can track the touches in my app.
My current structure is based on the FuzzYspo0N iphonetemplate.
So my main game processing code is in game.mm
I'm trying to add my own event listener class using the following code in the game.h file (very basic at the moment(
and in my game.mm file I am setting the event Receiver using
The problem that I am now having is that the 'MyEventReceiver' doesn't seems to be listening to any events so I think I'm missing something at some point (most likely something simple).
I'm feeling that I need to be using ISceneNodeAnimatorCameraTouch.h somewhere but not sure where or how.
Hopefully that is enough information for you to see where I am and hopefully you can point me in the right direction.
Thanks
The problem I was initially having was that I couldn't seem to workout where the event was being received.
I spotted that I hadn't correct implemented the rockfish patch and the entries in CIrrDeviceIphone were not in place.
I then added the patch files and initially there was about 42 errors. I worked out that this was due to changes in Irrlicht 1.7.1 that wasn't supported by the rockfish patch. I made changes to the rockfish files and managed to get the everything down to 2 errors.
The error was related to _createdDeviceEx existing in both the irrlicht.h file and the CIrrDeviceIphone.cpp file.
After many hour of messing with these files to try and get them to build into the libirrlichtdev.a file I managed to find a version in someones google svn repository that had been updated in June 2010 to add support for multitouch. I implemented these files and I can now successfully build the library.
now I'm not sure how to implement the event system so I can track the touches in my app.
My current structure is based on the FuzzYspo0N iphonetemplate.
So my main game processing code is in game.mm
I'm trying to add my own event listener class using the following code in the game.h file (very basic at the moment(
Code: Select all
class MyEventReceiver : public IEventReceiver
{
public:
virtual bool OnEvent(const SEvent& event)
{
printf("test");
return false;
}
};
Code: Select all
MyEventReceiver* rec;
mDevice->setEventReceiver(rec);
I'm feeling that I need to be using ISceneNodeAnimatorCameraTouch.h somewhere but not sure where or how.
Hopefully that is enough information for you to see where I am and hopefully you can point me in the right direction.
Thanks
UPDATE:
I've managed to recieve the event now by using the following code to attach the CSceneNodeAnimatorCameraTouch() node to the camera.
Now when I touch the screen the 'MyEventReceiver' class is called 3 times and then a "EXC_BAD_ACCESS" error is thrown on line 75 or CSceneNodeAnimatorCameraTouch.cpp
With a bit of testing the error only occurs when I leave my finger on the iPhone so it is being cased by the iPhone TouchesMoved method and not the tap.
I've managed to recieve the event now by using the following code to attach the CSceneNodeAnimatorCameraTouch() node to the camera.
Code: Select all
ISceneNodeAnimator* anm = new CSceneNodeAnimatorCameraTouch();
camera->addAnimator(anm);
anm->drop();
Code: Select all
case EET_MOUSE_INPUT_EVENT:
if (evt.MouseInput.Event == EMIE_MOUSE_MOVED)
{
TouchPos = TouchControl->getRelativePosition(); <== Line 75
return true;
}
break;
-
- Posts: 2
- Joined: Tue Jul 20, 2010 7:17 pm