Collision data processing method and device, storage medium, and electronic device

KR103013989B1Active Publication Date: 2026-09-02TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
KR1020237031526
Authority / Receiving Office
KR · KR
Patent Type
Patents
Current Assignee / Owner
Priority Date
2021-06-22
Filing Date
2022-06-02
Publication Date
2026-09-02
Estimated Expiration
2042-06-02

Smart Images

  • Figure 112023102004916-PCT00002_ABST
    Figure 112023102004916-PCT00002_ABST
Patent Text Reader

Abstract

A method and apparatus for processing collision data, a storage medium, a program product, and an electronic device are provided. The collision data processing method comprises the steps of: determining a collider to be processed within a virtual scene—the target collider is a convex polyhedron containing vertices—; obtaining a distance relationship between each of the vertices on the target collider—the distance relationship is used to represent the shape features of the target collider—; and, when the target collider is converted into a normalized geometric solid according to the distance relationship, converting the vertex data of the target collider according to a data format that aligns with the normalized geometric solid to obtain collision data of the target collider. The present application solves the technical problem in the related technology of relatively low processing efficiency caused by the relatively high difficulty of the collision data processing operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technology Field

[0001] Related applications

[0002] This application claims priority to Chinese patent application No. 202110694872.2, filed with the Chinese Intellectual Property Office on June 22, 2021, under the title “Collision Data Processing Method and Apparatus, Storage Medium, Program Product, and Electronic Device,” which is incorporated herein by reference in its entirety.

[0003] This application relates to the field of computers, in particular, to a collision data processing method and apparatus, a storage medium, and an electronic device. Background Technology

[0004] Many interactions often occur between virtual objects within a virtual game scene, and it is necessary to calculate collision data generated by colliders corresponding to the virtual objects and accurately control the virtual objects based on the calculation results.

[0005] However, collision data for the related technology is typically generated in a graphics engine (such as 3ds Max) and then imported into a game engine for use. The technical cost of this method is relatively high. If relatively simple collisions with high precision need to be generated, the technical cost will be even higher. Additionally, the model's mesh is used directly as the collision method. The computational results of this method have high accuracy, but the model contains too many vertices of the mesh, which will also cause the problem of relatively high consumption of data computation. The consumption here includes the following: 1. Consumption of searching for geometry within the 3D space provided in the virtual game scene: It is necessary to discover which collision bounding boxes are likely to collide, and a smaller number of collision bounding boxes indicates lower consumption. 2. Consumption of physical intersections between the above geometry: Simpler geometric intersections indicate lower consumption. 3. Consumption of physical utilization: Less utilization indicates lower consumption.

[0006] In other words, the consumption required to perform collision calculations for virtual objects colliding with the virtual scene provided by the related technology is relatively high; this increases operational difficulty when processing collision data of colliders corresponding to virtual objects, resulting in a problem of low processing efficiency.

[0007] The embodiments of this application provide a collision data processing method and apparatus, a storage medium, and an electronic device that help solve the technical problem of relatively low processing efficiency caused by high operational difficulty when processing collision data in the related technology.

[0008] According to one aspect of an embodiment of this application, a method for processing collision data performed in an electronic device is provided. The method comprises the steps of: determining a target collider to be processed in a virtual scene, wherein the target collider is a convex polyhedron containing vertices; obtaining a distance relationship between individual vertices on the target collider, wherein the distance relationship is used to characterize the shape features of the target collider; and, when the target collider is converted into a regular geometry according to the distance relationship, converting the vertex data of the target collider according to a data format that aligns with the regular geometry in order to obtain collision data of the target collider.

[0009] According to another aspect of an embodiment of this application, a collision data processing device is provided, the device comprising: a first determination unit configured to determine a target collider to be processed in a virtual scene—the target collider is a convex polyhedron including vertices—; a first acquisition unit configured to acquire distance relationships between individual vertices on the target collider—the distance relationships are used to characterize the shape features of the target collider—and a first processing unit configured to convert vertex data of the target collider according to a data format that matches the normal geometry in order to acquire collision data of the target collider when converting the target collider into a normal geometry according to the distance relationships.

[0010] According to another aspect of an embodiment of this application, a computer-readable storage medium is further provided, wherein the computer-readable storage medium stores a computer program, and the computer program is configured to implement a crash data processing method when executed.

[0011] According to another aspect of an embodiment of this application, an electronic device is further provided, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor configured to implement a crash data processing method by utilizing the computer program.

[0012] According to another aspect of an embodiment of this application, a computer program product is further provided, the computer program product comprises computer instructions stored in a computer-readable storage medium, and when the computer instructions are executed by a processor, the processor enables a crash data processing method. Brief explanation of the drawing

[0013] The accompanying drawings described herein are used to provide further understanding of this application and form part of this application. Exemplary embodiments and descriptions of this application are used to explain this application and do not constitute any inappropriate limitation to this application. In the accompanying drawings: FIG. 1 is a schematic diagram of the hardware environment of an arbitrary collision data processing method according to an embodiment of this application. FIG. 2 is a flowchart of a collision data processing method according to an embodiment of this application. FIG. 3 is a schematic diagram of an arbitrary collision data processing method according to an embodiment of this application. FIG. 4 is a schematic diagram of another arbitrary collision data processing method according to an embodiment of this application. FIG. 5 is a schematic diagram of another arbitrary collision data processing method according to an embodiment of this application. FIG. 6 is a schematic diagram of another arbitrary collision data processing method according to an embodiment of this application. FIG. 7 is a schematic diagram of another arbitrary collision data processing method according to an embodiment of this application. FIG. 8 is a flowchart of another arbitrary collision data processing method according to an embodiment of this application. FIG. 9 is a schematic diagram of an arbitrary collision data processing device according to an embodiment of this application. FIG. 10 is a schematic structural diagram of any electronic device according to an embodiment of this application. Specific details for implementing the invention

[0014] To enable a person skilled in the art to better understand the solution of this application, the technical solution of the embodiments of this application is described clearly and completely below with reference to the accompanying drawings in the embodiments of this application. Clearly, the described embodiments are not all of the embodiments, but only a part of the embodiments of this application. Any other embodiments obtained by a person skilled in the art based on the embodiments of this application without creative effort will fall within the scope of protection of this application.

[0015] In the specification, claims, and accompanying drawings of this application, terms such as “first,” “second,” etc. are intended to distinguish similar objects but do not necessarily indicate a specific order or sequence. It should be understood that the data used are interchangeable where appropriate, and that the embodiments of this application described herein may be implemented in an order other than that illustrated or described herein. Additionally, the terms “include,” “has,” and any variations thereof are intended to encompass non-exclusive inclusions. For example, a process, method, system, product, or device comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such process, method, product, or device.

[0016] According to one aspect of an embodiment of this application, a collision data processing method is provided. The above collision data processing method may be applied to a collision data processing system within a hardware environment as illustrated in FIG. 1, but is not limited thereto. The collision data processing system may include a terminal device (102), a network (104), a server (106), and a database (108), but is not limited thereto. A target client logged in using a target user account operates on the terminal device (102) (a game client used as the target client as illustrated in FIG. 1 is taken as an example). The terminal device (102) includes a human-computer interaction screen, a processor, and memory. The human-computer interaction screen is configured to display a virtual scene (a virtual game scene within a game operation will be presented at a display interface as illustrated in FIG. 1), and is also configured to provide a human-computer interaction interface to receive human-computer interaction actions for controlling a virtual object. A virtual object can detect interactions of its physical properties occurring in the virtual scene through a target collider configured for the virtual object; that is, it can detect whether a collision occurs between the target collider and the virtual object, but is not limited to this. The processor is configured to generate interaction commands in response to human-computer interaction actions and to transmit the interaction commands to the server. Memory is configured to store the relevant attribute data of the virtual object.

[0017] Additionally, the server (106) includes a processing engine configured to perform a storage or reading operation on the database (108). Specifically, the processing engine is configured to determine whether a target collider can be converted into a normal geometry based on distance relationships, and if it is determined that the target collider can be converted into a normal geometry, to convert the vertex data of the target collider according to a data format that matches the normal geometry and to store it in the database (108). The processing engine is also configured to read simply processed collision data from the database (108) for collision calculation.

[0018] A specific process includes the following steps: In step (S102), the server (106) obtains a target collider (100) to be processed in a virtual scene determined by a terminal device (102) by using a network (104) (which may be a collider corresponding to the body part of a virtual object as illustrated in FIG. 1). The target collider here is a convex polyhedron containing vertices. Next, in steps (S104) through (S106), the server (106) obtains distance relationships between individual vertices on the target collider, and in the case of converting the target collider into a normal geometric structure according to the distance relationships, converts the vertex data of the target collider according to a data format that matches the normal geometric structure in order to obtain collision data of the target collider.

