A collision detection algorithm based on AABB bounding box model segmentation and iteration

Through AABB bounding box model segmentation and iterative collision detection algorithm, the problem of misjudgment of AABB bounding boxes in engineering component detection is solved, and efficient and accurate collision detection and position judgment are achieved.

CN116386025BActive Publication Date: 2025-09-16SOUTHEAST UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310283532.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-22
Publication Date
2025-09-16
Estimated Expiration
2043-03-22

AI Technical Summary

Technical Problem

The existing AABB bounding box collision detection method has problems of misjudgment and insufficient accuracy when detecting engineering components, especially for irregular components, it is difficult to accurately determine the collision location.

Method used

The collision detection algorithm adopts AABB bounding box model segmentation and iteration. Through 3D grid segmentation and iteration, the model bounding sphere and sub-model bounding box are generated. The collision detection is performed in combination with the 3D grid unit to improve the detection accuracy and determine the collision location.

Benefits of technology

The accuracy of AABB bounding box detection has been improved, which can accurately determine the collision of engineering components, reduce misjudgments, and improve detection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116386025B_ABST
    Figure CN116386025B_ABST
Patent Text Reader

Abstract

The present invention provides a collision detection algorithm based on AABB bounding box model segmentation and iteration, including: using AABB bounding boxes to wrap the model to be tested and roughly detecting whether a collision problem occurs; using a bounding sphere detection method to roughly eliminate bounding box collision detection errors; by finding the extreme points and saddle coordinates of the model surface, segmenting the model through the xy, xz and yz planes of these coordinates, generating bounding boxes for each segmented model, and performing collision detection; using a three-dimensional grid to divide the model, detecting collision situations, further dividing and detecting the collision units with smaller grid sizes, and accurately determining whether the models collide through iteration. The present invention detects models detected by the AABB method for collision by using a three-dimensional grid division and iteration, thereby solving the possible misjudgment situation of the AABB method when performing model collision problems, and can obtain the precise location of the collision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of collision detection in three-dimensional digital models, and in particular but not limited to, to a collision detection algorithm based on AABB bounding box model segmentation and iteration. Background Art

[0002] Collision detection, a core technology in computer simulation, is essential for ensuring the interactivity and conceptualization of virtual three-dimensional models. Its primary function is to detect penetration and interference between three-dimensional models, thereby simulating and verifying the design of construction components and subsequent construction methods. To address this problem in various fields, scholars have proposed numerous different collision detection methods. Among them, collision detection methods based on hierarchical bounding boxes have been a hot topic of research and are currently widely used in various fields. The entire collision detection process of these methods is divided into two stages: rough collision detection (bounding box intersection testing) and precise collision detection (triangle intersection testing). The core concept is to enclose complex models with common geometric shapes, eliminating most non-intersecting objects and thus reducing the number of intersection tests for primitive pairs. Common bounding boxes are categorized into axial bounding boxes (AABBs), oriented bounding boxes (OBBs), and discrete directional bounding boxes (K-Dops).

[0003] The bounding box has two important properties: simplicity and precision, and these two properties are mutually exclusive. In specific implementation, it should be processed accordingly according to the different requirements of the specific situation. AABB is relatively simple to build and test, but has poor precision; while OBB has good precision, but is relatively complex to build and test. In view of the fact that most engineering structural components are relatively standard aggregates, the present invention adopts AABB bounding boxes to meet the accuracy requirements of component model collision detection. For some irregular components, based on the use of AABB bounding boxes, segmentation and iteration methods are used to improve the accuracy of AABB bounding box collision detection, thereby giving full play to the simplicity and efficiency advantages of AABB bounding box detection method in engineering component collision detection.

[0004] In view of this, it is necessary to provide a new detection method to solve at least part of the above problems. Summary of the Invention

[0005] In response to one or more problems in the prior art, the present invention proposes a collision detection algorithm based on AABB bounding box model segmentation and iteration. Through three-dimensional grid segmentation and iteration, models that may be detected using the AABB method for collision detection are detected, thereby solving the possible misjudgment of the AABB bounding box when performing model collision detection, and improving the accuracy of AABB bounding box collision detection, thereby giving full play to the simple and efficient advantages of the AABB bounding box detection method in engineering component collision detection, and the precise location of the collision can be obtained.

[0006] The technical solutions for achieving the purpose of the present invention are:

