Represents an axis aligned bounding box.

表示一个轴对齐的边界框。

An axis-aligned bounding box, or AABB for short, is a box aligned with coordinate axes and fully enclosing some object. Because the box is never rotated with respect to the axes, it can be defined by just its center and extents, or alternatively by min and max points.

一个轴对齐边界框,或AABB的简称,是一个坐标对齐的框(盒子)并且完全封闭一些对象。由于这个框(盒子)不会相对轴进行旋转,它只能通过center(中心)和extents(范围)进行定义,或者选择min(小)和 max(大)点。

                                     

Bounds is used by Collider.bounds, Mesh.bounds, Renderer.bounds.

边界框被用于Collider.bounds, Mesh.bounds, Renderer.bounds。

Variables  变量

center

中心

The center of the bounding box.

边界框(包围盒子)的中心

size

尺寸

The total size of the box. This is always twice as large as the extents.

盒子的总尺寸。这(尺寸size)总是extents(范围)的两倍大

extents

范围

The extents of the box. This is always half of the size.

边框(盒子)的范围。这(范围extents)总是size(尺寸)的一半

min

最小值

The minimal point of the box. This is always equal to center-extents.

框(盒子)的最小点,这总是等于center-extents(中心减范围)

max

最大值

The maximal point of the box. This is always equal to center extents.

框(盒子)的最大点,这总是等于center extents(中心加范围)

                                       于飞 unity

Constructors  构造函数

Bounds

边界框(包围盒子)

Creates new Bounds with a given center and total size. Bound extents will be half the given size.

使用给定中心和总尺寸来创建新边界框。边界框范围将为给定尺寸的一半。

Functions  函数

SetMinMax

设置最小最大

Sets the bounds to the min and max value of the box.

设置边界框的最小和最大值

Encapsulate

封装

Grows the Bounds to include the point.

增大边界框来包含这个点

Expand

扩大

Expand the bounds by increasing its size by amount along each side.

通过增加总数的大小(尺寸)延长每条边的长度来扩大

Intersects

相交

Does another bounding box intersect with this bounding box?

另一个边界框是否与这个边界框相交?

Contains

包含

Is point contained in the bounding box?

这个点是否被包含在边界框内?

SqrDistance

平方距离

The smallest squared distance between the point and this bounding box.

这个点和边界框之间的最小平方距离。

IntersectRay

相交射线

Does ray intersect this bounding box?

射线可以与这个边界框相交么?

ToString

转换为“字符串”

Returns a nicely formatted string for the bounds.

返回边界框已经格式化好的字符串。

                                       于飞 unity

Bounds.Bounds   边框

 

static function Bounds (center : Vector3, size : Vector3) : Bounds

Description  描述

Creates new Bounds with a given center and total size. Bound extents will be half the given size.

创建新边界和给定center(中心)大小的总和(尺寸和)。边界框范围将是给定尺寸的一半。

JS:

// Create pillar bounding box centered at the origin

//在框内中央的原点创建支点建筑
var bounds = Bounds (Vector3.zero, Vector3 (1, 2, 1));

                                       于飞 unity

C#::

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
    public Bounds bounds = new Bounds(Vector3.zero, new Vector3(1, 2, 1));
}

Bounds.IntersectRay  相交射线

 

function IntersectRay (ray : Ray) : boolean

Description  描述

Does ray intersect this bounding box?

射线是否与这个边界框相交?

                                       于飞 unity

JS:

// Creates a ray that points from the origin to the infinity among the z Axis.

//创建一个射线沿着Z轴从原点到无穷(远)

// And prints if the transform touched the ray.

//如果transform(转换)遇到射线,就输出
var ra : Ray  = new Ray (Vector3.zero, Vector3.forward);;

function Update () {
    // Color ra in the scene editor.

//在场景编辑器中赋予射线颜色

Debug.DrawRay (Vector3.zero, Vector3.forward * 999, Color.green);
    var bounds : Bounds = transform.collider.bounds;
    if (bounds.IntersectRay (ra))
        Debug.Log("Touched the ray");
}

C#:

using UnityEngine;
using System.Collections;

                                       于飞 unity

public class example : MonoBehaviour {
    public Ray ra = new Ray(Vector3.zero, Vector3.forward);
    void Update() {
        Debug.DrawRay(Vector3.zero, Vector3.forward * 999, Color.green);
        Bounds bounds = transform.collider.bounds;
        if (bounds.IntersectRay(ra))
            Debug.Log("Touched the ray");
       
    }
}

function IntersectRay (ray : Ray, out distance : float) : boolean

Description  描述

Does ray intersect this bounding box?

射线是否与这个边界框相交?

When IntersectRay returns true distance will be the distance to the ray's origin.

当IntersectRay(相交线)返回为真时, distance(距离)为射线到原点的距离。

                                       于飞 unity

JS:

// Creates a ray that points from the origin to 10 units among the z Axis.

//创建一个射线,沿着Z轴,从原点到10个单位的距离

// And prints if the transform touched the ray.
//如果transform(转换)遇到射线就输出。

var ra : Ray = new Ray (Vector3.zero, Vector3.forward);;
var t : float = 10.0;

function Update () {
    // Color ra in the scene editor.

//在场景编辑器中赋予射线颜色

Debug.DrawRay (Vector3.zero, Vector3.forward * 10, Color.green);
    var bounds : Bounds = transform.collider.bounds;
    if (bounds.IntersectRay (ra, t))
        Debug.Log("Touched the ray");
}

                                       于飞 unity

C#:

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
    public Ray ra = new Ray(Vector3.zero, Vector3.forward);
    public float t = 10.0F;
    void Update() {
        Debug.DrawRay(Vector3.zero, Vector3.forward * 10, Color.green);
        Bounds bounds = transform.collider.bounds;
        if (bounds.IntersectRay(ra, out t))
            Debug.Log("Touched the ray");
       
    }
}

                                       于飞 unity

