×
Меню
Индекс

Collision detection and creation
MAXimmerse article (EN)

Создание, средствами 3д МАХа, "фигурных" коробок окружения для Ниф файлов 4.2 версии.
А также общие заметки по разным значениям флагом детектирования столкновений.
Статья оригинальная, аглицкая(С)
 
Примечание!
- Означенное в статье, можно получить посредством ФФЕ модуля версии 4.2. Т.е. ниф файлы будут 4.2.
- Для ФФЕ 4.0 (похоже) не срабатывает. Т.к. опция управления созданием прокси геометрии недоступна.
- ТесЭкспортер, также ничего не создаст указанным здесь методом.
- Для МВ метод "капсулы" не работает в принципе.
- Ромб вполне свободно экспортируется, равно как и Юнион.
- собственно статья "обще познавательная".
Освещает вопрос, что же собственно такое Боунд объекты, или, что действительно означает параметр "has bound box" в настройках нод и шейпов.
А равно, как на него можно влиять "штатными" средствами.
 

Собственно сам метод (описанный ниже аглицким наречием).
*3д МАХ версии 4.2 или 5.
- создать бокс (например)
- клонировать.
- сменить название, например на такое ABV BnT.
- применить select&link инструмент, привязав клон к основному боксу.
- экспорт.
- в настройках экспорта, нажать кнопку Optimization.
- в настройках оптимизации выбрать опции:
Create ABV’s from Proxy Geometry
и Hide Proxy Geometry
- экспортировать.
- в ниф файле, получится Нода со значением Has Bounding Box = Box_Bv и метод работы по треугольникам.
Это значение определяется флагом ноды, частичную расшифровку можно увидеть по СкенеВиюверу выбрав свойства объекта и раздел общей сводки.
Т.е. проще говоря, все эти камлания включат параметр использования Коробки Окружения.
С желаемым значением этой самой коробки.
А также, позволят выбрать метод взаимодействия (ноды) с другими коллизиями (по видимости), т.е: треугольники, коробки, все вместе, или не вычислять.
 
Для МВ в этом смысла мало (по видимости) т.к. работает только простейшая коробка, да и та не везде.
Впрочем, это может быть и не совсем верно.
Увы, полных данных в этом вопросе (без наличия оригинальной справки к движку) у нас нет.
 
ABV - это базовый триггер. Затем пробел. И три буквы кода.
Обратите внимание, буквы создают выбранный режим для любых типов объектов.
Т.е. если выбрать S на кубе выше, получиться режим сферы в ниф файле.
S - создаст сферу, ака сферический режим ББ.
C - капсула.
B - бокс, куб, коробка.
H - халф спейс (ака полу пространственный).
L - лозенцовский (ака ромбический) режим.
U - последовательно вложенные прокси объекты. Которые могут быть любых выше перечисленных типов.
Эти данные изменят значения в поле ниже has bound box.
Т.е. определят виртуальную зону для работы коллизий с точкой опоры в координатах, здесь, того самого куба.
Т.е. базового объекта который находится в детях создаваемой ноды.
Т.е. ББ по факту, должна создаваться только для Нод, но не для шейпов.
Хотя нифскоп позволяет получать такое и для них.
 
Далее буква определяет наличие связи между объектами.
n - привязан к объекту верхнего уровня.
t - привязан к полигону. Помечено как нерабочее.
 
Следующая буква определяет метод взаимодействия коллизий.
N - ноне.
T - треугольники.
O - коробки (OBB)
C - совмещенный метод и коробки и треугольники.
Эти данные записываются во флаг объекта.
Т.е. флаг ноду будет меняться.
 
Для использования U.
Переименовать куб с ABV BnT на UnT.
Создать с него копию.
И переименовать на ABV BnT.
Select&link к кубу ABV UnT.
Повторить при необходимости.
 

И, сама статья в оригинале:
Это выдержка из Maximmerse.chm файла(С)

NiCollision and ABV Proxy Geometry
ABV Proxy Types
MaxImmerse supports the creation of proxy geometry for use in NetImmerse applications. The following section discusses how an artist can set up the collision volumes using Max.
The artist must generate the collision volumes named appropriately. Then, they must activate the Optimization option to “Create ABV’s from Proxy Geometry” upon export. This option can be found by pressing the Optimization Settings button on the Export options dialog.
ABV proxy geometry
It is much easier to test for a collision between two spheres than it is to test between two complex objects consisting of many hundreds or thousands of triangles. The same applies to other simple geometric shapes, such as half-spaces (one side of a plane) capsules & boxes (in increasing order of complexity). Alternate Bounding Volumes (ABVs) allow you to wrap your complex geometry with these simple shapes in order to significantly increase Collision performance.
NetImmerse now allows you to create proxy boxes inside your modeling package so that you can carefully define and align these ABVs to your model geometry.
Collidees and Colliders
All of the models in the Max file are separated into two categories: Colliders and Collidees. These groupings refer to the dynamic or static nature of the colliding objects. The collision system uses the knowledge that objects are static for optimization. The application processes the two groups and creates the collision models in the system appropriately. The geometry for these objects can be fairly complex, as the number of triangles would only affect the speed of the renderer, not the Collision system—which is normally the speed bottleneck because of the number of calculations required.
For all the types of ABVs, the proxy geometry is simply a box with a name that indicates what type of ABV it is. The first word of the name, “ABV” indicates that the box is an ABV proxy. The second word consists of three letters. The first indicates the type of ABV (S=sphere, C=capsule, B=box, H=half-space, L=lozenge<unsupported>, U=union<unsupported>), the second the connection type (‘n’=attach ABV to parent node, ‘t’=attach ABV to parent’s triangle mesh<unsupported>), and the third letter specifies the collision propagation flag (N=NONE, T=USE_TRIANGLES, O=USE_OBBS, C=CONTINUE). The rest of the name is ignored by the ABV generator, but may be used by the artist for whatever purpose is necessary.
For example, a box with the name “ABV SnN My Sphere Bound” would generate a spherical ABV that would be attached to the box’s parent in the scene hierarchy. The parent’s propagation mode would be set to NONE.
The meanings of the propagation flags are as follows:
 