[0007] A collision detection algorithm based on AABB bounding box model segmentation and iteration, including:

[0008] S1. Use AABB bounding boxes to wrap the models to be tested and generate model bounding boxes. Perform collision detection on the model bounding boxes and determine whether there is a collision between the model bounding boxes. If a collision occurs, proceed to step S2. Otherwise, terminate the detection and output that there is no collision between the models to be tested.

[0009] S2. Generate a model bounding sphere with the centroid of the model bounding box as the sphere center and the maximum distance between the edge of the model bounding box and the centroid as the radius. Perform collision detection on the model bounding spheres and determine whether collision occurs between the model bounding spheres. If collision occurs, proceed to step S3; otherwise, terminate the detection and output that no collision occurs between the models to be tested.

[0010] S3. Calculate the coordinates of the extreme points and the saddle of the surface of the model to be tested, segment the model to be tested according to the xy, xz, and yz planes where the extreme point coordinates are located, generate several sub-models to be tested, use AABB bounding boxes to wrap each sub-model to be tested and generate a sub-model bounding box, and mark the sub-model bounding boxes belonging to the same model to be tested;

[0011] S4, performing collision detection on the bounding boxes of the sub-models of different models to be tested, and determining whether collision occurs between the bounding boxes of the sub-models of different models to be tested. If collision occurs, proceed to step S5; otherwise, terminate the detection and output that no collision occurs between the models to be tested.

[0012] S5. Extract the bounding box of the sub-model that collides, and perform three-dimensional mesh segmentation on the model inside it to generate several mesh units. Perform row collision detection on the mesh units of different sub-model bounding boxes. If a collision occurs, extract the mesh unit that collides, reduce the mesh unit size and perform three-dimensional mesh segmentation again. Repeat this step to perform collision detection. When the mesh unit reaches the lower limit of the mesh unit size, terminate the iteration and output that the model to be tested has collided. If no collision occurs during the iteration process, output that there is no collision problem with the model to be tested.

[0013] Furthermore, in the collision detection algorithm based on AABB bounding box model segmentation and iteration of the present invention, the method for determining whether a collision occurs between model bounding spheres in S2 specifically includes:

[0014] If the distance between the two model enclosing spheres is ≥ the square of the minimum sum of the distances from the centers of the two model enclosing spheres to the surface, it is determined that no collision has occurred; otherwise, it is determined that a collision has occurred.

[0015] Furthermore, in the collision detection algorithm based on AABB bounding box model segmentation and iteration of the present invention, the formula for determining whether a collision occurs between model bounding spheres in S2 is as follows:

[0016] (pos1-pos2)·length 2 ≤(r1+r2) 2

[0017] Among them, pos1 and pos2 are the position coordinates of the centroids of the bounding boxes of the two models to be tested, pos1-pos2 is the vector pointing from the model 2 to the model 1 to be tested, and length 2 is the square of the length of the vector pointing from the model to be tested 2 to the model to be tested 1.

[0018] Furthermore, in the collision detection algorithm based on AABB bounding box model segmentation and iteration of the present invention, calculating the extreme point coordinates and saddle coordinates of the surface of the model to be tested in S3 specifically includes:

[0019] S3-1: Assume that the surface equation of the model to be measured is:

[0020] z=f(x,y)

[0021] S3-2: Solve the derivative of the surface equation at the point (x0, y0):

[0022]

[0023]

[0024] Where h represents a small quantity that tends to 0;

[0025] S3-3: Calculate the Hessian matrix:

[0026]

[0027] S3-4: Solve the eigenvalues ​​and eigenvectors of the Hessian matrix:

[0028]

[0029] Among them, λ represents the eigenvalue, represents the eigenvector;

[0030] S3-5: Determine the type of extreme point based on the positive or negative eigenvalues: when all eigenvalues ​​are positive, it is a local minimum; when all eigenvalues ​​are negative, it is a local maximum; when one eigenvalue is positive and the other is negative, it is a saddle point.

[0031] Furthermore, in the collision detection algorithm based on AABB bounding box model segmentation and iteration of the present invention, marking the bounding boxes of sub-models belonging to the same model to be tested in S3 specifically includes:

[0032] S31: Assume that the plane equation of the sub-model bounding box is: Ax+By+Cz+D=0, and the surface equation of the model to be tested is: F(x, y, z)=0, then the parametric equation of the intersection line of the surface of the model to be tested and the plane of the sub-model bounding box is: G(x, y, z)=0;

