Content update for ECS physics (#13291)
This commit is contained in:
@@ -77,12 +77,9 @@ namespace Content.Server.Physics.Controllers
|
||||
var shape = new PolygonShape();
|
||||
shape.SetAsBox(0.55f, 0.55f);
|
||||
|
||||
_fixtures.TryCreateFixture(body, new Fixture(body, shape)
|
||||
{
|
||||
ID = ConveyorFixture,
|
||||
CollisionLayer = (int) (CollisionGroup.LowImpassable | CollisionGroup.MidImpassable | CollisionGroup.Impassable),
|
||||
Hard = false,
|
||||
});
|
||||
_fixtures.TryCreateFixture(uid, shape, ConveyorFixture, hard: false,
|
||||
collisionLayer: (int) (CollisionGroup.LowImpassable | CollisionGroup.MidImpassable |
|
||||
CollisionGroup.Impassable), body: body);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,7 +157,7 @@ namespace Content.Server.Physics.Controllers
|
||||
continue;
|
||||
|
||||
if (physics.BodyType != BodyType.Static)
|
||||
_physics.WakeBody(physics);
|
||||
_physics.WakeBody(entity, body: physics);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -180,7 +177,7 @@ namespace Content.Server.Physics.Controllers
|
||||
if (!TryComp<PhysicsComponent>(uid, out var body))
|
||||
return;
|
||||
|
||||
_fixtures.DestroyFixture(body, ConveyorFixture);
|
||||
_fixtures.DestroyFixture(uid, ConveyorFixture, body: body);
|
||||
}
|
||||
|
||||
public override void UpdateBeforeSolve(bool prediction, float frameTime)
|
||||
@@ -237,8 +234,9 @@ namespace Content.Server.Physics.Controllers
|
||||
transform.LocalPosition = localPos;
|
||||
|
||||
// Force it awake for collisionwake reasons.
|
||||
body.Awake = true;
|
||||
body.SleepTime = 0f;
|
||||
// TODO: Just use sleepallowed
|
||||
_physics.SetAwake(entity, body, true);
|
||||
_physics.SetSleepTime(body, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user