NONE
The most efficient propagation flag. If a collision is found with the ABV, then the object is considered to be hit. Collision will not propagate to any of the ancestors; so many collision calculations will be avoided. However, the ABV should be an acceptable approximation of the geometry it is enclosing.
 
USE_TRIANGLES
The least efficient propagation flag. If attached to a triangle mesh, collision testing will iterate through every triangle of that mesh, if the ABV deems a collision is possible, so it is best used for low-triangle meshes. If this flag is specified for a parent node, however (as is the only case currently supported by the ABV generator), the meaning is slightly different. If a collision is found possible, testing will continue to the children of the node, otherwise it will stop and collision will not be deemed possible
 
USE_OBBS
Like the previous flag, this one has different meanings for triangle meshes and parent nodes. If defined for a mesh, this causes the collision system to test using an algorithm that is efficient for a large mesh. Cutoffs can be specified to prevent the testing from propagating all the way to the individual triangles. When attached to a parent node, it has the same meaning as the previous flag.
 
CONTINUE
The CONTINUE flag is designed to support ABVs attached to objects such as animated characters, where the ABVs need to move with the portion of the character that they are enclosing. This flag is only defined for attachment to parent nodes, as triangle meshes do not have any children. This flag works on its node much as the NONE flag—a collision with the ABV means the underlying geometry is considered to be hit. The difference is that, whether or not a collision is found, testing is always continued on to the children of the node. This will be clearer when we discuss the ABV tree for the Soldier model.
In order for the proxy ABVs to affect the proper nodes, you need to attach the proxies as children of the nodes you want them to define ABVs for. This way, not only does the ABV generator know who to attach the ABV to, but the proxies will also inherit any transformations you may give to the parents, so the ABV proxies will remain in the proper position in relation to the parents while the model is being manipulated. When working with a character, for instance, you may want to define the ABVs while the character is in figure mode so that the boxes are axis-aligned for the most part while you are defining them. The 3DSMax schematic view of the projectiles file is shown above as an example. The first child of each node is the actual geometry for that node, and the second child is the ABV description, each of which has a single Box child and a basic name for ABV generation.
The location and orientation of the axes of the proxy are unimportant. One may want to align them with those of the object the box is attached to for clarity’s sake, if desired, but the box will maintain its orientation to the parent no matter what these values are.
For modeling purposes, it is nice to set the property of the proxy box to “See-Through”, as is done in the 3DSMax pictures below.
 
Spheres
A Sphere ABV is generated using the center of the box as its center, and the length of the longest box side as the diameter. If you use a cube to model the ABV, as shown in the left picture, the sphere will exactly fit the inside of the box. The picture on the right shows the sphere in the application with a wireframe depiction of the ABV surrounding it. All the wireframes in this sample have been increased in size, so that they are not partially obscured by the object’s geometry.
 
Capsules
A Capsule ABV is generated using the center of the box as its center, the longest box axis as the length of the cylinder, and the length of the second longest axis as the diameter. If you model the ABV using a box that has two equal sides, then the ABV will exactly fit inside of this box. If all three sides are equal, then you’ll have a Capsule that looks like a Sphere, but is not as efficient as a Sphere.
 
Boxes
Boxes are defined to be exactly the size of the proxy box. When a box is defined to surround an actual box geometry, the ABV may not be easy to distinguish from the parent in 3DSMax (see picture to the left). Since this sample slightly increases the size of the wireframe ABV, it IS visible in the app (see picture to the right).
 
Half Spaces
Half Spaces are defined as being co-planar with the bottom of the proxy box and pointing in the direction of this face. This box bottom is the face that is perpendicular to the shortest edge of the box, and is the face at the local origin of the proxy box. To model, create a box that is very thin (looks like a plane), and place it just on top of the surface it will be attached to. Any object intersecting or on the other side of this box will generate a collision with the Half Space ABV generated for the parent.
 
Soldiers (для МВ по видимости полностью не актуально) т.к. локальные группы коллизий в составе скелета существ не используются.
The soldier models use the same proxy ABVs as the projectile models, but a couple other aspects of modeling the ABVs come into play here. The first picture above shows a proxy-ABV hierarchy defined and tailored for the Soldier in figure mode (the Figure Soldier). The second shows a proxy-ABV hierarchy defined and tailored for the Soldier moving in his backward walk cycle (the Walk Soldier).
First of all, the basic proxy-ABVs for the main body parts--torso, legs, feet, arms, hands & head--were modeled in figure mode and are the same for both models. Because a skin-and-bones character does not have individual skins for each body part, these proxy-ABVs were attached to the underlying bones of the character, instead. While the bones will not be rendered (they should be set to “hidden” when exported to nif format), they do remain with the model in order to control the positioning of the skin. Because of these attachments, the proxy-ABVs move with the character when he is animated (right picture).
Many of the proxy-ABVs use the CONTINUE propagation flag, including the torso, legs and arms. Because of the way collision propagation works, proxy-ABVs should be defined for all children of a node that uses CONTINUE and should likely be defined all the way down the tree until NONE proxy-ABVs are reached. In order to better clarify this and the other points, we will look at the definition of the soldier proxy-ABVs in detail from the top bone down, following the schematic diagram (for the Walk Soldier) pictured below.