Rigid body collision detection method and system based on adaptive resolution

Through the rigid body collision detection method with adaptive resolution, the detection parameters are adjusted using scene complexity indicators and the time step and resolution are dynamically adjusted, which solves the problem of inefficiency in complex scenarios in the existing technology, and realizes the complex dynamic scenarios in complex scenarios. efficient and accurate collision detection.

CN119026379BActive Publication Date: 2025-01-14NANJING ARTIFICIAL INTELLIGENCE CHIPS RES INST OF AUTOMATION CHINESE ACAD OF SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411498512.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-25
Publication Date
2025-01-14
Estimated Expiration
2044-10-25

AI Technical Summary

Technical Problem

When the prior art deals with rigid body collision detection in complex dynamic scenarios, it is difficult to balance the computing efficiency and detection accuracy. Traditional methods are inefficient in complex scenarios and have problems of wasting computing resources in simple scenarios.

Method used

Adopting the rigid body collision detection method based on adaptive resolution, adjust the weight matrix by obtaining scene complexity indicators, map rigid body data to high-dimensional space, build a k-d tree for near-neighbor search, generate a list of potential collision pairs, and update the tensor field and feature description. , perform hierarchical clustering and parallel collision detection, dynamically adjust the time step and spatial resolution, and realize adaptive grid and Li algebraic representation to improve detection accuracy and efficiency.

Benefits of technology

实现了在复杂动态场景中自适应调整检测精度和效率,确保仿真环境的可靠性和实时性,降低了计算复杂度,提高了碰撞检测的准确性和效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119026379B_ABST
    Figure CN119026379B_ABST
Patent Text Reader

Abstract

The present invention discloses a rigid body collision detection method and system based on adaptive resolution, the method comprising obtaining rigid body data, mapping it to a high-dimensional space, constructing a k-d tree and performing a nearest neighbor search, generating a potential collision pair list; constructing an initial tensor field, calculating a scalar field and finding a local maximum point, obtaining an updated potential collision pair list; constructing a complex sequence array, calculating and obtaining an analysis result; constructing an adaptive grid and performing local collision detection, obtaining a collision pair array; dividing the simulation space into grid units, calculating an entropy gradient, updating the motion state of the rigid body, and calculating Lie algebra local features; performing hierarchical clustering and parallel collision detection, generating global collision detection data; calculating a high-dimensional feature vector; and calculating and obtaining a complexity level and an overall scene complexity index. The present invention implements an adaptive resolution collision detection method in a complex dynamic scene, and can flexibly adjust the accuracy and efficiency of collision detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of dynamics simulation, and in particular to a rigid body collision detection method and system based on adaptive resolution. Background Art

[0002] In the field of computer simulation and physics engines, collision detection is the basic technology for realizing rigid body interaction and physical simulation. With the continuous development of application scenarios such as virtual reality, augmented reality, autonomous driving simulation, robot training, and massively multiplayer online games, the complexity and diversity of simulation scenarios are increasing. These scenarios usually involve high-speed movement and frequent interactions of a large number of rigid bodies. Traditional collision detection algorithms face significant challenges in handling these complex scenarios.

[0003] Traditional collision detection methods usually use fixed resolution for calculation. These methods perform well in some simple or static scenes, but the limitations of fixed resolution begin to emerge when dealing with dynamic and complex scenes. Although high-resolution detection algorithms can provide higher accuracy, the computational cost is expensive and it is difficult to meet the needs of real-time simulation; while low-resolution detection methods may lead to missed collisions or false detections, affecting the reliability of the simulation. Especially in scenarios where real-time and accuracy must be guaranteed, how to balance computational efficiency and detection accuracy has become a major problem facing existing technologies.

[0004] In addition, with the improvement of hardware performance, simulation systems have more computing resources to use, but the reasonable allocation and optimization of computing resources are still crucial. Traditional methods work at a fixed resolution and fail to fully utilize the flexibility of modern computing resources, resulting in inefficiency in complex scenes and the risk of wasting computing resources in simple scenes.

[0005] In order to solve the above problems, there is an urgent need for a method that can dynamically adjust the detection accuracy and adaptively allocate computing resources according to the complexity of the scene. This can not only ensure the detection accuracy in complex scenes, but also improve the computing efficiency in simple scenes to meet the needs of real-time simulation. Summary of the invention

[0006] The purpose of the invention is to provide a rigid body collision detection method and system based on adaptive resolution to solve the above-mentioned problems existing in the prior art.

[0007] The technical solution is a rigid body collision detection method based on adaptive resolution, comprising the following steps:

[0008] S1. Obtain rigid body data and calculate scene complexity index; based on the scene complexity index, adjust the preset weight matrix to obtain the adjusted weight matrix; based on the adjusted weight matrix, map the rigid body data to a high-dimensional space to obtain a high-dimensional point set array; based on the high-dimensional point set array, construct a kd tree and perform a neighbor search to generate a potential collision pair list; wherein the rigid body data includes the three-dimensional coordinate position data, velocity vector data, acceleration vector data and pre-calculated shape complexity scalar value of the rigid body;

[0009] S2. Based on the potential collision pair list, construct an initial tensor field and calculate the tensor field of the next time step; discretize the tensor field of the next time step into a grid structure, perform eigenvalue decomposition based on the grid structure, and obtain an eigenvalue array; based on the eigenvalue array, calculate the scalar field and find the local maximum point; based on the local maximum point, select the center of the high collision probability area; based on the center of the high collision probability area, update the potential collision pair list to obtain an updated potential collision pair list;

[0010] S3, constructing a point cloud data set based on the updated potential collision pair list; constructing a complex sequence array based on the point cloud data set; calculating the continuous homology of each complex in the complex sequence array to form a continuous homology graph; analyzing the continuous homology graph to obtain an analysis result; constructing an adaptive grid based on the analysis result; performing local collision detection in the adaptive grid to obtain a collision pair array;

[0011] S4, based on the collision pair array, dividing the preset simulation space into uniform grid cells, calculating the entropy gradient of each grid cell; based on the entropy gradient, adjusting the time step and spatial resolution of each grid cell, and updating the motion state of the rigid body in each grid cell to obtain updated state data;

[0012] S5, representing the updated state data as Lie group elements, and calculating the multi-scale Lie algebra representation and the Lie algebra local features based on the Lie group elements; constructing feature descriptors based on the multi-scale Lie algebra representation and the Lie algebra local features; performing hierarchical clustering based on the feature descriptors to obtain hierarchical clustering results; performing parallel collision detection based on the hierarchical clustering results, obtaining and merging collision detection results, and generating global collision detection data;

[0013] S6. Based on the global collision detection data, calculate the global features and local features; combine the global features and local features into a high-dimensional feature vector; reduce the dimension of the high-dimensional feature vector to obtain the reduced-dimensional data; based on the reduced-dimensional data, use the K-means clustering method to calculate the clustering results; based on the clustering results, calculate the complexity level of each rigid body and the overall scene complexity index.

[0014] Adaptive resolution based rigid body collision detection system, including:

[0015] at least one processor; and,

[0016] a memory communicatively connected to at least one of the processors; wherein,

[0017] The memory stores instructions that can be executed by the processor, and the instructions are used to be executed by the processor to implement the rigid body collision detection method based on adaptive resolution.

[0018] Beneficial effect: The present invention realizes an adaptive resolution collision detection method in complex dynamic scenes, which can flexibly adjust the accuracy and efficiency of collision detection according to the real-time complexity of the scene, ensuring reliable detection effects in various simulation environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 It is a flow chart of the present invention.

[0020] Figure 2 This is a flow chart of step S1 of the present invention.

[0021] Figure 3 This is a flow chart of step S2 of the present invention.

[0022] Figure 4 This is a flow chart of step S3 of the present invention.

[0023] Figure 5 This is a flow chart of step S4 of the present invention.

[0024] Figure 6 This is a flow chart of step S5 of the present invention.

[0025] Figure 7 This is a flow chart of step S6 of the present invention.

[0026] Figure 8 This is a flow chart of rigid body collision detection with adaptive resolution according to an embodiment of the present invention. DETAILED DESCRIPTION

[0027] like Figure 1 As shown, the present application proposes a rigid body collision detection method based on adaptive resolution, comprising the following steps:

[0028] S1. Obtain rigid body data and calculate scene complexity index; based on the scene complexity index, adjust the preset weight matrix to obtain the adjusted weight matrix; based on the adjusted weight matrix, map the rigid body data to a high-dimensional space to obtain a high-dimensional point set array; based on the high-dimensional point set array, construct a kd tree and perform a neighbor search to generate a potential collision pair list; wherein the rigid body data includes the three-dimensional coordinate position data, velocity vector data, acceleration vector data and pre-calculated shape complexity scalar value of the rigid body;

[0029] S2. Based on the potential collision pair list, construct an initial tensor field and calculate the tensor field of the next time step; discretize the tensor field of the next time step into a grid structure, perform eigenvalue decomposition based on the grid structure, and obtain an eigenvalue array; based on the eigenvalue array, calculate the scalar field and find the local maximum point; based on the local maximum point, select the center of the high collision probability area; based on the center of the high collision probability area, update the potential collision pair list to obtain an updated potential collision pair list;

[0030] S3, constructing a point cloud data set based on the updated potential collision pair list; constructing a complex sequence array based on the point cloud data set; calculating the continuous homology of each complex in the complex sequence array to form a continuous homology graph; analyzing the continuous homology graph to obtain an analysis result; constructing an adaptive grid based on the analysis result; performing local collision detection in the adaptive grid to obtain a collision pair array;

[0031] S4. Based on the collision pair array, the preset simulation space is divided into uniform grid cells, and the entropy gradient of each grid cell is calculated; based on the entropy gradient, the time step and spatial resolution of each grid cell are adjusted, and the motion state of the rigid body in each grid cell is updated to obtain updated state data.

[0032] S5, representing the updated state data as Lie group elements, and calculating the multi-scale Lie algebra representation and the Lie algebra local features based on the Lie group elements; constructing feature descriptors based on the multi-scale Lie algebra representation and the Lie algebra local features; performing hierarchical clustering based on the feature descriptors to obtain hierarchical clustering results; performing parallel collision detection based on the hierarchical clustering results, obtaining and merging collision detection results, and generating global collision detection data;

