Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -484,11 +484,12 @@ private void RemoveForces(bool nonAngular)
if (_pendingForces.Count > 0)
{
ForceApplicationType velocityApplicationTypes = ForceApplicationType.AddRelativeForce | ForceApplicationType.AddForce | ForceApplicationType.AddExplosiveForce;
ForceApplicationType nonVelocityTypes = ForceApplicationType.MovePosition | ForceApplicationType.MoveRotation;

List<EntryData> newDatas = CollectionCaches<EntryData>.RetrieveList();
foreach (EntryData item in _pendingForces)
{
if (VelocityApplicationTypesContains(item.Type) == !nonAngular)
if (TypesContain(velocityApplicationTypes, item.Type) == !nonAngular || TypesContain(nonVelocityTypes, item.Type))
newDatas.Add(item);
}
// Add back to _pendingForces if changed.
Expand All @@ -500,9 +501,9 @@ private void RemoveForces(bool nonAngular)
}
CollectionCaches<EntryData>.Store(newDatas);

bool VelocityApplicationTypesContains(ForceApplicationType apt)
static bool TypesContain(ForceApplicationType types, ForceApplicationType apt)
{
return (velocityApplicationTypes & apt) == apt;
return (types & apt) == apt;
}
}
}
Expand Down