One major problem is passing the terrain data from the region to theÂ protocol stack. The existing implementation passed an array of floatsÂ that were presumed to be a 256x256 array of region terrain heights.Â TheÂ TerrainChannelclass is an attempt to hide the terrain implementationÂ fromÂ TerrainModule.Â TerrainChannelÂ can’t be passed into the protocol stack (LLClientView) becauseÂ TerrainChannelÂ is defined as part of OpenSim.Region.FrameworkÂ which is not visible to the protocol code.
My solution is to create theÂ TerrainDataÂ class inÂ OpenSim.Framework.Â TerrainData just wraps the data structure for the terrain and additionally hasÂ the attributes giving X and Y size.
I didn’t want to change the signature of IClientAPI since so many external modulesÂ rely on it.Â It should be Â changed to pass TerrainData rather than a float.Â I decided to not change IClientAPI but rather have LLClientView ignoreÂ the passed array and instead reach back into the associated scene and fetch theÂ TerrainData instance.
At the moment, all of these changes are in the varregion branch of the OpenSimulator repository.