示例#1
0
        public static void AddArrow(this DynamicPrimitive dynamicPrimitive, Vector3 start, Vector3 end, Color color, float lineWidth)
        {
            const float Ratio = 0.2f;
            var         mid   = Vector3.Lerp(end, start, Ratio);
            var         head  = (end - start).Length() * Ratio;

            dynamicPrimitive.AddLine(start, mid, null, color, lineWidth);
            dynamicPrimitive.AddSolidCone(Vector3.Zero, head, head * 0.5f, 24,
                                          MatrixHelper.CreateRotation(Vector3.Up, Vector3.Normalize(end - start)) *
                                          Matrix.CreateTranslation(mid), color);
        }