|
|
|
|
|
|
|
|
|
|
void UpdateHumanDepthImage() |
|
|
|
{ |
|
|
|
if (occlusionManager == null) |
|
|
|
if (m_RawHumanDepthImage == null) |
|
|
|
if (!occlusionManager.TryAcquireHumanDepthCpuImage(out XRCpuImage image)) |
|
|
|
return; |
|
|
|
|
|
|
|
using (image) |
|
|
|
if (occlusionManager && occlusionManager.TryAcquireHumanDepthCpuImage(out XRCpuImage image)) |
|
|
|
UpdateRawImage(m_RawHumanDepthImage, image); |
|
|
|
using (image) |
|
|
|
{ |
|
|
|
UpdateRawImage(m_RawHumanDepthImage, image); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
m_RawHumanDepthImage.enabled = false; |
|
|
|
if (occlusionManager == null) |
|
|
|
return; |
|
|
|
|
|
|
|
if (!occlusionManager.TryAcquireHumanStencilCpuImage(out XRCpuImage image)) |
|
|
|
return; |
|
|
|
|
|
|
|
using (image) |
|
|
|
if (occlusionManager && occlusionManager.TryAcquireHumanStencilCpuImage(out XRCpuImage image)) |
|
|
|
{ |
|
|
|
using (image) |
|
|
|
{ |
|
|
|
UpdateRawImage(m_RawHumanStencilImage, image); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
UpdateRawImage(m_RawHumanStencilImage, image); |
|
|
|
m_RawHumanStencilImage.enabled = false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// "Apply" the new pixel data to the Texture2D.
|
|
|
|
texture.Apply(); |
|
|
|
|
|
|
|
// Make sure it's enabled.
|
|
|
|
rawImage.enabled = true; |
|
|
|
} |
|
|
|
|
|
|
|
void OnCameraFrameReceived(ARCameraFrameEventArgs eventArgs) |
|
|
|