[0019] In this embodiment, after a target collider to be processed within a virtual scene is determined, the distance relationships of individual vertices on the target collider are obtained. Whether the target collider can be converted into a normalized geometric structure having a simplified structure is then determined based on the distance relationships. If it is determined that the target collider can be converted into a normalized geometric structure, the vertex data of the target collider is converted according to a data format that matches the normalized geometric structure, and simplified collision data of the target collider is obtained. Accordingly, a target collider having a sophisticated structure can be converted into a normalized geometric structure having a simplified structure, and the collision data of the collider is stored in a data format that matches the normalized geometric structure. The collision operation is performed using the simplified collision data, thereby reducing the computational consumption of the electronic device for the collision data and improving the processing efficiency of the electronic device for the collision data, and thereby overcoming the problem of low processing efficiency for collision data in the related technology.

[0020] In one embodiment, the above terminal device may be configured as a target client and may include, but is not limited to, at least one of the following: a mobile phone (Android mobile phone and iOS mobile phone), a laptop, a tablet, a palmtop, a mobile Internet device (MID), a PAD, a desktop, a smart television, etc. The target client may be a video client, an instant messaging client, a browser client, an educational client, etc., provided with a virtual object that requires physical interaction. The virtual object will perform interactive collision actions by using a collider. The above network may include a wired network and a wireless network, but is not limited thereto. A wired network includes a local area network, a metropolitan area network, and a wide area network. A wireless network includes Bluetooth, Wi-Fi, and other networks that achieve wireless communication. A server may be a single server, a server cluster composed of multiple servers, or a cloud server. The foregoing description is merely an example and is not limited to this embodiment.

[0021] In one embodiment, as illustrated in FIG. 2, the above collision data processing method may be performed, for example, in an electronic device. The electronic device is, for example, a terminal device or a server as illustrated in FIG. 1. The method comprises the following:

[0022] S202. Determine a target collider to be processed within a virtual scene, and the target collider is a convex polyhedron containing vertices.

[0023] The target collider may be a collider constructed for a virtual object within the virtual scene (e.g., a 3D object within the virtual scene), but is not limited thereto. The virtual object described herein may be a dynamic object appearing in the virtual scene, such as a user-controlled virtual character, a virtual prop or carrier, or a pre-constructed static object, such as a house building or a factory landscape, but is not limited thereto. The collider may be a carrier constructed for the virtual object and used to detect collisions occurring during the interaction process, but is not limited thereto. The structure of the target collider in this embodiment is complex, and this is a structure designed for a fit based on the structural framework of the virtual object itself (such as the skeletal framework of a virtual character and the reinforced structural framework of a house building), that is, the convex polyhedron includes a plurality of vertices.

[0024] S204. Obtain distance relationships between individual vertices on the target collider. Distance relationships are used to characterize the shape features of the target collider.

[0025] In the relevant technology, electronic devices have relatively high consumption for collision operations. Typically, due to the relatively complex geometric structure of the collider, a large amount of vertex data needs to be introduced, resulting in relatively high data computation consumption during collision operations and artistic creation. To overcome the above problem, this embodiment simplifies the structure of the target collider based on the distance relationship between individual vertices on the target collider, converts the target collider into a normalized geometric structure having the simplified structure, and provides a method for storing collision data in the normalized geometric structure, thereby improving the operational efficiency of the electronic device for processing collision data of the collider (e.g., improving the operational efficiency of determining whether the collider collides).

[0026] In one embodiment, distance relationships between individual vertices are used to characterize the results of comparing distances between individual vertices. Distance relationships may reflect the shape features of the target collider. Individual vertices on the target collider are traversed, and each vertex is used as the current vertex. Multiple distances between all other vertices (i.e., vertices other than the current vertex) and the current vertex are obtained separately. The above distance relationships may be multiple distance relationships. Distance relationships may be used to recognize the target collider as a normalized geometry having a structure similar to the target collider. Normalized geometry may include, but is not limited to, rectangular solids and cylinders. Vertex data of the target collider will be converted according to the data format of a normalized geometry similar to the target collider; that is, the format of the vertex data is converted into the data format of a normalized geometry similar to the target collider, thereby achieving the purpose of simplifying the collision data of the collider.

[0027] S206. When converting a target collider into a normalized geometric structure based on distance relationships, the vertex data of the target collider is converted according to a data format that matches the normalized geometric structure in order to obtain collision data of the target collider. The data format of the collision data matches the data format of the normalized geometric structure. The collision data of the target collider is used to characterize the target collider having a simplified structure; that is, the collision data characterizes the shape features of the normalized geometric structure.

[0028] In one embodiment, the data format corresponding to the normalized geometry may be a format corresponding to the index parameter of the normalized geometry, but is not limited thereto. For example, if the normalized geometry is a rectangular prism, the index parameter of the normalized geometry may include the center point coordinates of an oriented bounding box and a direction of convergence, but is not limited thereto. If the normalized geometry is a cylinder, the index parameter of the normalized geometry may include the center point coordinates and a radius, but is not limited thereto. This is exemplary and is not intended to be limited in this embodiment.

[0029] Additionally, in one embodiment, the rectangular solids within the regular geometry may include, but are not limited to, a standard rectangular solid and a reference rectangular solid. The reference rectangular solid may have a structure similar to that of a standard rectangular solid, i.e., an approximate rectangular solid, but is not limited to.

[0030] In one embodiment, after a normalized geometry is determined as a reference cuboid, the convex features of the reference cuboid may also be extracted to further recognize the structure specifically corresponding to the reference cuboid in the virtual scene (e.g., feature extraction is performed on the convex side of the reference cuboid), but are not limited thereto. As in the reference cuboid, the relationship between the three axis edge lengths representing length, width, and height is as follows: if two of the axis edge lengths are less than the third axis edge length and significantly less than this, the target collider is recognized as a wood stick. If one axis edge length is less than the other two axis edge lengths and significantly less than this, the target collider may be recognized as a roof. The three axis edge lengths are three values ​​of length, width, and height in the reference cuboid. This is exemplary and is not intended to be limited in this embodiment.

[0031] In one embodiment, the above collision data processing method may be applied to a data optimization process for a collider corresponding to a single virtual object model, but is not limited thereto, or may perform simplified optimization processing in batch on data for colliders corresponding to all virtual object models within a virtual scene, thereby improving the processing efficiency of electronic data for collision data.

[0032] Additionally, in one embodiment, different accuracys may also be selected for processing collision data depending on different specific applications, but are not limited thereto. For example, when the collision data processing method is applied to a client, there is a relatively high requirement for the accuracy of the collision data processing. When the collision data processing method is applied to a server, there is a relatively low requirement for the accuracy of the collision data processing. The accuracy here may be the data accuracy during the transformation of the collision data, but is not limited thereto. By processing collision data at different accuracys, the art designer will not need to learn in depth about the simplification optimization algorithm and its parameters, thereby conveniently providing processing operations with individual accuracys, which achieves the purpose of simplifying processing operations and improving the processing efficiency of the electronic device.

[0033] According to the embodiment provided by this application, after a target collider to be processed within a virtual scene is determined, the distance relationships of individual vertices on the target collider are obtained. Whether the target collider can be converted into a normal geometric structure having a simplified structure is then determined based on the distance relationships. If it is determined that the target collider can be converted into a normal geometric structure, the vertex data of the target collider is converted according to a data format that matches the normal geometric structure, and simplified collision data of the target collider is obtained. Accordingly, a target collider having a sophisticated structure can be converted into a normal geometric structure having a simplified structure, and the collision data of the collider is stored in a data format that matches the normal geometric structure. The collision operation is performed using the simplified collision data, thereby achieving the effect of reducing computational consumption for the collision data and improving processing efficiency for the collision data, whereby the problem of low processing efficiency of electronic devices for collision data in the related technology is overcome.

[0034] Obtaining distance relationships between individual vertices on a target collider in an arbitrary manner includes the following:

[0035] When the number of vertices on the target collider reaches a first threshold, the distance relationship between multiple edges connected to each vertex on the target collider is obtained separately. That is, the result of comparing the lengths of multiple edges is determined.

[0036] Based on this, the collision data processing method may further include converting the target collider into a standard cuboid when the distance relationship indicates that three edges connected to one target vertex within the target collider are perpendicular to each other, and the standard geometry includes a standard cuboid. The target vertex is a vertex where three edges connected to the vertex are perpendicular to each other.

[0037] In one embodiment, the first threshold may be the number of vertices of a standard rectangular prism, but is not limited thereto, and the first threshold may be 8, but is not limited thereto. That is, when the number of vertices on the target collider reaches 8, the distance between individual vertices is obtained, and whether the target collider is a standard rectangular prism is recognized based on the relationship between the individual distances.

[0038] In one embodiment, before converting the vertex data of a target collider according to a data format that aligns with a normal geometry in order to obtain collision data of a target collider, the method further comprises the following:

[0039] Determining the current vertex from individual vertices on the target collider, and determining the first reference point and the second reference point closest to the current vertex;

[0040] Obtaining the first distance between the current vertex and the first reference point, and the second distance between the current vertex and the second reference point;