[0033] S32: Substitute the parametric equation into the plane equation of the sub-model bounding box to obtain: Ax(t)+By(t)+Cz(t)+D=0, solve for the parameter t, and obtain the intersection of the surface of the model to be tested and the plane of the sub-model bounding box: (x(t), y(t), z(t));

[0034] S33: Determine whether the intersection point (x(t), y(t), z(t)) exists. If so, the plane and the surface intersect, otherwise they do not intersect.

[0035] S34: If the curved surface of the model to be tested intersects with two or more planes of the bounding boxes of the multiple sub-models, the multiple sub-model bounding boxes are determined to belong to the same model to be tested and marked.

[0036] Furthermore, in the collision detection algorithm based on AABB bounding box model segmentation and iteration of the present invention, the collision detection between the bounding boxes of sub-models of different models to be tested in S4 specifically includes:

[0037] S4-1: Determine whether any line segment on the bounding box of one sub-model intersects with the plane on which the face of the bounding box of another sub-model is located. If so, find the intersection point and proceed to S4-2. If not, terminate the test and output that no collision occurs between any line segment on the bounding box of one sub-model and the plane on which the face of the bounding box of another sub-model is located.

[0038] S4-2: Determine whether the intersection point is within the surface of the bounding box of the other sub-model. If so, it indicates that a collision occurs between the line segment on the bounding box of one sub-model and the surface on the bounding box of the other sub-model. If not, it indicates that no collision occurs between the line segment on the bounding box of one sub-model and the surface on the bounding box of the other sub-model.

[0039] S4-3: Traverse all line segments on the bounding box of one sub-model and all faces on the bounding box of another sub-model. If any line segment on the bounding box of one sub-model does not collide with a face on the bounding box of another sub-model, then there is no collision between the bounding boxes of the sub-models; otherwise, there is a collision between the bounding boxes of the sub-models.

[0040] Furthermore, in the collision detection algorithm based on AABB bounding box model segmentation and iteration of the present invention, determining in S4-1 whether a line segment on a sub-model bounding box intersects with a plane on which a face on another sub-model bounding box lies includes:

[0041] Let AB be the line segment on the bounding box of one sub-model and P be a point on the face of the bounding box of another sub-model. If:

[0042]

[0043] Then line segment AB intersects plane P at a point where is the vector pointing from P to A, is the vector pointing from P to B, is the plane normal vector, and · is the dot product of the vectors.

[0044] Furthermore, in the collision detection algorithm based on AABB bounding box model segmentation and iteration of the present invention, finding the intersection point in S4-1 includes:

[0045] Assume that the equation of the plane on which the face of the bounding box of another sub-model lies is:

[0046] Ax+By+Cz+D=0

[0047] Assume that the equation of the line on which the line segment on the bounding box of a sub-model lies is:

[0048]

[0049] Then we solve:

[0050]

[0051] The coordinates of the intersection of the line and the plane are:

[0052] (x0+at,y0+bt,y0+cb)

[0053] Furthermore, in the collision detection algorithm based on AABB bounding box model segmentation and iteration of the present invention, the formula for determining whether the intersection point is within the surface of the bounding box of the other sub-model in S4-2 is:

[0054]

[0055] If the above formula is satisfied, then point P is inside rectangle ABCD, the point P refers to the intersection point, and the rectangle ABCD refers to the surface on the bounding box of another sub-model.

[0056] Furthermore, the collision detection algorithm based on AABB bounding box model segmentation and iteration of the present invention, S5 specifically includes:

[0057] S5-1: Set the initial grid unit side length, side length lower limit and the amount of side length reduction for each iteration;

[0058] S5-2: Extract the bounding box of the sub-model that collided, and perform 3D mesh segmentation on the model inside it to generate several mesh units;

[0059] S5-3: Use the method in S3 to mark the grid cells that belong to the same sub-model bounding box;

[0060] S5-4: Calculate the position coordinates of the eight vertices of the sub-model bounding box. If the eight vertices are all inside the original unsegmented model, it means that the sub-model to be tested is inside the original model and will not collide with other sub-models to be tested, so it does not participate in collision detection;

[0061] S5-5: Perform collision detection on the grid cells using the method in S4. If a collision occurs, reduce the size of the grid cells and repeat steps S5-1 to S5-5.