Bounds.SetMinMax  设置最小最大

 

function SetMinMax (min : Vector3, max : Vector3) : void

Description  描述

Sets the bounds to the min and max value of the box.

设置边界框的最小最大值

Using this function is faster than assigning min and max separately.

使用这个函数比单独分配最小最大值要快。

Unity Bounds 边界框(包围盒)相关推荐

  1. 3D集合图元:最小边界框/包围盒(boundingbox)

    对于2D边界框的应用时比较广泛地,它为一个简单匹配建立了很小的计算规则,3D模型的boundingbox则比较困难,计算代价较大.对于PCL库的使用则降低了计算难度,三维数值化降低了建模过程,可以使用 ...

  2. ITK:获取PointSet的边界框

    ITK:获取PointSet的边界框 内容提要 输出结果 C++实现代码 内容提要 获取PointSet的边界框 输出结果 bounds::[0,0.1,0,0.1,0,0]中心:[0.05,0.05 ...

  3. Wise-IoU 作者导读:基于动态非单调聚焦机制的边界框损失

    论文地址:Wise-IoU: Bounding Box Regression Loss with Dynamic Focusing Mechanism GitHub:https://github.co ...

  4. Ray-AABB问题:判断线段是否相交于轴对齐边界框(Axially Aligned Bounding Box, AABB)

    摘要 Ray-AABB问题:判断线段是否相交于轴对齐边界框(Axially Aligned Bounding Box, AABB) 本文介绍了slab算法的实现,从一个简单实现开始,逐步优化slab算 ...

  5. imgaug增强边界框

    imgaug对边界框及其扩展具有本地支持. 它们通过其左上角和右下角的坐标表示,既是绝对值,又具有亚像素精度. 在imgaug中,边框仅受增强器更改图像几何形状的影响. 例如 水平翻转或仿射变换. 它 ...

  6. python采用Basemap绘制完美中国地图(包括绘制边界框,随机点等)

    python采用Basemap绘制完美中国地图(包括绘制边界框,随机点等) 1. 效果图 2. 原理 2.1 依赖模块及安装 2.2 工程目录 2.3 依赖文件latlng.txt 经纬度 3 源码 ...

  7. 【OpenCV 】计算物体的凸包/创建包围轮廓的矩形和圆形边界框/createTrackbar添加滑动条/

    目录 topic 1:模板匹配 topic 2:图像中寻找轮廓 topic 3:计算物体的凸包 topic 4:轮廓创建可倾斜的边界框和椭圆¶ topic 5:轮廓矩¶ topic 6:为程序界面添加 ...

  8. 边界框的回归策略搞不懂?算法太多分不清?看这篇就够了

    作者 | fivetrees 来源 | https://zhuanlan.zhihu.com/p/76477248 本文已由作者授权,未经允许,不得二次转载 [导读]目标检测包括目标分类和目标定位 2 ...

  9. 实战:基于深度学习和几何的3D边界框估计

    点击上方"小白学视觉",选择加"星标"或"置顶" 重磅干货,第一时间送达 3D 对象检测问题在需要决策或与现实世界中的对象交互的机器人应用中 ...

  10. 谷歌AI发布“会动的”3D物体数据集,附带标记边界框、相机位姿、稀疏点云,网友:快给我的AR模型用上...

    萧箫 发自 凹非寺 量子位 报道 | 公众号 QbitAI 见过3D物体数据集,见过会动的3D物体数据集吗? 每段动态视频都以目标为中心拍摄,不仅自带标注整体的边界框,每个视频还附带相机位姿和稀疏点云 ...

最新文章

  1. 基础数据结构【三】————老鼠走迷宫问题————堆栈应用
  2. 年货买了没?大数据告诉你年货买什么!
  3. 使用 Application Developer V7 来创建和部署 JSR 168 协作 portlet
  4. 滴滴算法大赛算法解决过程 - 机器学习
  5. 微软独立虚拟机Hyper-V Server 2008
  6. 是栈还是队列c语言实验报告怎么写,队列和栈(C语言)
  7. java default修饰符_2019最新java面试题附答案
  8. origin数据平滑_研发工程师必备:20条实用origin技能,让作图效率飞起来
  9. 简单的封装axios 不包含状态码和提示
  10. bzoj 3679: 数字之积
  11. 团队分享心得体会_团队合作心得体会总结
  12. 小样本学习(few-shot learning)之——原形网络(Prototypical Networks)
  13. 使用java将word文档docx,doc(包含图形,文本框)完美转换成所有格式图片(pdf,png,gif,jpeg等等)
  14. 交换机短路_交换机端口短路 导致上网不正常
  15. 北京理工大学计算机实验广域网通信与有,北京理工大学计算机实验七报告表
  16. 中儒集团董事长朱宝先生一行到访亚信总部!
  17. KMP算法前后缀原理
  18. java如何在一个Action中调用另外一个Action
  19. 黄佳《零基础学机器学习》chap2笔记
  20. 树莓派烧录RetroPie系统FC NES游戏设置连发按键以及Sprite限制解除并超频

热门文章

  1. 苹果可以用android流量监控,iPhone怎么看流量统计?
  2. Mac精品应用推荐:专业的后期特效制作软件
  3. seo入门级教程!再看不懂就放弃做互联网吧!
  4. Android基础整合项目之节日群发助手(三)
  5. 发红包的程序代码java_Java实现微信发红包
  6. CentOS7安装Oracle 11gR2详细记录整理
  7. Python3语言详解
  8. 首批企业入驻“一县一店”:多元化方式助力农产外销
  9. php如何开启COM组件
  10. 机器人工程师技术资料