Closed KuoHaoZeng closed 6 months ago
Merged from physics-det-new-cam-adjust
with code refactors.
I added UpdateAgentBoxCollider
with an argument colliderScaleRatio=vector3
to spawn a new box collider. It will spawn a box collider according to agent's body (after destroy the pre-existing one)
On the other hand, DestroyAgentBoxCollider
will just removes the existing box collider.
No UseFPINCollider
augment anymore!
Nothing happens with box collider functionality anymore during the initialization or reset.
To adjust the collider, we must explicitly call UpdateAgentBoxCollider
or DestroyAgentBoxCollider
Add imageSynthesis.OnCameraChange()
at the end of updateCameraProperties
to solve the segmentation mask issue with the change of FoV.
Nothing jumps out, and looks good. But what I recommend to make sure things work as expected, and easier for the reviewers to understand how the code should work is creating some unit tests :) LGTM after some minor comments
The newly added SpawnBoxCollider function generates a box with an active collider encapsulates the agent. Currently, it only supports the Stretch agent.
New augments:
useFPINCollider
: bool. When set to True, SpawnBoxCollider is included during the initialization phase. If False, initialization proceeds as previously.colliderScaleRatio
: dict. It specifies the scale ratio of the box along each axis, for example,{"x": 1.0, "y": 1.0, "z": 1.0}
. A value of 1.0 indicates that the box size matches the detected bounds.