[0041] The third distance is determined based on the first and second distances - the third distance is the length of the hypotenuse of the right triangle, and the right triangle takes the first and second distances as the lengths of the right edges -;

[0042] Determine the third reference point from individual vertices on the target collider, excluding the current vertex, the first reference vertex, and the second reference point, based on the third distance - the distance between the current vertex and the third reference point is the third distance -;

[0043] Determining the reference plane of the target collider according to the first reference point, the second reference point, and the third reference point;

[0044] Determining the fourth reference point closest to the current vertex from individual vertices excluding the current vertex, the first reference vertex, the second reference point, and the third reference point on the target collider - the connection line between the fourth reference point and the current vertex is perpendicular to the reference plane -; and

[0045] Determine the current vertex as the target vertex, and determine the convergence direction of the oriented boundary setting box that aligns with the standard rectangular prism according to the first distance, the second distance, and the fourth distance between the current vertex and the fourth reference point - the vertex data includes the direction vector of the convergence direction of the oriented boundary setting box -.

[0046] A detailed explanation will be provided with reference to the target collider illustrated in FIG. 3:

[0047] When it is determined that the number of vertices of the target collider reaches 8, a traversal calculation is started at an arbitrary point. The calculation is assumed to start at vertex A, which serves as the current vertex, as illustrated in FIG. 3: the two vertices closest to vertex A, B (i.e., the first reference point) and C (the second reference point), are obtained. The distance between A and B corresponds to L1 (the thick horizontal line as illustrated in FIG. 3, i.e., the first distance), and the distance between A and C corresponds to L2 (the thick vertical line as illustrated in FIG. 3, i.e., the second distance). According to the rule of rectangles, vertices A, B, and C are adjacent vertices, and AB can be determined to be perpendicular to AC.

[0048] The distance of the hypotenuse AC of triangle ABC is calculated as Lx based on the individual positions and distances L1 and L2 of vertices B and C. The remaining vertices on the target collider are traversed to obtain the distance between each vertex and vertex A in turn. Additionally, vertex D (i.e., the third reference point), which is spaced apart from vertex A at a distance of Lx (i.e., the third distance), is determined as the last point of the plane on which triangle ABC is located (i.e., the reference plane).

[0049] The distance from vertices other than vertices B, C, and D to vertex A is to find the vertex E closest to vertex A, and thus AB, AC, and AE are determined from the geometric relationship of the cuboid as three mutually perpendicular edges within the cuboid. The vectors corresponding to each of the three edges can be determined as the forward vector, right vector, and up vector of the standard cuboid. The lengths of the three edges are traversed and compared. The longest edge AE (that distance is the fourth distance) is recognized as the forward vector of the cuboid and is determined as the exact convergence direction of the currently recognized oriented bounding box (OBB) of the standard cuboid.

[0050] According to an embodiment of this application, when the number of vertices on a target collider reaches a first threshold and three edges connected to the target vertex are perpendicular to each other, the target collider is recognized as a standard rectangular prism. Next, the convergence direction of the OBB of the standard rectangular prism is determined based on the distance relationship between the target vertex and other vertices. The vertex data of the above target collider is converted according to a data format corresponding to a standard rectangular prism, and collision data is obtained that converts the target collider into a simplified standard rectangular prism. By doing so, the effect of simplifying the collision data is achieved, and the processing efficiency of an electronic device using the collision data for collision operations is improved.

[0051] Obtaining distance relationships between individual vertices on a target collider in an arbitrary manner includes the following:

[0052] S1. When the quantity of vertices on the target collider reaches the first threshold, the center coordinate point of all vertices on the target collider is determined. The center coordinate point is the average value of the coordinate values ​​of all vertices.

[0053] S2. Obtain the distance relationship between individual vertices and center coordinate points. The distance relationship corresponding to an arbitrary vertex is used to characterize the distance between the vertex and the center coordinate point.

[0054] In one embodiment, based on determining a distance relationship, the collision data processing method may further include the following:

[0055] 1) Determining that a target collider is recognized as a reference cuboid when the distance relationship between an individual vertex and a center coordinate point is less than a first distance threshold - the normalized geometry includes a reference cuboid -; and

[0056] 2) When determining at least two groups of parallel surfaces based on the distance relationships of individual vertices, determining that the target collider is recognized as a reference cuboid—normal geometry includes a reference cuboid—. Each group of parallel surfaces includes two mutually parallel surfaces. For example, each of the two mutually parallel surfaces includes four vertices.

[0057] Not all colliders appearing in the virtual scene may be standard rectangular prisms, but most of them are approximate rectangular prisms (i.e., reference rectangular prisms that can also be referred to as standard approximate rectangular prisms). Accordingly, in this embodiment, it is also possible to determine whether a target collider is a standard approximate rectangular prism by at least one of the following methods: 1) if the distance between all vertices on the collider and a center coordinate point is approximately the same (i.e., the distance between each individual vertex and the center coordinate point is all less than a first distance threshold), the collider may be determined to be recognized as a standard approximate rectangular prism. 2) if at least two groups of planes approximately parallel to each other exist at eight vertices of the collider (i.e., at least two groups of parallel surfaces are determined based on individual vertices), the collider may be determined to be recognized as a standard approximate rectangular prism.

[0058] In one embodiment, after determining that a target collider is recognized as a reference cuboid, the collision data processing method further comprises: obtaining a first volume value corresponding to the target collider and a second volume value corresponding to the reference cuboid; determining the ratio of the first volume value to the second volume value; and determining that the target collider is converted into a reference cuboid when the ratio reaches a second threshold.

[0059] The second threshold here may vary and is set for different specific usage scenarios, but is not limited thereto. For example, when the collision data processing method is applied to a client, there is a relatively high requirement for the accuracy of the collision data processing, and the threshold here may be set to a relatively large value. When the collision data processing method is applied to a server, there is a relatively low requirement for the accuracy of the collision data processing, and the threshold here may be set to a relatively small value. The second threshold is 1 or less.

[0060] For example, assuming the second threshold is 1, when the ratio of the first volume value V1 corresponding to the target collider to the second volume value V2 corresponding to the reference cuboid is p, the ratio p is compared with the second threshold 1. When p = 1, it is determined that the target collider recognized as the reference cuboid can be converted into the reference cuboid. However, when the ratio is less than the second threshold of 1, it indicates that there is a large difference between them, and the target collider recognized as the reference cuboid does not need to be converted into the reference cuboid, so that the vertex data of the target collider does not need to be converted into collision data that matches the data format of the reference cuboid.

[0061] According to this embodiment of the application, when it is determined that the distance between each individual vertex and a center coordinate point is all less than a first distance threshold, or that at least two groups of parallel surfaces exist at each vertex, the target collider is recognized as a reference cuboid (approximate cuboid). In this case, the reliability of the above approximate recognition result is verified by using the volume comparison result between the target collider and the reference cuboid. When the volume comparison result indicates that the threshold condition is satisfied, it is determined to convert the vertex data of the target collider into collision data simplified into a format corresponding to the reference cuboid, thereby achieving the effect of improving the processing efficiency of an electronic device that uses collision data for collision operations.

[0062] After determining, in an arbitrary manner, that the target collider is transformed into a reference cuboid, the collision data processing method further includes:

[0063] S1. Determine the projection plane corresponding to the reference rectangular prism.

[0064] S2. To obtain projection points corresponding to each individual vertex, map each vertex on the reference cuboid to a projection plane.

[0065] S3. To obtain a first plane vertex set and a second plane vertex set, individual vertices are grouped according to the projection distance between a vertex and a corresponding projection point, and vertices within the first plane vertex set are located on the first plane, and vertices within the second plane vertex set are located on the second plane.

[0066] S4. When the first plane is parallel to the second plane, the convergence direction of the oriented boundary setting box that aligns with the reference rectangular prism is determined according to the first plane and the second plane, and the vertex data includes a direction vector of the convergence direction of the oriented boundary setting box.

[0067] After the target collider is recognized as a reference cuboid, the target collider also needs to be converted into a collision box, and the convergence direction of the OBB corresponding to the boundary setting box is recognized. As an optional embodiment, the convergence direction of the OBB of the reference cuboid may be determined using a projection plane-separated axis OBB convergence algorithm, but is not limited thereto.

[0068] A detailed explanation will be provided with reference to the target collider illustrated in FIG. 4:

[0069] The target collider is assumed to be recognized as a reference cuboid as shown in FIG. 4, the projection plane corresponding to the reference cuboid is determined to be a plane formed by the dot filling region shown in FIG. 4, and the vertical plane is perpendicular to the horizontal plane.

[0070] All vertices on the reference cuboid are then traversed. Vertex A is used again for the purpose of explanation. The projection point A1 of vertex A on the projection plane is calculated, and then the projection points corresponding to each other vertex on the projection plane are obtained. The projection point B1 of vertex B on the projection plane is additionally assumed to be the closest to projection point A1 (the distance between the dashed line A1B1 as shown in the drawing). The individual projection distances of AA1 and BB1 are then compared, and vertex A and vertex B are classified as a far plane point and a near plane point based on the result of the distance comparison.