[0033] S6. Based on the global collision detection data, calculate the global features and local features; combine the global features and local features into a high-dimensional feature vector; reduce the dimension of the high-dimensional feature vector to obtain the reduced-dimensional data; based on the reduced-dimensional data, use the K-means clustering method to calculate the clustering results; based on the clustering results, calculate the complexity level of each rigid body and the overall scene complexity index.

[0034] like Figure 2 As shown, according to one aspect of the present application, step S1 is further:

[0035] S11, reading the three-dimensional coordinate position data, velocity vector data, acceleration vector data and pre-calculated shape complexity scalar value of the rigid body from the simulation environment database, and combining them to form rigid body data; based on the rigid body data, calculating the average distance and average velocity of the rigid body; based on the average distance and average velocity, calculating the scene complexity index; multiplying the complexity index by a pre-defined scaling parameter to obtain an adjustment factor;

[0036] S12, using the adjustment factor to update the preset weight matrix to obtain an updated weight matrix; based on the rigid body data and the updated weight matrix, performing element-level nonlinear transformation to obtain a high-dimensional point set array;

[0037] S13, constructing a kd tree based on the high-dimensional point set array, performing a k nearest neighbor search in the kd tree, and obtaining a search result; calculating the Euclidean distance between each index pair in the search result based on the search result and the three-dimensional coordinate position data of the rigid body;

[0038] S14. Based on the Euclidean distance between each index pair and a preset threshold, potential collision pairs are screened out to generate a potential collision pair list.

[0039] In one embodiment of the present application, the three-dimensional coordinate position data (x, y, z), velocity vector data (vx, vy, vz), acceleration vector data (ax, ay, az) and the pre-calculated shape complexity scalar value s of each rigid object are read from the simulation environment database. These data are combined into an input vector I = (x, y, z, vx, vy, vz, ax, ay, az, s) and stored in a temporary array A. All input vectors in the temporary array A are traversed to calculate the Euclidean distance of all rigid objects in the original three-dimensional space. The sum of these distance values ​​is divided by the number of combinations of the total number of rigid objects to obtain the average distance d avg At the same time, calculate the modulus of the velocity vectors of all rigid objects, sum these modulus values ​​and divide them by the total number of rigid objects to get the average velocity v avg Using the average distance d avg and the average speed v avg , and the total number of rigid body objects n in the temporary array A, through the formula C = (n * v avg ) / d avg Calculate the complexity index C. Multiply C with the predefined scaling parameter α to get the adjustment factor f = 1 + αC.

[0040] Initialize the weight matrix W to a 10x10 identity matrix. Use the adjustment factor f to update the weight matrix W: multiply all elements in the 4th to 9th rows (corresponding to velocity and acceleration) in the weight matrix W by the factor f, and store the updated weight matrix as W'. Use the updated weight matrix W' to map each input vector I in the temporary array A: calculate W' * I through matrix multiplication to obtain a 10-dimensional vector, and then pass the vector into the hyperbolic tangent function for element-level nonlinear transformation to obtain a point P = tanh(W' * I) in the high-dimensional space, where tanh( ) represents the hyperbolic tangent function, and store all transformed points P in the high-dimensional point set array C.

[0041] Construct an empty kd tree data structure T, traverse the high-dimensional point set array C, and insert each point P into the kd tree data structure T. The insertion process starts from the root node of the tree, and selects the left subtree or the right subtree at each level according to the coordinate value of the current dimension until a suitable leaf node position is found to insert the point P. For each point P in the high-dimensional point set array C, perform a k-nearest neighbor search in the kd tree T. The search process starts from the root node, recursively traverses the branches of the tree, and maintains a set of the current k nearest neighbor points. After the search is completed, the index pairs of each point P and its k nearest neighbor points are stored in a temporary array D.

[0042] Traverse each index pair (i, j) in the temporary array D. Use these indexes to obtain the corresponding 3D coordinate data from the original temporary array A. Calculate the Euclidean distance d between the two 3D coordinates ij If the Euclidean distance d ij If it is less than a predefined threshold Δ, the index pair (i, j) is added to the potential collision pair list E. Finally, the generated potential collision pair list E is output.

[0043] According to one aspect of the present application, in step S11, the average distance and average speed of the rigid body are calculated based on the rigid body data; based on the average distance and average speed, the scene complexity index is further calculated as:

[0044] S111. Based on the rigid body data, a KD tree algorithm is used to generate a spatial index structure; based on the spatial index structure, a local density of each rigid body is calculated;

[0045] S112. Calculate the average relative velocity of each rigid body and adjacent rigid bodies based on the rigid body data;

[0046] S113, constructing a two-dimensional probability density function based on the local density and average relative velocity of all rigid bodies using a kernel density estimation method;

[0047] S114, calculating the information entropy of the two-dimensional probability density function; based on the two-dimensional probability density function, using the maximum information coefficient algorithm, calculating the nonlinear correlation between the local density and the average relative velocity;

[0048] S115. Calculate the scene complexity index based on information entropy and nonlinear correlation.

[0049] In one embodiment of the present application, the position (x, y, z) and velocity (vx, vy, vz) data of all rigid bodies are extracted from the temporary array A. The KD tree algorithm is used to organize these data into a spatial index structure T. For each rigid body i, the spatial index structure T is used to quickly find the set of neighboring rigid bodies Ni within its range r. The local density ρi=|Ni| / (43*π*r³) is calculated, where |Ni| is the number of neighboring rigid bodies. For each rigid body i, the average relative velocity vi between it and the neighboring rigid bodies is calculated. rel =Σ j∈Ni |vi-vj| / |Ni|. Using the kernel density estimation (KDE) method, based on the local density ρi and the average relative velocity vi of all rigid bodies rel , construct a two-dimensional probability density function P(ρ,v rel ). Calculate P(ρ, v rel )’s information entropy H=-ΣP(ρ,v rel )*log(P(ρ,v rel )) Calculate ρ and v using the maximum information coefficient (MIC) algorithm rel The nonlinear correlation between MIC(ρ,v rel ). Combining entropy H and correlation MIC, calculate the new scene complexity index C = α*H + β*MIC (ρ, v rel ), where α and β are predefined weights.

