public void updateDirectionMarkers()
{
//Debug.Log("updating directionMarkers");
for (int i = 0; i < NumDirectionMarkers; ++i)
{
float relValue = (i + 1) * 1.0f / (NumDirectionMarkers + 1);
Vector3 direction = new Vector3();
double lat = 0;
double lon = 0;
//calc positions along the path in evenly spaced distances
Vector3 position = evaluateAt(relValue, out direction, out lat, out lon);
GameObject cone = directionMarkers[i];
cone.renderer.enabled = true;
cone.renderer.material.SetColor("_EmissiveColor", LineColor);
cone.transform.position = position;
float scale = LineWidth * this.ConeRadiusToLineWidthFactor;
cone.transform.localScale = new Vector3(scale, scale, scale);
//Orientation:
// get surface normal/up vector
Vector3 up = this.referenceBody.GetSurfaceNVector(lat, lon);
//construct rotation so that the cones local Z-Axis matches the direction axis, and its X-Axis matches the up-vector
Quaternion rotation = Quaternion.LookRotation(direction, up);
cone.transform.rotation = rotation;
}
//Debug.Log("hiding otherr markers");
//hide all other gameobjects
for (int i = NumDirectionMarkers; i < 20; ++i)
{
GameObject cone = directionMarkers[i];
cone.renderer.enabled = false;
}
}