[0071] After the transverse process for all vertices on the reference cuboid is completed, four far-plane vertices and four near-plane vertices will be determined from the eight vertices of the reference cuboid, namely, the first set of plane vertices and the second set of plane vertices. If a vertex in the first set of plane vertices is located on the first plane and a vertex in the second set of plane vertices is located on the second plane, and the first plane and the second plane are two approximately parallel planes, the reference cuboid may be further determined to be an approximately cuboid. The three axial directions of the determined reference cuboid, namely forward, right, and top, are then recognized in the above manner based on the manner described herein.

[0072] After the three axis directions are determined, all vertices on the reference cuboid are traversed again for calculation and projected separately in the three axis directions to obtain maximum and minimum values. The average value in each axis direction is calculated based on the maximum and minimum values ​​here, namely half the edge length value of ExtendX in the X-axis direction, half the edge length value of ExtendY in the Y-axis direction, and half the edge length value of ExtendZ in the Z-axis direction. The exact convergence direction of the OBB is then obtained by convergence.

[0073] When the OBB convergence algorithm is not used, the display effect of the collider may be as shown in the left figure of Fig. 5, which shows a serious mismatch. After the orientation of the OBB is roughly calculated, the display effect may be as shown in the middle figure of Fig. 5, which is still not sufficiently aligned, but the orientation is correct. However, after the full OBB convergence algorithm is used, the display effect may be as shown in the right figure of Fig. 5, which can be accurately aligned with the original model.

[0074] According to an embodiment of this application, a projection plane-separated axis OBB convergence algorithm is used to determine a more accurate convergence direction for a reference cuboid, thereby facilitating the conversion of target collision data into collision data that is easy to store and process.

[0075] After determining, in an arbitrary manner, that the target collider is transformed into a reference cuboid, the collision data processing method further includes:

[0076] S1. Determine a forward vector corresponding to the geometric center point of a reference rectangular prism, and determine a vertical plane containing the forward vector.

[0077] S2. Rotate the vertical plane a number of times (e.g., N times, where N is a positive integer) by taking the direction of the forward vector as the axis, and perform the following operation after each rotation:

[0078] To obtain a third plane vertex set and a fourth plane vertex set, individual vertices on a reference cuboid are grouped according to the vertical distance from each individual vertex to the vertex plane, and vertices within the third plane vertex set are located on the third plane, and vertices within the fourth plane vertex set are located on the fourth plane.

[0079] S3. When the third plane is parallel to the fourth plane, the convergence direction of the oriented boundary setting box that aligns with the reference rectangular prism is determined according to the third plane and the fourth plane, and the vertex data includes a direction vector of the convergence direction of the oriented boundary setting box.

[0080] After the target collider is recognized as a reference cuboid, the target collider also needs to be converted into a collision box, and the convergence direction of the OBB corresponding to the boundary setting box is recognized. As an optional embodiment, the convergence direction of the OBB of the reference cuboid may be determined using a rotation recursion OBB convergence algorithm, but is not limited thereto.

[0081] Details are explained in combination with the following example. Horizontal rotation recursion is taken as an example.

[0082] The forward vector is generated based on the geometric center point of the reference rectangular prism, and the recursive operation is performed by rotation around the axis in the forward direction by 0 to 360 degrees based on the vertical plane in the forward direction.

[0083] Each recursive rotation involves controlling the vertical plane to rotate by 1 degree around an axis, and calculating the vertical distance from all vertices on the reference cuboid to the vertical plane above in this angular state; classifying vertices with approximately the same vertical distance into one group in order to obtain multiple groups of sets of vertices having approximately the same distance;

[0084] After the result of the recursive rotation operation is obtained by completing the 360-degree rotation process, the maximum number of sets of vertices having approximately the same distance from the vertical plane is determined and is determined to be equal to the set of candidate plane vertices; and the determination of whether the plane determined based on the set of candidate plane vertices is parallel to the reference vertical plane above is further determined. If the plane is determined to be parallel to the vertical plane, the reference cuboid is further determined to be an approximate cuboid. The three axial directions of the determined reference cuboid, namely forward, right, and upward, are then recognized in the above manner based on the manner described herein.

[0085] After the three axis directions are determined, all vertices on the reference cuboid are traversed again for calculation and projected separately in the three axis directions to obtain maximum and minimum values. The average value in each axis direction is calculated based on the maximum and minimum values ​​here, namely half the edge length value of ExtendX in the X-axis direction, half the edge length value of ExtendY in the Y-axis direction, and half the edge length value of ExtendZ in the Z-axis direction. The exact convergence direction of the OBB is then obtained by convergence.

[0086] According to an embodiment of this application, a rotational recursive OBB convergence algorithm is used to determine a more accurate convergence direction for a reference cuboid, thereby facilitating the conversion of target collision data into target collision data that is easy to store and process.

[0087] After determining the ratio of the first volume value to the second volume value in an arbitrary manner, the collision data processing method further comprises the following:

[0088] Extracting convex features of the reference cuboid when the ratio does not reach the second threshold - the convex surface features include the edge lengths of the three axis edges corresponding to the reference cuboid, and the three axis edges are mutually perpendicular edges within the reference cuboid -;

[0089] Determining that the reference rectangular prism is converted into a long stick-type rectangular prism when both the first difference value between the edge length of the first axis edge and the edge length of the third axis edge, and the second difference value between the edge length of the second axis edge and the edge length of the third axis edge exceed the second distance threshold; and

[0090] Determining that the reference cuboid is converted into a roof-like cuboid when both the third difference value between the edge length of the first axis edge and the edge length of the second axis edge, and the fourth difference value between the edge length of the first axis edge and the edge length of the third axis edge exceed the third distance threshold.

[0091] The transformation method provided in the above method in this embodiment supports transforming most obvious collider convex hulls into rectangular prisms or other regular geometric structures (such as cylinders or capsules), but there are still some special colliders that differ significantly, and these cannot directly complete an accurate and simplified transformation process. These special colliders may have distinct geometric features, but are not limited to this.

[0092] In one embodiment, the geometric features referenced to transform the special collider above may include, but are not limited to, the following convex features: the distance relationship between the three axis edges of the OBB recognized in the reference cuboid.

[0093] For example, if two of the three axis edges are relatively short and much shorter than the third axis edge, the reference cuboid here will be converted into a long stick-type cuboid. If one of the three axis edges is relatively short and much shorter than the other two axis edges, the reference cuboid will be converted into a roof-like cuboid.

[0094] According to an embodiment of this application, some specific colliders are further recognized and transformed based on some recognizable convex features, and the transformation is performed according to a determined specific rectangular prism data format, thereby achieving the effect of simplifying the collider collision data.

[0095] After obtaining the distance relationship between individual vertices and center coordinate points in an arbitrary manner, the collision data processing method includes the following:

[0096] S1. If the target collider is determined to be a non-reference rectangular solid, the geometric center point of the target collider is obtained.

[0097] S2. Obtain the connection line distance from individual vertices on the target collider to the geometric center point.

[0098] S3. When the difference value between individual connection line distances is less than the third threshold, the target collider is recognized as a cylinder, and the normal geometry includes a cylinder.

[0099] S4. Construct the spatial function of the cylinder based on the coordinates of the geometric center point and the radius of the cylinder, and the vertex data includes the spatial function of the cylinder.

[0100] If the number of vertices of the target collider is not the first threshold, and it is determined that the target collider does not satisfy the recognition condition for a rectangular prism, it may be additionally determined whether the target collider satisfies the recognition condition for a cylinder.

[0101] For example, the geometric center point is determined by individual vertices on the target collider. The distance from each vertex to the vertical vector of the geometric center point (i.e., the distance of the connecting line from each vertex and the geometric center point). If the distance from all vertices to the geometric center point is approximately the same (i.e., the difference between the individual connecting line distances is less than the third threshold), the target collider, which is not a reference cuboid, is recognized as a cylinder.

[0102] Next, the spatial function of the cylinder is directly constructed based on the coordinates and radius of the center point of the recognized cylinder's geometry, and the vertex data of the target collider, having a sophisticated structure according to the format of the spatial function that aligns with the cylinder, is transformed.

[0103] The upper and lower radii of the recognized cylinder are different. If the recognized cylinder likely has a large upper portion and a small lower portion, alignment is required, and cutting division is performed. When a complex convexity is divided and merged into multiple simple boundary boxes, the cutting division method of the cylinder may be similar to the cutting division method of the convex decomposition algorithm, but is not limited thereto.

[0104] According to an embodiment of this application, when the target collider is not a reference rectangular prism, it is determined whether the target collider can be recognized as a cylinder. When the target collider is recognized as a cylinder, the data of the target collider that aligns with the cylinder is determined, thereby facilitating simplified conversion. By doing so, the operational complexity of storing the collision data of the target collider is reduced, and the processing efficiency of an electronic device for retrieving the stored collision data to perform collision operations is improved.

