关于Sweep and Prune 算法

在第一阶段的检测(BroadPhase)中所需要的算法就是Sweep and Prune,因为从未接触过此类的东西,所以不知道到底是个什么东西,今天终于找到具体资料了,一看,晕倒掉了.原来就是<游戏编程精粹2>里面所提及到的 逐维递归分组法...
貌似如果有人搜索相关词汇是能够搜索到我的blog的,特别留下此文以防止有哥们走我同样的弯路了...

顺便放一个英文东西:
来自于:http://parallel.vub.ac.be/documentation/pvm/Example/Marc_Ramaekers/node3.html
Sweep and Prune
Given a number N of objects, O(N2) object pairs have to be checked for collision. In general, the objects in most of the pairs aren't even close to each other so we should be able to eliminate them quickly. To do this we use a technique called Sweep and Prune ([CLMP95]). In this section I will briefly introduce this technique.

To determine whether two objects are close enough to potentially collide, the Sweep and Prune checks whether the axis aligned bounding boxes of the respective objects overlap. If they do, further investigation is necessary. If not, the objects can't possibly collide and the algorithm can move on. To determine whether two bounding boxes overlap, the algorithm reduces the 3D problem to three simpler 1D problems. It does so by determining the intervals occupied by the bounding volume along each of the x,y and z axes. If and only if the intervals of two bounding volumes overlap in all of the three dimensions, the objects corresponding to these bounding volumes must overlap. To determine which intervals of the objects along an axis overlap, the list of the intervals is sorted. Normally, using quick-sort, this would be an  process. However, by exploiting frame coherence (the similarity between situations in two subsequent frames) we can sort the lists in an expected (O(N), using insertion sort.

Another difficult part in the Sweep and Prune approach is the maintenance of the bounding volume. If the objects in the scene move or rotate, the previously calculated bounding boxes are invalid. It is important to be able to update the boxes as quickly as possible. Again, we can do this by exploiting frame coherence.

The algorithm's performance is of course dependent on the application and the typical situations that occur in that application. Many variations exists, such as reducing the overlap problem by only 1 dimension and using a rectangle intersection test. It is also possible to choose other types of bounding volumes that might be faster to update but produce a less accurate approximation of the object.

时间: 2025-01-21 13:35:56

关于Sweep and Prune 算法的相关文章

常见3D物理引擎概述

今天帮朋友找3D物理引擎的资料,以前也看过那么多了,一直没有总结过,今天顺便整理一下. 1.  Havok: 老牌的君王,支持功能如下: http://www.havok.com ·         Collision Detection - including Continuous Physics ·         MOPP Technology - for compact representation of large collision meshes ·         Dynamics

Parallel Collision Detection

First, a short note on the structure of our collision detection program. An overview of the processing pipeline is given in Figure 1. We assume that before entering the pipeline a scene has been loaded containing some objects. In our implementation,

《大规模Java平台虚拟化与调优》——1.3 大规模Java平台的技术因素

1.3 大规模Java平台的技术因素 当设计大规模Java平台时,需要考虑很多的技术因素.例如,对于构建良好的大规模Java平台来说,需要很好地理解Java垃圾回收(garbage collection,GC)以及JVM架构.硬件和hypervisor架构.本节中,概要讨论了GC.非一致内存架构(Non-Uniform Memory Architecture,NUMA),以及在理论和实际操作中的内存限制.稍后的章节会给出更为详细的描述,但首先在整体上理解围绕大规模Java平台设计有哪些问题是非常

Hierarchical Collision Detection Methods

In this section, we will discuss briefly the approach taken by hierarchical collision detection methods. These algorithms work on the face-face level. Given a pair of objects, they check which faces of the objects overlap, so they are carried out beh

Android的内存分配与回收

  想写一篇关于android的内存分配和回收文章的想法来源于追查一个魅族手机图片滑动卡顿问题,我们想了很多办法还是没有避免他不停的GC,所以就打算详细的看看内存分配和GC的原理,为什么会不断的GC,GC ALLOC和GC COCURRENT有什么区别,能不能想办法扩大堆内存减少GC的频次等等. 1.JVM内存回收机制 1.1 回收算法 标记回收算法(Mark and Sweep GC)         从"GC Roots"集合开始,将内存整个遍历一次,保留所有可以被GC Roots

碰撞检测 小结

Sweep and Prune:1.将物体的AABB分离到三个坐标轴上.得到若干个区间.2.根据区间的终点坐标由小到大排序.3.逐个遍历排序结果,当遇到一个区间的起始点的时候,就将这个区间放到一个列表中:当遇到一个区间的终点时,就将这个区间从列表中清除. 当在列表中存在区间,而又遇到一个新区间的起始点时,则遇到的区间与列表中的所有区间重叠.4.如果一对物体在三个坐标轴上的区间都重叠,那么他们的AABB相叠. Mid-phase碰撞检测 碰撞检测树就是将要碰撞的网格分离成多个部分,并将这些部分按树

【两项业界最佳】普林斯顿新算法自动生成高性能神经网络,同时超高效压缩

神经网络的结构对其性能有极其重要的影响.目前主流的神经网络结构搜索法仍然是试凑法,该方法存在三大问题: 训练过程中神经网络结构是固定的,训练并不能改善结构 时间和计算消耗巨大 生成的网络通常很冗余,计算和存储成本过高 为了解决以上问题,普林斯顿大学研究人员仿照人类大脑的学习过程,提出了一种自动生成神经网络的算法.该算法从一个种子结构(seed architecture)开始,这个种子结构类似于初生婴儿的大脑. 在训练过程中,先根据反向传播算法获得的梯度(gradient),连接和生长(grow)

jvm系列(三):GC算法 垃圾收集器

概述 垃圾收集 Garbage Collection 通常被称为"GC",它诞生于1960年 MIT 的 Lisp 语言,经过半个多世纪,目前已经十分成熟了. jvm 中,程序计数器.虚拟机栈.本地方法栈都是随线程而生随线程而灭,栈帧随着方法的进入和退出做入栈和出栈操作,实现了自动的内存清理,因此,我们的内存垃圾回收主要集中于 java 堆和方法区中,在程序运行期间,这部分内存的分配和使用都是动态的. 对象存活判断 判断对象是否存活一般有两种方式: 引用计数:每个对象有一个引用计数属性

JVM学习(4)——全面总结Java的GC算法和回收机制

引用实例被添加在引用队列中,可以在任何时候通过查询引用队列回收对象. 现在我对一个对象的生命周期进行描述: 新建Java对象A首先处于可达的,未执行finalize方法的状态,随着程序的运行,一些引用关系会消失,或者变迁,当对A使用可达性算法判断,对象A变成了 GC Roots 不可达时,A从可达状态变迁到不可达状态,但是JVM不会就就这样把它清理了,而是在第一次GC的时候,对它首先进行一个标记(标记清除算法),之后最少还要再进行一次筛选,而对其筛选的的条件就是看该对象是否覆盖了Object的f