Closed shivanshpatel35 closed 4 years ago
This metadata information was previously undocumented, but the Object Attribute Section of the documentation has now been updated to include objectBounds
.
Note that this is not an exact measure of the dimensions of an object, but rather the object oriented bounding box that encapsulates the object. Also note that only objects that have the Pickupable
attribute have bounds at the moment.
Can we somehow access objectBounds
for the objects which have Pickupable
attribute False
?
Only Pickupable = True
objects have object oriented bounds at the moment. We are looking into adding this information to the metadata of all objects in a future release.
Is there a way to get objectBounds
for Pickupable = False
yet? I thought it would be enough to remove the check for
if(simObj.PrimaryProperty == SimObjPrimaryProperty.CanPickup)
objMeta.objectBounds = WorldCoordinatesOfBoundingBox(simObj);
in L350 of PhysicsRemoteFPSAgentController.cs
and recompile, but looks like Unity does not return bounding boxes for these objects to begin with.
This feature is still in development and will be usable in a future release. Removing that line and recompiling won't do anything because the WorldCoordinatesOfBoundingBox(simobj)
function call only works with objects with the tag CanPickup. Trying to use that call on any object will fail unless the object is Pickupable = True
As an update to this issue, the latest release version 2.4.0 now includes a world axis aligned volume that encapsulates all objects, these can be used for extremely rough estimations or volume. Note that because the axisAlignedBoundingBox is aligned to the world axis, if the object rotates then this axis aligned box will change volume. Pickupable objects also still have an object aligned bounding box, which are constant volume regardless of the object rotation.
How can I get dimensions of the objects? I was expecting to find that in event.metadata['objects'][i](for i th object) but it does not have dimension information.