[0105] In an arbitrary manner, before converting the vertex data of a target collider according to a data format that aligns with a normal geometry to acquire collision data of a target collider, the collision data processing method includes the following:

[0106] S1. Divide the target collider by using equidistant boundary setting boxes to acquire multiple collision sub-bodies.

[0107] S2. Determine the intersection points of the connection lines between individual vertices on the target collider and individual sub-colliders among multiple sub-colliders.

[0108] S3. To obtain a bounding sub-box corresponding to the sub-collision, convergence combinations are performed sequentially on the intersection points within each sub-collision.

[0109] S4. In order to traverse individual bounding sub-boxes and obtain a bulk bounding box corresponding to a target collider, bounding sub-boxes having a size difference value less than the fourth threshold are merged.

[0110] S5. Take the vertex data of the bulk boundary setting box as the vertex data of the target collider.

[0111] In this embodiment, for a convex part having a complex structure, a convex part decomposition algorithm may be used to divide a complex target collider and merge it into a plurality of simple boundary setting boxes, but is not limited thereto.

[0112] A detailed explanation will be provided with reference to the flow of the convex decomposition algorithm illustrated in Fig. 6:

[0113] The target collider (hereinafter referred to as the convex part) is assumed to be a cone as illustrated in FIG. 6 (a). As illustrated in FIG. 6 (b), the convex part is selected for division. When the convex part is divided into multiple sub-collisors by using an equidistant boundary setting box configured at a unit distance according to the size of the convex part, three identical-sized rectangular prisms as illustrated in FIG. 6 (c) can be obtained as the result of the division.

[0114] Next, the intersection points of the connection lines between individual vertices on the target collider and individual sub-colliders are determined. For example, the convexity shown in FIG. 7(a) is the convexity shown in FIG. 6(a). As shown in FIG. 7(b), the upper intersection process is performed upward based on the lower vertices, and the lower intersection process is performed downward based on the upper vertices. Here, intersection means determining the intersection points.

[0115] The intersection points within each sub-collision are successively converged and combined to obtain a boundary box occupying a small space, that is, a boundary box composed of all intersection points. The boundary box illustrated by the dashed box in FIG. 6(d) is a boundary sub-box (represented by the thick solid line in the figure) obtained by converging the boundary boxes after equidistant division in FIG. 6(c). The size of the above boundary sub-box is then determined. Boundary boxes having similar sizes below a threshold (i.e., the difference value in size is below the fourth threshold) are merged into one larger boundary box (i.e., a bulk boundary box). As illustrated in FIG. 6(e), two boundary sub-boxes are merged into one larger boundary box.

[0116] According to an embodiment of this application, since the target collider is divided based on an equidistant boundary setting box, the target collider is simplified into sub-coliders occupying a smaller space, and the sub-coliders are then combined and merged, which achieves the purpose of simplifying the structure of the target collider and obtaining simplified collision data.

[0117] As an arbitrary method, after converting the target collider into a normalized geometry based on distance relationships, the collision data processing method further includes the following:

[0118] S1. When a normalized geometry includes multiple subnormalized geometryes, determine the size of the subnormalized geometryes.

[0119] S2. If the difference between the sizes of two adjacent subnormal geometric figures is less than the fifth threshold, merge the two adjacent subnormal geometric figures.

[0120] S3. If the difference between the size of the first subnormal geometry and the size of the second subnormal geometry within multiple subnormal geometryes is less than the sixth threshold, and the first subnormal geometry is located inside the second subnormal geometry, the first subnormal geometry is culled.

[0121] When a normalized geometry contains multiple subnormalized geometryes, additional processing may be performed using a combinational merging algorithm and a small object culling algorithm, but is not limited thereto. The combinational merging algorithm is intended to merge two connected cuboids that have a small size or containment relationship into a single cuboid (i.e., the difference between the sizes of two adjacent subnormalized geometryes is less than the fifth threshold). The above small object culling algorithm is intended to directly culle any bounding box that is much smaller than the enclosing bounding box (i.e., the difference between the sizes of the first subnormalized geometry and the second subnormalized geometry is less than the sixth threshold) and is embedded within another bounding box.

[0122] Additionally, in this embodiment, error checking may be performed after the transformation is completed, but is not limited thereto. Each vertex of the transformed cuboid is compared with each vertex of the original target collider. If the error is less than the error range, the transformation is indicated as successful, or otherwise, the transformation is not allowed.

[0123] According to an embodiment of this application, in order to facilitate obtaining simplified collision data, integrated simplification will be performed on a complex normal geometry comprising a plurality of sub-normal geometries by a combination merging method and a small object culling method.

[0124] In an arbitrary manner, transforming the vertex data of a target collider according to a data format that aligns with a normalized geometry to obtain collision data of a target collider includes transforming the vertex data of the target collider according to a data format of a geometry index that aligns with a normalized geometry to obtain collision data.

[0125] Optionally, in this embodiment, if the target collider is transformed into a rectangular prism, the transformation and storage are performed according to the data format of the geometric index corresponding to the rectangular prism. For example, the coordinates of the center coordinate point and the direction vector of the OBB's convergence direction are stored. If the target collider is transformed into a cylinder, the transformation and storage are performed according to the data format of the geometric index corresponding to the cylinder. For example, the geometric center point, radius, etc. of the cylinder are stored.

[0126] According to an embodiment of this application, vertex data of a target collider is stored according to a data format of a geometric index that corresponds to a normalized geometric structure, which simplifies the storage method of collision data of a target collider having a complex structure, and thereby improves processing efficiency for retrieving collision data to perform a collision operation.

[0127] Specifically, an explanation is provided with reference to the example illustrated in FIG. 8.

[0128] After the target collider is acquired, it is physically simplified. It is first determined whether the target collider is a capsule (i.e., a cylinder). If the target collider is a capsule, the target collider is directly converted into a capsule that is easy to process, and the vertex data of the target collider is converted and stored according to the data format corresponding to the capsule. The conversion process may refer to the flow of a reference cuboid (such as a box), identical to the following.

[0129] If it is determined that the target collider is a standard cuboid rather than a capsule, a box transformation flow is utilized to accurately transform the target collider into a standard cuboid, and the convergence direction of the corresponding OBB is calculated. To obtain collision data, the vertex data of the target collider is transformed according to the data format of the standard cuboid. Methods for calculating the convergence direction of the OBB include a projection plane solving method and a rotation recursion solving method. The transformed standard cuboid undergoes combination merging or small object culling and error checking. After successful verification, the transformed collision data is exported for use.

[0130] If it is determined that the target collider is a standard approximate cuboid rather than a capsule, a large box approximate transformation flow is adopted, whereby the target collider is decomposed by unit partitioning and independent convergence, and subsequently, the decomposed boundary boxes are merged. To acquire collision data, the vertex data of the target collider is transformed according to the standard approximate cuboid data format. Error checking is performed on the collision data. After successful verification, the transformed collision data is exported for use.

[0131] The flow illustrated in FIG. 10 described above is an example and is not limited to this embodiment.

[0132] For the sake of brevity, the above-described method embodiments are expressed as a combination of a series of actions. However, a person skilled in the art should recognize that this application is not limited to the order of the actions described, because, according to this application, some steps may be performed in a different order or simultaneously. It should be further recognized by a person skilled in the art that all embodiments described in this specification belong to preferred embodiments, and that the actions and modules involved are not necessarily required by this application.

[0133] According to another aspect of an embodiment of this application, a collision data processing device for implementing the collision data processing method described above is further provided. As illustrated in FIG. 9, the device comprises the following:

[0134] A first determination unit (902) configured to determine a target collider to be processed within a virtual scene - the target collider is a convex polyhedron including vertices -;

[0135] A first acquisition unit (904) configured to acquire distance relationships between individual vertices on a target collider - distance relationships are used to characterize the shape features of the target collider -; and

[0136] A first processing unit (906) configured to convert vertex data of a target collider according to a data format that matches the regular geometric structure in order to obtain collision data of the target collider when converting the target collider into a regular geometric structure according to distance relationship.

[0137] In this embodiment, the embodiment of the collision data processing device above may refer to, but is not limited to, the method embodiment above and will not be described in detail in this specification.

[0138] In an optional manner, the first acquisition unit includes the following:

[0139] A first acquisition module configured to separately acquire distance relationships between a plurality of edges each connected to each vertex on a target collider when the quantity of vertices on a target collider reaches a first threshold; and

[0140] A first determination module configured to determine that a target collider is transformed into a standard cuboid when the distance relationship indicates that three edges connected to one target vertex within the target collider are perpendicular to each other—normal geometry includes a standard cuboid—. A target vertex is a vertex where three edges connected to the vertex are perpendicular to each other.

[0141] In this embodiment, the embodiment of the collision data processing device above may refer to, but is not limited to, the method embodiment above and will not be described in detail in this specification.

[0142] As an optional method, the collision data processing device further includes the following:

