TerraExplorer Events

TerraExplorer provides an extensive set of events available to clients, allowing them to know when the user performs operations on objects (i.e. edits them or flies to them) or intercepts messages before they are sent to their destination containers (allowing the client to modify them or to display them himself). Controlling the camera or objects on the terrain continuously (in a smooth movement) is also made possible with the help of the OnFrame() event. A client can update the position of the objects/camera in each frame by handling this event. Use the ISGWorld61.AttachEvent() method to listen to TerraExplorer events.

 

SGWorld.AttachEvent("onFrame", onFrame);

function onFrame()

{

            var pos = SGWorld.Navigate.GetPosition();

            pos.X += 0.5;

            pos.Y -= 0.2;

            SGWorld.Navigate.SetPosition(pos);                      

}