[0050] In another embodiment of the present application, based on the adjusted weight matrix, a high-dimensional point set array is obtained as follows: Initialize a 10x10 random orthogonal matrix Q as the initial weight matrix. Use QR decomposition to ensure the orthogonality of Q. Based on the complexity index C, construct a nonlinear activation function f(x)=tanh(γ*C*x), where γ is an adjustable parameter. Apply singular value decomposition (SVD) to the random orthogonal matrix Q to obtain singular values ​​U, Σ, V T . Adjust the singular value according to the complexity index C: Σ'=Σ*(1+δ*C), where δ is the scaling factor. Reconstruct the adjusted weight matrix W'=U*Σ'*V T. Extract the input vector I = (x, y, z, vx, vy, vz, ax, ay, az, s) of each rigid body from the temporary array A. For each input vector I, calculate its representation in the adjusted weight space: I'= f(W' * I). Use locality sensitive hashing (LSH) to map the vector I' to a high-dimensional space to generate a sparse high-dimensional vector H, select k random hyperplanes, calculate the positional relationship between the vector I' and these hyperplanes, and generate a k-bit binary code. Store the high-dimensional vector H of each rigid body in a new array B, retaining its correspondence with the original rigid body. Use the high-dimensional vectors in array B to construct an approximate nearest neighbor (ANN) index structure, such as a hierarchical navigable small world (HNSW) graph, which will be used for subsequent fast neighbor searches.

[0051] This embodiment improves the efficiency and accuracy of the initial potential collision pair screening. By introducing kernel density estimation (KDE) and maximum information coefficient (MIC) to calculate the scene complexity, it is possible to more accurately capture the nonlinear characteristics of rigid body distribution and motion, thereby better adapting to different types of simulation scenes. Based on the random orthogonal matrix and nonlinear activation function dynamically adjusted by the complexity index, the high-dimensional mapping process can adaptively emphasize important features and enhance the feature differentiation ability in scenes of different complexities. The introduction of local sensitive hashing (LSH) and approximate nearest neighbor (ANN) index structures, such as HNSW graphs, improves the efficiency of similarity search in high-dimensional space. This multi-level optimization strategy enables this embodiment to reduce the computational complexity while maintaining high accuracy, especially in large-scale, highly dynamic rigid body simulation scenes. For example, in a complex scene containing tens of thousands of rigid bodies, this embodiment can reduce the screening time of the initial potential collision pairs from the traditional method of several minutes to seconds, while maintaining or even improving the accuracy of the screening. In addition, the adaptive characteristics of this embodiment enable it to automatically adjust in scenarios of different complexities and maintain high efficiency without human intervention, which is of great significance for long-term, large-scale dynamic simulations and can reduce simulation preparation time and computing resource consumption.

[0052] like Figure 3 As shown, according to one aspect of the present application, step S2 is further:

[0053] S21. Based on the potential collision pair list, obtain the three-dimensional coordinate position data, velocity vector data and acceleration vector data of the corresponding rigid body to construct an initial tensor field; based on the initial tensor field, use a predefined partial differential equation and a numerical method to calculate the tensor field of the next time step;

[0054] S22, discretizing the tensor field of the next time step into a grid structure; performing eigenvalue decomposition on the tensor value of each grid point in the grid structure to obtain an eigenvalue array; calculating the scalar field based on the eigenvalue array, and finding the local maximum point in the scalar field;

[0055] S23, based on the scalar field, sorting the local maximum points to obtain a sorting result; based on the sorting result, selecting the first N points as high collision probability points; calculating the Euclidean distance between the position of each rigid body and the high collision probability point, selecting M rigid bodies with the smallest Euclidean distance, and obtaining a temporary rigid body object; wherein M and N are natural numbers greater than 0;

[0056] S24. Merge the temporary rigid body object and the potential collision pair list to remove duplications, and obtain an updated potential collision pair list.

[0057] In one embodiment of the present application, all the rigid body object indices involved are extracted from the potential collision pair list E. Using these indices, the position (x, y, z), velocity (vx, vy, vz) and acceleration (ax, ay, az) data of the corresponding rigid body are obtained from the temporary array A. For each rigid body i, a 3x3 local tensor Ti is created at its position (xi, yi, zi), where the diagonal elements are the velocity components (vxi, vyi, vzi) of the rigid body and the non-diagonal elements are the combination of the acceleration components. All local tensors Ti are combined into the initial tensor field T0.

[0058] The predefined partial differential equation dT / dt = D▽²T + αT·▽T - βT is used to describe the change of the tensor field T with time t, where D is the diffusion coefficient, α and β are predefined constants, ▽² and ▽ represent the Laplace operator and gradient operator respectively, and d represents the partial differential character. The initial tensor field T0 is substituted into the equation and solved using numerical methods (such as the finite difference method) to obtain the tensor field T1 of the next time step. The tensor field T1 is discretized into a grid structure G. The simulation space is divided into three-dimensional grids with equal spacing, and the value of the tensor field is calculated at each grid point and stored in the array G. For the tensor values ​​at non-grid point positions, the trilinear interpolation method is used to calculate them from the values ​​of the surrounding 8 grid points.

[0059] Perform eigenvalue decomposition on the discretized tensor field G. At each grid point (i, j, k), calculate the eigenvalues ​​λ1, λ2, λ3 and the corresponding eigenvectors v1, v2, v3 of the local tensor G[i, j, k]. Store the eigenvalues ​​and their corresponding eigenvectors in the array EV. Based on the calculated eigenvalues, construct the scalar field S: for each grid point (i, j, k), calculate S[i, j, k] = (λ1-λ2)²+ (λ2-λ3)²+ (λ3-λ1)², where λ1, λ2, λ3 are the three eigenvalues ​​of the point, and store the calculated scalar field S in a new array. Find the local maximum point in the scalar field S, use a 3x3x3 sliding window to traverse the entire scalar field, if the value of the center point is greater than the values ​​of all 26 adjacent points, mark the point as a local maximum point, and store the coordinates of all found local maximum points and the corresponding S values ​​in the array LM.

[0060] Sort the local maximum points in the array LM and arrange them from large to small according to the S value. Select the first N points (N is a predefined constant), which are regarded as the center of the high collision probability area. Store the coordinates of these N points in the array HC. For each high collision probability point in the array HC, find the M rigid body objects closest to the point in the original temporary array A (M is a predefined constant), specifically: calculate the Euclidean distance between the position of each rigid body and the high collision probability point, and select the M rigid bodies with the smallest distance. Store the index pairs of these rigid bodies in the array PC. Merge the array PC with the potential collision pair list E, remove duplicates, and obtain the updated potential collision pair list E'.

[0061] According to one aspect of the present application, in step S21, based on the initial tensor field, using predefined partial differential equations and numerical methods, the tensor field of the next time step is further calculated as:

[0062] S211, based on the initial tensor field, extract the tensor value of each grid point, and reorganize it to obtain a sparse matrix;

[0063] S212, constructing and training a deep residual network model, inputting the sparse matrix into the trained deep residual network model, and obtaining the predicted tensor field state of the next time step;

[0064] S213, combining the preset physical constraints, correcting the tensor field state of the next time step to obtain a corrected tensor field state of the next time step;

[0065] S214. Reconstruct the corrected tensor field state of the next time step into a three-dimensional tensor field structure to obtain the tensor field of the next time step.

[0066] In one embodiment of the present application, the tensor value of each grid point is extracted from the initial tensor field T0. These tensor values ​​are reorganized into a large sparse matrix M. A deep residual network (ResNet) model F is constructed to predict the time evolution of the tensor field. The input of the deep residual network model F is the tensor field state of the current time step, and the output is the tensor field state of the next time step. The deep residual network model F is trained using historical simulation data to minimize the mean square error between the predicted value and the actual evolution result. The sparse matrix M is input into the trained deep residual network model F to obtain the predicted tensor field state M' for the next time step. Combined with physical constraints, such as the divergence of the tensor field is zero, the tensor field state M' for the next time step is corrected, and the Lagrange multiplier method is used to integrate these constraints into the prediction. The corrected tensor field state M' for the next time step is reconstructed into a three-dimensional tensor field structure to obtain the tensor field T1 for the next time step.

[0067] In another embodiment of the present application, eigenvalue decomposition and scalar field calculation are performed, specifically: extract the 3x3 tensor G[i, j, k] at each grid point (i, j, k) from the discretized tensor field G. For each G[i, j, k], eigenvalue decomposition is performed using the quaternion method. The 3x3 matrix is ​​represented as a quaternion, and then the eigenvalues ​​are calculated using quaternion algebra. Adaptive smoothing filtering is applied to the calculated eigenvalues ​​λ1, λ2, λ3 to reduce numerical instability. The local variance is used as a guide for the smoothing parameter. Construct a tensor shape descriptor S[i, j, k]=(λ1-λ2) 2 +(λ2-λ3) 2 +(λ3-λ1) 2 / (λ1 2 +λ2 2 +λ3 2 ). Using the local structure tensor method, the directional derivative of the tensor shape descriptor S is calculated to obtain the anisotropy and main direction information of the tensor field. Combining the tensor shape descriptor S and the directional information, an enhanced scalar field E is constructed. At each grid point (i, j, k), E[i, j, k] = S[i, j, k] * (1 + β * |▽S|), where β is the weight coefficient and |▽S| is the gradient amplitude of the tensor shape descriptor S.

[0068] This embodiment improves the accuracy and computational efficiency of collision probability prediction. The introduction of a deep residual network (ResNet) to predict the time evolution of the tensor field not only improves the calculation speed (in large-scale scenarios, the calculation time can be shortened from hours to minutes) compared to traditional numerical solution methods, but also better captures complex nonlinear dynamic behaviors. The correction mechanism combined with physical constraints ensures that the prediction results conform to the laws of physics and improves the reliability of the simulation. The quaternion method is used for eigenvalue decomposition, combined with adaptive smoothing filtering and local structure tensor analysis, to improve the accuracy and robustness of feature extraction, especially in the presence of numerical instability. This embodiment can more accurately identify high-collision risk areas and maintain high efficiency even in complex multi-object interaction scenarios. For example, in a simulation involving thousands of irregularly shaped rigid bodies, the recognition accuracy of high-risk collision areas can be increased by more than 20%, while reducing the calculation time by 50%. In addition, by constructing an enhanced scalar field, the anisotropy and main change directions in the scene can be more effectively captured, which is crucial for accurately predicting potential collisions between objects of complex shapes. This embodiment improves the temporal and spatial resolution of collision prediction, allowing the system to adapt to larger-scale and more complex dynamic simulation scenarios while maintaining high accuracy, providing a more reliable foundation for subsequent accurate collision detection.

[0069] like Figure 4 As shown, according to one aspect of the present application, step S3 is further:

[0070] S31, based on the updated potential collision pair list, obtain the three-dimensional coordinate position data of the corresponding rigid body to form a point cloud data set; perform Vietoris-Rips complex construction on the point cloud data set to obtain a complex sequence array; calculate the persistence homology of each complex in the complex sequence array to form a persistence homology graph; wherein the persistence homology graph contains persistence interval information of each dimension;

[0071] S32, based on the persistent homology graph, calculating a predetermined number of features with the longest duration in each dimension; storing the birth values ​​and death values ​​of the predetermined number of features to form topological feature data; and constructing an adaptive grid based on the topological feature data;

[0072] S33, mapping the rigid bodies in the updated potential collision pair list to the adaptive grid and generating a mapping table; traversing each non-empty grid cell and its adjacent cells in the mapping table, executing a collision detection algorithm on the rigid body pairs, and obtaining a collision pair array.

[0073] In one embodiment of the present application, all the involved rigid body object indices are extracted from the updated potential collision pair list E'. Using these indices, the position data (x, y, z) of the corresponding rigid body are obtained from the temporary array A. These position data are organized into a point cloud dataset P, where each point represents the center position of a rigid body. The point cloud dataset P is constructed by Vietoris-Rips complex: a series of radius parameters ε1<ε2<...<ε are selected. n , for each ε i , if the distance between two points is less than ε i , then add an edge between these two points. For each ε i , generates a complex containing all the edges less than ε i The constructed complex sequence is stored in the array VR, where each element corresponds to an ε i The complex of the value.

[0074] Calculate the persistence homology for each complex in the array VR: For each dimension (0D, 1D, 2D), calculate the process of the Betti number changing with ε. Store the calculation results in the persistence homology graph PD, which contains the persistence interval information of each dimension. Analyze the persistence homology graph PD to identify significant topological features: calculate the k features with the longest duration in each dimension (k is a predefined constant), and store the birth and death values ​​of these features in the array ST, where each element contains the dimension, birth value, and death value of the feature. Based on the significant topological features of the array ST, construct an adaptive grid structure AG: initialize a uniform grid, and then refine the grid in the areas where the features appear and disappear according to the features in the array ST. If a grid cell contains the birth point or death point of the feature, divide the cell into smaller sub-cells to obtain the final adaptive grid structure AG.

[0075] Map the rigid body objects in the potential collision pair list E' to the adaptive grid structure AG. For each rigid body, determine the grid cell where it is located based on its position data in the temporary array A, and record the index of the rigid body in the cell. Generate a mapping table M, where the key is the identifier of the grid cell and the value is the list of rigid body indices contained in the cell.

[0076] Perform local collision detection in the adaptive mesh structure AG. Traverse each non-empty mesh cell in the mapping table M, perform an accurate collision detection algorithm (such as the GJK algorithm) on the rigid body pairs within the cell and the pairs with the rigid bodies in the adjacent cells, obtain the complete geometric data of the corresponding rigid bodies from the temporary array A, and perform detailed intersection tests. Store the detected collision pairs in the array CD. The array CD contains the accurate collision detection results after topological analysis and adaptive mesh optimization, and each element is a pair of rigid body indices that collide.

[0077] In another embodiment of the present application, a Vietoris-Rips complex is constructed and continuous homology calculation is performed, specifically: a subset P' is randomly selected from the point cloud data set P as the reference point set. The geodesic distance from each point in P' to all other points in P is calculated using the FastMarching Method. Based on the geodesic distance, an adaptive Vietoris-Rips (AVR) complex is constructed. For each scale parameter ε, if the geodesic distance between two points is less than ε, an edge is added between them. The AVR complex is stored using a sparse matrix representation to reduce memory usage. For each ε value, a sparse adjacency matrix A is generated. ε . Implement a parallelized persistence homology algorithm. Distribute the computational tasks to multiple processor cores, with each core responsible for computing the persistence homology of one dimension. In each dimension, the zigzag persistence homology algorithm is used to compute the variation of the Betti number with ε, which allows the insertion and deletion of simplices in the complex sequence. Discrete Morse theory is applied to simplify the persistence homology computation and construct a discrete gradient vector field to reduce the number of critical simplices that need to be processed. Stability statistics of the persistence graph, such as the Bottleneck Distance and the Wasserstein Distance, are computed to quantify the significance of topological features.

[0078] In another embodiment of the present application, constructing an adaptive grid can also be: extracting significant topological features from a persistence graph, including homology classes with long duration and features with high stability statistics. Using the persistent entropy method, importance weights are assigned to each extracted topological feature. The weight is proportional to the duration and stability of the feature. Initialize an octree data structure O to represent the adaptive grid, and the root node represents the entire simulation space. For each significant topological feature, locate its corresponding spatial region in the octree data structure O, and adaptively subdivide the octree nodes of the region according to the importance weight and spatial position of the feature. Use a curvature-based refinement criterion to further optimize the grid structure and increase the grid density in areas with larger surface curvature of the object.

[0079] Implement a mesh smoothing transition algorithm to ensure that the size of adjacent mesh cells changes gradually, and use a 2:1 balance constraint to prevent the size difference between adjacent cells from being too large. Apply topology-preserving mesh simplification technology to reduce mesh complexity while maintaining key topological features, and use edge collapse operations to preferentially remove edges that do not affect the overall topological structure. Construct the final adaptive mesh structure AG, including the hierarchical relationship of mesh cells, adjacency information, and geometric data of each cell, and store the AG as an efficient data structure to facilitate subsequent collision detection operations.

[0080] This embodiment improves the efficiency and accuracy of collision detection in complex scenes. The adaptive Vietoris-Rips complex and fast expansion algorithm are used to calculate the geodesic distance. Compared with the traditional method based on Euclidean distance, it can more accurately capture the topological relationship between non-convex objects, and has obvious advantages in processing complex rigid bodies. For example, in a scene containing a large number of irregular objects, the accuracy of topological feature recognition can be increased by about 30%, providing a more reliable basis for subsequent collision detection. The introduction of parallelized continuous homology algorithm and zigzag continuous homology technology improves the efficiency of topological feature calculation. In large-scale scenes (such as those containing more than 100,000 rigid bodies), the calculation time can be reduced from the hour level of traditional methods to the minute level while maintaining a high degree of accuracy. In addition, the discrete Morse theory is applied to simplify the continuous homology calculation, further optimizing the algorithm performance, especially when processing high-dimensional topological features. Based on these advanced topological analysis results, a highly optimized adaptive grid structure is constructed. By combining the refinement criteria based on continuous entropy and curvature, the grid complexity can be reduced while maintaining key topological features. For example, in complex multi-object interaction scenes, the adaptive grid can reduce the number of grid cells by more than 70% compared to the uniform grid, while maintaining or even improving the accuracy of collision detection. The grid smoothing transition algorithm and topology-preserving simplification technology further optimize the grid quality and ensure an efficient collision detection process. This embodiment not only improves the efficiency of collision detection in complex scenes, but also improves the ability to handle irregular shapes and multi-scale problems, providing a solid foundation for high-precision, large-scale dynamics simulation.

[0081] like Figure 5 As shown, according to one aspect of the present application, step S4 is further:

[0082] S41, based on the collision pair array, obtaining the three-dimensional coordinate position data, velocity vector data and acceleration vector data of the corresponding rigid body to form a new array; based on the new array, dividing the preset simulation space into a uniform three-dimensional grid structure; based on the three-dimensional coordinate position data, assigning each rigid body in the new array to a corresponding grid unit in the three-dimensional grid structure, calculating the number of rigid bodies contained in each grid unit, the average velocity and the average acceleration, and forming statistical information;

[0083] S42, based on the statistical information, calculating the local information entropy of each grid unit; calculating the difference between the local information entropy of each grid unit and the local information entropy of the adjacent unit to obtain an entropy gradient vector; based on the entropy gradient vector, constructing an adaptive sampling strategy, adjusting the time step and spatial resolution of each grid unit, and obtaining adjusted parameters;

[0084] S43. Based on the adjusted parameters, the fourth-order Runge-Kutta method is used to update the motion state of the rigid body in each grid unit to obtain updated state data.

[0085] In one embodiment of the present application, all rigid body object indices involved are extracted from the collision pair array CD. Using these indices, the position (x, y, z), velocity (vx, vy, vz) and acceleration (ax, ay, az) data of the corresponding rigid body are obtained from the temporary array A. These data are organized into a new array R, in which each element contains the complete state information of a rigid body. The simulation space is divided into a uniform three-dimensional grid structure UG. Each rigid body in the array R is traversed and assigned to the corresponding grid cell according to its position data. For each grid cell, the number of rigid bodies n, the average velocity v contained therein, and the average velocity v are calculated. avg and the average acceleration a avg . Store these statistics in an array CS, where each element corresponds to the statistics of a grid cell (n, v avg , a avg ).

[0086] Based on the array CS, calculate the local information entropy H of each grid cell. For each cell, use the formula H=-Σ(p i *log(p i )) Calculate the entropy value, where p i is the normalized value of the ith statistic (number of rigid bodies, average velocity, average acceleration) in the cell. The calculated entropy values ​​are stored in a new array LE, whose structure corresponds to the array CS. The gradient is calculated for the entropy values ​​in the array LE. For each grid cell, the difference between its entropy value and the entropy values ​​of the six adjacent cells (upper, lower, left, right, front, and back) is calculated to obtain the entropy gradient vector (dH / dx, dH / dy, dH / dz). These gradient vectors are stored in a new array EG, whose structure corresponds to the array LE.

[0087] Based on the entropy gradient array EG, an adaptive sampling strategy is constructed. For each grid cell, the sampling parameters are adjusted according to the modulus of its gradient vector |▽H|: the time step Δt = Δt base * (1 + β * |▽H|) - ¹ and spatial resolution Δx = Δx base * (1 + γ * |▽H|) - ¹, where Δt base and Δx base is the reference value, β and γ are predefined adjustment coefficients. The adjusted parameters (Δt, Δx) are stored in a new array AP, whose structure corresponds to the array EG.

[0088] Use the adaptive parameters in array AP to update the motion state of the rigid body in each grid cell. Traverse each rigid body in array R and use the fourth-order Runge-Kutta method to update its position and velocity according to the time step Δt and current velocity and acceleration of the grid cell in which it is located. Store the updated rigid body state data in a new temporary array A'.

[0089] Based on the temporary array A', collision detection is re-executed. Using the adaptive grid structure AG, the rigid bodies in the temporary array A' are remapped to the grid cells. In each non-empty grid cell and its adjacent cells, an accurate collision detection algorithm (such as the GJK algorithm) is performed on the rigid body pairs, and the detected collision pairs are stored in the new array CD'. The temporary array A' contains the rigid body states updated according to the adaptive sampling strategy driven by information entropy, and the array CD' is the collision detection results recalculated based on these updated states.

[0090] In another embodiment of the present application, the local information entropy calculation and entropy gradient calculation are specifically performed as follows: extracting the statistical data (n, v) of each grid cell from the array CS avg , a avg ). Using the kernel density estimation (KDE) method, we construct the multidimensional probability density function P(n, v avg , a avg ). For each grid cell, calculate its k nearest neighbor cells (k is a predefined constant) and use a fast k nearest neighbor algorithm, such as Ball Tree, to improve search efficiency. For each grid cell i, construct a local probability distribution Pi based on its k nearest neighbors and use the adaptive bandwidth KDE method, where the bandwidth is dynamically adjusted according to the local data density. Calculate the local Renyi entropy of each cell i: Hi = 1 / (1-α) * log(Σj Pi(j) α ), where α is the order of Renyi entropy and j traverses the k nearest neighbors of i.

