kOS.Suffixed.VectorRenderer.LabelPlacement C# (CSharp) Method

LabelPlacement() private method

Place the 2D label at the correct projected spot on the screen from its location in 3D space:
private LabelPlacement ( ) : void
return void
        private void LabelPlacement()
        {
            Vector3 screenPos = GetViewportPosFor(shipCenterCoords + labelLocation);

            // If the projected location is on-screen:
            if (screenPos.z > 0
                 && screenPos.x >= 0 && screenPos.x <= 1
                 && screenPos.y >= 0 && screenPos.y <= 1)
            {
                label.enabled = true;
                label.transform.position = screenPos;
            }
            else
            {
                label.enabled = false;
            }
        }