[0143] To acquire collision data of the target collider, before converting the vertex data of the target collider according to a data format that matches the normalized geometry, the following steps:

[0144] A step of determining a current vertex from individual vertices on a target collider, and determining a first reference point and a second reference point closest to the current vertex;

[0145] A step of obtaining a first distance between the current vertex and a first reference point, and a second distance between the current vertex and a second reference point;

[0146] Step of determining the third distance based on the first and second distances - the third distance is the length of the hypotenuse of the right triangle, and the right triangle takes the first and second distances as the lengths of the right edges -;

[0147] A step of determining a third reference point from individual vertices excluding the current vertex, the first reference vertex, and the second reference point on the target collider according to the third distance - the distance between the current vertex and the third reference point is the third distance -;

[0148] A step of determining a reference plane of a target collider according to a first reference point, a second reference point, and a third reference point;

[0149] A step of determining the fourth reference point closest to the current vertex from individual vertices excluding the current vertex, the first reference vertex, the second reference point, and the third reference point on the target collider - the connection line between the fourth reference point and the current vertex is perpendicular to the reference plane -; and

[0150] A second processing unit configured to perform the step of determining a current vertex as a target vertex, and determining the convergence direction of an oriented boundary setting box that aligns with a standard rectangular prism according to a first distance, a second distance, and a fourth distance between the current vertex and a fourth reference point—the vertex data includes a direction vector of the convergence direction of the oriented boundary setting box.

[0151] In this embodiment, the embodiment of the collision data processing device above may refer to, but is not limited to, the method embodiment above and will not be described in detail in this specification.

[0152] In an optional manner, the first acquisition unit includes the following:

[0153] A second determination module configured to determine the center coordinate points of all vertices on the target collider when the quantity of vertices on the target collider reaches a first threshold;

[0154] A second acquisition module configured to acquire distance relationships between individual vertices and center coordinate points;

[0155] A third decision module configured to determine that a target collider is recognized as a reference cuboid when the distance relationship indicates that the individual distance between an individual vertex and a center coordinate point is less than a first distance threshold—the normalized geometry includes a reference cuboid—; and

[0156] A fourth determination module configured to determine that a target collider is recognized as a reference cuboid when determining at least two groups of parallel surfaces based on the distance relationship of individual vertices - the normalized geometry includes a reference cuboid -.

[0157] In this embodiment, the embodiment of the collision data processing device above may refer to, but is not limited to, the method embodiment above and will not be described in detail in this specification.

[0158] As an optional method, the collision data processing device further includes the following:

[0159] A third acquisition module configured to acquire a first volume value corresponding to the target collider and a second volume value corresponding to the reference rectangular prism after it is determined that the target collider is a reference rectangular prism;

[0160] A fifth determination module configured to determine the ratio of a first volume value to a second volume value; and

[0161] A sixth decision module configured to determine that the target collider is converted into a reference cuboid when the ratio reaches a second threshold.

[0162] In this embodiment, the embodiment of the collision data processing device above may refer to, but is not limited to, the method embodiment above and will not be described in detail in this specification.

[0163] As an optional method, the collision data processing device further includes the following:

[0164] After it is determined that the target collider is transformed into a reference cuboid, a projection plane corresponding to the reference cuboid is determined;

[0165] In order to obtain projection points corresponding to each individual vertex, individual vertices on a reference rectangular prism are mapped to a projection plane;

[0166] To obtain a first set of planar vertices and a second set of planar vertices, individual vertices are grouped according to the projection distance between the vertices and their corresponding projection points - vertices within the first set of planar vertices are located on the first plane, and vertices within the second set of planar vertices are located on the second plane -;

[0167] A first processing module configured to determine the convergence direction of an oriented boundary box that aligns with a reference cuboid according to the third plane and the fourth plane when the third plane is parallel to the fourth plane, wherein the vertex data includes a direction vector of the convergence direction of the oriented boundary box.

[0168] In this embodiment, the embodiment of the collision data processing device above may refer to, but is not limited to, the method embodiment above and will not be described in detail in this specification.

[0169] As an optional method, the collision data processing device further includes the following:

[0170] After it is determined that the target collider is transformed into a reference cuboid, a forward vector corresponding to the geometric center point of the reference cuboid is determined, and a vertical plane containing the forward vector is determined;

[0171] By taking the direction of the forward vector as the axis, the vertical plane is rotated multiple times, and after each rotation, the following action:

[0172] To obtain a third plane vertex set and a fourth plane vertex set, group individual vertices on a reference cuboid according to the vertical distance from each individual vertex to the vertex plane—vertices in the third plane vertex set are located on the third plane, and vertices in the fourth plane vertex set are located on the fourth plane—and perform;

[0173] A second processing module configured to determine the convergence direction of an oriented boundary box that aligns with a reference cuboid according to the third plane and the fourth plane when the third plane is parallel to the fourth plane, wherein the vertex data includes a direction vector of the convergence direction of the oriented boundary box.

[0174] In this embodiment, the embodiment of the collision data processing device above may refer to, but is not limited to, the method embodiment above and will not be described in detail in this specification.

[0175] As an optional method, the collision data processing device further includes the following:

[0176] An extraction module configured to extract convex features of a reference cuboid if, after the ratio of a first volume value to a second volume value is determined, the ratio does not reach a second threshold—the convex surface features include the edge lengths of three axial edges corresponding to the reference cuboid, and the three axial edges are mutually perpendicular edges within the reference cuboid—;

[0177] A seventh determination module configured to determine that the reference rectangular prism is converted into a long stick-type rectangular prism when both the first difference value between the edge length of the first axis edge and the edge length of the third axis edge, and the second difference value between the edge length of the second axis edge and the edge length of the third axis edge, exceed a second distance threshold; and

[0178] An eighth determination module configured to determine that a reference cuboid is converted into a roof-like cuboid when both the third difference value between the edge length of the first axis edge and the edge length of the second axis edge, and the fourth difference value between the edge length of the first axis edge and the edge length of the third axis edge, exceed the third distance threshold.

[0179] In this embodiment, the embodiment of the collision data processing device above may refer to, but is not limited to, the method embodiment above and will not be described in detail in this specification.

[0180] As an optional method, the collision data processing device further includes the following:

[0181] After the distance relationship between individual vertices and the center coordinate point is obtained, if the target collider is determined to be a non-standard cuboid, the geometric center point of the target collider is obtained; the connection line distance from individual vertices on the target collider to the geometric center point is obtained; and if the difference value between the individual connection line distances is less than a third threshold, the target collider is recognized as a cylinder - the normalized geometry includes a cylinder -; and a third processing module configured to construct a spatial function of the cylinder according to the coordinates of the geometric center point and the radius of the cylinder - the vertex data includes the spatial function of the cylinder -.

[0182] In this embodiment, the embodiment of the collision data processing device above may refer to, but is not limited to, the method embodiment above and will not be described in detail in this specification.

[0183] As an optional method, the collision data processing device further includes the following:

[0184] A segmentation unit configured to segment a target collider using an equidistant boundary setting box to acquire a plurality of sub-coliders before the vertex data of the target collider is converted according to a data format that aligns with a normal geometric structure in order to acquire collision data of the target collider;

[0185] A second determination unit configured to determine the intersection point of a connection line between an individual vertex on a target collider and an individual sub-collision among a plurality of sub-collision bodies;

[0186] A combination unit configured to perform a convergence combination on the intersection points within each sub-collision to obtain a bounding sub-box corresponding to the sub-collision;

[0187] A first merging unit configured to merge boundary setting sub-boxes having a size difference value less than a fourth threshold in order to traverse individual boundary setting sub-boxes and obtain a bulk boundary setting box corresponding to a target collider; and

[0188] A third decision unit configured to take vertex data of a bulk boundary setting box as vertex data of a target collider.

[0189] In this embodiment, the embodiment of the collision data processing device above may refer to, but is not limited to, the method embodiment above and will not be described in detail in this specification.

[0190] As an optional solution, the device further includes the following:

[0191] A fourth determination unit configured to determine the size of a sub-normal geometric structure when the target collider is converted into a normal geometric structure according to a distance relationship and the normal geometric structure includes a plurality of sub-normal geometric structures;

[0192] A second merging unit configured to merge two adjacent subnormal geometric structures when the difference value between the sizes of two adjacent subnormal geometric structures is less than a fifth threshold; and

[0193] A culling unit configured to culle a first subnormal geometry when the difference between the size of a first subnormal geometry and the size of a second subnormal geometry within a plurality of subnormal geometrys is less than a sixth threshold and the first subnormal geometry is located inside the second subnormal geometry.

[0194] In an optional manner, the first processing unit includes the following:

[0195] A storage module configured to convert vertex data of a target collider according to the data format of a geometry index that matches a normal geometry in order to acquire collision data.

[0196] In this embodiment, the embodiment of the collision data processing device above may refer to, but is not limited to, the method embodiment above and will not be described in detail in this specification.