[0091] The Renyi entropy field H of the entire space is calculated using a fast Fourier transform (FFT), the grid is divided into overlapping blocks, FFT is applied to each block, and the results are then merged. An anisotropic diffusion filter is applied to smooth the entropy field H, preserving edge information. A structure tensor is used to guide the diffusion process, preserving more details in high gradient areas. The gradient ▽H of the smoothed entropy field is calculated, and higher-order finite difference methods, such as fourth-order central differences, are used to improve the accuracy of the gradient estimate. The Helmholtz-Hodge decomposition is applied to the gradient field ▽H to decompose it into a divergence-free field and an irrotational field, which helps to separate the main directions of change of the entropy.

[0092] In another embodiment of the present application, constructing an adaptive sampling strategy is specifically as follows: based on the Helmholtz-Hodge decomposition result, construct an adaptive importance function I(x) = ||▽H(x)||² + β * div(▽H(x)), where β is a weight coefficient. Generate sampling points using an adaptive Monte Carlo method: Use the Metropolis-Hastings algorithm to generate a Markov chain with the adaptive importance function I(x) as the target distribution. For each generated sampling point, calculate its local feature scale L(x) = γ / (ε+I(x)), where γ and ε are predefined constants.

[0093] Based on the local characteristic scale L(x), an adaptive kernel function K(x, y) = exp(-||xy||² / (2L(x)²)) is constructed, where exp( ) represents an exponential function. Using Gaussian process regression, the field quantity distribution of the entire space is estimated based on the sampling points and the adaptive kernel function K. The prediction variance of the Gaussian process model is calculated as the uncertainty measure U(x). Combining the importance function I(x) and the uncertainty U(x), the final adaptive sampling density function D(x) = I(x) * (1 +λ* U(x)) is constructed, where λ is a balance parameter. The adaptive sampling density function D(x) is used to guide the next round of adaptive sampling, dynamically adjusting the sampling density and computing resource allocation of each region.

