A collision detection optimization method and system for virtual reality training

By generating an inertial collision box model and performing inertial collision detection, the problem of inaccurate collision test results caused by not considering the inertia of object motion in existing technologies is solved, thereby improving the accuracy of collision detection and immersion in virtual reality scenes.

CN119444979BActive Publication Date: 2025-11-18ARMY ENG UNIV OF PLA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411390171.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-08
Publication Date
2025-11-18
Estimated Expiration
2044-10-08

AI Technical Summary

Technical Problem

Existing 3D object collision detection methods fail to effectively consider the motion inertia of objects, resulting in discrepancies between collision test results and actual results, which affects the immersive experience in virtual reality scenes.

Method used

By generating an inertial collision box model, collision detection is performed based on the motion inertia of the target object. The vertex position coordinates in two-dimensional space are obtained using model mesh information, and inertial prediction is performed by combining historical velocity information to generate inertial collision velocity and box model for detection.

Benefits of technology

It improves the accuracy of collision test results in virtual reality scenarios, enhancing the user's immersive experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119444979B_ABST
    Figure CN119444979B_ABST
Patent Text Reader

Abstract

The application provides a collision detection optimization method and system for virtual reality training. The method first obtains the second vertex position coordinates of a virtual reality model in a two-dimensional space based on model grid information. The historical speed information of the virtual reality model of a target is obtained, and the inertial collision speed of the virtual reality model is obtained through inertia prediction according to the historical speed information. The inertial collision box model of the virtual reality model is generated according to the second vertex position coordinates of the target model and the inertial collision speed of the virtual reality model. The collision object collision box model is generated, and the inertial collision detection is performed according to the inertial collision box model and the collision object collision box model. The inertial collision speed of the target test object can be predicted based on the historical motion speed of the target test object. The inertial collision box is generated according to the inertial collision speed of the target test object and the vertex position information, and the inertial collision detection is performed. Finally, the accuracy of the collision test result in the virtual reality scene is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of collision test modeling technology, and more specifically, to a collision detection optimization method and system for virtual reality training. Background Technology

[0002] In virtual reality scenarios, three-dimensional objects often come into contact with each other due to user interaction. To ensure a positive user experience, the system needs to generate corresponding collision responses upon detecting collisions, providing a more immersive experience. Therefore, collision detection of three-dimensional objects plays a crucial role in the proper functioning of virtual games.

[0003] Conventional 3D object collision detection methods mainly project the topological structure of 3D objects onto a 2D plane. By determining the distance and direction of the projection results on the 2D plane, the intersection test results of the 2D plane are obtained. Then, combined with the mapping principle of 3D space, the actual collision detection results of the virtual scene are obtained. This method does not perform inertial collision verification based on the motion inertia of objects, which leads to a difference between the collision test results and the actual results. This greatly affects the development and application of collision testing in actual virtual reality scenarios. Summary of the Invention

[0004] This application provides a collision detection optimization method and system for virtual reality training, which can generate an inertial collision box based on the motion inertia of the target test object and perform inertial collision verification, thereby improving the accuracy of collision test results in virtual reality scenes.

[0005] In a first aspect, this application provides a collision detection optimization method for virtual reality training. This method can be executed by a network device, or by a chip configured in the network device, and this application does not limit the execution of such method.

[0006] Specifically, the method includes:

[0007] Initiate virtual reality collision detection to determine the virtual reality model of the target object and the corresponding model mesh information of the target object in the virtual reality coordinate system;

[0008] Based on the model mesh information, obtain the coordinates of the second vertex position of the virtual reality model in two-dimensional space;

[0009] The historical velocity information of the virtual reality model of the target is obtained, and inertial prediction is performed based on the historical velocity information to obtain the inertial collision velocity of the virtual reality model.

[0010] Based on the coordinates of the second vertex of the target model and the inertial collision velocity of the virtual reality model, an inertial collision box model of the virtual reality model is generated.

[0011] Generate a collision box model of the collision object, and perform inertial collision detection based on the inertial collision box model and the collision object collision box model.

[0012] In conjunction with the first aspect, in some implementations of the first aspect, obtaining the second vertex position coordinates of the virtual reality model in two-dimensional space based on the model mesh information specifically includes: obtaining the first vertex position coordinates of the virtual reality model in three-dimensional space based on the model mesh information, and performing spatial transformation on the first vertex position coordinates to obtain the second vertex position coordinates of the virtual reality model in two-dimensional space.

[0013] In conjunction with the first aspect, in certain implementations of the first aspect, obtaining the coordinates of the first vertex position of the virtual reality model in three-dimensional space based on the model mesh information specifically includes:

[0014] Get the center coordinates of the colliding object;