[0197] According to another aspect of the embodiment of this application, an electronic device for implementing the above collision data processing method is further provided. The electronic device may be a terminal device or a server as illustrated in FIG. 1. This embodiment is described, for example, by taking a server that acts as an electronic device. As illustrated in FIG. 10, the electronic device includes a memory (1002) and a processor (1004). The memory (1002) stores a computer program. The processor (1004) is configured to perform steps in any method embodiment by utilizing the computer program.

[0198] Optionally, in this embodiment, the electronic device may be located at least one of a plurality of network devices of a computer network.

[0199] Optionally, in this embodiment, the processor may be configured to perform the following steps by using a computer program:

[0200] S1. Determine a target collider to be processed within a virtual scene, and the target collider is a convex polyhedron containing vertices.

[0201] S2. Obtain the distance relationships between individual vertices on the target collider.

[0202] S3. When converting a target collider into a normalized geometry based on distance relationships, the vertex data of the target collider is converted according to a data format that matches the normalized geometry in order to obtain collision data of the target collider.

[0203] Optionally, a person skilled in the art will recognize that the structure illustrated in FIG. 10 is merely exemplary and that the electronic device may be a smartphone (e.g., an Android cell phone and an iOS cell phone), a tablet, a palmtop, a mobile Internet device (MID), a PAD, etc. FIG. 10 does not limit the electronic device and the structure of the electronic device described above. For example, the electronic device and the electronic device may also include more or fewer components (e.g., network interfaces) than illustrated in FIG. 10, or may have a different configuration than illustrated in FIG. 10.

[0204] Memory (1002) may be configured to store software programs and modules, such as program instructions / modules corresponding to the collision data processing method and device of the embodiment of this application. A processor (1004) executes the software programs and modules stored in memory (1002) to perform individual functional applications and data processing, that is, to implement the collision data processing method above. Memory (1002) may include high-speed random access memory and may also include one or more non-volatile memories, such as magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some cases, memory (1002) may further include memory located remotely from the processor (1004). This remote memory may be coupled to a terminal via a network. Examples of the above networks include, but are not limited to, the Internet, intranet, local area network, mobile communication network, and combinations thereof. Specifically, memory (1002) may store information such as collision data of a target collision object, but is not limited thereto. For example, as illustrated in FIG. 10, the memory (1002) may include, but is not limited to, a first determination unit (902), a first acquisition unit (904), and a first processing unit (906) within the collision data processing device. Additionally, the memory may also include, but is not limited to, other modules or units within the collision data processing device described above, which will not be described in detail in this example.

[0205] Optionally, the transmitting device (1006) is configured to receive or transmit data by using a network. Specific examples of the network include wired networks and wireless networks. In one example, the transmitting device (1006) includes a network interface controller (NIC) that can be connected to other network devices and routers via a network cable to communicate with the Internet or a local area network. In one example, the transmitting device (1006) is a radio frequency (RF) module configured to communicate with the Internet wirelessly.

[0206] Additionally, the electronic device further includes a display (1008) configured to display a virtual scene and a virtual object corresponding to a target collider appearing in the virtual scene; and a connection bus (1010) configured to connect individual module components within the electronic device.

[0207] In another embodiment, a terminal device or a server may be a node within a distributed system. The distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting multiple nodes through network communication. A peer-to-peer (P2P) network may be formed between the nodes. Any type of computing device, such as an electronic device like a server or a terminal, may become a node within the blockchain system by participating in a P2P network.

[0208] According to one aspect of this application, a computer program product or a computer program is provided. The computer program product or the computer program comprises computer instructions stored in computer-readable memory. A processor of a computer device reads computer instructions from a computer-readable storage medium and executes computer instructions to enable the computer device to implement the above crash data processing method. The computer program is configured to perform steps in any of the above-described method embodiments when operated.

[0209] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:

[0210] S1. Determine a target collider to be processed within a virtual scene, and the target collider is a convex polyhedron containing vertices.

[0211] S2. Distance relationships between individual vertices on a target collider are obtained, and these distance relationships are used to characterize the shape features of the target collider.

[0212] S3. When converting a target collider into a normalized geometry based on distance relationships, the vertex data of the target collider is converted according to a data format that matches the normalized geometry in order to obtain collision data of the target collider.

[0213] Optionally, in this embodiment, a person skilled in the art will understand that all or part of the steps of the method in the above embodiment may be implemented by a program that commands the associated hardware of the terminal device. The program may be stored in a computer-readable storage medium. The storage medium may include a flash disk, read-only memory (ROM), random access memory (RAM), a magnetic disk, an optical disk, etc.

[0214] The sequence numbers of the above-described embodiments of this application are for illustrative purposes only and do not imply preference between the embodiments.

[0215] When the integrated unit in the above-described embodiment is implemented in the form of a software functional unit and is sold or used as an independent product, the integrated unit may be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of this application, or a part contributing to the related technology, or all or part of the technical solution may be implemented in the form of a software product. The computer software product is stored in a storage medium and includes some instructions for instructing one or more computer devices (which may be a PC, server, network device, etc.) to perform all or part of the steps of the method in the embodiment of this application.

[0216] In the embodiments of this application described above, the description of the embodiments has a separate focus. For parts not described in detail in the embodiments, refer to the relevant descriptions in other embodiments.

[0217] It should be understood that in some of the embodiments provided in this application, the disclosed client may be implemented in other ways. The device embodiments described above are merely examples. For example, the division into units is merely a logical functional division, and in actual implementations, it may be a different division. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not performed. Additionally, the mutual coupling or direct coupling or communication connection displayed or discussed may be implemented through some interfaces. Indirect coupling or communication connection between units or modules may be implemented electronically or in other forms.

[0218] The unit described as a separate part may or may not be physically separate, and the part displayed as a unit may or may not be a physical unit, may be located in one location, or may be distributed across multiple network units. Some or all of the unit may be selected based on practical requirements to achieve the purpose of the solution of the embodiment.

[0219] Additionally, the functional units in the embodiments of this application may be integrated into a single processing unit, each of the units may be physically separated, or two or more units may be integrated into a single unit. The integrated unit may be implemented in the form of hardware or in the form of a software functional unit.

[0220] The foregoing description is merely an exemplary embodiment of this application. A person skilled in the art may make additional improvements and modifications without departing from the principles of this application, and such improvements and modifications fall within the scope of protection of this application.

Claims

