浏览代码

inner mesh scaling and disabled renderes

/main
Mohsen Kamalzadeh 4 年前
当前提交
154db48b
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4
      com.unity.perception/Runtime/GroundTruth/Labelers/BoundingBox3DLabeler.cs

4
com.unity.perception/Runtime/GroundTruth/Labelers/BoundingBox3DLabeler.cs


// Need to convert all bounds into labeling mesh space...
foreach (var mesh in meshFilters)
{
if (!mesh.GetComponent<Renderer>().enabled)
continue;
var currentTransform = mesh.gameObject.transform;
// Grab the bounds of the game object from the mesh, although these bounds are axis-aligned,
// they are axis-aligned with respect to the current component's coordinate space. This, in theory

// Apply the transformations on this object until we reach the labeled transform
while (currentTransform != labelTransform)
{
transformedBounds.center = Vector3.Scale(transformedBounds.center, currentTransform.localScale);
transformedBounds.center = currentTransform.localRotation * transformedBounds.center;
transformedBounds.center += currentTransform.localPosition;
transformedBounds.extents = Vector3.Scale(transformedBounds.extents, currentTransform.localScale);

正在加载...
取消
保存