[0015] Obtain all mesh edge points of the model mesh information, and determine the Euclidean distance between each mesh edge point and the object center coordinates of the colliding object;

[0016] The grid edge point with the smallest Euclidean distance to the center coordinates of the colliding object is taken as the first vertex position coordinate of the virtual reality model in three-dimensional space.

[0017] In conjunction with the first aspect, in some implementations of the first aspect, the orthogonal projection method is used to spatially transform the coordinates of the first vertex position to obtain the coordinates of the second vertex position of the virtual reality model in two-dimensional space.

[0018] In conjunction with the first aspect, in certain implementations of the first aspect, the inertial collision velocity of the virtual reality model is obtained by performing inertial prediction based on the historical velocity information, specifically including:

[0019] Multiple historical velocity vectors are obtained based on the historical velocity information;

[0020] An inertial prediction model is constructed for each dimension of multiple historical velocity vectors, resulting in the first inertial prediction model, the second inertial prediction model, and the third inertial prediction model.

[0021] The first inertial collision velocity component, the second inertial collision velocity component, and the third inertial collision velocity component are determined according to the first inertial prediction model, the second inertial prediction model, and the third inertial prediction model, respectively. Then, the inertial collision velocity vector is obtained from the first inertial collision velocity component, the second inertial collision velocity component, and the third inertial collision velocity component.

[0022] The inertial collision velocity vector is projected to obtain the inertial collision velocity in two dimensions.

[0023] In conjunction with the first aspect, in some implementations of the first aspect, generating the collision box model of the collision object specifically includes:

[0024] Obtain the virtual reality model of the collision object;

[0025] An inertial collision box model of the collision object is generated based on the virtual reality model of the collision object, and the inertial collision box model of the collision object is used as the collision box model of the collision object.

[0026] In conjunction with the first aspect, in some implementations of the first aspect, the virtual reality model file of the target object is stored in OBJ format.

[0027] Secondly, this application provides a collision detection optimization system for virtual reality training, including a collision testing unit, the collision testing unit comprising:

[0028] The model creation module is used to initiate virtual reality collision detection, determine the virtual reality model of the target object, and the model mesh information corresponding to the target object in the virtual reality coordinate system.

[0029] The model processing module is used to obtain the coordinates of the second vertex position of the virtual reality model in two-dimensional space based on the model mesh information;

[0030] The model processing module is used to acquire historical velocity information of the virtual reality model of the target, perform inertial prediction based on the historical velocity information, and obtain the inertial collision velocity of the virtual reality model.

[0031] The model processing module is used to generate an inertial collision box model of the virtual reality model based on the coordinates of the second vertex of the target model and the inertial collision velocity of the virtual reality model.

[0032] The test execution module is used to generate a collision box model of the collision object and perform inertial collision detection based on the inertial collision box model and the collision object collision box model.

[0033] Thirdly, this application provides a computer terminal device, the computer terminal device including a memory and a processor, the memory storing code, and the processor being configured to acquire the code and execute the above-described collision detection optimization method for virtual reality training.

[0034] Fourthly, this application provides a computer-readable storage medium storing at least one computer program, which is loaded and executed by a processor to perform the operations described above in the collision detection optimization method for virtual reality training.

[0035] The technical solutions provided by the embodiments disclosed in this application have the following beneficial effects:

[0036] This application provides a collision detection optimization method and system for virtual reality training. First, the virtual reality model of the target object and its corresponding model mesh information in the virtual reality coordinate system are determined. Based on the model mesh information, the coordinates of the second vertex of the virtual reality model in two-dimensional space are obtained. Historical velocity information of the target virtual reality model is acquired, and inertial prediction is performed based on this information to obtain the inertial collision velocity of the virtual reality model. Based on the second vertex coordinates of the target model and the inertial collision velocity, an inertial collisionbox model of the virtual reality model is generated. A collisionbox model of the collision object is generated, and inertial collision detection is performed based on both the inertial collisionbox model and the collision object collisionbox model. This method can predict the inertial collision velocity of the target test object based on its historical motion velocity. Based on the inertial collision velocity and vertex position information of the target test object, an inertial collisionbox is generated and inertial collision verification is performed, ultimately improving the accuracy of collision test results in virtual reality scenes. Attached Figure Description

[0037] Figure 1 This is an exemplary flowchart of a collision detection optimization method for virtual reality training, according to some embodiments of this application.

[0038] Figure 2 This is an exemplary flowchart of determining the position coordinates of the first vertex in some embodiments of this application;

[0039] Figure 3 This is an exemplary flowchart of determining the inertial collision velocity of a virtual reality model in some embodiments of this application;