[0062] S5-6: When no collision is detected during the iteration, the iteration is terminated and the output shows that there is no collision problem in the model to be tested; when the unit side length is reduced to the lower limit of the side length, the iteration is terminated and the output shows that there is a collision in the model.

[0063] Compared with the prior art, the present invention adopts the above technical solution and has the following technical effects:

[0064] 1. The collision detection algorithm based on AABB bounding box model segmentation and iteration of the present invention takes into account the characteristics that most engineering structural components are relatively standard aggregates. The use of AABB bounding boxes can meet the accuracy requirements of component model collision detection. For some irregular components, the segmentation and iteration methods are used on the basis of using AABB bounding boxes to improve the accuracy of AABB bounding box collision detection, thereby giving full play to the simplicity and efficiency advantages of AABB bounding box detection method in engineering component collision detection.

[0065] 2. The collision detection algorithm based on AABB bounding box model segmentation and iteration of the present invention detects models that may collide using the AABB method through three-dimensional grid segmentation and iteration, solves the possible misjudgment of AABB bounding box when performing model collision problems, improves the accuracy of AABB bounding box collision detection, and can obtain the exact location of the collision.

[0066] 3. The collision detection algorithm based on AABB bounding box model segmentation and iteration of the present invention calculates the positional relationship between the new model generated after three-dimensional grid segmentation and the original model, determines whether the newly generated model is located inside the original model, eliminates the model located inside the original model, reduces the number of bounding boxes to be detected, and improves model detection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] The accompanying drawings are used to provide a further understanding of the present invention and, together with the description, to explain the embodiments of the present invention, but do not constitute a limitation of the present invention. In the accompanying drawings:

[0068] Figure 1 The flowchart of the collision detection algorithm based on AABB bounding box model segmentation and iteration of the present invention is shown.

[0069] Figure 2 A schematic diagram of a model collision and bounding box according to an embodiment of the present invention is shown.

[0070] Figure 3 A schematic diagram showing a cross section of a wrapped ball according to an embodiment of the present invention is shown.

[0071] Figure 4 A schematic diagram of segmenting a model according to an embodiment of the present invention is shown.

[0072] Figure 5 A schematic diagram of the AABB bounding boxes of model A and model C according to an embodiment of the present invention is shown.

[0073] Figure 6 A schematic diagram of the AABB bounding boxes of model B and model C according to an embodiment of the present invention is shown.

[0074] Figure 7A schematic diagram of a complex model according to another embodiment of the present invention is shown. DETAILED DESCRIPTION

[0075] In order to further understand the present invention, preferred embodiments of the present invention are described below in conjunction with examples. However, it should be understood that these descriptions are only for further illustrating the features and advantages of the present invention, rather than limiting the claims of the present invention.

[0076] The description in this section focuses on a few typical embodiments only, and the present invention is not limited to the scope of the embodiments described. Combinations of different embodiments, replacement of certain technical features in different embodiments, and replacement of certain technical features in the embodiments with the same or similar prior art methods are also within the scope of the present invention.

[0077] According to one aspect of the present invention, a collision detection algorithm based on AABB bounding box model segmentation and iteration is provided. Figure 1 As shown, the specific steps are as follows:

[0078] Step 1: First, use the AABB bounding box to wrap the model to be tested, such as Figure 2 As shown, a rough inspection found that there was a collision problem between the two models;

[0079] Step 2: Use the centroid of the bounding box and the maximum distance between the edge of the bounding box and the centroid as the radius to generate a bounding sphere, and perform collision analysis on the model, such as Figure 3 As shown, the detection error caused by the edge gap problem during AABB bounding box detection is roughly eliminated and substituted into the formula:

[0080] (pos1-pos2)·length 2 ≤(r1+r2) 2

[0081] If the calculation result shows that the inequality holds, it is considered that a collision has occurred and the next calculation is carried out;

[0082] Step 3: Find the extreme points and saddle coordinates of the model surface, segment the model using the xy, xz, and yz planes of these coordinates, and then generate bounding boxes for each segmented model.

[0083] According to its surface equation

[0084] z=f(x,y)

[0085] Find the derivative:

[0086] To solve the derivative of the surface z = f (x, y) at the point (x0, y0), the following formula can be used:

[0087]

[0088]

[0089] Where h represents a small quantity that tends to 0;

[0090] Calculate the Hessian matrix:

