perf(simulation): copy native ray hits without NumPy protocol probing
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user