Claim 1 A method for processing collision data performed in an electronic device, comprising: a step of determining a target collider in a virtual scene, wherein the target collider is a convex polyhedron having vertices; a step of obtaining a distance relationship between individual vertices on the target collider, wherein the distance relationship characterizes the shape features of the target collider; And when converting the target collider into a regular geometry according to the distance relationship, to obtain collision data of the target collider, the method includes the step of converting vertex data of the target collider according to a data format that aligns with the regular geometry—the collision data characterizes the shape features of the regular geometry—and the step of obtaining distance relationships between individual vertices on the target collider includes the step of separately obtaining distance relationships between a plurality of edges each connected to each vertex on the target collider when the number of vertices on the target collider reaches a first threshold; and prior to the step of converting vertex data of the target collider according to a data format that aligns with the regular geometry, the collision data processing method further includes the step of determining that the target collider is converted into a standard rectangular prism when the distance relationship indicates that three edges connected to one target vertex within the target collider are perpendicular to each other, and the regular geometry includes the standard rectangular prism, and to obtain collision data of the target collider, the regular Before the step of converting vertex data of the target collider according to a data format that aligns with the geometric structure, the collision data processing method comprises the steps of determining a current vertex from individual vertices on the target collider, and determining a first reference point and a second reference point closest to the current vertex;A step of obtaining a first distance between the current vertex and the first reference point, and a second distance between the current vertex and the second reference point; a step of determining a third distance according to the first distance and the second distance, wherein the third distance is the length of the hypotenuse of a right triangle, and the right triangle takes the first distance and the second distance as the lengths of the right edges; a step of determining a third reference point from individual vertices on the target collider, excluding the current vertex, the first reference vertex, and the second reference point, according to the third distance, wherein the distance between the current vertex and the third reference point is the third distance; a step of determining a reference plane of the target collider according to the first reference point, the second reference point, and the third reference point; a step of determining a fourth reference point closest to the current vertex from individual vertices on the target collider, excluding the current vertex, the first reference vertex, the second reference point, and the third reference point, wherein the connecting line between the fourth reference point and the current vertex is the reference A collision data processing method further comprising: being perpendicular to a plane; and determining the current vertex as the target vertex, and determining the convergence direction of an oriented boundary setting box that aligns with the standard rectangular prism according to the first distance, the second distance, and the fourth distance between the current vertex and the fourth reference point, wherein the vertex data includes a direction vector of the convergence direction of the oriented boundary setting box. Claim 2 The collision data processing method according to claim 1, wherein the step of obtaining distance relationships between individual vertices on the target collision body comprises: determining a center coordinate point of the vertex on the target collision body when the quantity of the vertex on the target collision body reaches a first threshold; and obtaining distance relationships between the individual vertices and the center coordinate point; and prior to the step of converting vertex data of the target collision body according to a data format that aligns with the normal geometric structure, the collision data processing method further comprises: determining that the target collision body is recognized as a reference cuboid when the distance relationship indicates that the individual distance between the individual vertex and the center coordinate point is less than the first distance threshold - wherein the normal geometric structure includes the reference cuboid, and the reference cuboid has a structure similar to that of a standard cuboid -; and determining that the target collision body is recognized as a reference cuboid when at least two groups of parallel surfaces are determined according to the distance relationships of the individual vertices. Claim 3 In paragraph 2, after the step of determining that the target collider is recognized as a reference rectangular prism, the collision data processing method further comprises: the step of obtaining a first volume value corresponding to the target collider and a second volume value corresponding to the reference rectangular prism; the step of determining the ratio of the first volume value to the second volume value; and the step of determining that the target collider is converted into the reference rectangular prism when the ratio reaches a second threshold. Claim 4 In claim 3, after the step of determining that the target collider is transformed into the reference cuboid, the collision data processing method further comprises: the step of determining a projection plane corresponding to the reference cuboid; the step of mapping the individual vertices on the reference cuboid to the projection plane in order to obtain projection points corresponding to each of the individual vertices; the step of grouping the individual vertices according to the projection distance between the vertices and the corresponding projection points in order to obtain a first plane vertex set and a second plane vertex set, wherein the vertices in the first plane vertex set are located on the first plane and the vertices in the second plane vertex set are located on the second plane; and the step of determining the convergence direction of an oriented boundary setting box that aligns with the reference cuboid according to the first plane and the second plane when the first plane is parallel to the second plane, wherein the vertex data includes a direction vector of the convergence direction of the oriented boundary setting box. Claim 5 In paragraph 3, after the step of determining that the target collider is transformed into the reference cuboid, the collision data processing method comprises: determining a forward vector corresponding to the geometric center point of the reference cuboid and determining a vertical plane including the forward vector; rotating the vertical plane multiple times by taking the direction of the forward vector as an axis, and after each rotation, performing the following operation: grouping the individual vertices on the reference cuboid according to the vertical distance from the individual vertices to the vertical plane in order to obtain a third plane vertex set and a fourth plane vertex set—whereby the vertices in the third plane vertex set are located on the third plane and the vertices in the fourth plane vertex set are located on the fourth plane. A collision data processing method further comprising the step of determining the convergence direction of an oriented boundary setting box that aligns with the reference rectangular prism according to the third plane and the fourth plane when the third plane is parallel to the fourth plane, wherein the vertex data includes a direction vector of the convergence direction of the oriented boundary setting box. Claim 6 In claim 3, after the step of determining the ratio of the first volume value to the second volume value, the collision data processing method comprises, when the ratio does not reach the second threshold, the step of extracting convex features of the reference rectangular prism—the convex surface features include the edge lengths of three axis edges corresponding to the reference rectangular prism, and the three axis edges are mutually perpendicular edges within the reference rectangular prism—; and the step of determining that the reference rectangular prism is converted into a long stick-type rectangular prism when both the first difference value between the edge length of the first axis edge and the edge length of the third axis edge, and the second difference value between the edge length of the second axis edge and the edge length of the third axis edge, are greater than the second distance threshold. A collision data processing method further comprising the step of determining that the reference rectangular prism is converted into a roof-like rectangular prism when both the third difference value between the edge length of the first axis edge and the edge length of the second axis edge, and the fourth difference value between the edge length of the first axis edge and the edge length of the third axis edge, are greater than a third distance threshold. Claim 7 In claim 2, after the step of obtaining the distance relationship between the individual vertices and the center coordinate point, the collision data processing method further comprises: the step of obtaining the geometric center point of the target collider when it is determined that the target collider is a non-standard rectangular parallepiped; the step of obtaining the connection line distance from the individual vertices on the target collider to the geometric center point; the step of recognizing the target collider as a cylinder when the difference value between the individual connection line distances is less than a third threshold - the normalized geometry includes the cylinder -; and the step of constructing a spatial function of the cylinder according to the coordinates of the geometric center point and the radius of the cylinder - the vertex data includes the spatial function of the cylinder - a collision data processing method. Claim 8 In claim 2, prior to the step of converting vertex data of the target collider according to a data format that aligns with the normal geometric structure in order to obtain collision data of the target collider, the collision data processing method further comprises: a step of dividing the target collider by using an equidistant bounding box to obtain a plurality of sub-coliders; a step of determining the intersection point of a connection line between the individual vertex on the target collider and the individual sub-colider among the plurality of sub-coliders; a step of performing a convergence combination sequentially on the intersection point within each sub-colider to obtain a bounding sub-box corresponding to the sub-colider; a step of merging bounding sub-boxes having a size difference value less than a fourth threshold to traverse the individual bounding sub-boxes and obtain a bulk bounding box corresponding to the target collider; and a step of taking the vertex data of the bulk bounding box as the vertex data of the target collider. Claim 9 In claim 1, after converting the target collider into a normalized geometry according to the distance relationship, the collision data processing method further comprises: a step of determining the size of a sub-normalized geometry when the normalized geometry includes a plurality of sub-normalized geometryes; a step of merging two adjacent sub-normalized geometryes when the difference value between the sizes of two adjacent sub-normalized geometryes is less than a fifth threshold; and a step of culling the first sub-normalized geometry when the difference value between the size of a first sub-normalized geometry and the size of a second sub-normalized geometry within a plurality of sub-normalized geometryes is less than a sixth threshold and the first sub-normalized geometry is located inside the second sub-normalized geometry. Claim 10 A collision data processing method according to claim 1, wherein the step of converting the vertex data of the target collider according to a data format that aligns with the normal geometric structure in order to obtain collision data of the target collider includes the step of converting the vertex data of the target collider according to a data format of a geometric index that aligns with the normal geometric structure in order to obtain collision data. Claim 11 As a collision data processing device, a first determination unit configured to determine a target collider within a virtual scene—the target collider is a convex polyhedron having vertices—; a first acquisition unit configured to acquire distance relationships between individual vertices on the target collider—the distance relationships characterize the shape features of the target collider—; And when converting the target collider into a normal geometric structure according to the distance relationship, to acquire collision data of the target collider, the first processing unit configured to convert the vertex data of the target collider according to a data format matching the normal geometric structure—the collision data characterizes the shape features of the normal geometric structure—is included, and the first acquisition unit is configured to separately acquire the distance relationship between a plurality of edges each connected to each vertex on the target collider when the number of vertices on the target collider reaches a first threshold, and before converting the vertex data of the target collider according to a data format matching the normal geometric structure, the first acquisition unit is further configured to determine that the target collider is converted into a standard rectangular prism when the distance relationship indicates that three edges connected to one target vertex within the target collider are perpendicular to each other, and the normal geometric structure includes the standard rectangular prism, and the collision data processing device further includes a second processing unit, and the second processing unit is the In order to obtain collision data of a target collider, before converting the vertex data of the target collider according to a data format that aligns with the normal geometric structure, a current vertex is determined from individual vertices on the target collider, and a first reference point and a second reference point closest to the current vertex are determined; a first distance between the current vertex and the first reference point, and a second distance between the current vertex and the second reference point are obtained;A third distance is determined according to the first distance and the second distance, wherein the third distance is the length of the hypotenuse of a right triangle, and the right triangle takes the first distance and the second distance as the lengths of the right edges; a third reference point is determined from individual vertices on the target collider, excluding the current vertex, the first reference vertex, and the second reference point, according to the third distance, wherein the distance between the current vertex and the third reference point is the third distance; a reference plane of the target collider is determined according to the first reference point, the second reference point, and the third reference point; a fourth reference point closest to the current vertex is determined from individual vertices on the target collider, excluding the current vertex, the first reference vertex, the second reference point, and the third reference point, wherein the connecting line between the fourth reference point and the current vertex is perpendicular to the reference plane. A collision data processing device configured to determine the current vertex as the target vertex, and to determine the convergence direction of an oriented boundary setting box aligned with the standard rectangular prism according to the first distance, the second distance, and the fourth distance between the current vertex and the fourth reference point, wherein the vertex data includes a direction vector of the convergence direction of the oriented boundary setting box. Claim 12 A computer-readable storage medium comprising a stored program, wherein, when executed, the program implements the collision data processing method according to any one of claims 1 to 10. Claim 13 An electronic device comprising a memory and a processor, wherein the memory stores a computer program and the processor is configured to implement the collision data processing method according to any one of claims 1 to 10 by utilizing the computer program. Claim 14 delete Claim 15 delete Claim 16 delete

Citation Information

Patent Citations

  • Composite bounding box algorithm based on AABB and OBB self adaption

    CN106503347A

  • Process and device for collision detection of objects

    US20020154128A1

  • Monitoring proximity of objects at construction jobsites via three-dimensional virtuality in real-time

    US20140200863A1