[0091] The Hessian matrix is ​​the matrix of second-order partial derivatives and can be calculated using the following formula:

[0092]

[0093] Solve for eigenvalues ​​and eigenvectors:

[0094] To solve the eigenvalues ​​and eigenvectors of the Hessian matrix, the following formula can be used:

[0095]

[0096] Thus, the position of the extreme point of the surface is obtained, and the irregular model is divided according to the xy plane to generate two new models A and B, such as Figure 4 As shown;

[0097] By calculating whether the surface equation of the same model intersects with two or more planes of the bounding box, traversing the planes of the bounding boxes of models A and B, if the model surface intersects with more than two planes of the two bounding boxes, the two models A and B will not be analyzed and calculated for collision with each other;

[0098] Step 4: Use row collision detection on the newly divided bounding box;

[0099] First, perform AABB bounding box detection on model A and model C, as shown in the following example: Figure 5 As shown. Analyze the relative position of edge b of the bounding box of model C and surface a of the bounding box of model A, where p is a point on surface a;

[0100] The solution can be found by determining whether the two endpoints of the line segment mn are on the same side of the plane. If both endpoints are on the same side, they definitely do not intersect. is the plane normal vector, and the formula is as follows:

[0101]

[0102] Through calculation, we can see that the inequality does not hold, that is, the line segment mn has no intersection with the plane a, so there is no collision problem between model A and model C;

[0103] Similarly, perform AABB bounding box detection on model B and model C, such as Figure 5As shown. Analyze the relative position of edge c of the bounding box of model C and surface b of the bounding box of model B, where q is a point on surface b;

[0104] The solution can be found by determining whether the two endpoints of the line segment rs are on the same side of the plane. If both endpoints are on one side, they definitely do not intersect. is the plane normal vector, and the formula is as follows:

[0105]

[0106] Through calculation, we can see that the inequality does not hold, that is, line segment rs has no intersection with plane b, so there is no collision problem between model B and model C;

[0107] Since there is no model collision problem between Model A and Model C, and between Model B and Model C, there is no collision problem between the original two models.

[0108] If the collision of the bounding box still exists after segmentation, such as Figure 7 As shown, proceed to step 5 and use row collision detection on the newly divided bounding box;

[0109] Extract the bounding box where the collision occurred and mesh the model inside it;

[0110] S52, setting the side length of the initial grid unit, the lower limit of the side length, and the amount of decrease in the side length for each iteration;

[0111] S53. To simplify the collision calculation process, for each unit, use the algorithm involving the intersection of curved and flat surfaces in step 3 to traverse each cross-section of each bounding box. If the same surface equation of the model intersects two or more planes of multiple bounding boxes, mark these bounding boxes and eliminate the bounding boxes that originally belonged to the same model.

[0112] S54. Calculate the eight vertex position coordinates of the bounding box. If all the coordinates are in each part of the model, they will not be included in the calculation, reducing the number of bounding boxes to be detected. The purpose of this step is to reduce the number of models to be tested during collision calculations. If the bounding box of the sub-model is wrapped by the surface of the original model, it means that the newly generated sub-model is inside the original model and it is impossible for a collision to occur. Therefore, this part of the sub-model that will definitely not collide will be eliminated.

[0113] S55. Perform unit collision analysis using the algorithm in step 4. If a collision still exists, repeat steps S51 to S55. Extract the bounding box with collision obtained in S55 and substitute it into S51 for iteration, while gradually reducing the unit size.

[0114] S56. When no collision is detected during the iteration, the iteration is terminated and the model is output as having no collision problem; when the unit side length is reduced to the lower limit of the side length, the iteration is terminated and the model is output as having collision problem.

[0115] The description and application of the present invention here are illustrative and are not intended to limit the scope of the present invention to the above-mentioned embodiments. The relevant descriptions of the effects or advantages involved in the specification may not be reflected in the actual experimental examples due to the uncertainty of specific condition parameters or other factors, and the relevant descriptions of the effects or advantages are not used to limit the scope of the invention. Variations and changes to the embodiments disclosed here are possible, and the replacement of the embodiments and various equivalent components are well known to those of ordinary skill in the art. It should be clear to those skilled in the art that, without departing from the spirit or essential characteristics of the present invention, the present invention can be implemented in other forms, structures, arrangements, proportions, and with other components, materials and parts. Without departing from the scope and spirit of the present invention, other variations and changes can be made to the embodiments disclosed here.

