Commit f629be3
authored
Optimize BoundingBox distanceToEdge scalar math (#2749)
Avoid TempVars and temporary Vector3f mutation in the point distance path by computing axis deltas directly.
Adds direct edge-case coverage for inside, surface, single-axis outside, and multi-axis outside points.
Measured locally with BoundingVolumeBenchmark: inside/outside points improved from about 23 ns/op to about 2.1/2.5 ns/op.1 parent ebe10ba commit f629be3
2 files changed
Lines changed: 29 additions & 26 deletions
File tree
- jme3-core/src
- main/java/com/jme3/bounding
- test/java/com/jme3/bounding
Lines changed: 15 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
960 | 960 | | |
961 | 961 | | |
962 | 962 | | |
963 | | - | |
964 | | - | |
965 | | - | |
966 | | - | |
967 | | - | |
968 | | - | |
969 | | - | |
970 | 963 | | |
971 | 964 | | |
| 965 | + | |
972 | 966 | | |
973 | | - | |
974 | | - | |
| 967 | + | |
| 968 | + | |
975 | 969 | | |
976 | | - | |
977 | | - | |
978 | | - | |
| 970 | + | |
| 971 | + | |
979 | 972 | | |
980 | | - | |
981 | 973 | | |
982 | 974 | | |
983 | | - | |
984 | | - | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
985 | 978 | | |
986 | | - | |
987 | | - | |
988 | | - | |
| 979 | + | |
| 980 | + | |
989 | 981 | | |
990 | | - | |
991 | 982 | | |
992 | 983 | | |
993 | | - | |
994 | | - | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
995 | 987 | | |
996 | | - | |
997 | | - | |
998 | | - | |
| 988 | + | |
| 989 | + | |
999 | 990 | | |
1000 | | - | |
1001 | 991 | | |
1002 | 992 | | |
1003 | | - | |
1004 | 993 | | |
1005 | 994 | | |
1006 | 995 | | |
| |||
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
44 | 58 | | |
45 | 59 | | |
46 | 60 | | |
| |||
0 commit comments