public void poly(params Vector3[] points) { var colors = new List <Vector4>(); foreach (var p in points) { colors.Add(V4Colors.Red); } PolylineGameObject.Create(context.GetEntityManager(), new ElementTag("Poly_" + DateTime.Now.Ticks), points, colors.ToArray()); }
public override void DrawBox(ElementTag tag, BoundingBox box, IEntityManager emanager) { var points = GeometryBuilder.BuildBox(box); var color = V4Colors.NextColor(random); if (tag.IsEmpty) { Thread.Sleep(10); tag = new ElementTag(DateTime.Now.Ticks.ToString()); } debug.Add(PolylineGameObject.Create(emanager, new ElementTag("OctreeBox_" + tag.ToString()), points, points.Select(x => color).ToArray())); }
public static CoordinateSystemLinesGameObject Build(IEntityManager manager, Vector3 center = new Vector3()) { var llength = 100; var obj = new CoordinateSystemLinesGameObject(); var points = new[] { center - Vector3.UnitX * llength, center + Vector3.UnitX * llength, center - Vector3.UnitY * llength, center + Vector3.UnitY * llength, center - Vector3.UnitZ * llength, center + Vector3.UnitZ * llength, }; var color = new[] { V4Colors.Green, V4Colors.Green, V4Colors.Red, V4Colors.Red, V4Colors.Blue, V4Colors.Blue, }; obj.Lines = PolylineGameObject.Create(manager, new ElementTag("Coordinate System"), points, color).Tag; var lenght = 20.0f; var radius = 5.0f; obj.Arrows = new ElementTag[3]; obj.Arrows[0] = ArrowGameObject.Build(manager, new ArrowData { axis = Vector3.UnitZ, orthogonal = Vector3.UnitX, center = center + Vector3.UnitZ * (llength - lenght + 5), lenght = lenght, radius = radius, color = V4Colors.Blue, tag = new ElementTag("Arrow_Z") }).Tag; obj.Arrows[1] = ArrowGameObject.Build(manager, new ArrowData { axis = Vector3.UnitX, orthogonal = Vector3.UnitY, center = center + Vector3.UnitX * (llength - lenght + 5), lenght = lenght, radius = radius, color = V4Colors.Green, tag = new ElementTag("Arrow_X") }).Tag; obj.Arrows[2] = ArrowGameObject.Build(manager, new ArrowData { axis = Vector3.UnitY, orthogonal = Vector3.UnitZ, center = center + Vector3.UnitY * (llength - lenght + 5), lenght = lenght, radius = radius, color = V4Colors.Red, tag = new ElementTag("Arrow_Y") }).Tag; return(obj); }