[0040] Figure 4 These are schematic diagrams of exemplary hardware and / or software of a collision test unit according to some embodiments of this application;

[0041] Figure 5This is a schematic diagram of the structure of a computer terminal device that implements a collision detection optimization method for virtual reality training, according to some embodiments of this application. Detailed Implementation

[0042] This application determines the virtual reality model of the target object and the corresponding model mesh information in the virtual reality coordinate system; obtains the coordinates of the second vertex of the virtual reality model in two-dimensional space based on the model mesh information; obtains the historical velocity information of the target virtual reality model, performs inertial prediction based on the historical velocity information, and obtains the inertial collision velocity of the virtual reality model; generates an inertial collisionbox model of the virtual reality model based on the second vertex coordinates of the target model and the inertial collision velocity of the virtual reality model; generates a collision box model of the collision object, and performs inertial collision detection based on the inertial collision box model and the collision object collision box model. It can predict the inertial collision velocity of the target test object based on the historical motion velocity of the target test object, generate an inertial collision box based on the inertial collision velocity and vertex position information of the target test object, and perform inertial collision verification, ultimately improving the accuracy of collision test results in virtual reality scenes.

[0043] To better understand the above technical solutions, a detailed description of the solutions will be provided below in conjunction with the accompanying drawings and specific implementation methods. (Reference) Figure 1 The figure is an exemplary flowchart of a collision detection optimization method for virtual reality training according to some embodiments of this application. The collision detection optimization method mainly includes the following steps:

[0044] In step S101, virtual reality collision detection is initiated to determine the virtual reality model of the target object and the corresponding model mesh information of the target object in the virtual reality coordinate system.

[0045] Optionally, in some embodiments, the virtual reality model of the target can be determined by selecting or importing the target model from a 3D model library. Specifically, when the target model does not exist in the existing library, it is necessary to create the target model using 3D modeling software (such as Blender, Maya, etc.) and define its geometric structure and material properties.

[0046] In some embodiments, the model mesh information corresponding to the target in the virtual reality coordinate system can be obtained by extracting the mesh information (MeshData) of the target's virtual reality model, including the position coordinates of all vertices, connecting edges, and the vertex sequence that makes up the face. The mesh information can be read directly from the model file or generated by a graphics API (such as OpenGL, DirectX). In some embodiments, the virtual reality model file of the target object is stored in OBJ format.

[0047] In step S102, the coordinates of the second vertex of the virtual reality model in two-dimensional space are obtained based on the model mesh information.

[0048] Preferably, in some embodiments, obtaining the second vertex position coordinates of the virtual reality model in two-dimensional space based on model mesh information specifically includes: obtaining the first vertex position coordinates of the virtual reality model in three-dimensional space based on model mesh information, and performing spatial transformation on the first vertex position coordinates to obtain the second vertex position coordinates of the virtual reality model in two-dimensional space.

[0049] Optionally, in some embodiments, reference is made to Figure 2 As shown, this figure is an exemplary flowchart for determining the coordinates of the first vertex in some embodiments of this application. Obtaining the coordinates of the first vertex of a virtual reality model in three-dimensional space based on model mesh information specifically includes:

[0050] In step S1021, the coordinates of the object center of the colliding object are obtained;

[0051] In step S1022, all mesh edge points of the model mesh information are obtained, and the Euclidean distance between each mesh edge point and the object center coordinates of the colliding object is determined.

[0052] In step S1023, the grid edge point with the smallest Euclidean distance to the center coordinates of the colliding object is taken as the first vertex position coordinate of the virtual reality model in three-dimensional space.

[0053] It should be noted that the collision object is a virtual object used in virtual reality space to conduct collision tests on the target model. In specific implementation, the centroid of the collision object can be used as the object center of the collision object, and the coordinate value of the object center can be used as the object center coordinate of the collision object.

[0054] In some embodiments, the grid vertices of the model grid information can be used as the grid edge points of the model grid information. All vertex coordinates can be extracted from the grid information of the target model. For example, the vertex coordinates can be represented as a vertex list V={v1,v2,…,vn}, where each vertex vi=(xi,yi,zi) is a three-dimensional vector used to represent the grid edge point.

[0055] Optionally, in some embodiments, orthogonal projection is used to spatially transform the coordinates of the first vertex to obtain the coordinates of the second vertex of the virtual reality model in two-dimensional space.

[0056] It should be noted that orthographic projection is a common method for directly projecting points in three-dimensional space onto a two-dimensional plane. The projection process does not consider the perspective effect of the viewpoint, so there is no change in size or distance.

[0057] In step S103, the historical velocity information of the target's virtual reality model is obtained, and inertial prediction is performed based on the historical velocity information to obtain the inertial collision velocity of the virtual reality model.

