mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Heavily optimise entitylookup (#5400)
* Heavily optimise entitylookup Previously I made it so MOST of entitylookup goes through the same 4 or 5 codepaths and uses shapes. The downside was some codepaths were made much slower in the process. This fixes most of the going up and down lookups that some codepaths did. It should also be faster than the pre-shapes version because GetLocalPhysicsTransform is being used for the non-approx queries and most entities are parented directly to their broadphase. * Tests and confidence * code * dang
This commit is contained in:
@@ -25,6 +25,13 @@ public static class Matrix3Helpers
|
||||
return a.EqualsApprox(b, (float) tolerance);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Box2Rotated TransformBounds(this Matrix3x2 refFromBox, Box2Rotated box)
|
||||
{
|
||||
var matty = Matrix3x2.Multiply(refFromBox, box.Transform);
|
||||
return new Box2Rotated(Vector2.Transform(box.BottomLeft, matty), Vector2.Transform(box.TopRight, matty));
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static Box2 TransformBox(this Matrix3x2 refFromBox, Box2Rotated box)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user