Ejemplo n.º 1
0
 public void arrow(Vector3 start, Vector3 direction)
 {
     ArrowGameObject.Build(context.GetEntityManager(), new Std.Engine.Core.Utilities.ArrowData {
         center     = start,
         axis       = direction,
         orthogonal = Vector3.Zero,
         lenght     = 20,
         color      = V4Colors.Green,
         radius     = 2,
         tag        = new ElementTag("Arrow_" + DateTime.Now.Ticks)
     });
 }
Ejemplo n.º 2
0
        public GameObject DrawArrow(string key, ArrowDetails arrowData)
        {
            var llength = 10;

            var tt = new ArrowData {
                axis       = arrowData.Axis,
                orthogonal = arrowData.Orthogonal,
                center     = arrowData.Center + arrowData.Axis * (llength - 2),
                lenght     = 2.1f,
                radius     = .8f,
                color      = arrowData.Color
            };

            var points = new[] {
                arrowData.Center, arrowData.Center + arrowData.Axis * llength,
            };

            var arrow = ArrowGameObject.Create(Context, ElementTag.New($"{key}_arrowhead"), tt);

            var line = VisualPolylineObject.Create(Context, ElementTag.New($"{key}_arrowline"),
                                                   points, arrowData.Color, true);

            return(new MultiVisualObject(new[] { arrow.Tag, line.Tag }, key));
        }