Claims

1. A collision detection algorithm based on AABB bounding box model segmentation and iteration, characterized in that: include: S1. Use AABB bounding boxes to wrap the models to be tested and generate model bounding boxes. Perform collision detection on the model bounding boxes and determine whether there is a collision between the model bounding boxes. If a collision occurs, proceed to step S2. Otherwise, terminate the detection and output that there is no collision between the models to be tested. S2. Generate a model bounding sphere with the centroid of the model bounding box as the sphere center and the maximum distance between the edge of the model bounding box and the centroid as the radius. Perform collision detection on the model bounding spheres and determine whether collision occurs between the model bounding spheres. If collision occurs, proceed to step S3; otherwise, terminate the detection and output that no collision occurs between the models to be tested. S3. Calculate the coordinates of the extreme points and the saddle of the surface of the model to be tested, segment the model to be tested according to the xy, xz, and yz planes where the extreme point coordinates are located, generate several sub-models to be tested, use AABB bounding boxes to wrap each sub-model to be tested and generate a sub-model bounding box, and mark the sub-model bounding boxes belonging to the same model to be tested; S4, performing collision detection on the bounding boxes of the sub-models of different models to be tested, and determining whether collision occurs between the bounding boxes of the sub-models of different models to be tested. If collision occurs, proceed to step S5; otherwise, terminate the detection and output that no collision occurs between the models to be tested. S5. Extract the bounding box of the sub-model that has collided, and perform three-dimensional mesh segmentation on the model inside it to generate a number of mesh units. Perform row collision detection on the mesh units that are not in the same sub-model bounding box. If a collision exists, extract the mesh unit that has collided, reduce the mesh unit size, perform three-dimensional mesh segmentation again, and repeat this step to perform collision detection. When the mesh unit reaches the lower limit of the mesh unit size, the iteration is terminated, and the collision of the models to be tested is output. If no collision occurs during the iteration process, the output model to be tested has no collision problem.

2. The collision detection algorithm based on AABB bounding box model segmentation and iteration according to claim 1 is characterized in that: The method for determining whether a collision occurs between the model bounding balls in S2 specifically includes: If the distance between the two model enclosing spheres is ≥ the square of the minimum sum of the distances from the centers of the two model enclosing spheres to the surface, it is determined that no collision has occurred; otherwise, it is determined that a collision has occurred.

3. The collision detection algorithm based on AABB bounding box model segmentation and iteration according to claim 1 or 2, characterized in that: The formula for determining whether a collision occurs between the model bounding balls in S2 is as follows: (pos1-pos2)·length 2 ≤(r1+r2) 2 Among them, pos1 and pos2 are the position coordinates of the centroids of the bounding boxes of the two models to be tested, pos1-pos2 is the vector pointing from the model 2 to the model 1 to be tested, and length 2 is the square of the length of the vector pointing from the model to be tested 2 to the model to be tested 1.

4. The collision detection algorithm based on AABB bounding box model segmentation and iteration according to claim 1, characterized in that: The calculation of the extreme point coordinates and saddle coordinates of the surface of the model to be tested in S3 specifically includes: S3-1: Assume that the surface equation of the model to be measured is: z=f(x,y) S3-2: Solve the derivative of the surface equation at the point (x0, y0): Where h represents a small quantity that tends to 0; S3-3: Calculate the Hessian matrix: S3-4: Solve the eigenvalues ​​and eigenvectors of the Hessian matrix: Among them, λ represents the eigenvalue, represents the eigenvector; S3-5: Determine the type of extreme point based on the positive or negative eigenvalues: when all eigenvalues ​​are positive, it is a local minimum; when all eigenvalues ​​are negative, it is a local maximum; when one eigenvalue is positive and the other is negative, it is a saddle point.

5. The collision detection algorithm based on AABB bounding box model segmentation and iteration according to claim 1, characterized in that: The sub-model bounding boxes marked in S3 as belonging to the same model to be tested specifically include: S31: Assume that the plane equation of the sub-model bounding box is: Ax+By+Cz+D=0, and the surface equation of the model to be tested is: F(x, y, z)=0, then the parametric equation of the intersection line of the surface of the model to be tested and the plane of the sub-model bounding box is: G(x, y, z)=0; S32: Substitute the parametric equation into the plane equation of the sub-model bounding box to obtain: Ax(t)+By(t)+Cz(t)+D=0, solve for the parameter t, and obtain the intersection of the surface of the model to be tested and the plane of the sub-model bounding box: (x(t), y(t), z(t)); S33: Determine whether the intersection point (x(t), y(t), z(t)) exists. If so, the plane and the surface intersect, otherwise they do not intersect. S34: If the curved surface of the model to be tested intersects with two or more planes of the bounding boxes of the multiple sub-models, the multiple sub-model bounding boxes are determined to belong to the same model to be tested and marked.

