Example #1
0
        /// <summary>
        /// Draws the thing.
        /// </summary>
        public virtual void drawMe()
        {
            GL.Color3(baseColor);

            GL.PushMatrix();
            GL.Translate(location);

            if (velocity.Length == 0)
            {
                GL.Rotate(yaw, 0.0, 1.0, 0.0);
            }
            else
            {
                Quaternion rotationQuat = DrawUtils.RotationBetweenVectors(new Vector3(0, 0, 1), new Vector3(velocity));

                Matrix4 rotation = DrawUtils.CreateFromQuaternion(rotationQuat);

                GL.MultMatrix(ref rotation);
            }

            drawModel();

            if (states.Count > 0)
            {
                GL.Translate(stateLocation);

                foreach (StateIndicator si in states)
                {
                    si.drawMe();
                }
            }

            GL.PopMatrix();
        }