[0058] Optionally, in some embodiments, the historical velocity information of the target's virtual reality model can be obtained by parsing the target's virtual reality model file. Specifically, the virtual reality model file contains a portion of the target object's velocity information. In some other embodiments, a velocity value sequence can also be randomly generated by a random number generator as the historical velocity information of the target's virtual reality model, wherein the sequence elements in the velocity value sequence are the velocity vectors of the target's virtual reality model.

[0059] It should be noted that the inertial collision velocity is a predicted collision velocity obtained based on historical velocity information from the virtual reality model. This predicted velocity is used to extend the collision box of the virtual online model, thereby obtaining an inertial collision box for inertial collision testing. Optionally, in some embodiments, reference is made to... Figure 3 As shown, this figure is an exemplary flowchart of determining the inertial collision velocity of a virtual reality model in some embodiments of this application. Specifically, obtaining the inertial collision velocity of the virtual reality model through inertial prediction based on historical velocity information includes:

[0060] In step S1031, multiple historical velocity vectors are obtained based on historical velocity information;

[0061] In step S1032, an inertial prediction model is constructed for each vector dimension of the multiple historical velocity vectors to obtain a first inertial prediction model, a second inertial prediction model, and a third inertial prediction model.

[0062] In step S1033, inertial collision velocity is predicted based on the first inertial prediction model, the second inertial prediction model and the third inertial prediction model. The first inertial collision velocity component, the second inertial collision velocity component and the third inertial collision velocity component are determined respectively. Then, the inertial collision velocity vector is obtained from the first inertial collision velocity component, the second inertial collision velocity component and the third inertial collision velocity component.

[0063] In step S1034, the inertial collision velocity vector is vector-projected to obtain the inertial collision velocity in the two-dimensional direction.

[0064] Optionally, in some embodiments, a moving average autoregressive model is used as the inertial prediction model. Below is a preferred embodiment of using a moving average autoregressive model as the inertial prediction model for inertial collision velocity prediction in this application: First, the prediction period is preset to 100 units of time. At this time, the velocity components of the first dimension over the past 100 units of time can be recorded to obtain a sequence of the first dimension velocity components. In other embodiments, the prediction period can be preset to other time lengths. Then, a time series graph of the first dimension velocity component sequence can be plotted. The horizontal axis of the time series graph corresponds to the time corresponding to different units of time. Furthermore, an exponential transformation can be performed on the time series graph of the first dimension velocity component sequence set to eliminate the trend of variance changing with time in the time series graph.

[0065] Secondly, based on the time series plot of the first-dimensional velocity component sequence, an autocorrelation coefficient plot of the first-dimensional velocity component is plotted, where the horizontal axis of the autocorrelation coefficient plot represents the lag period number, and the vertical axis represents the value of the autocorrelation coefficient. A partial autocorrelation coefficient plot of the first-dimensional velocity component is also plotted, where the horizontal axis of the partial autocorrelation coefficient plot represents the lag period number, and the vertical axis represents the value of the partial autocorrelation coefficient.

[0066] Based on the characteristics of the autocorrelation coefficient plot and the partial autocorrelation coefficient plot, the order of the model and the range of coefficient values ​​can be preliminarily determined. For example, an autocorrelation coefficient plot can be drawn to observe whether the autocorrelation coefficient exhibits a truncated characteristic after a certain order. If the autocorrelation coefficient drops sharply after a certain order and remains near 0, the order of the autoregressive model can be preliminarily determined. Similarly, a partial autocorrelation coefficient plot can be drawn to observe whether the partial autocorrelation coefficient exhibits a truncated characteristic after a certain order. If the partial autocorrelation coefficient drops sharply after a certain order and remains near 0, the order of the moving average model can be preliminarily determined.

[0067] In practice, we can first find the last significant autocorrelation coefficient based on the autocorrelation coefficient plot. This is the order of the autocorrelation model. For example, if the last significant autocorrelation coefficient in the autocorrelation coefficient plot is at order 3, then the order of the autocorrelation model is 3. Then, based on the partial autocorrelation coefficient plot, we can find the last significant partial autocorrelation coefficient. This is the order of the moving average model. For example, if the last significant partial autocorrelation coefficient in the partial autocorrelation coefficient plot is at order 2, then the order of the moving average model is 2. Finally, based on the autocorrelation coefficient plot and the partial autocorrelation coefficient plot, we can determine the order (p,q) of the autoregressive moving average model. For example, if both the autocorrelation coefficient plot and the partial autocorrelation coefficient plot decay to zero after order 3, then the order of the autoregressive moving average model is (3,3). Then, based on the order of the autoregressive moving average model, we can select appropriate parameters to establish an autoregressive moving average model for the first-dimensional velocity component sequence. By substituting the first-dimensional velocity component sequence into the autoregressive moving average model, we can predict the subsequent first-dimensional velocity components. The first-dimensional velocity component at the end of the next unit time is taken as the first inertial collision velocity component.

