/// <summary> /// Updates the given body model. /// Be carefull.. this method runs within 3D-Engine update thread. /// </summary> /// <param name="scene">The scene to be manipulated.</param> /// <param name="manipulator">The manipulator.</param> /// <param name="bodyObject">The body object.</param> /// <param name="bodyIndex">Index of the body.</param> private static void UpdateBodyModel(Scene scene, SceneManipulator manipulator, Body bodyObject, int bodyIndex) { // Ensure we have a layer for this body string actBodyLayerName = "Body_" + bodyIndex; SceneLayer actBodyLayer = manipulator.TryGetLayer(actBodyLayerName); if(actBodyLayer == null) { actBodyLayer = manipulator.AddLayer(actBodyLayerName); manipulator.SetLayerOrderID(actBodyLayer, bodyIndex); } }