Fixed map collider generation
I didn't realize the bodies were generated in the same method that generates the mesh triangles, TODO consider splitting that
This commit is contained in:
@@ -347,9 +347,10 @@ namespace Barotrauma
|
||||
|
||||
return pathCells;
|
||||
}
|
||||
|
||||
|
||||
public static List<Body> GeneratePolygons(List<VoronoiCell> cells, out List<VertexPositionTexture> verticeList, bool setSolid=true)
|
||||
{
|
||||
//TODO: consider separating body generation from render triangle generation
|
||||
verticeList = new List<VertexPositionTexture>();
|
||||
var bodies = new List<Body>();
|
||||
|
||||
|
||||
@@ -440,16 +440,17 @@ namespace Barotrauma
|
||||
|
||||
List<VoronoiCell> cellsWithBody = new List<VoronoiCell>(cells);
|
||||
|
||||
#if CLIENT
|
||||
List<VertexPositionTexture> bodyVertices;
|
||||
bodies = CaveGenerator.GeneratePolygons(cellsWithBody, out bodyVertices);
|
||||
|
||||
#if CLIENT
|
||||
|
||||
renderer.SetBodyVertices(bodyVertices.ToArray());
|
||||
renderer.SetWallVertices(CaveGenerator.GenerateWallShapes(cells));
|
||||
|
||||
renderer.PlaceSprites(generationParams.BackgroundSpriteAmount);
|
||||
#endif
|
||||
|
||||
|
||||
ShaftBody = BodyFactory.CreateEdge(GameMain.World,
|
||||
ConvertUnits.ToSimUnits(new Vector2(borders.X, 0)),
|
||||
ConvertUnits.ToSimUnits(new Vector2(borders.Right, 0)));
|
||||
|
||||
Reference in New Issue
Block a user