[0068] In practice, for example, the least squares method can be used to estimate parameters and perform significance tests on the autoregressive and moving average processes of the model. In some embodiments, the significance level is 0.05. Finally, the most suitable autoregressive moving average model parameters are selected according to the Schwarz Bayes criterion, thereby determining the final autoregressive moving average model of the first dimension velocity component.

[0069] The first inertial prediction model is the change function of the first-dimensional velocity component over a past unit of time. By substituting the sequence of the first-dimensional velocity components into the autoregressive moving average model, the subsequent first-dimensional velocity components can be predicted. In some embodiments, the first-dimensional velocity component at the end of the next unit of time is taken as the first inertial collision velocity component.

[0070] In some embodiments, the inertial collision velocity vector is vector-projected using the orthogonal projection method to obtain the inertial collision velocity in two dimensions.

[0071] In step S104, an inertial collision box model of the virtual reality model is generated based on the second vertex position coordinates of the target model and the inertial collision velocity of the virtual reality model.

[0072] It should be noted that the inertial collision box model is an adaptive collision box model obtained based on the historical velocity information of the virtual reality model. Inertial collision prediction based on the adaptive collision box model can predict the collision result during the continuous movement of the virtual reality model object. Optionally, in some embodiments, generating the inertial collision box model of the virtual reality model based on the second vertex position coordinates of the target model and the inertial collision velocity of the virtual reality model specifically includes:

[0073] Obtain all edge points of the target model, and determine the model center point based on the geometric center of all edge points;

[0074] Based on the model center point of the target model, all edge points of the target model are centered to obtain the set of centered edge points of the target model;

[0075] Obtain the covariance matrix of the target model from the centralized edge point set;

[0076] The eigenvalues ​​and eigenvectors of the covariance matrix are obtained. Based on the inertial collision velocity of the virtual reality model, the eigenvalues ​​and eigenvectors of the covariance matrix are filtered to obtain the inertial eigenvalues ​​and inertial eigenvectors.

[0077] An inertial collision box model of the virtual reality model is generated based on the inertial eigenvalues, inertial eigenvectors, and the coordinates of the second vertex of the target model.

[0078] Optionally, in some embodiments, the coordinates of all model vertices in the target model file can be used as the edge points of the target model, and then a centralized edge point set can be obtained by performing a difference operation between the position coordinates of all edge points and the geometric center.

[0079] In some embodiments, the covariance matrix of the target model is determined according to the following formula:

[0080]

[0081] in, Let be the covariance matrix, N be the number of centralized edge points in the centralized edge point set, and i be the intermediate variable for summation. Let i be the coordinate vector of the i-th centered edge point in the set of centered edge points. It is the transpose of the coordinate vector of the i-th centered edge point in the set of centered edge points.

[0082] Optionally, in some embodiments, feature filtering is performed on the eigenvalues ​​and eigenvectors of the covariance matrix based on the inertial collision velocity of the virtual reality model to obtain inertial eigenvalues ​​and inertial eigenvectors. Specifically, this includes:

[0083] Obtain the velocity vector of the inertial collision velocity of the virtual reality model;

[0084] The vector product of all feature vectors is obtained by taking the velocity vector of the inertial collision velocity. The feature vector with the smallest vector product is removed and the mean vector of the feature vectors is filled in to supplement it, resulting in multiple inertial feature vectors.

[0085] The eigenvalues ​​corresponding to the eigenvectors with the smallest vector product are removed, and the mean of the eigenvalues ​​is used to fill in the missing values, resulting in multiple inertial eigenvalues.

[0086] It should be noted that the smaller the vector product of the feature vector and the velocity vector of the inertial collision velocity, the greater the deviation between the vector direction of the feature vector and the direction of the inertial collision velocity. In this case, it is necessary to reconstruct the feature vector to obtain the inertial feature vector, thereby increasing the distance of the final inertial collision box in the direction of the inertial collision velocity and improving the accuracy of the collision test when the target object moves in the direction of the inertial collision velocity.

[0087] Optionally, in some embodiments, generating the inertial collision box model of the virtual reality model based on the inertial feature values ​​and inertial feature vectors, as well as the second vertex position coordinates of the target model, specifically includes:

[0088] Obtain inertial eigenvalues ​​and inertial eigenvectors, and determine the model orientation of the inertial collision box model based on the inertial eigenvalues ​​and inertial eigenvectors;

