internal override VertexCollection GetVertices(PointF origin) { if (_cachedVerts != null) { return(_cachedVerts); } VertexCollection result = new VertexCollection() { Mode = BeginMode.Quads }; result.AddRange(new List <PointF> { origin.Add(Position), origin.Add(new PointF(Position.X, Position.Y + Height)), origin.Add(new PointF(Position.X + Width, Position.Y + Height)), origin.Add(new PointF(Position.X + Width, Position.Y)) }); result = base.RotateVerts(result); _cachedVerts = result; if (result == null) { ; } return(result); }
internal override VertexCollection GetVertices(PointF origin) { if (_cachedVerts != null) { return(_cachedVerts); } VertexCollection result = new VertexCollection() { Mode = BeginMode.Polygon }; result.AddRange(_points.Select(p => p = new PointF(p.X + X, p.Y + Y))); result = base.RotateVerts(result); _cachedVerts = result; return(result); }
public static void VerifyAttachmentProperties(Attachment attachment) { if (attachment is IVertexIncludingAttachment mesh) { VertexCollection collection = new VertexCollection(mesh.VertexCount); VertexNode[] nodes; if (mesh.Vertices.Length > mesh.VertexCount * 2) { nodes = CreateWeightedNodes(mesh.Vertices, mesh.VertexCount); } else { nodes = CreateSimpleNodes(mesh.Vertices, mesh.VertexCount); } collection.AddRange(nodes); mesh.VertexCollection = collection; } }