Creating a target light in Ogre

Evak

21-01-2009 18:18:58

Hi Lioric,

oFusion exports target lights correctly so when you move the target or light, the lights always faces the target. This is really cool :)

I was wondering how we create a target light in Ogre that can be picked up and exported correctly by the serializer library? I guess I'm just asking for breakdown for how the target lights are set up by ofusion so we can duplicate the behavior in our editor and save the target light correctly in the OSM.

Lioric

27-01-2009 02:49:00

Hi Evak, it seems that i have unintentionally missed this thread :roll:

Its very late here, but i will post the needed information first thing in the morning

Lioric

28-01-2009 16:00:03

Just create a light and a target node in your application , the target can be any node (a helper is suggested, but can be any node in your scene) and use the "setAutoTracking" method in the light object to attach the target, as this:



yourLight->setAutoTracking(true, targetNode);



When this scene is saved, the light will be created correctly as a target light and will be loaded correctly by the oScene Loader library

Evak

29-01-2009 01:37:40

Oh thanks will pass it on to our coders. Much easier than I thought :)