[0094] This embodiment improves the adaptability and computational efficiency of collision detection in dynamic scenes. The introduction of kernel density estimation (KDE) and Renyi entropy calculation can more accurately capture the nonlinear characteristics and local complexity of rigid body distribution compared to traditional statistical methods. For example, in a highly non-uniformly distributed rigid body scene, the accuracy of local complexity estimation can be increased by about 25%, providing more reliable guidance for subsequent adaptive sampling. The entropy field is processed by fast Fourier transform (FFT) and anisotropic diffusion filter, which improves the computational efficiency and accuracy in large-scale scenes. In simulations involving hundreds of thousands of rigid bodies, the time for entropy field calculation and smoothing can be shortened from hours to minutes in traditional methods while maintaining a high degree of accuracy. The application of Helmholtz-Hodge decomposition to analyze entropy gradients enables the system to more accurately identify key change areas in the scene, which is crucial for the efficient allocation of computing resources. Based on these advanced analysis results, a highly optimized adaptive sampling strategy is implemented. By combining the adaptive Monte Carlo method and Gaussian process regression, the system can dynamically adjust the sampling density and computing resource allocation according to local complexity. For example, in complex multi-object interaction areas, the sampling density can be automatically increased by 5-10 times, while in low-activity areas it can be reduced accordingly, thereby reducing the overall computational effort while maintaining high accuracy. In highly dynamic scenes, this embodiment can reduce the collision detection time between consecutive time steps by about 40%, while maintaining or even improving detection accuracy. This embodiment not only improves the efficiency of collision detection in dynamic scenes, but also enhances the system's adaptability to complex, multi-scale problems, providing strong support for high-precision, real-time dynamic simulation.

[0095] like Figure 6 As shown, according to one aspect of the present application, step S5 is further:

[0096] S51, representing the updated state data as Lie group elements, calculating the logarithm of the Lie group elements, and mapping the logarithm of the Lie group elements to obtain Lie algebraic elements; convolving the Lie algebraic elements with the Gaussian kernel function to form a multi-scale Lie algebraic representation; based on the multi-scale Lie algebraic representation, calculating the Lie algebraic local features of each scale, including the norm, trace, determinant of the Lie algebraic elements and the representation of the relative position and relative velocity between adjacent rigid bodies on the Lie algebra, to form a Lie algebraic local feature array;

[0097] S52, constructing a multi-scale feature descriptor based on the Lie algebra local feature array; based on the multi-scale feature descriptor, using a bottom-up hierarchical clustering algorithm to perform hierarchical clustering to obtain a hierarchical clustering result;

[0098] S53, storing the hierarchical clustering results in a tree structure, each node in the tree structure contains a rigid body index belonging to a cluster formed in the hierarchical clustering process; performing parallel collision detection on each layer of the tree structure, merging the collision detection results from the leaf node upwards, and generating global collision detection data.

[0099] In one embodiment of the present application, the position (x, y, z), direction (qw, qx, qy, qz) (expressed as quaternions) and velocity (vx, vy, vz) data of each rigid body are extracted from the updated temporary array A'. These data are combined into elements of the Lie group SE(3) (three-dimensional special Euclidean group), specifically in the form of a 4x4 matrix, and the SE(3) elements of all rigid bodies are stored in the array G. Define the scale parameter s1 <s2<...<s m For each SE(3) element in the array G, calculate its i The Lie algebra representation under: Calculate the logarithmic mapping of SE(3) elements to obtain Lie algebra elements, and then compare them with the parameter s i The Gaussian kernel function is convolved and the Lie algebra representations of all rigid bodies at all scales are stored in the multidimensional array MS.

[0100] For each scale representation in the array MS, local features are calculated. For each rigid body at each scale, the norm, trace, determinant and other invariants of its Lie algebra elements are calculated. At the same time, the representation of the relative position and relative velocity between adjacent rigid bodies on the Lie algebra is calculated, and these local features are stored in a new array LF. Based on the local feature array LF, a multi-scale feature descriptor is constructed for each rigid body. For each rigid body, its features at different scales are connected into a high-dimensional vector: the invariants and relative relationship features at each scale are combined in a predefined order, and these feature descriptors are stored in a new array FD.

[0101] Hierarchical clustering is performed using the feature descriptor array FD. A bottom-up hierarchical clustering algorithm is used, and each rigid body is initially an independent cluster. At each step, the two closest clusters are merged until the predefined number of clusters is reached or the termination condition is met. The distance metric uses the Euclidean distance in the feature space. The clustering results are stored in a tree structure HT, and each node contains the index of the rigid body belonging to the cluster. Parallel collision detection is performed on each layer of the tree structure HT. Starting from the finest layer, for each node: if the node contains multiple rigid bodies, a bounding volume hierarchy (BVH) is constructed using the position and geometry data in the temporary array A'; fast collision detection is performed on the rigid bodies within the node, and BVH is used for preliminary screening; an accurate collision detection algorithm (such as the GJK algorithm) is performed on rigid body pairs that may collide; the detected collision pairs are added to the collision result list of this layer.

[0102] Merge the collision detection results of each layer from bottom to top. Starting from the leaf node of the tree structure HT, propagate the detected collision information upward. For each non-leaf node, merge the collision results of its child nodes and remove duplicate collision pairs. During the merging process, if collision detection has not been performed between two child nodes, it will be performed at this time. Finally, a global list of collision detection results is obtained. The global collision detection result list is stored as an array CR. Each element in the array CR is a collision pair, which contains the indexes of the two colliding rigid bodies and their collision points, collision normals and other detailed information.

[0103] In another embodiment of the present application, the calculation of the multi-scale Lie algebraic representation and the Lie algebraic local features can also be: extract the SE(3) group element of each rigid body from the array G. Use the Baker-Campbell-Hausdorff (BCH) formula to map the SE(3) element to its Lie algebra se(3). Construct a Lie algebraic multiresolution analysis (LAMRA) framework and define a series of scale parameters s1< s2 < ... < s m , corresponding to different observation scales. For each scale s i , construct the Lie group convolution kernel φ i , use the exponential map to transform the Gaussian kernel from Euclidean space to the SE(3) manifold. For each rigid body's Lie algebra representation ξ, calculate its Lie group convolution at each scale: ξ i = Ad(exp(-ξ))*∫φ i (g)*ξ*dg, where Ad is the adjoint representation.