6. The collision detection algorithm based on AABB bounding box model segmentation and iteration according to claim 1, characterized in that: In S4, the collision detection between the bounding boxes of sub-models of different models to be tested is performed separately, specifically including: S4-1: Determine whether any line segment on the bounding box of one sub-model intersects with the plane on which the face of the bounding box of another sub-model is located. If so, find the intersection point and proceed to S4-2. If not, terminate the test and output that no collision occurs between any line segment on the bounding box of one sub-model and the plane on which the face of the bounding box of another sub-model is located. S4-2: Determine whether the intersection point is within the surface of the bounding box of the other sub-model. If so, it indicates that a collision occurs between the line segment on the bounding box of one sub-model and the surface on the bounding box of the other sub-model. If not, it indicates that no collision occurs between the line segment on the bounding box of one sub-model and the surface on the bounding box of the other sub-model. S4-3: Traverse all line segments on the bounding box of one sub-model and all faces on the bounding box of another sub-model. If any line segment on the bounding box of one sub-model does not collide with a face on the bounding box of another sub-model, then there is no collision between the bounding boxes of the sub-models; otherwise, there is a collision between the bounding boxes of the sub-models.

7. The collision detection algorithm based on AABB bounding box model segmentation and iteration according to claim 6, characterized in that: In S4-1, determining whether a line segment on a sub-model bounding box intersects with a plane on which a face on another sub-model bounding box lies includes: Let AB be the line segment on the bounding box of one sub-model and P be a point on the face of the bounding box of another sub-model. If: Then line segment AB intersects plane P at a point where is the vector pointing from P to A, is the vector pointing from P to B, is the plane normal vector, and · is the dot product of the vectors.

8. The collision detection algorithm based on AABB bounding box model segmentation and iteration according to claim 6, characterized in that: Finding the intersection point in S4-1 includes: Assume that the equation of the plane on which the face of the bounding box of another sub-model lies is: Ax+By+Cz+D=0 Assume that the equation of the line on which the line segment on the bounding box of a sub-model lies is: Then we solve: The coordinates of the intersection of the line and the plane are: (x0+at,y0+bt,y0+cb).

9. The collision detection algorithm based on AABB bounding box model segmentation and iteration according to claim 6, characterized in that: The formula for determining whether the intersection point is within the surface of the bounding box of another sub-model in S4-2 is: If the above formula is satisfied, then point P is inside rectangle ABCD, the point P refers to the intersection point, and the rectangle ABCD refers to the surface on the bounding box of another sub-model.

10. The collision detection algorithm based on AABB bounding box model segmentation and iteration according to claim 1, characterized in that: S5 specifically includes: S5-1: Set the initial grid unit side length, side length lower limit and the amount of side length reduction for each iteration; S5-2: Extract the bounding box of the sub-model that collided, and perform 3D mesh segmentation on the model inside it to generate several mesh units; S5-3: Use the method in S3 to mark the grid cells that belong to the same sub-model bounding box; S5-4: Calculate the position coordinates of the eight vertices of the sub-model bounding box. If the eight vertices are all inside the original unsegmented model, it means that the sub-model to be tested is inside the original model and will not collide with other sub-models to be tested, so it does not participate in collision detection; S5-5: Perform collision detection on the grid cells using the method in S4. If a collision occurs, reduce the size of the grid cells and repeat steps S5-1 to S5-5. S5-6: When no collision is detected during the iteration, the iteration is terminated and the output shows that there is no collision problem in the model to be tested; when the unit side length is reduced to the lower limit of the side length, the iteration is terminated and the output shows that there is a collision in the model.

Citation Information

Patent Citations

  • Virtual assembly-oriented collision detection method based on AABB (Axis Aligned Bounding Box)-OBB (Oriented Bounding Box) mixed bounding box

    CN102368280A

  • Operation collision detection method for virtual reality scene

    CN111652908A