[0089] The position of the second vertex is taken as the model center of the inertial collider model;

[0090] A local coordinate system is constructed using inertial eigenvectors, transforming all vertices of the virtual reality model into the local inertial coordinate system;

[0091] Establish an axis-aligned bounding box in the local inertial coordinate system;

[0092] Transform the vertices of the axis-aligned bounding box model back into virtual reality coordinate space to obtain the inertial collision box model.

[0093] Preferably, in some embodiments, the transformation matrix of the local inertial coordinate system is a square matrix composed of inertial eigenvectors. All vertices of the virtual reality model can be transformed to the local inertial coordinate system by multiplying the inverse matrix of the transformation matrix of the local inertial coordinate system with the vertex coordinates of the virtual reality model.

[0094] Optionally, in some embodiments, the existing technology can be used to establish the axis-aligned bounding box in the local inertial coordinate system. For example, the endpoint coordinates in the local inertial coordinate system are calculated, the axis-aligned bounding box is constructed based on the endpoint coordinates, and then the axis-aligned bounding box is transformed back into the virtual reality coordinate space through the transformation matrix of the local inertial coordinate system to obtain the inertial collision box model.

[0095] In step S105, a collision box model of the collision object is generated, and inertial collision detection is performed based on the inertial collision box model and the collision object collision box model.

[0096] Preferably, in some embodiments, generating the collision box model of the collision object specifically includes:

[0097] Obtain the virtual reality model of the collision object;

[0098] Generate an inertial collision box model of the collision object based on the virtual reality model of the collision object, and use the inertial collision box model of the collision object as the collision box model of the collision object.

[0099] Preferably, in some embodiments, inertial collision detection based on the inertial collision box model and the collision object collision box model specifically includes:

[0100] Obtain the projected coordinates of the inertial collision box model on different coordinate axes in virtual reality space;

[0101] Obtain the projected coordinates of the collision box model of the colliding object on different coordinate axes in virtual reality space;

[0102] Determine whether there is an overlap between the projected coordinates of the inertial collision box model on different coordinate axes in virtual reality space and the projected coordinates of the collision object's collision box model on different coordinate axes in virtual reality space. If there is an overlap, determine that there is an inertial collision between the target object and the collision object.

[0103] Furthermore, in another aspect of this application, in some embodiments, this application provides a collision detection optimization system for virtual reality training, the system including a collision testing unit, referenced... Figure 4 The figure is a schematic diagram of exemplary hardware and / or software of a collision test unit according to some embodiments of this application. The collision test unit 400 includes: a model creation module 401, a model processing module 402, and a test execution module 404, which are described below:

[0104] The model creation module 401 is used to initiate virtual reality collision detection, determine the virtual reality model of the target object and the model mesh information corresponding to the target object in the virtual reality coordinate system;

[0105] Model processing module 402 is used to obtain the coordinates of the second vertex of the virtual reality model in two-dimensional space based on the model mesh information;

[0106] The model processing module 402 is used to acquire the historical velocity information of the virtual reality model of the target, perform inertial prediction based on the historical velocity information, and obtain the inertial collision velocity of the virtual reality model.

[0107] The model processing module 402 is used to generate an inertial collision box model of the virtual reality model based on the position coordinates of the second vertex of the target model and the inertial collision velocity of the virtual reality model.

[0108] Test execution module 403 is used to generate collision box models of collision objects and perform inertial collision detection based on the inertial collision box model and the collision object collision box model.

[0109] The foregoing detailed an example of a collision detection optimization method and system for virtual reality training provided in the embodiments of this application. It is understood that, in order to achieve the above functions, the corresponding device includes hardware structures and / or software modules for performing each function.

[0110] Those skilled in the art should readily recognize that, based on the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a certain function in the application is executed in a manner that drives hardware or computer software depends on the specific application and design constraints of the technical solution. Therefore, those skilled in the art can use different methods to implement the described function for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0111] In addition, this application also provides a computer terminal device, which includes a memory and a processor. The memory stores code, and the processor is configured to acquire the code and execute the above-described collision detection optimization method for virtual reality training.

[0112] In some embodiments, reference Figure 5 The figure is a schematic diagram of a computer terminal device applying a collision detection optimization method for virtual reality training, according to some embodiments of this application. The collision detection optimization method for virtual reality training described in the above embodiments can... Figure 5 The computer terminal device 500 shown is used to implement this, and the computer terminal device 500 includes at least one communication bus 501, communication interface 502, processor 503 and memory 504.

[0113] The processor 503 can be a general-purpose central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more devices used to control the execution of a collision detection optimization method for virtual reality training as described in this application.

