public static ElementTag BuildArrow(IEntityManager manager, ArrowData data) { var geo = GeometryBuilder.BuildArrow(data); return(manager .CreateEntity(data.tag) .AddComponent(geo) .AddComponent(D3DTriangleColoredVertexRenderComponent.AsStrip()) .AddComponent(new TransformComponent()) .Tag); }
public static ArrowGameObject Build(IEntityManager manager, ArrowData data) { var geo = GeometryBuilder.BuildArrow(data); geo.Color = data.color; var en = manager .CreateEntity(data.tag) .AddComponents( geo, D3DTriangleColoredVertexRenderComponent.AsStrip(), new TransformComponent() ); return(new ArrowGameObject(en.Tag)); }
public static ArrowGameObject Create(IContextState context, ElementTag tag, ArrowData data, bool visible = true) { var geo = GeometryBuilder.BuildArrow(data); var geoId = context.GetGeometryPool() .AddGeometry(geo); var en = context.GetEntityManager() .CreateEntity(tag) .AddComponent(visible ? RenderableComponent.AsTriangleColored(SharpDX.Direct3D.PrimitiveTopology.TriangleStrip) : RenderableComponent.AsTriangleColored(SharpDX.Direct3D.PrimitiveTopology.TriangleStrip).Disable()) .AddComponent(TransformComponent.Identity()) .AddComponent(MaterialColorComponent.Create(data.color)) .AddComponent(geoId) ; return(new ArrowGameObject(en.Tag)); }