How can i get center's point of Island ?

compvis

02-06-2009 11:48:48

Hi,

Maybe this is my foolish question. But i still post...

How can i get center's point of Insland that loaded in Hydrax plugin ?

Thank you so much !

Xavyiy

02-06-2009 13:55:42

Do yo mean how to get the center of the island that the hydrax demo/editor include?

As far as I remember, the terrain scene manager sets the (0,0) terrain corner in the (0,X,0) world position, so.. you can get the middle of the terrain with:
Ogre::Vector3 center = Ogre::Vector3(TerrainWidth, 0, TerrainHeigth)/2;

Sizes are stored in Island.cfg:
PageWorldX=3000
PageWorldZ=3000
so...

Ogre::Vector3 center = Ogre::Vector3(1500, 0, 1500);

:)