[0114] The communication bus 501 may include a path for transmitting information between the aforementioned components.

[0115] Memory 504 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disks or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. Memory 504 may exist independently and be connected to processor 503 via communication bus 501. Memory 504 may also be integrated with processor 503.

[0116] The memory 504 stores program code for executing the scheme of this application, and its execution is controlled by the processor 503. The processor 503 executes the program code stored in the memory 504. The program code may include one or more software modules. In the above embodiment, the determination of the coordinates of the second vertex position can be achieved by the processor 503 and one or more software modules in the program code in the memory 504.

[0117] Communication interface 502 uses any transceiver-like device for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area networks (WLAN), etc.

[0118] Optionally, the computer terminal device 500 may also include a power supply 505 for providing power to various devices or circuits in the real-time computer terminal device.

[0119] In a specific implementation, as one example, a computer terminal device may include multiple processors, each of which may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. Here, a processor may refer to one or more devices, circuits, and / or processing cores used to process data (e.g., computer program instructions).

[0120] The aforementioned computer terminal device can be a general-purpose computer terminal device or a dedicated computer terminal device. In specific implementations, the computer terminal device can be a desktop computer, a portable computer, a network server, a handheld computer (PDA), a mobile phone, a tablet computer, a wireless terminal device, a communication device, or an embedded device. This application does not limit the type of computer terminal device.

[0121] In addition, other aspects of this application provide a computer-readable storage medium storing at least one computer program that is loaded and executed by a processor to perform the operations described above in a collision detection optimization method for virtual reality training.

[0122] In summary, the collision detection optimization method and system for virtual reality training disclosed in this application first determines the virtual reality model of the target object and the corresponding model mesh information of the target object in the virtual reality coordinate system; based on the model mesh information, it obtains the coordinates of the second vertex position of the virtual reality model in two-dimensional space; it obtains the historical velocity information of the target virtual reality model, performs inertial prediction based on the historical velocity information, and obtains the inertial collision velocity of the virtual reality model; based on the second vertex position coordinates of the target model and the inertial collision velocity of the virtual reality model, it generates an inertial collisionbox model of the virtual reality model; it generates a collision box model of the collision object, performs inertial collision detection based on the inertial collision box model and the collision object collision box model, and can predict the inertial collision velocity of the target test object based on the historical motion velocity of the target test object, generate an inertial collision box based on the inertial collision velocity and vertex position information of the target test object and perform inertial collision verification, ultimately improving the accuracy of collision test results in virtual reality scenes.

[0123] The above descriptions are merely embodiments of this application, and common knowledge such as specific technical solutions or characteristics in the solutions are not described in detail here. It should be noted that those skilled in the art can make several modifications and improvements without departing from the technical solutions of this application, and these should also be considered within the scope of protection of this application, without affecting the effectiveness of the implementation of this application or the practicality of the patent.

[0124] The scope of protection claimed in this application shall be determined by the content of its claims. The specific embodiments described in the specification can be used to interpret the content of the claims. Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of the invention. Therefore, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application also intends to include these modifications and variations.

Claims

1. A collision detection optimization method for virtual reality training, characterized in that, include: Initiate virtual reality collision detection to determine the virtual reality model of the target object and the corresponding model mesh information of the target object in the virtual reality coordinate system; Based on the model mesh information, obtain the coordinates of the second vertex position of the virtual reality model in two-dimensional space; The historical velocity information of the virtual reality model of the target is obtained, and inertial prediction is performed based on the historical velocity information to obtain the inertial collision velocity of the virtual reality model. Based on the coordinates of the second vertex of the target model and the inertial collision velocity of the virtual reality model, an inertial collision box model of the virtual reality model is generated; this includes: obtaining all edge points of the target model, determining the model center point based on the geometric center of all edge points; centering all edge points of the target model based on the model center point to obtain a set of centered edge points; obtaining the covariance matrix of the target model based on the set of centered edge points; obtaining the eigenvalues ​​and eigenvectors of the covariance matrix, performing feature filtering on the eigenvalues ​​and eigenvectors of the covariance matrix based on the inertial collision velocity of the virtual reality model to obtain inertial eigenvalues ​​and inertial eigenvectors; and generating the inertial collision box model of the virtual reality model based on the inertial eigenvalues ​​and inertial eigenvectors and the coordinates of the second vertex of the target model. In this process, the coordinates of all model vertices in the target model file are taken as the edge points of the target model. Then, by performing a difference operation between the position coordinates of all edge points and the geometric center, a centralized edge point set is obtained. The process of generating an inertial collisionbox model for a virtual reality model based on inertial eigenvalues, inertial eigenvectors, and the coordinates of the second vertex of the target model includes: obtaining inertial eigenvalues ​​and inertial eigenvectors; determining the model orientation of the inertial collisionbox model based on the inertial eigenvalues ​​and inertial eigenvectors; using the second vertex position as the model center of the inertial collisionbox model; constructing a local coordinate system using the inertial eigenvectors; transforming all model vertices of the virtual reality model to the local inertial coordinate system; establishing an axis-aligned bounding box in the local inertial coordinate system; and transforming the model vertices of the axis-aligned bounding box back to the virtual reality coordinate space to obtain the inertial collisionbox model. Generate a collision box model of the collision object, and perform inertial collision detection based on the inertial collision box model and the collision object collision box model.

