perf(simulation): copy native ray hits without NumPy protocol probing

This commit is contained in:
DCCONSTRUCTIONS
2026-10-09 10:21:22 +03:00
parent 0fb9636683
commit 4153c122a3
+4 -1
View File
@@ -296,7 +296,10 @@ def mounted_range_returns(query, origin, directions, key, spec, forward, *,
str(hit.get("rigidBody", "")).startswith("/World/Rover")
or str(hit.get("collision", "")).startswith("/World/Rover")
):
positions[row] = hit["position"]
point = hit["position"]
# NumPy probes arbitrary sequence protocols on pybind Float3,
# which is much slower than reading its three exact components.
positions[row] = (point[0], point[1], point[2])
paths[row] = str(hit.get("collision", ""))
distances = np.linalg.norm(positions - origin, axis=1)
depth = np.full(count, np.nan, np.float32)