본문에 조명기를 연결하려고하면이 줄에 항상이 오류 메시지가 나타납니다.'System.Collections.Generic.List'형식을 'FarseerPhysics.Dynamics.Fixture'로 암시 적으로 변환 할 수 없습니다.
Fixture Newfixture = FixtureFactory.AttachCompoundPolygon(list, 1.0f, TestBody);
암시 적으로 유형 'System.Collections.Generic.List을'변환 할 수 없습니다 'FarseerPhysics.Dynamics.Fixture'
나는 고정을 작성하고 몸에 첨부 할 수 있습니까? 한 몸에 하나 이상의 고정물을 부착 할 수 있습니까?
내 코드의 나머지 :
이List<Vertices> list = new List<Vertices>();
Vector2 _origin;
float _scale;
uint[] data = new uint[Sprite.Width * Sprite.Height];
Sprite.GetData(data);
Vertices textureVertices = PolygonTools.CreatePolygon(data, Sprite.Width, false);
Vector2 centroid = -textureVertices.GetCentroid();
textureVertices.Translate(ref centroid);
_origin = -centroid;
textureVertices = SimplifyTools.ReduceByDistance(textureVertices, 4f);
list = Triangulate.ConvexPartition(textureVertices, TriangulationAlgorithm.Bayazit);
_scale = 1f;
Vector2 vertScale = new Vector2(ConvertUnits.ToSimUnits(1)) * _scale;
foreach (Vertices vertices in list)
{
vertices.Scale(ref vertScale);
}
'FixtureFactory.AttachCompoundPolygon'는 단일 목록을하지 반환, (당신이 가정하고 있기 때문에, 경우 수 있습니다 하나가있을 것입니다) 목. – Habib