[0104] Use the fast multipole method (FMM) to accelerate the computation of Lie group convolution: decompose SE(3) into translation and rotation parts and apply FMM separately. For each scale, the Lie algebra representation ξ i , compute a series of Lie algebra invariants such as Killing forms, structural constants, and Cartan subalgebras. Using principal component analysis on the Grassmann manifold, we extract the Lie algebra representation sequence {ξ1, ξ2, ..., ξ m Based on the extracted principal components and invariants, a multi-scale feature descriptor F is constructed, and the importance of features at different scales is measured using Fisher information metric.

[0105] In another embodiment of the present application, hierarchical clustering based on feature descriptors is specifically as follows: using multi-scale feature descriptors F, constructing a similarity graph G, and using the locally scale-adaptive Mahalanobis distance for edge weights. Applying a variant algorithm of spectral clustering, calculating the graph Laplacian matrix L, and solving the generalized eigenvalue problem Lv=λDv, where D is the degree matrix. Using the Lanczos algorithm to efficiently calculate the first k eigenvectors of L, the k value is automatically determined by the feature gap heuristic method.

[0106] In the feature vector space, Adaptive Density Peak Clustering is applied to automatically detect density peaks as cluster centers. Construct a minimum spanning tree (MST) to connect cluster centers: Use the Boruvka algorithm to construct MST in parallel to improve the processing efficiency of large-scale data. Perform hierarchical clustering based on MST, use a dynamic programming algorithm to optimize the selection of cutting points, and generate the optimal hierarchical structure. Apply the continuous homology theory to analyze the stability of clustering, calculate the continuous graph of clustering results, and evaluate the clustering quality of different levels. According to the results of continuous homology analysis, select the most stable level as the final clustering result. Store the clustering results in the tree structure HT.

[0107] In another embodiment of the present application, generating global collision detection data further comprises: constructing a hierarchical bounding volume structure (HBVH) based on the hierarchical clustering result HT, wherein each clustering node corresponds to a bounding volume represented by an oriented bounding box (OBB). Implementing a hierarchical traversal algorithm accelerated by a graphics processing unit (GPU), using a computing unified device architecture (CUDA) programming model, parallelizing the traversal of the HBVH, and each GPU thread is responsible for an intersection test of a bounding volume pair.

[0108] At each cluster level, we use temporal coherence to optimize collision detection. We maintain an array of timestamps to record the time of the last detection, and prioritize the areas that have changed recently. We apply the continuous collision detection (CCD) algorithm to the lowest level of bounding volumes where collisions may occur, using the conservative advancement method to accurately calculate the first contact time.

[0109] Implement an adaptive segmentation strategy. Dynamically adjust the accuracy of collision detection based on the relative speed and distance of objects, using more refined detection in areas of high-speed approach. Use spatial hash tables to accelerate collision pair screening in local areas, divide the space into grids, and use perfect hash functions to quickly locate potential collision pairs. Parallel execution of the Gilbert-Johnson-Keerthi (GJK) algorithm for accurate collision detection. Use the Single Instruction Multiple Data (SIMD) instruction set to optimize GJK's vector operations. Implement a dynamic load balancing strategy based on work stealing to dynamically allocate and redistribute collision detection tasks between processor cores.

[0110] Use a hierarchical union-find data structure to merge collision detection results. Process results at different levels in parallel and merge them from bottom to top to solve the problem of overlapping collision groups. Apply spatiotemporal consistency optimization to predict possible collisions in the next time step. Use a Kalman filter to estimate the motion state of objects and allocate computing resources in advance.

[0111] This embodiment improves the performance and scalability of collision detection in complex dynamic scenes. The Lie Algebra Multi-Resolution Analysis (LAMRA) framework is used to represent rigid body motion, which can capture complex rotational and translational motions more accurately than traditional Euclidean space methods. When dealing with rigid bodies that rotate at high speed or move in large amplitudes, the accuracy of motion representation can be improved by about 35%, providing a more reliable basis for subsequent collision detection. The fast multipole method (FMM) is used to accelerate Lie group convolution calculations, improving computational efficiency in large-scale scenes. In simulations involving hundreds of thousands of rigid bodies, the time for motion feature extraction can be shortened from hours to minutes in traditional methods while maintaining a high degree of accuracy. The application of principal component analysis on Grassmann manifolds enables the system to more effectively capture multi-scale motion patterns, which is essential for accurately predicting complex interactions. This embodiment implements highly optimized hierarchical clustering and parallel collision detection strategies. By combining spectral clustering variants and adaptive density peak detection, the system can automatically identify and hierarchically process scene areas of different complexities. For example, in complex multi-object interaction areas, the clustering level and detection accuracy can be automatically increased, while simple areas can be quickly skipped, thereby reducing the overall computational effort while maintaining high accuracy. In addition, the introduction of GPU-accelerated hierarchical traversal algorithms and temporal coherence optimization further improves the efficiency of collision detection between consecutive time steps. In highly dynamic scenes, the total time for collision detection can be reduced by approximately 50% while maintaining or even improving detection accuracy. The application of continuous collision detection (CCD) and conservative forward methods enables the system to accurately capture instantaneous contact between high-speed moving objects, which is often overlooked in traditional discrete time step methods. This embodiment not only improves the efficiency and accuracy of collision detection in complex dynamic scenes, but also enhances the system's ability to handle large-scale, high-speed motion problems, providing strong support for high-fidelity, real-time dynamic simulation.

[0112] like Figure 7 As shown, according to one aspect of the present application, step S6 is further:

[0113] S61. Calculate global features and local features based on the global collision detection data, wherein the global features include the total number of rigid bodies, average velocity, average acceleration, rigid body density distribution, and collision frequency; and the local features include the number of adjacent rigid bodies, relative velocity, and local density;

[0114] S62, combining the global features and the local features into a high-dimensional feature vector, performing standardization processing based on the high-dimensional feature vector to obtain a standardized feature vector; performing principal component analysis dimensionality reduction based on the standardized feature vector to obtain data after dimensionality reduction;

[0115] S63. Based on the data after dimensionality reduction, the K-means clustering method is used to calculate the clustering results; based on the clustering results, the complexity level of each rigid body is calculated; based on each complexity level, the weighted average is calculated as the overall scene complexity indicator.

[0116] In one embodiment of the present application, all the rigid body object indices involved are extracted from the collision detection result array CR. Using these indices, the complete state data of the corresponding rigid body is obtained from the temporary array A', including position (x, y, z), velocity (vx, vy, vz), acceleration (ax, ay, az), direction (qw, qx, qy, qz) and angular velocity (ωx, ωy, ωz). These data are organized into a new array SD, in which each element corresponds to the complete state of a rigid body.

[0117] Based on the data in the array SD, the global features of the scene are calculated, specifically the following features: the total number of rigid bodies n = the length of SD; the average speed v avg = Σ(|v|) / n, where |v| is the modulus of each rigid body velocity; the average acceleration a avg = Σ(|a|) / n, where |a| is the modulus of each rigid body acceleration; Rigid body density distribution: divide the space into grids and calculate the number of rigid bodies in each grid; Collision frequency f = number of collision pairs (i.e., length of CR) / n. Store these global features in the array GF.

[0118] For each rigid body in the array SD, calculate its local features: For each rigid body i, calculate the number of neighboring rigid bodies: the number of other rigid bodies within the predefined radius r; relative speed: the average relative speed with neighboring rigid bodies; local density: the number of rigid bodies within the radius r with the rigid body as the center divided by the volume of the sphere; angular velocity magnitude: |ω|; average distance from collision objects: if the rigid body is in the array CR, calculate its average distance from all collision objects. Store these local features of each rigid body in the array LF.

[0119] Combine the global feature array GF and the local feature array LF to construct the feature vector of each rigid body. For each rigid body, concatenate its local features with the global features to form a high-dimensional feature vector: the format of the feature vector is [local features, global features]. Store the feature vectors of all rigid bodies in a new array FV.

[0120] Perform principal component analysis (PCA) dimensionality reduction on the eigenvector array FV. Standardize the data in the eigenvector array FV. Calculate the covariance matrix and solve its eigenvalues ​​and eigenvectors. Select the k principal components with the highest cumulative explained variance (k is a predefined constant). Project each eigenvector in the eigenvector array FV onto these k principal components to obtain the reduced dimensionality data. Store the dimensionality reduction results in a new array RD.

[0121] Apply the K-means clustering algorithm to the reduced data array RD. Initialize K cluster centers (K is the predefined number of complexity levels). Repeat the following steps until convergence: assign each data point to the nearest cluster center; update the center of each cluster to the average of all points in the cluster. After clustering, each data point is assigned a complexity level (1 to K). Store the complexity level corresponding to each rigid body in the array CL.

[0122] Based on the clustering result array CL, calculate the overall scene complexity index OC. Assign a weight wk to each complexity level k (for example, wk = k), and then calculate the weighted average: OC = (Σ(k * wk * nk)) / n, where nk is the number of rigid bodies with complexity level k, and n is the total number of rigid bodies. Store the calculated weighted average OC as a scalar variable. The weighted average OC is a single scalar value that represents the complexity evaluation result of the entire scene.

[0123] According to one aspect of the present application, calculating local features is further as follows: extracting the position (x, y, z), velocity (vx, vy, vz), acceleration (ax, ay, az) and angular velocity (ωx, ωy, ωz) data of each rigid body from the temporary array A'. Construct a spherical harmonics basis to represent the local scene features around the rigid body. Select a suitable order L to generate (L+1)² basis functions. For each rigid body i, sample N points in a spherical area with a radius R around it. Use a quasi-Monte Carlo method (such as the Halton sequence) to generate sampling points to ensure uniform coverage. For each sampling point, calculate its position, relative velocity and local density relative to the rigid body i. Use the adaptive kernel density estimation (AKDE) method to calculate the local density. Project the features of the sampling points onto the spherical harmonics basis to obtain the spherical harmonic coefficients ci of the rigid body i. lm , the Fast Spherical Harmonic Transform (FSHT) algorithm is used to accelerate the calculation process.

[0124] Calculate the rotation invariant descriptor of the spherical harmonic coefficients. Use the spherical harmonic power spectrum Pl = Σm |ci lm |² and spherical harmonic bispectrum B l1,l2,l3 =Σ m1,m2,m3 ci l1m1* ci l2m2 * ci l3m3 * W(l1, m1, l2, m2, l3, m3), where W is the Wigner 3-j symbol, l1, l2, l3 represent different angular momentum quantum numbers, and m1, m2, m3 represent different magnetic quantum numbers. Use the exponential map on the Lie group SE(3) to convert the velocity and angular velocity of the rigid body into the twist coordinate ξ. Calculate the twist norm ||ξ|| and the helix angle θ = arccos((tr(exp(ξ)) - 1) / 2), where arccos( ) represents the inverse cosine function and tr( ) represents the trace of the matrix.

[0125] Combining spherical harmonic descriptors, twist features and local statistics (such as average relative velocity, local density variance), the local eigenvector fi of rigid body i is constructed, and the eigenvectors of all rigid bodies are stored in the array LF.

[0126] In another embodiment of the present application, local feature vectors and global features of all rigid bodies are extracted from arrays LF and GF and combined into a high-dimensional feature matrix X. The Robust Principal Component Analysis (RPCA) method is applied to decompose the high-dimensional feature matrix X into a low-rank matrix L and a sparse matrix S: X = L + S. The alternating direction multiplier method (ADMM) is used to solve the RPCA optimization problem.

[0127] Apply Kernel Principal Component Analysis (KPCA) to the low-rank matrix L. Select the radial basis function (RBF) as the kernel function, and the kernel parameters are determined by cross-validation. Use the Nystrom method to approximate large kernel matrices to reduce the computational complexity of KPCA. Randomly select m samples to construct a small kernel matrix, and then expand it to the entire data. Implement an incremental KPCA algorithm that can update the feature space online. When a new rigid body is added to the simulation, there is no need to recalculate the entire feature space. Apply the t-SNE (t-distributed Stochastic Neighbor Embedding) algorithm to further reduce the dimensionality and visualize the high-dimensional features. Use the tree-based approximation method to speed up the calculation of t-SNE.

[0128] Combine the results of KPCA and t-SNE to construct a multi-view feature representation. Use multi-view learning methods, such as canonical correlation analysis (CCA), to integrate information from different views. Apply feature selection algorithms, such as Lasso regularization, to select the most representative subset from the original features, which helps improve the interpretability of the model. Store the results after dimensionality reduction and feature selection in a new array RD, preserving the correspondence between each rigid body and its reduced dimensionality features.

[0129] Use the reduced-dimensional data RD to construct a k-nearest-neighbor graph G, where the edge weights are calculated using a heat kernel: wij = exp(-||xi - xj||² / (2σ²)), where σ is the local scale parameter. Apply a variant of the spectral clustering algorithm to calculate the graph Laplacian matrix L = D - W, where D is the degree matrix and W is the adjacency matrix. Use a Krylov subspace method (such as Arnoldi iteration) to solve the generalized eigenvalue problem Lv=λDv and obtain the eigenvectors corresponding to the first k smallest non-zero eigenvalues.

[0130] Apply the Density Peak Clustering algorithm in the feature vector space. Calculate the local density ρi and the minimum distance Δi to high-density points for each point. Construct a decision graph (ρi, Δi) and automatically identify the cluster centers. Use the DBSCAN algorithm to detect density peaks in the decision graph and determine the optimal number of clusters K. Implement a parallelized Fast Search of Density Peaks algorithm, use KD trees to accelerate neighbor search, and parallelize density and distance calculations. Apply fuzzy c-means clustering to assign membership to each complexity level for each data point, and use the kernel fuzzy c-means algorithm to improve adaptability to nonlinear boundaries. Implement an online clustering update mechanism. When a new rigid body is added to the simulation, the complexity level is updated using an incremental clustering algorithm without re-clustering all the data. Store the clustering results (complexity level and membership of each rigid body) in an array CL. For each rigid body, CL contains its main complexity level and membership to other levels.

[0131] Extract the complexity level and membership information of each rigid body from the array CL. Construct a complexity distribution histogram H, where each interval represents a complexity level. Calculate the Shannon entropy of the complexity distribution: Es=-Σp(i)logp(i), where p(i) is the probability of the i-th complexity level. Generalize the complexity metric using Renyi entropy: Er=1 / (1-α)log(Σp(i) α ), where α is the Renyi entropy parameter. By adjusting α, different complexity features can be emphasized.

[0132] Compute the fractal dimension of the complexity distribution. Estimate the fractal dimension D using the box counting method: count the number of non-empty boxes N(ε) at different scales ε, and estimate D by the slope of log(N(ε)) with respect to log(1 / ε). Apply persistent homology to analyze the complexity distribution, construct the Vietoris-Rips complex of the complexity level, calculate 0-dimensional and 1-dimensional persistent homology, and use persistent entropy to quantify the complexity of topological features. Compute the multiscale entropy (MSE) of the complexity distribution. Calculate sample entropy at multiple time scales to capture the scale dependence of scene complexity. Use transfer entropy to analyze the dynamic relationship between complexity levels. Compute the information flow between different complexity levels and quantify the strength of their interaction.

[0133] Combining the above multiple indicators, principal component analysis is used to construct the comprehensive complexity index CI. The calculation formula of CI is: CI = w1Es + w2Er + w3D + w4PE + w5MSE + w6TE, where wi is the weight coefficient determined by PCA. The calculated comprehensive complexity index CI is stored as a scalar variable OC as the final measure of the overall scene complexity. At the same time, each component indicator is saved for multi-dimensional complexity analysis.

[0134] This embodiment improves the accuracy and computational efficiency of scene complexity evaluation in dynamic simulation. Spherical harmonics are used to represent local scene features, which can more accurately capture the three-dimensional spatial distribution features around rigid bodies than traditional grid-based methods. When dealing with scenes with non-uniform and complex-shaped object distribution, the accuracy of local feature description can be improved by about 40%, providing a more reliable basis for subsequent complexity analysis. Combining robust principal component analysis and kernel principal component analysis, effective dimensionality reduction and denoising of high-dimensional features are achieved. In large-scale scenes containing hundreds of thousands of feature dimensions, the time for feature dimensionality reduction and extraction can be shortened from hours to minutes in traditional methods, while maintaining or even improving the representativeness of features. The application of incremental KPCA and multi-view learning methods enables the system to update the feature space online and integrate multi-source information, which is particularly important for long-term and dynamically changing simulation scenes. Based on these high-quality feature representations, advanced complexity level clustering and overall scene complexity calculation are achieved. By combining spectral clustering, density peak clustering and fuzzy c-means algorithm, the system can more accurately identify and classify regions of different complexity. For example, in complex scenarios containing multiple different interaction modes, the accuracy of complexity classification can be improved by about 30%, providing key guidance for adaptive simulation strategies. In addition, the introduction of multidimensional complexity indicators, such as Renyi entropy, fractal dimension, and multiscale entropy, further improves the comprehensiveness and robustness of complexity assessment. In highly nonlinear, multi-scale dynamic systems, this multidimensional assessment can capture subtle complexity changes that traditional single indicators may ignore. The application of persistent homology analysis and transfer entropy calculation enables the system to deeply understand the topological characteristics of complexity distribution and information flows of different complexities.

[0135] like Figure 8 As shown, in another embodiment of the present application, a rigid body collision detection method based on adaptive resolution includes the following steps:

[0136] Step 1, initialize the simulation environment and collect rigid body parameters;

[0137] Identify and load all rigid bodies in the simulation environment and collect the initial parameters of each rigid body, such as initial position r0, initial motion velocity v0, acceleration a, etc. Set the minimum value C of the environment complexity according to the simulation task and device performance max and the maximum value C min , the minimum value of resolution R min and the maximum value R max And the minimum value of the collision detection time step Δt min and the maximum value Δt max . All data is stored for subsequent motion simulation and collision detection.

[0138] Step 2, dividing the simulation space into a grid structure;

[0139] The simulation space is divided into a grid structure consisting of 1×1 cells to effectively manage and optimize the position and movement of rigid bodies. In this structure, rigid bodies are marked to corresponding grid areas according to their positions, so that potential collision areas can be quickly located during collision detection.

[0140] Step 3: Calculate the initial complexity of the scene;

[0141] In a static scene, the total number of rigid bodies N and the total area V of the scene are calculated by counting the number of rigid bodies and cells in the simulation scene, so as to obtain the average density of rigid bodies in the scene p=N / V, and the average density of rigid bodies is used as an indicator to measure the complexity C of the scene.

[0142] For dynamic scenes, in addition to considering the average density p of the rigid body, it is also necessary to analyze the collision frequency of the rigid body. With the data collected in step 1, the formula r(t)=r0+v can be directly used o t+1 / 2at 2 Calculate the displacement of the rigid body at time t, connect the displacements of the rigid body in multiple time steps, generate the prediction of the rigid body's motion trajectory, and mark the grid cells that these motion trajectories may cover in the simulation space. Repeat this step for all rigid bodies to detect the overlapping areas between trajectories, which are potential collision intervals. Assuming that a total of n overlaps are detected within time t, the collision frequency of the rigid body during this period is f=n / t. Finally, combine the average density of rigid bodies and the collision frequency to quantify the overall complexity of the scene through the formula C=αp+βf, where α and β are weight parameters.

[0143] Step 4: Set the initial resolution and collision detection time step;

[0144] According to the scene complexity C evaluated in step 3, set the resolution R and the collision detection time step Δt. For low-complexity scenes, select a lower resolution and a larger time step to improve simulation efficiency and reduce the computational burden; for high-complexity scenes, select a higher resolution and a smaller time step to ensure that the accuracy of collision detection is not affected by insufficient resolution. The specific calculation formula is as follows:

[0145] R=R min +(CC min ) / (C max -C min )×(R max -R min );

[0146] Δt=Δt max -(CCmin ) / (C max -C min ) ×(Δt max -Δt min );

[0147] The resolution R and the collision detection time step Δt are linearly correlated with the scene complexity C. The greater the scene complexity C, the greater the resolution R and the smaller the collision detection time step Δt; the smaller the scene complexity C, the smaller the resolution R and the larger the collision detection time step Δt. By setting the resolution and collision detection time step reasonably, the simulation performance can be optimized on the basis of balancing the detection accuracy and computational efficiency. Ensure that the selection of resolution and detection time step is adapted to the scene complexity to achieve efficient and accurate collision detection.

[0148] Step 5: Dynamic scene complexity monitoring and adjustment;

[0149] During the simulation process, it is necessary to monitor the dynamic changes in the scene in real time and use the sliding window algorithm to dynamically update the evaluation results of the scene complexity. First, set a sliding window of 10 time steps, and then collect data such as the change in the number of rigid bodies, the change in speed, the change in relative distance, and the frequency of collisions in each time step. Each time the sliding window moves, the data is updated and the scene complexity is dynamically calculated based on the latest data. Based on the scene complexity calculated in real time, the resolution and collision detection time step are dynamically adjusted to ensure that the simulation optimizes the computational efficiency while maintaining accuracy.

[0150] Step 6: Adaptive resolution collision detection implementation in dynamic scenes.

[0151] Based on scene initialization and real-time complexity monitoring, collision detection with adaptive resolution is realized. Based on the above steps, the system can realize the adjustment of adaptive resolution and collision monitoring time step according to the dynamic complexity of the scene, so as to select the appropriate detection method. max / 2, high-resolution detection is used, that is, a continuous collision detection algorithm is used to calculate the collision between rigid bodies frame by frame. max / 2, low-resolution detection is used, that is, a discrete collision detection algorithm is used to evaluate whether the rigid body collides at a lower calculation frequency. Finally, the system feeds the detection results back to the simulation engine, updates the motion state of the rigid body, and adjusts the resolution setting for the next time step. Through multiple simulation iterations, the system continuously optimizes the adjustment strategy of adaptive resolution, so that collision detection has both high precision and can run efficiently in complex scenarios.

[0152] This embodiment optimizes the position and motion management of the rigid body by dividing the simulation space into a grid structure of 1×1 cells, simplifies the positioning of the potential collision area, and thus improves the computational efficiency of the overall collision detection. By calculating the initial complexity of the scene, combined with factors such as the average density of the rigid body and the collision frequency, the overall complexity of the scene is accurately evaluated, providing data support for the subsequent resolution and collision detection time step setting. According to the evaluated scene complexity, the initial resolution and collision detection time step are dynamically set. The greater the scene complexity, the higher the resolution, and the smaller the collision detection time step; the smaller the scene complexity, the lower the resolution, and the larger the collision detection time step. By reasonably adjusting the resolution and collision detection time step, the detection accuracy and computational efficiency are balanced. The dynamic changes of the scene are monitored in real time through the sliding window algorithm, and the scene complexity evaluation results are dynamically updated based on data such as the number of rigid bodies, speed changes, relative distance changes, and collision frequency. Based on the scene complexity calculated in real time, the system can dynamically adjust the resolution and collision detection time step to ensure that the simulation optimizes the computational efficiency while maintaining accuracy. Based on the scene initialization and real-time complexity monitoring results, collision detection with adaptive resolution is achieved. By adjusting the resolution and collision detection time step, the system uses a high-resolution continuous collision detection algorithm in high-complexity scenes and a low-resolution discrete collision detection algorithm in low-complexity scenes, thereby effectively balancing detection accuracy and computational efficiency in scenes of different complexity.

[0153] According to one aspect of the present application, a rigid body collision detection system based on adaptive resolution includes:

[0154] at least one processor; and,

[0155] a memory communicatively connected to at least one of the processors; wherein,

[0156] The memory stores instructions that can be executed by the processor, and the instructions are used to be executed by the processor to implement the rigid body collision detection method based on adaptive resolution described in any of the above embodiments.

[0157] The present invention solves the problems of low computational efficiency and poor real-time performance of existing rigid body collision detection methods in complex dynamic scenes. A rigid body collision detection method based on adaptive resolution is proposed to provide technical support for the accuracy and real-time performance of the simulation environment.

[0158] The preferred embodiments of the present invention are described in detail above; however, the present invention is not limited to the specific details in the above embodiments. Within the technical concept of the present invention, various equivalent transformations can be made to the technical solutions of the present invention, and these equivalent transformations all belong to the protection scope of the present invention.

Claims

1. A rigid body collision detection method based on adaptive resolution, characterized in that: The steps include: S1. Obtain rigid body data and calculate scene complexity index; based on the scene complexity index, adjust the preset weight matrix to obtain the adjusted weight matrix; based on the adjusted weight matrix, map the rigid body data to a high-dimensional space to obtain a high-dimensional point set array; based on the high-dimensional point set array, construct a kd tree and perform a nearest neighbor search to generate a potential collision pair list; The rigid body data includes the three-dimensional coordinate position data, velocity vector data, acceleration vector data and pre-calculated shape complexity scalar value of the rigid body; S2. Based on the list of potential collision pairs, construct the initial tensor field and calculate the tensor field for the next time step; Discretize the tensor field of the next time step into a grid structure, perform eigenvalue decomposition based on the grid structure, and obtain an eigenvalue array; based on the eigenvalue array, calculate the scalar field and find the local maximum point; Based on the local maximum point, the center of the high collision probability area is selected; based on the center of the high collision probability area, the potential collision pair list is updated to obtain an updated potential collision pair list; S3. construct a point cloud dataset based on the updated potential collision pair list; construct a complex sequence array based on the point cloud dataset; Calculate the persistence homology of each complex in the complex sequence array to form a persistence homology graph; analyze the persistence homology graph to obtain analysis results; and construct an adaptive grid based on the analysis results; Perform local collision detection in the adaptive grid and obtain a collision pair array; S4, based on the collision pair array, dividing the preset simulation space into uniform grid cells, and calculating the entropy gradient of each grid cell; Based on the entropy gradient, the time step and spatial resolution of each grid cell are adjusted, and the motion state of the rigid body in each grid cell is updated to obtain updated state data; S5, representing the updated state data as Lie group elements, and calculating the multi-scale Lie algebraic representation and the Lie algebraic local features based on the Lie group elements; constructing a feature descriptor based on the multi-scale Lie algebraic representation and the Lie algebraic local features; Based on the feature descriptors, hierarchical clustering is performed to obtain hierarchical clustering results; based on the hierarchical clustering results, parallel collision detection is performed to obtain and merge collision detection results to generate global collision detection data; S6. Calculate global features and local features based on global collision detection data; Combine global features and local features into a high-dimensional feature vector; reduce the dimension of the high-dimensional feature vector to obtain the reduced-dimensional data; based on the reduced-dimensional data, use the K-means clustering method to calculate the clustering results; Based on the clustering results, the complexity level of each rigid body and the overall scene complexity index are calculated.

2. The rigid body collision detection method based on adaptive resolution according to claim 1, characterized in that: Step S1 is further as follows: S11, reading the three-dimensional coordinate position data, velocity vector data, acceleration vector data and pre-calculated shape complexity scalar value of the rigid body from the simulation environment database, and combining them to form rigid body data; Based on the rigid body data, the average distance and average speed of the rigid body are calculated; based on the average distance and average speed, the scene complexity index is calculated; Multiply the complexity index with a predefined scaling parameter to obtain an adjustment factor; S12, using the adjustment factor to update the preset weight matrix to obtain an updated weight matrix; based on the rigid body data and the updated weight matrix, performing element-level nonlinear transformation to obtain a high-dimensional point set array; S13, constructing a kd tree based on the high-dimensional point set array, performing a k nearest neighbor search in the kd tree, and obtaining a search result; calculating the Euclidean distance between each index pair in the search result based on the search result and the three-dimensional coordinate position data of the rigid body; S14. Based on the Euclidean distance between each index pair and a preset threshold, potential collision pairs are screened out to generate a potential collision pair list.

3. The rigid body collision detection method based on adaptive resolution according to claim 2, characterized in that: Step S2 is further as follows: S21. Based on the potential collision pair list, obtain the three-dimensional coordinate position data, velocity vector data and acceleration vector data of the corresponding rigid body, and construct an initial tensor field; Based on the initial tensor field, the tensor field at the next time step is calculated using predefined partial differential equations and numerical methods; S22, discretizing the tensor field of the next time step into a grid structure; performing eigenvalue decomposition on the tensor value of each grid point in the grid structure to obtain an eigenvalue array; calculating the scalar field based on the eigenvalue array, and finding the local maximum point in the scalar field; S23, based on the scalar field, sorting the local maximum points to obtain a sorting result; based on the sorting result, selecting the first N points as high collision probability points; calculating the Euclidean distance between the position of each rigid body and the high collision probability point, selecting M rigid bodies with the smallest Euclidean distance, and obtaining a temporary rigid body object; wherein M and N are natural numbers greater than 0; S24. Merge the temporary rigid body object and the potential collision pair list to remove duplications, and obtain an updated potential collision pair list.

4. The method for rigid body collision detection based on adaptive resolution according to claim 3, characterized in that: Step S3 is further as follows: S31, based on the updated potential collision pair list, obtain the three-dimensional coordinate position data of the corresponding rigid body to form a point cloud data set; perform Vietoris-Rips complex construction on the point cloud data set to obtain a complex sequence array; calculate the persistence homology of each complex in the complex sequence array to form a persistence homology graph; wherein the persistence homology graph contains persistence interval information of each dimension; S32, based on the persistent homology graph, calculating a predetermined number of features with the longest duration in each dimension; storing the birth values ​​and death values ​​of the predetermined number of features to form topological feature data; Construct adaptive grid based on topological feature data; S33, mapping the rigid bodies in the updated potential collision pair list to the adaptive grid and generating a mapping table; traversing each non-empty grid cell and its adjacent cells in the mapping table, executing a collision detection algorithm on the rigid body pairs, and obtaining a collision pair array.

5. The method for rigid body collision detection based on adaptive resolution according to claim 4, characterized in that: Step S4 is further as follows: S41, based on the collision pair array, obtaining the three-dimensional coordinate position data, velocity vector data and acceleration vector data of the corresponding rigid body to form a new array; based on the new array, dividing the preset simulation space into a uniform three-dimensional grid structure; based on the three-dimensional coordinate position data, assigning each rigid body in the new array to a corresponding grid unit in the three-dimensional grid structure, calculating the number of rigid bodies contained in each grid unit, the average velocity and the average acceleration, and forming statistical information; S42, based on the statistical information, calculating the local information entropy of each grid unit; calculating the difference between the local information entropy of each grid unit and the local information entropy of the adjacent unit to obtain an entropy gradient vector; based on the entropy gradient vector, constructing an adaptive sampling strategy, adjusting the time step and spatial resolution of each grid unit, and obtaining adjusted parameters; S43. Based on the adjusted parameters, the fourth-order Runge-Kutta method is used to update the motion state of the rigid body in each grid unit to obtain updated state data.

6. The rigid body collision detection method based on adaptive resolution according to claim 5, characterized in that: Step S5 is further as follows: S51, representing the updated state data as Lie group elements, calculating the logarithm of the Lie group elements, and mapping the logarithm of the Lie group elements to obtain Lie algebraic elements; convolving the Lie algebraic elements with the Gaussian kernel function to form a multi-scale Lie algebraic representation; based on the multi-scale Lie algebraic representation, calculating the Lie algebraic local features of each scale, including the norm, trace, determinant of the Lie algebraic elements and the representation of the relative position and relative velocity between adjacent rigid bodies on the Lie algebra, to form a Lie algebraic local feature array; S52, constructing a multi-scale feature descriptor based on the Lie algebra local feature array; based on the multi-scale feature descriptor, using a bottom-up hierarchical clustering algorithm to perform hierarchical clustering to obtain a hierarchical clustering result; S53, storing the hierarchical clustering results in a tree structure, each node in the tree structure contains a rigid body index belonging to a cluster formed in the hierarchical clustering process; performing parallel collision detection on each layer of the tree structure, merging the collision detection results from the leaf node upwards, and generating global collision detection data.

7. The rigid body collision detection method based on adaptive resolution according to claim 6, characterized in that: Step S6 is further as follows: S61. Calculate global features and local features based on the global collision detection data, wherein the global features include the total number of rigid bodies, average velocity, average acceleration, rigid body density distribution, and collision frequency; and the local features include the number of adjacent rigid bodies, relative velocity, and local density; S62, combining the global features and the local features into a high-dimensional feature vector, performing standardization processing based on the high-dimensional feature vector to obtain a standardized feature vector; performing principal component analysis dimensionality reduction based on the standardized feature vector to obtain data after dimensionality reduction; S63, based on the data after dimensionality reduction, using K-means clustering method to calculate the clustering results; Based on the clustering results, the complexity level of each rigid body is calculated; Based on each complexity level, a weighted average is calculated as the overall scene complexity indicator.

8. The rigid body collision detection method based on adaptive resolution according to claim 7, characterized in that: In step S11, the average distance and average speed of the rigid body are calculated based on the rigid body data; based on the average distance and average speed, the scene complexity index is further calculated as: S111. Generate a spatial index structure based on rigid body data using a KD tree algorithm; Based on the spatial index structure, the local density of each rigid body is calculated; S112. Calculate the average relative velocity of each rigid body and adjacent rigid bodies based on the rigid body data; S113, constructing a two-dimensional probability density function based on the local density and average relative velocity of all rigid bodies using a kernel density estimation method; S114, calculating the information entropy of the two-dimensional probability density function; based on the two-dimensional probability density function, using the maximum information coefficient algorithm, calculating the nonlinear correlation between the local density and the average relative velocity; S115. Calculate the scene complexity index based on information entropy and nonlinear correlation.

9. The rigid body collision detection method based on adaptive resolution according to claim 7, characterized in that: In step S21, based on the initial tensor field, the tensor field of the next time step is calculated using the predefined partial differential equation and numerical method as follows: S211, based on the initial tensor field, extract the tensor value of each grid point, and reorganize it to obtain a sparse matrix; S212, constructing and training a deep residual network model, inputting the sparse matrix into the trained deep residual network model, and obtaining the predicted tensor field state of the next time step; S213, combining the preset physical constraints, correcting the tensor field state of the next time step to obtain a corrected tensor field state of the next time step; S214. Reconstruct the corrected tensor field state of the next time step into a three-dimensional tensor field structure to obtain the tensor field of the next time step.

10. Rigid body collision detection system based on adaptive resolution, characterized in that: include: at least one processor; as well as, a memory communicatively connected to at least one of the processors; wherein, The memory stores instructions that can be executed by the processor, and the instructions are used to be executed by the processor to implement the rigid body collision detection method based on adaptive resolution as described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Precise hit detection and effect generation method in virtual battlefield

    CN104809267A

  • Road trafficability detection method, system and equipment

    CN111680611A