Irrlitch on the IPhone

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Post Reply
digijohnny
Posts: 63
Joined: Sat Sep 12, 2009 6:08 pm
Contact:

Irrlitch on the IPhone

Post by digijohnny »

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
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Do you have screenshots? And could you provide some code examples for the add-ons for others to use?
Arcoroc
Posts: 51
Joined: Wed Oct 01, 2008 11:40 pm
Location: Canada

Post by Arcoroc »

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.
L/
Garfinkle
Posts: 36
Joined: Wed Jul 07, 2010 11:35 am
Location: Manchester, UK

Post by Garfinkle »

@arcroroc Could you please give me an example of how to use the rockfish example. I'm having trouble working out exactly how to implement it.

Thanks
Arcoroc
Posts: 51
Joined: Wed Oct 01, 2008 11:40 pm
Location: Canada

Post by Arcoroc »

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.
L/
Garfinkle
Posts: 36
Joined: Wed Jul 07, 2010 11:35 am
Location: Manchester, UK

Post by Garfinkle »

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(

Code: Select all

class MyEventReceiver : public IEventReceiver 
{ 
public: 
	virtual bool OnEvent(const SEvent& event) 
	{ 
		printf("test");
		return false; 
	} 
};
and in my game.mm file I am setting the event Receiver using

Code: Select all

MyEventReceiver* rec;
mDevice->setEventReceiver(rec);
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 :D
Garfinkle
Posts: 36
Joined: Wed Jul 07, 2010 11:35 am
Location: Manchester, UK

Post by Garfinkle »

UPDATE:

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();
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

Code: Select all

case EET_MOUSE_INPUT_EVENT:
		if (evt.MouseInput.Event == EMIE_MOUSE_MOVED)
		{
			TouchPos = TouchControl->getRelativePosition();   <== Line 75
			return true;
		}
		break;
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.
Garfinkle
Posts: 36
Joined: Wed Jul 07, 2010 11:35 am
Location: Manchester, UK

Post by Garfinkle »

Got it working now :D

Thanks anyway :D
Arcoroc
Posts: 51
Joined: Wed Oct 01, 2008 11:40 pm
Location: Canada

Post by Arcoroc »

You're welcome, although indeed it doesn't look like you needed much help!

Let me know if you run into anymore caveats, I can certainly forage in my code to see if i can find any difference.

How did you get to resolve your last pointer issue?
L/
arranger1044
Posts: 2
Joined: Tue Jul 20, 2010 7:17 pm

Post by arranger1044 »

Hi I'm trying to compile the lib on iphone with the touch patch but i had no luck till now, can someone post the full set of files required or the already compiled lib?
Post Reply