Lighting optimization (caching shadow vertices & only checking hulls in range if the position or range of the light changes), ragdoll optimization, itemcomponent optimization, dragging stunned/dead characters

This commit is contained in:
Regalis11
2015-10-11 21:04:42 +03:00
parent 0a96254696
commit 8df9133e84
25 changed files with 377 additions and 201 deletions
+5 -3
View File
@@ -488,6 +488,8 @@ namespace Subsurface
}
ic.WasUsed = false;
if (container != null) ic.ApplyStatusEffects(ActionType.OnContained, deltaTime);
if (!ic.IsActive) continue;
if (condition > 0.0f)
@@ -495,7 +497,7 @@ namespace Subsurface
ic.Update(deltaTime, cam);
ic.PlaySound(ActionType.OnActive, Position);
ic.ApplyStatusEffects(ActionType.OnActive, deltaTime, null);
ic.ApplyStatusEffects(ActionType.OnActive, deltaTime, null);
}
else
{
@@ -505,7 +507,7 @@ namespace Subsurface
if (body == null || !body.Enabled) return;
if (body.LinearVelocity.Length() > 0.001f)
if (Math.Abs(body.LinearVelocity.X) > 0.01f || Math.Abs(body.LinearVelocity.Y) > 0.01f)
{
FindHull();
@@ -808,7 +810,7 @@ namespace Subsurface
if (body != null && body.UserData as Item != item) continue;
dist = Vector2.Distance(pickPosition, item.SimPosition);
if ((closest == null || dist < closestDist))
if (dist < item.prefab.PickDistance && (closest == null || dist < closestDist))
{
closest = item;
closestDist = dist;