2. The collision detection optimization method for virtual reality training as described in claim 1, characterized in that, The step of obtaining the coordinates of the second vertex of the virtual reality model in two-dimensional space based on the model mesh information includes: Based on the model mesh information, the coordinates of the first vertex of the virtual reality model in three-dimensional space are obtained, and the coordinates of the second vertex of the virtual reality model in two-dimensional space are obtained by spatial transformation of the first vertex coordinates.

3. The collision detection optimization method for virtual reality training as described in claim 2, characterized in that, The step of obtaining the coordinates of the first vertex of the virtual reality model in three-dimensional space based on the model mesh information includes: Get the center coordinates of the colliding object; Obtain all mesh edge points of the model mesh information, and determine the Euclidean distance between each mesh edge point and the object center coordinates of the colliding object; The grid edge point with the smallest Euclidean distance to the center coordinates of the colliding object is taken as the first vertex position coordinate of the virtual reality model in three-dimensional space.

4. The collision detection optimization method for virtual reality training as described in claim 2, characterized in that, The method further includes: The coordinates of the second vertex of the virtual reality model in two-dimensional space are obtained by spatial transformation of the coordinates of the first vertex using orthogonal projection.

5. The collision detection optimization method for virtual reality training as described in claim 1, characterized in that, The step of performing inertial prediction based on the historical velocity information to obtain the inertial collision velocity of the virtual reality model includes: Multiple historical velocity vectors are obtained based on the historical velocity information; An inertial prediction model is constructed for each dimension of multiple historical velocity vectors, resulting in the first inertial prediction model, the second inertial prediction model, and the third inertial prediction model. The first inertial collision velocity component, the second inertial collision velocity component, and the third inertial collision velocity component are determined according to the first inertial prediction model, the second inertial prediction model, and the third inertial prediction model, respectively. The inertial collision velocity vector is obtained according to the first inertial collision velocity component, the second inertial collision velocity component, and the third inertial collision velocity component. The inertial collision velocity vector is projected to obtain the inertial collision velocity in two dimensions.

6. The collision detection optimization method for virtual reality training as described in claim 1, characterized in that, The generated collision box model of the collision object includes: Obtain the virtual reality model of the collision object; An inertial collision box model of the collision object is generated based on the virtual reality model of the collision object, and the inertial collision box model of the collision object is used as the collision box model of the collision object.

7. The collision detection optimization method for virtual reality training as described in claim 1, characterized in that, The virtual reality model file of the target object is stored in OBJ format.

8. A collision detection optimization system for virtual reality training, comprising a collision testing unit, wherein the collision detection optimization system for virtual reality training is used to implement the collision detection optimization method for virtual reality training as described in claim 1, characterized in that, The collision test unit includes: The model creation module is used to initiate virtual reality collision detection, determine the virtual reality model of the target object, and the model mesh information corresponding to the target object in the virtual reality coordinate system. The model processing module is used to obtain the coordinates of the second vertex position of the virtual reality model in two-dimensional space based on the model mesh information; The model processing module is used to acquire historical velocity information of the virtual reality model of the target, perform inertial prediction based on the historical velocity information, and obtain the inertial collision velocity of the virtual reality model. The model processing module is used to generate an inertial collision box model of the virtual reality model based on the coordinates of the second vertex of the target model and the inertial collision velocity of the virtual reality model. The test execution module is used to generate a collision box model of the collision object and perform inertial collision detection based on the inertial collision box model and the collision object collision box model.

9. A computer terminal device, characterized in that, The computer terminal device includes a memory and a processor, the memory storing code, and the processor being configured to acquire the code and execute a collision detection optimization method for virtual reality training as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing at least one computer program, characterized in that, The computer program is loaded and executed by a processor to perform the operations described in any one of claims 1 to 7 of the collision detection optimization method for virtual reality training.

Citation Information

Patent Citations

  • Medical vehicle anti-collision detection method, device and system

    CN110806581A

  • Collision detection method and device and readable storage medium

    CN118608730A