public override float CalculateDefaultMoment() { cpPolyShape shape = (cpPolyShape)_info.GetShapes().FirstOrDefault(); return(_mass == cp.Infinity ? cp.Infinity : cp.MomentForPoly(_mass, shape.Count, shape.GetVertices(), cpVect.Zero, 0.0f)); }
protected override float CalculateArea() { cpPolyShape shape = (cpPolyShape)_info.GetShapes().FirstOrDefault(); //.front(); shape.CacheBB(); return(cp.AreaForPolyOld(shape.Count, shape.GetVertices())); }
public void Draw(cpPolyShape poly, cpColor color) { cpColor fill = new cpColor(color); fill.a = cp.cpflerp(color.a, 1.0f, 0.5f); DrawPolygon(poly.GetVertices(), poly.Count, color); }