返回介绍

CullingGroup.SetBoundingDistances 设置边界距离

发布于 2019-12-18 15:37:38 字数 3234 浏览 1514 评论 0 收藏 0

JavaScript => public function SetBoundingDistances(distances: float[]): void;
C# => public void SetBoundingDistances(float[] distances);

Parameters 参数

distancesAn array of bounding distances. The distances should be sorted in increasing order.
边界距离数组。该距离递增排序。
distanceBehavioursAn array of CullingDistanceBehaviour settings. The array should be the same length as the array provided to the distances parameter. It can also be omitted or passed as null, in which case all distances will be given CullingDistanceBehaviour.Normal behaviour.

Description 描述

Set bounding distances for 'distance bands' the group should compute, as well as options for how spheres falling into each distance band should be treated.

设置distance bands边界距离,以及选择球进入每个绑定距离应该如何对待。

Each distance value indicates a band that is 'up to' that distance; the array [10, 20, 30] describes distance bands “from 0 to 10m”, “from 10m to 20m” and “from 20m to 30m.”

每个距离值表明绑定范围的递增;数组[10, 20, 30]描述了距离的范围“从0到10m”,“从10m到20m”和“从20m和30m”。

The distance from the reference point (set by CullingGroup.SetDistanceRefPoint) to the nearest edge of the sphere is used to calculate which distance band a sphere is in. Therefore a sphere that covers multiple distance bands will be considered to be in the nearest one to the reference point.

参考点(通过CullingGroup.SetDistanceRefPoint设置参考点)到最近的边界球计算的距离。因此含多个距离带时,该距离将会被认为最近的一个边界球到参考点的距离。

The distanceBehaviours array describes how a sphere being in a given distance band should have its culling modified. For example, you might force any object within 20m to be visible even if it is behind the camera (to ensure that characters behind the player are still running full animation, audio, etc) while forcing any object beyond 200m to be invisible (effectively, culling spheres based on distance).

distanceBehaviours数组描述如何修改在给定的距离范围内的球的剔除。例如,你可能会让任何在20内的对象变得可见即使是在相机后面(确保角色背后的人物仍然运行完整的动画,音频等),当任何超过200范围的物体变得不可见(实际上,边界球基于距离)。

In addition to forcing objects to be visible or invisible, you can use distance bands to drive level-of-detail changes in your objects. For example, you might define bands “from 0 to 40m” and “from 40m to 80m”, and while you might have both bands apply occlusion and frustum culling as normal, you could have objects in the second band be animated with a less complex rig, or run a less complex AI behaviour.

除了使物体可见或不可见之外,你还可以使用边界距离来驱使不同等级的细节变化。比如,你可以定义边界“从0到40”和“从40到80”,并且正常情况下你可能有两个边界范围应用于发生和阻碍剔除,你的第二个边界范围可以用于较少复杂度的动画或者运行一个较少复杂度的人工智能行为。

By default, any spheres beyond the final bounding distance are implicitly forced to be invisible. To avoid this, you can specify a final bounding distance of float.PositiveInfinity.

默认情况下,任何超过最后边界距离的边界球隐式强制变为不可见。为了避免这种情况,你可以指定float.PositiveInfinity的最后的边界球的距离。

cullinggroup

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文