Voxelization path finding method and device, electronic equipment and storage medium

By voxelizing the obstacle model and using the A* algorithm, the path planning problem of game characters finding paths on the surface of obstacles is solved, efficient and accurate travel path search is achieved, and the complexity and low efficiency of path planning in the existing technology is solved. The problem.

CN119258533APending Publication Date: 2025-01-07BEIJING PIXEL SOFTWARE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411298009.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-18
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

In existing three-dimensional games, it is difficult for game characters to effectively plan their travel paths when finding roads on the surface of obstacles, especially in larger obstacle surface environments, and it is difficult for the prior art to accurately calculate the travel paths.

Method used

By obtaining the starting point and end point of the virtual character's travel on the surface of the obstacle model, voxelization is performed based on the geometric center point of the obstacle model, a voxel table is generated, and a voxel path is searched using the A* algorithm to convert it into a travel path.

Benefits of technology

It realizes efficient search of virtual character travel paths on the surface of obstacles, simplifies the path planning process, and improves the pathfinding efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119258533A_ABST
    Figure CN119258533A_ABST
Patent Text Reader

Abstract

The invention provides a voxelization path finding method and device, electronic equipment and a storage medium, and relates to the field of games. Firstly, the advancing starting point and the advancing ending point of a virtual character on the surface of an obstacle model are obtained; voxelizing the obstacle model based on the geometric center point of the obstacle model to obtain a voxel table; the voxel table comprises a plurality of position data sets, and each position data set is used for reflecting the position of one voxel; based on the voxel table, determining a starting point voxel and an end point voxel respectively corresponding to the advancing starting point and the advancing end point; based on the voxel table, searching a voxel path from the starting point voxel to the terminal point voxel by using an A * algorithm; the voxel path is converted into a travel path from a travel start point to a travel end point. According to the invention, voxelization is carried out on the obstacle model based on the geometric center point of the obstacle model to obtain the voxel table, so that the advancing path of the virtual character on the surface of the obstacle can be found based on the voxel table.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of games, and in particular to a voxelized pathfinding method, device, electronic device and storage medium. Background Art

[0002] In current 3D games, game characters usually have pathfinding requirements, but existing pathfinding is usually performed in game scene maps. In some special game designs, game characters need to find their way on larger obstacle surfaces. In this scenario, how to obtain the path of the game character on the obstacle surface is a problem that needs to be considered. Summary of the invention

[0003] The purpose of the present invention is to provide a voxelized pathfinding method, device, electronic device and storage medium to improve the problems existing in the prior art.

[0004] The embodiments of the present invention can be implemented as follows:

[0005] In a first aspect, the present invention provides a voxelized pathfinding method, comprising:

[0006] Obtain the starting point and end point of the virtual character on the surface of the obstacle model;

[0007] Based on the geometric center point of the obstacle model, voxelizing the obstacle model to obtain a voxel table; the voxel table includes a plurality of position data sets, each position data set is used to reflect the position of a voxel;

[0008] Based on the voxel table, determining the starting voxel and the ending voxel corresponding to the travel starting point and the travel ending point respectively;

[0009] Based on the voxel table, using the A* algorithm to find the voxel path from the starting voxel to the end voxel;

[0010] The voxel path is converted into a travel path from the travel start point to the travel end point.

[0011] Optionally, the obstacle model includes a plurality of triangular primitives, each of which includes three vertices;

[0012] The step of voxelizing the obstacle model based on the geometric center point of the obstacle model to obtain a voxel table includes:

[0013] Obtaining a peripheral polyhedron of the obstacle model and a geometric center point of the obstacle model; each face of the peripheral polyhedron includes a plurality of grids;

[0014] For any of the triangular primitives of the obstacle model, three first rays starting from the geometric center point and pointing to the three vertices of the triangular primitive are obtained, and the intersection point of each of the first rays with the surface of the peripheral polyhedron is used as a vertex projection to obtain three vertex projections of the triangular primitive;

[0015] Acquire each target mesh in the area enclosed by the projections of three vertices of the triangular primitive;

[0016] For each target grid, based on the geometric center point, perform a center projection process on the target grid onto the plane where the triangular primitive is located, so as to obtain a position data set of voxels corresponding to the target grid;

[0017] Each triangular primitive of the obstacle model is traversed to obtain the voxel table.

[0018] Optionally, the step of performing center projection processing on the target mesh onto the plane where the triangular primitive is located based on the geometric center point to obtain a position data set of voxels corresponding to the target mesh includes:

[0019] Obtain four second rays starting from the geometric center point and pointing to four mesh vertices of the target mesh respectively, and use the intersection of each second ray and the plane where the triangular primitive is located as a projection point to obtain four projection points corresponding to the target mesh;

[0020] Calculate the interval distance between each projection point and the geometric center point, and find the first projection point with the smallest interval distance and the second projection point with the largest interval distance;

[0021] Based on the grid position of the target grid, the interval distances corresponding to the first projection point and the second projection point, a position data set of voxels corresponding to the target grid is generated.

[0022] Optionally, the position data set includes grid positions of grids corresponding to voxels on a peripheral polyhedron of the obstacle model; each face of the peripheral polyhedron includes a plurality of grids;

[0023] Before the step of determining the starting point voxel and the ending point voxel corresponding to the travel starting point and the travel ending point respectively based on the voxel table, the method further includes:

[0024] Classifying all position data sets in the voxel table according to different grid positions to obtain multiple data groups;

[0025] Finding each data group to be screened whose number of position data sets is not unique from all data groups;

[0026] For each of the data groups to be screened, each pair of pending position data sets with voxel overlap in the data group to be screened is found and each pair of pending position data sets is combined or filtered until there is no voxel overlap between any two position data sets in the data group to be screened.

[0027] Optionally, the shape of the voxel is a regular tetrahedron, and the position data set further includes a top surface side edge distance between any vertex of the top surface of the regular tetrahedron corresponding to the voxel and the geometric center point, and a bottom surface side edge distance between any vertex of the bottom surface of the regular tetrahedron and the geometric center point;

[0028] The step of finding each pending position data set with voxel overlap in the data group to be screened and combining or filtering each pending position data set comprises:

[0029] For any two to-be-screened position data sets in the to-be-screened voxel group, a first top surface side edge distance and a first bottom surface side edge distance are obtained from one of the to-be-screened position data sets, and a second top surface side edge distance and a second bottom surface side edge distance are obtained from the other to-be-screened position data set;

[0030] If the second bottom surface side edge distance is greater than the first top surface side edge distance and the first bottom surface side edge distance is greater than the second top surface side edge distance, it is determined that there is a voxel overlap between the two to-be-screened voxels represented by the two to-be-screened position data sets, a grid position is extracted from any to-be-screened position data set, the grid position, the first top surface side edge distance and the second bottom surface side edge distance are saved to obtain a new position data set, and the two to-be-screened position data sets are replaced by the new position data set;

[0031] If the first bottom surface side edge distance is greater than the second top surface side edge distance and the two bottom surface side edge distances are greater than the first top surface side edge distance, it is determined that there is a voxel overlap between the two to-be-screened voxels represented by the two to-be-screened position data sets, a grid position is extracted from any to-be-screened position data set, the grid position, the second top surface side edge distance and the first bottom surface side edge distance are saved to obtain a new position data set, and the two to-be-screened position data sets are replaced by the new position data set;

[0032] If the second top surface side edge distance is greater than the first top surface side edge distance and the first bottom surface side edge distance is greater than the second bottom surface side edge distance, it is determined that there is a voxel overlap between the two to-be-screened voxels represented by the two to-be-screened position data sets, and the to-be-screened position data set including the second top surface side edge distance and the second bottom surface side edge distance is deleted;

[0033] If the first top surface side edge distance is greater than the second top surface side edge distance and the two bottom surface side edge distances are greater than the first bottom surface side edge distance, it is determined that there is voxel overlap between the two voxels to be screened represented by the two data sets of position to be screened, and the data set of position to be screened including the first top surface side edge distance and the first bottom surface side edge distance is deleted.

[0034] Optionally, the step of searching for a voxel path from the starting voxel to the ending voxel using an A* algorithm based on the voxel table includes:

[0035] Taking the starting point voxel as the current voxel;

[0036] Based on the voxel table, obtaining each adjacent voxel of the current voxel;

[0037] Based on a preset jump height, each pending voxel that can be traveled is selected from all adjacent voxels;

[0038] Calculate the cost value of each pending voxel, and select the pending voxel with the smallest cost value as the next hop voxel of the current voxel;

[0039] Determine whether the adjacent voxels of the next-hop voxel include the end point voxel;

[0040] If the neighboring voxels of the next-hop voxel do not include the end-point voxel, the next-hop voxel is used as a new current voxel and the step of obtaining each neighboring voxel of the current voxel based on the voxel table is returned to be executed until the neighboring voxels of the next-hop voxel include the end-point voxel;

[0041] If the adjacent voxels of the next-hop voxel include the destination voxel, a voxel path from the start voxel to the destination voxel is obtained.

[0042] Optionally, the shape of the voxel is a regular tetrahedron, and the position data set includes a grid position of a grid corresponding to the voxel on the peripheral polyhedron of the obstacle model, a top surface side edge distance between any vertex of the top surface of the regular tetrahedron corresponding to the voxel and the geometric center point, and a bottom surface side edge distance between any vertex of the bottom surface of the regular tetrahedron and the geometric center point; each face of the peripheral polyhedron includes a plurality of grids;

[0043] The step of selecting each pending voxel that can be moved from all adjacent voxels based on the preset jump height includes:

[0044] For each of the adjacent voxels, the difference between the bottom side edge distances of the adjacent voxel and the current voxel is calculated to obtain a height difference between the adjacent voxel and the current voxel, and if the height difference is lower than the preset jump height, the adjacent voxel is used as a target adjacent voxel;

[0045] Obtaining the grid position in the position data set corresponding to each target adjacent voxel, and taking each target adjacent voxel that is unique in the grid position among all target adjacent voxels as a pending voxel that can be moved;

[0046] If there are two target adjacent voxels whose corresponding grid positions are the same, determine the near-center voxel and the far-center voxel in the two target adjacent voxels, and use the far-center voxel as the pending voxel that can be moved;

[0047] Calculating the gap distance between the near-center voxel and the far-center voxel, and calculating the entrance width of the virtual character entering the gap space formed between the near-center voxel and the far-center voxel from the current voxel;

[0048] If the entrance width and the gap spacing are not less than the passing width of the virtual character, the near-center voxel is used as a pending voxel that can be moved.

[0049] In a second aspect, the present invention provides a voxelized pathfinding device, comprising:

[0050] An acquisition module, used to acquire the starting point and the end point of the virtual character on the surface of the obstacle model;

[0051] A voxelization module, configured to voxelize the obstacle model based on the geometric center point of the obstacle model to obtain a voxel table; the voxel table includes a plurality of position data sets, each position data set is used to reflect the position of a voxel;

[0052] Pathfinding module, used to:

[0053] Based on the voxel table, determining the starting point voxel and the ending point voxel corresponding to the travel starting point and the travel ending point respectively;

[0054] Based on the voxel table, using the A* algorithm to find the voxel path from the starting voxel to the end voxel;

[0055] The voxel path is converted into a travel path from the travel start point to the travel end point.

[0056] In a third aspect, the present invention provides an electronic device, comprising: a memory and a processor, wherein the memory stores a software program, and when the electronic device is running, the processor executes the software program to implement the voxelized pathfinding method as described in the first aspect above.

[0057] In a fourth aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the voxelized pathfinding method described in the first aspect is implemented.

[0058] Compared with the prior art, the embodiments of the present invention provide a voxelized pathfinding method, device, electronic device and storage medium, firstly obtaining the starting point and end point of the virtual character on the surface of the obstacle model; based on the geometric center point of the obstacle model, voxelizing the obstacle model to obtain a voxel table; the voxel table includes several position data sets, each of which is used to reflect the position of a voxel; based on the voxel table, determining the starting voxel and the end point voxel corresponding to the starting point and the end point; based on the voxel table, using the A* algorithm to find the voxel path from the starting point voxel to the end point voxel; converting the voxel path to the path from the starting point to the end point. The present invention voxelizes the obstacle model based on the geometric center point of the obstacle model to obtain a voxel table, so that the path of the virtual character on the obstacle surface can be found based on the voxel table. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0060] Figure 1 One of the flowchart diagrams of a voxelized pathfinding method provided in an embodiment of the present invention.

[0061] Figure 2 A schematic diagram of central projection of a triangular primitive provided in an embodiment of the present invention.

[0062] Figure 3 A target grid f provided by an embodiment of the present invention c Schematic diagram of the relative position relationship between the corresponding voxels.

[0063] Figure 4 A schematic diagram of central projection of two adjacent triangular primitives provided in an embodiment of the present invention.

[0064] Figure 5 The second flowchart of a voxelized pathfinding method provided by an embodiment of the present invention.

[0065] Figure 6A schematic diagram of the positional relationship between two voxels corresponding to the same grid on the same number axis provided in an embodiment of the present invention.

[0066] Figure 7 A schematic diagram of the positions of two voxels forming a gap space provided by an embodiment of the present invention.

[0067] Figure 8 The third flowchart of a voxelized pathfinding method provided by an embodiment of the present invention.

[0068] Fig. 9 A schematic diagram of the positional relationship between two adjacent voxels provided in an embodiment of the present invention.

[0069] Fig.10 A schematic diagram of the structure of a voxelized pathfinding device provided in an embodiment of the present invention.

[0070] Fig.11 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0071] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0072] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0073] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0074] In addition, the terms “first”, “second”, etc., if used, are merely used to distinguish between the descriptions and should not be understood as indicating or implying relative importance.

[0075] It should be noted that, in the absence of conflict, the features in the embodiments of the present invention may be combined with each other.

[0076] The voxelized pathfinding method provided by the embodiment of the present invention can be applied to electronic devices, such as smart phones, smart tablets, personal notebooks, personal computers, servers and other devices with computing capabilities.

[0077] Please refer to Figure 1 , Figure 1 A schematic flow chart of a voxelized pathfinding method provided by an embodiment of the present invention includes the following steps S101 to S105:

[0078] S101. Obtain a starting point and an end point of a virtual character on a surface of an obstacle model.

[0079] In this embodiment, the virtual character can be a player-controlled character in a three-dimensional game, or an NPC (non-player character) in a game scene. The obstacle model includes a plurality of triangular primitives, each of which includes three vertices.

[0080] Optionally, the obstacle model may be in a spherical shape, an ellipsoidal shape, an irregular shape, etc., and the present invention is not limited to this.

[0081] S102 . Based on the geometric center point of the obstacle model, voxelize the obstacle model to obtain a voxel table.

[0082] In this embodiment, the voxel table includes a plurality of position data sets, each of which is used to reflect the position of a voxel. Voxel is the abbreviation of volume pixel, which represents a hexahedral element in three-dimensional space.

[0083] S103 . Determine the starting point voxel and the ending point voxel corresponding to the starting point and the ending point, respectively, based on the voxel table.

[0084] In this embodiment, the position data set of the starting point voxel corresponding to the travel starting point and the position data set of the end point voxel corresponding to the travel end point can be found from the voxel table.

[0085] S104 , based on the voxel table, using the A* algorithm to find the voxel path from the starting voxel to the end voxel.

[0086] In this embodiment, the voxel path includes position data sets of a starting point voxel, a plurality of passing voxels, and a destination voxel.

[0087] S105 , converting the voxel path into a travel path from the travel starting point to the travel end point.

[0088] In this embodiment, the travel path includes the position coordinates of a travel starting point, a plurality of path points, and a travel end point.

[0089] The voxelized pathfinding method provided in the embodiment of the present invention first obtains the starting point and the end point of the virtual character on the surface of the obstacle model; based on the geometric center point of the obstacle model, the obstacle model is voxelized to obtain a voxel table; the voxel table includes several position data sets, each position data set is used to reflect the position of a voxel; based on the voxel table, the starting voxel and the end point voxel corresponding to the starting point and the end point are determined; based on the voxel table, the voxel path from the starting point voxel to the end point voxel is found using the A* algorithm; the voxel path is converted into a path from the starting point to the end point. The present invention voxels the obstacle model based on the geometric center point of the obstacle model to obtain a voxel table, so that the path of the virtual character on the obstacle surface can be found based on the voxel table.

[0090] In an optional implementation, the obstacle model may be voxelized by central projection. Correspondingly, the sub-steps of voxelizing the obstacle model based on the geometric center point of the obstacle model in step S102 to obtain a voxel table may include steps S1021 to S1025.

[0091] S1021. Obtain a peripheral polyhedron of the obstacle model and a geometric center point of the obstacle model.

[0092] In this embodiment, the outer polyhedron may be a regular hexahedron or a regular octahedron, each face of which includes a plurality of grids.

[0093] Assuming that the outer polyhedron consists of Z faces, and each face consists of N*N grids, then the grid position of a grid can be expressed as f c (f z ,f x ,f y ), indicating that the grid belongs to the x*yth grid on the zth face of the outer polyhedron.

[0094] Optionally, the outer polyhedron may be formed by extending the circumscribed polyhedron of the obstacle model outward by a certain distance.

[0095] S1022. For any triangular primitive of the obstacle model, obtain three first rays starting from the geometric center point and pointing to the three vertices of the triangular primitive respectively, and use the intersection point of each first ray with the surface of the outer polyhedron as a vertex projection to obtain three vertex projections of the triangular primitive.

[0096] S1023. Obtain each target mesh in the area enclosed by the projections of the three vertices of the triangle primitive.

[0097] In the optional example, please combine Figure 2 , Figure 2In the figure, points A, B, and C are the three vertices of the triangle primitive, point O is the geometric center point of the outer polyhedron, and the three first rays starting from the geometric center point and pointing to the three vertices of the triangle primitive are The three intersect with a face of the outer polyhedron at points A1, B1, and C1, respectively, that is, the three vertex projections of the triangle primitive (ΔABC) are A1, B1, and C1, respectively, and each orange-red grid in the area surrounded by the three vertex projections is the target grid. This example is only an example and is not limited here.

[0098] S1024. For each target grid, perform a center projection process on the target grid onto the plane where the triangular primitive is located based on the geometric center point to obtain a position data set of voxels corresponding to each target grid.

[0099] In this embodiment, for a target mesh, a process of performing a center projection process on the target mesh onto the plane where the triangular primitive is located based on the geometric center point to obtain a position data set of voxels corresponding to the target mesh includes the following steps (1) to (3):

[0100] (1) Obtain four second rays starting from the geometric center point and pointing to the four mesh vertices of the target mesh respectively, and use the intersection point of each second ray with the plane where the triangle primitive is located as the projection point to obtain four projection points corresponding to the target mesh;

[0101] (2) Calculate the distance between each projection point and the geometric center point, and find the first projection point with the smallest distance and the second projection point with the largest distance;

[0102] (3) Based on the grid position of the target grid, the interval distances corresponding to the first projection point and the second projection point, a position data set of the voxels corresponding to the target grid is generated.

[0103] In this embodiment, the shape of the voxel corresponding to a target grid is a regular tetrahedron, the top surface of which is close to the center point of the set, and the bottom surface is close to the target grid. The four side edges of the regular tetrahedron belong to the four second rays respectively, and the projection of the geometric center point on the top surface of the regular tetrahedron is the center point of the vertex. The position data set of the voxel corresponding to a target grid is represented by SVoxel[f c , D Min , D Max ], f c represents the grid position of the voxel corresponding to the grid on the outer polyhedron of the obstacle model, D Min Represents the distance between any vertex of the top surface of the regular tetrahedron where the voxel is located and the geometric center point, D Max Represents the distance between any vertex of the bottom surface of the regular tetrahedron voxel and the geometric center point.

[0104] For each target mesh in the area enclosed by the projections of the three vertices of a triangular primitive, steps (1) to (3) are executed to obtain a position data set of voxels corresponding to each target mesh.

[0105] For an optional example, see Figure 3 , Figure 3 A target grid f is shown in c Based on the relative position relationship of the corresponding voxel, the target mesh is projected onto the plane where the triangular primitive is located based on the geometric center point, and the four projection points of the target mesh on the plane where the triangular primitive is located are A, B, C, and D (where B and D are Figure 3 (not shown), and among the four projection points, it is obvious that the first projection point C has the smallest distance from the geometric center point O, and the second projection point A has the largest distance from the geometric center point O. The target grid f c The corresponding voxel shape is Figure 3 As shown in the red regular tetrahedron in the figure.

[0106] Then the final saved target grid f c The corresponding voxel position data set is SVoxel[fc, |OC|, |0A|]. Where |OC| and |0A| are the lengths of line segment OC and line segment OA, respectively, representing the top side edge distance and bottom side edge distance of the red regular tetrahedron. This example is only an example and is not limited here.

[0107] S1025. Traverse each triangular primitive of the obstacle model to obtain a voxel table.

[0108] In this embodiment, for each triangular primitive of the obstacle model, the above steps S1022 to S1024 are executed to complete voxelization of the obstacle model and obtain a voxel table.

[0109] After performing central projection on all triangles of the obstacle model, the voxel table is obtained. There may be different voxels with the same grid position in the location data set. This is because a certain grid (assuming it is represented as EFGH) in the area surrounded by the three vertex projections of a triangle may also be located in the area surrounded by the three vertex projections of another triangle. For two location data sets with the same grid position, the corresponding two voxels may have voxel overlap. These two voxels need to be replaced with one voxel to facilitate the rationality of subsequent path finding.

[0110] exist Figure 2 Based on Figure 4, assuming that another triangular primitive adjacent to the triangular primitive (ΔABC) is ΔBCD, and based on the geometric center point O, the center projection of ΔBCD is performed, and the three vertex projections of ΔBCD on the peripheral polyhedron are B1, C1, and D1. Therefore, in the process of voxelizing the obstacle model, voxelizing ΔABC will obtain the position data sets corresponding to each orange-red grid and each green grid, and voxelizing ΔBCD will obtain the position data sets corresponding to each yellow grid and each green grid. Therefore, in the final voxel table, each green grid will have two corresponding position data sets, and the two voxels represented by the two position data sets corresponding to each green grid may have overlapping voxels, which need to be merged or deleted.

[0111] This example is only an example and is not intended to be limiting.

[0112] Therefore, in order to ensure the permeability of the bottom surface of each voxel, it is necessary to further merge or delete voxels in the voxel table. Figure 5 After the above step S102, the method may further include the following steps S10a to S10c.

[0113] S10a, classifying all position data sets in the voxel table according to different grid positions to obtain multiple data groups.

[0114] S10b. Find out, from all data groups, each data group to be screened whose number of position data sets is not unique.

[0115] S10c, for each data group to be screened, find out each pending position data set with voxel overlap in the data group to be screened and combine or filter each pending position data set until there is no voxel overlap between any two position data sets in the data group to be screened.

[0116] In this embodiment, the process of finding each pending position data set with voxel overlap in the data group to be screened and combining or filtering each pending position data set may include the following steps S10c1 to S10c5:

[0117] S10c1. For any two data sets of positions to be screened in the voxel group to be screened, obtain a first top surface side edge distance and a first bottom surface side edge distance from one of the data sets of positions to be screened, and obtain a second top surface side edge distance and a second bottom surface side edge distance from the other data set of positions to be screened.

[0118] In this embodiment, for any two to-be-screened position data sets SVoxel1[fc, a1, b1] and SVoxel2[fc, a2, b2] in the to-be-screened voxel group, the first top surface side edge distance a1, the first bottom surface side edge distance b1, the second top surface side edge distance a2, and the second bottom surface side edge distance b2 are placed on the same number axis for comparison, and there exists the following Figure 6 There are six positional relationships shown in Figure 1. Among them, there is no voxel overlap in the first two positional relationships, and the second positional relationship reflects the relative positional relationship between two voxels. Figure 7 The red voxels shown are identical to the green voxels. Figure 6 There is voxel overlap in the last four positional relationships.

[0119] S10c2. If the second bottom surface side edge distance is greater than the first top surface side edge distance and the first bottom surface side edge distance is greater than the second top surface side edge distance, it is determined that there is voxel overlap between the two voxels to be screened represented by the two position data sets to be screened, and the grid position is extracted from any of the position data sets to be screened, and the grid position, the first top surface side edge distance and the second bottom surface side edge distance are saved to obtain a new position data set, and the two position data sets to be screened are replaced with the new position data set.

[0120] Combination Figure 6 , if the relationship between the first top side edge distance a1, the first bottom side edge distance b1, the second top side edge distance a2, and the second bottom side edge distance b2 is as follows Figure 6 As shown in the third case, that is, the two voxels partially overlap, then the two position data sets to be screened SVoxel1[fc, a1, b1] and SVoxel2[fc, a2, b2] will be replaced by the new position data set SVoxel[fc, a1, b2].

[0121] S10c3. If the first bottom surface side edge distance is greater than the second top surface side edge distance and the second bottom surface side edge distance is greater than the first top surface side edge distance, it is determined that there is voxel overlap between the two voxels to be screened represented by the two position data sets to be screened, and the grid position is extracted from any of the position data sets to be screened, and the grid position, the second top surface side edge distance and the first bottom surface side edge distance are saved to obtain a new position data set and the two position data sets to be screened are replaced with the new position data set.

[0122] Combination Figure 6 , if the relationship between the first top side edge distance a1, the first bottom side edge distance b1, the second top side edge distance a2, and the second bottom side edge distance b2 is as follows Figure 6 As shown in the fourth case, that is, the two voxels partially overlap, then the two position data sets to be screened SVoxel1[fc, a1, b1] and SVoxel2[fc, a2, b2] will be replaced by the new position data set SVoxel[fc, a2, b1].

[0123] S10c4. If the second top surface side edge distance is greater than the first top surface side edge distance and one bottom surface side edge distance is greater than the second bottom surface side edge distance, it is determined that there is voxel overlap between the two to-be-screened voxels represented by the two to-be-screened position data sets, and the to-be-screened position data set including the second top surface side edge distance and the second bottom surface side edge distance is deleted.

[0124] Combination Figure 6 , if the relationship between the first top side edge distance a1, the first bottom side edge distance b1, the second top side edge distance a2, and the second bottom side edge distance b2 is as follows Figure 6 As shown in the fifth case, that is, if two voxels overlap, then SVoxel2[fc, a2, b2] will be deleted from the two position data sets SVoxel1[fc, a1, b1] and SVoxel2[fc, a2, b2].

[0125] S10c5. If the first top surface side edge distance is greater than the second top surface side edge distance and the second bottom surface side edge distance is greater than the first bottom surface side edge distance, it is determined that there is voxel overlap between the two to-be-screened voxels represented by the two to-be-screened position data sets, and the to-be-screened position data set including the first top surface side edge distance and the first bottom surface side edge distance is deleted.

[0126] Combination Figure 6 , if the relationship between the first top side edge distance a1, the first bottom side edge distance b1, the second top side edge distance a2, and the second bottom side edge distance b2 is as follows Figure 6 As shown in the fifth case, that is, the two voxels overlap, then SVoxel1[fc, a1, b1] will be deleted from the two position data sets to be screened SVoxel1[fc, a1, b1] and SVoxel2[fc, a2, b2].

[0127] The obstacle model is voxelized to obtain a voxel table, and then the voxels in the voxel table are merged or deleted when there are more than one voxels corresponding to the same grid, so that a more simplified voxel table is obtained, so that subsequent path planning can be performed in the voxel space, which simplifies the complexity of subsequent path finding and speeds up path finding efficiency.

[0128] In the optional implementation, in the above step S103, the principles of determining the starting voxel corresponding to the starting point of the travel and determining the terminal voxel corresponding to the end point of the travel are the same. Taking the determination of the starting voxel corresponding to the starting point of the travel as an example, it is to obtain a ray starting from the geometric center point and pointing to the starting point of the travel. The voxel corresponding to the starting grid where the intersection of the ray and the outer cube is located is the starting voxel. The position data set corresponding to the starting grid can be found from the voxel table, which is the position data set of the starting voxel. The principle of determining the terminal voxel corresponding to the end point of the travel is the same as this, and will not be repeated here.

[0129] In an optional implementation, Figure 1 Based on Figure 8 In the above step S104, based on the voxel table, the process of using the A* algorithm to find the voxel path from the starting voxel to the end voxel may include the following sub-steps S1041 to S104, including:

[0130] S1041. Set the starting voxel as the current voxel.

[0131] S1042. Based on the voxel table, obtain each adjacent voxel of the current voxel.

[0132] In this embodiment, the neighboring voxels of the current voxel may be voxels located in four directions of the front, back, left, and right of the current voxel.

[0133] S1043. Based on a preset jump height, select each pending voxel that can be moved from all adjacent voxels.

[0134] In this embodiment, considering that the jumping height limit of the virtual character is not to exceed the preset jumping height, when the virtual character is in the current voxel and searches for the next jumping voxel from the adjacent voxels, the height difference between the adjacent voxels needs to be considered.

[0135] Optionally, when two adjacent voxels of the current voxel correspond to the same grid on the peripheral polyhedron, it is necessary to consider not only the height difference between the current voxel and the two adjacent voxels, but also the relative positions of the two adjacent voxels. Therefore, the sub-steps of step S1043 may include the following sub-steps S10431 to S10435.

[0136] S10431. For each adjacent voxel of the current voxel, calculate the difference between the bottom side edge distances of the adjacent voxel and the current voxel to obtain the height difference between the adjacent voxel and the current voxel. If the height difference is lower than a preset jump height, take the adjacent voxel as the target adjacent voxel.

[0137] Combination Fig. 9 , the current voxel is a green voxel, its adjacent voxel is a purple voxel, the bottom side edge distance of the current voxel is the length of line segment OB, the bottom side edge distance of its adjacent voxel is the length of line segment OA, and the height difference between the two voxels is the difference between the lengths of OA and OB. This example is for illustration only and is not intended to be limiting.

[0138] In this embodiment, the target adjacent voxel is an adjacent voxel that the virtual character can reach by jumping from the current voxel.

[0139] S10432. Obtain the grid position in the position data set corresponding to each target adjacent voxel, and take each target adjacent voxel with a unique grid position among all target adjacent voxels as a pending voxel that can be moved.

[0140] In this embodiment, for checking the grid positions contained in the position data set corresponding to each target adjacent voxel, if the grid position corresponding to any target adjacent voxel is unique in the position data set corresponding to all target adjacent voxels, then it is confirmed that the target adjacent voxel belongs to the pending voxel that the virtual character can move to.

[0141] S10433. If there are two target adjacent voxels whose corresponding grid positions are the same, determine the near-center voxel and the far-center voxel in the two target adjacent voxels, and use the far-center voxel as a pending voxel that can be moved.

[0142] In this embodiment, if there are two target adjacent voxels with the same grid position among all target adjacent voxels, the top side edge distances corresponding to the two target adjacent voxels are obtained, and the target adjacent voxel with the smaller top side edge distance among the two target adjacent voxels is taken as the near center voxel, and the other target adjacent voxel with the smaller top side edge distance is taken as the far center voxel. The far center voxel can be directly determined as the pending voxel that the virtual character can move to.

[0143] In the optional example, please combine Figure 7 , Figure 7 In the figure, the grid positions of the corresponding grids of the red voxels and the green voxels are the same. The red voxels and the green voxels are obtained by voxelizing two different triangular face elements (triangular face element 1 and triangular face element 2) on the obstacle model. Obviously, the top side edge distance (the length of OA) of the red voxel is greater than the top side edge distance (the length of OB) of the green voxel. Therefore, the green voxel is a near-center voxel, and the red voxel is a far-center voxel.

[0144] S10434, calculating the gap distance between the near-center voxel and the far-center voxel, and calculating the entrance width of the gap space formed by the virtual character entering from the current voxel into the near-center voxel and the far-center voxel.

[0145] In this embodiment, the top side edge distance and bottom side edge distance in the three position data sets corresponding to the current voxel, the near-center voxel and the far-center voxel can be obtained to obtain 6 distance values. The gap spacing is the difference between the top side edge distance of the far-center voxel and the bottom side edge distance of the near-center voxel. Then, the entrance width can be calculated based on these 6 distance values, which is divided into the following cases:

[0146] Case (1): If the distance between the top side edge of the far-center voxel is less than the distance between the bottom side edge of the current voxel, the entrance width is confirmed to be 0;

[0147] Case (2): if the top side edge distance of the far-center voxel > the bottom side edge distance of the current voxel > the bottom side edge distance of the near-center voxel, then the entrance width = the top side edge distance of the far-center voxel - the bottom side edge distance of the current voxel;

[0148] Case (3): If the bottom side edge distance of the current voxel is less than the bottom side edge distance of the near-center voxel, then the entrance width = the gap spacing.

[0149] In the optional example, combine Figure 7 , the current voxel, the near-center voxel, and the far-center voxel are blue voxels, green voxels, and red voxels respectively. The positional relationship between the three conforms to the above situation (2), so the gap spacing is the length of AB, and the entrance width is the length of CD. Combined with Figure 7 The examples shown are merely illustrative and are not intended to be limiting.

[0150] S10435. If the entrance width and the gap spacing are not less than the passing width of the virtual character, the near-center voxel is used as a pending voxel that can be moved.

[0151] In this embodiment, the passing width depends on the travel mode setting of the virtual character in the system setting. If the entrance width and the gap spacing are not less than the passing width of the virtual character, then the near-center voxel can be used as the pending voxel that the virtual character can travel.

[0152] Optionally, taking the virtual character as a human character as an example, if the virtual character can crawl, the passing width can be the width of the virtual character's body; if the virtual character can only walk upright, the passing width can be the upright height of the virtual character; if the virtual character can walk with a bent waist, the passing width can be the bent waist height of the virtual character.

[0153] In this way, through the above steps S10431 to S10435, each pending voxel that can be moved can be screened out from all adjacent voxels of the current voxel.

[0154] S1044 , calculating the cost value of each pending voxel, and selecting the pending voxel with the smallest cost value as the next hop voxel of the current voxel.

[0155] In this embodiment, the method for calculating the cost value may be the method for calculating the cost value in the A* algorithm in the prior art, which will not be described in detail here.

[0156] S1045: Determine whether the adjacent voxels of the next-hop voxel include the end point voxel.

[0157] In this embodiment, if the neighboring voxels of the next-hop voxel do not include the end voxel, then S1046 is executed and then the process returns to S1042 until the neighboring voxels of the next-hop voxel include the end voxel. If the neighboring voxels of the next-hop voxel include the end voxel, then S1047 is executed.

[0158] S1046: Use the next hop voxel as the new current voxel.

[0159] S1047. Obtain a voxel path from the starting voxel to the ending voxel.

[0160] Through the above steps S1041 to S1047, the voxel path from the starting voxel to the ending voxel can be found.

[0161] Optionally, the process of converting the voxel path into a travel path from the starting point to the end point in the above step S105 includes: calculating the base center point of the regular tetrahedron corresponding to each passing voxel in the voxel path based on the position data set of the passing voxel, and using the base center point as the passing path point until the passing path point corresponding to each passing voxel in the voxel path is obtained; and connecting the starting point, the obtained passing path points and the end point in series to obtain the travel path.

[0162] It should be noted that the execution order of each step in the above method embodiment is not limited to that shown in the drawings, and the execution order of each step shall be based on the actual application situation.

[0163] In order to execute the corresponding steps in the above method embodiment and various possible implementations, an implementation of a voxelized pathfinding device is provided below.

[0164] See also Fig.10 , Fig.10 The schematic diagram of the structure of the voxelized pathfinding device provided by the embodiment of the present invention is shown. The voxelized pathfinding device 200 comprises: an acquisition module 210 , a voxelization module 220 and a pathfinding module 230 .

[0165] An acquisition module 210 is used to acquire a starting point and an end point of the virtual character on the surface of the obstacle model;

[0166] The voxelization module 220 is used to voxelize the obstacle model based on the geometric center point of the obstacle model to obtain a voxel table; the voxel table includes a plurality of position data sets, each position data set is used to reflect the position of a voxel;

[0167] The path-finding module 230 is used to: determine the starting voxel and the ending voxel corresponding to the starting point and the ending point respectively based on the voxel table; find the voxel path from the starting point voxel to the ending point voxel using the A* algorithm based on the voxel table; and convert the voxel path into a travel path from the starting point to the ending point.

[0168] Optionally, the obstacle model includes several triangular primitives, and the triangular primitive includes three vertices. The voxelization module 220 can be specifically used to: obtain the outer polyhedron of the obstacle model and the geometric center point of the obstacle model; each face of the outer polyhedron includes several meshes; for any triangular primitive of the obstacle model, obtain three first rays starting from the geometric center point and pointing to the three vertices of the triangular primitive respectively, and use the intersection of each first ray and the face of the outer polyhedron as the vertex projection to obtain the three vertex projections of the triangular primitive; obtain each target mesh in the area surrounded by the three vertex projections of the triangular primitive; for each target mesh, perform center projection processing on the plane where the triangular primitive is located based on the geometric center point to obtain the position data set of the voxel corresponding to the target mesh; traverse each triangular primitive of the obstacle model to obtain a voxel table.

[0169] Optionally, the voxelization module 220 can be specifically used to: obtain four second rays starting from the geometric center point and pointing to the four mesh vertices of the target mesh respectively, and use the intersection of each second ray with the plane where the triangular primitive is located as the projection point to obtain four projection points corresponding to the target mesh; calculate the interval distance between each projection point and the geometric center point, and find the first projection point with the smallest interval distance and the second projection point with the largest interval distance; based on the grid position of the target mesh, the interval distances corresponding to the first projection point and the second projection point, generate a position data set of the voxels corresponding to the target mesh.

[0170] Optionally, the position data set includes the grid position of the grid corresponding to the voxel on the peripheral polyhedron of the obstacle model; each face of the peripheral polyhedron includes a plurality of grids. The voxelization module 220 can also be used to: classify all the position data sets in the voxel table according to the different grid positions to obtain multiple data groups; find out each data group to be screened in which the number of position data sets is not unique from all the data groups; for each data group to be screened, find out each pending position data set with voxel overlap in the data group to be screened and combine or filter each pending position data set until there is no voxel overlap between any two position data sets in the data group to be screened.

[0171] Optionally, the shape of the voxel is a regular tetrahedron, and the position data set also includes the top side edge distance between any vertex of the top surface of the regular tetrahedron corresponding to the voxel and the geometric center point, and the bottom side edge distance between any vertex of the bottom surface of the regular tetrahedron and the geometric center point. The voxelization module 220 can be specifically used to: for any two data sets of positions to be screened in the voxel group to be screened, obtain the first top surface side edge distance and the first bottom surface side edge distance from one of the data sets of positions to be screened, and obtain the second top surface side edge distance and the second bottom surface side edge distance from the other data set of positions to be screened; if the second bottom surface side edge distance is greater than the first top surface side edge distance and the first bottom surface side edge distance is greater than the second top surface side edge distance, then it is determined that there is a voxel overlap between the two voxels to be screened represented by the two data sets of positions to be screened, extract the grid position from any data set of positions to be screened, save the grid position, the first top surface side edge distance and the second bottom surface side edge distance to obtain a new position data set, and replace the two data sets of positions to be screened with the new position data set; if the first bottom surface side edge distance is greater than the second top surface side edge distance and the second bottom surface side edge distance is greater than the first top surface side edge distance, then it is determined that the two voxels to be screened represented by the two data sets of positions to be screened If there is a voxel overlap between the two voxels to be screened represented by the two data sets, a grid position is extracted from any data set of positions to be screened, the grid position, the second top surface side edge distance and the first bottom surface side edge distance are saved to obtain a new position data set, and the two data sets of positions to be screened are replaced by the new position data set; if the second top surface side edge distance is greater than the first top surface side edge distance and the first bottom surface side edge distance is greater than the second bottom surface side edge distance, then it is determined that there is a voxel overlap between the two voxels to be screened represented by the two data sets of positions to be screened, and the data sets of positions to be screened including the second top surface side edge distance and the second bottom surface side edge distance are deleted; if the first top surface side edge distance is greater than the second top surface side edge distance and the second bottom surface side edge distance is greater than the first bottom surface side edge distance, then it is determined that there is a voxel overlap between the two voxels to be screened represented by the two data sets of positions to be screened, and the data sets of positions to be screened including the first top surface side edge distance and the first bottom surface side edge distance are deleted.

[0172] Optionally, the path-finding module 230 can be specifically used to: take the starting voxel as the current voxel; based on the voxel table, obtain each adjacent voxel of the current voxel; based on a preset jump height, filter out each traversable pending voxel from all adjacent voxels; calculate the cost value of each pending voxel, and select the pending voxel with the smallest cost value as the next-hop voxel of the current voxel; determine whether the adjacent voxels of the next-hop voxel include the terminal voxel; if the adjacent voxels of the next-hop voxel do not include the terminal voxel, take the next-hop voxel as the new current voxel and return to execute the step of obtaining each adjacent voxel of the current voxel based on the voxel table, until the adjacent voxels of the next-hop voxel include the terminal voxel; if the adjacent voxels of the next-hop voxel include the terminal voxel, the voxel path from the starting voxel to the terminal voxel is obtained.

[0173] Optionally, the shape of the voxel is a regular tetrahedron, and the position data set includes the grid position of the grid corresponding to the voxel on the peripheral polyhedron of the obstacle model, the top surface side edge distance between any vertex of the top surface of the regular tetrahedron corresponding to the voxel and the geometric center point, and the bottom surface side edge distance between any vertex of the bottom surface of the regular tetrahedron and the geometric center point; each face of the peripheral polyhedron includes a number of grids. The pathfinding module 230 can be specifically used to: for each adjacent voxel, calculate the difference between the bottom side edge distances corresponding to the adjacent voxel and the current voxel, and obtain the height difference between the adjacent voxel and the current voxel. If the height difference is lower than the preset jump height, the adjacent voxel is used as the target adjacent voxel; obtain the grid position in the position data set corresponding to each target adjacent voxel, and use each target adjacent voxel with a unique grid position in all target adjacent voxels as a pending voxel that can be moved; if there are two target adjacent voxels with the same grid position, determine the near-center voxel and the far-center voxel in the two target adjacent voxels, and use the far-center voxel as a pending voxel that can be moved; calculate the gap spacing between the near-center voxel and the far-center voxel, and calculate the entrance width of the gap space formed by the virtual character entering from the current voxel between the near-center voxel and the far-center voxel; if the entrance width and the gap spacing are not lower than the passing width of the virtual character, the near-center voxel is used as a pending voxel that can be moved.

[0174] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the voxelized pathfinding device 200 described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0175] See also Fig.11 , Fig.11 The electronic device 300 includes a processor 310 , a memory 320 , and a bus 330 , wherein the processor 310 is connected to the memory 320 via the bus 330 .

[0176] The memory 320 may be used to store software programs, for example, software programs corresponding to the voxelized pathfinding device 200 provided in the embodiment of the present invention. The processor 310 executes various functional applications and data processing to implement the voxelized pathfinding method provided in the embodiment of the present invention by running the software programs stored in the memory 320.

[0177] Among them, the memory 320 can be but is not limited to: RAM (Random Access Memory), ROM (Read Only Memory), FLASH (Flash Memory), PROM (Programmable Read-Only Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electric Erasable Programmable Read-Only Memory), etc.

[0178] The processor 310 may be an integrated circuit chip with signal processing capability. The processor 310 may be a general-purpose processor, including: CPU (Central Processing Unit), NP (Network Processor), etc.; it may also be: DSP (Digital Signal Processing), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0179] Understandably, Fig.11 The structure shown is for illustration only. The electronic device 300 may also include Fig.11 More or fewer components as shown, or with Fig.11 Different configurations are shown. Fig.11 Each component shown in the figure can be implemented by hardware, software or a combination thereof.

[0180] The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the voxelized pathfinding method disclosed in the above embodiment is implemented. The computer-readable storage medium can be, but is not limited to, various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a PROM, an EPROM, an EEPROM, a FLASH disk, or an optical disk.

[0181] In summary, the embodiments of the present invention provide a voxelized pathfinding method, device, electronic device and storage medium, firstly obtaining the starting point and end point of the virtual character on the surface of the obstacle model; based on the geometric center point of the obstacle model, voxelizing the obstacle model to obtain a voxel table; the voxel table includes several position data sets, each position data set is used to reflect the position of a voxel; based on the voxel table, the starting voxel and the end point voxel corresponding to the starting point and the end point are determined; based on the voxel table, the voxel path from the starting point voxel to the end point voxel is found using the A* algorithm; the voxel path is converted into a path from the starting point to the end point. The present invention voxelizes the obstacle model based on the geometric center point of the obstacle model to obtain a voxel table, so that the path of the virtual character on the obstacle surface can be found based on the voxel table.

[0182] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A voxelized pathfinding method, characterized in that: include: Obtain the starting point and end point of the virtual character on the surface of the obstacle model; Based on the geometric center point of the obstacle model, voxelizing the obstacle model to obtain a voxel table; the voxel table includes a plurality of position data sets, each position data set is used to reflect the position of a voxel; Based on the voxel table, determining the starting voxel and the ending voxel corresponding to the travel starting point and the travel ending point respectively; Based on the voxel table, using the A* algorithm to find the voxel path from the starting voxel to the end voxel; The voxel path is converted into a travel path from the travel start point to the travel end point.

2. The method according to claim 1, characterized in that The obstacle model includes a plurality of triangular primitives, each of which includes three vertices; The step of voxelizing the obstacle model based on the geometric center point of the obstacle model to obtain a voxel table includes: Obtaining a peripheral polyhedron of the obstacle model and a geometric center point of the obstacle model; each face of the peripheral polyhedron includes a plurality of grids; For any of the triangular primitives of the obstacle model, three first rays starting from the geometric center point and pointing to the three vertices of the triangular primitive are obtained, and the intersection point of each of the first rays with the surface of the peripheral polyhedron is used as a vertex projection to obtain three vertex projections of the triangular primitive; Acquire each target mesh in the area enclosed by the projections of three vertices of the triangular primitive; For each target grid, based on the geometric center point, perform a center projection process on the target grid onto the plane where the triangular primitive is located, so as to obtain a position data set of voxels corresponding to the target grid; Each triangular primitive of the obstacle model is traversed to obtain the voxel table.

3. The method according to claim 2, characterized in that The step of performing center projection processing on the target grid onto the plane where the triangular primitive is located based on the geometric center point to obtain a position data set of voxels corresponding to the target grid includes: Obtain four second rays starting from the geometric center point and pointing to four mesh vertices of the target mesh respectively, and use the intersection of each second ray and the plane where the triangular primitive is located as a projection point to obtain four projection points corresponding to the target mesh; Calculate the interval distance between each projection point and the geometric center point, and find the first projection point with the smallest interval distance and the second projection point with the largest interval distance; Based on the grid position of the target grid, the interval distances corresponding to the first projection point and the second projection point, a position data set of voxels corresponding to the target grid is generated.

4. The method according to claim 1, characterized in that The position data set includes grid positions of grids corresponding to voxels on a peripheral polyhedron of the obstacle model; each face of the peripheral polyhedron includes a plurality of grids; Before the step of determining the starting point voxel and the ending point voxel corresponding to the travel starting point and the travel ending point respectively based on the voxel table, the method further includes: Classifying all position data sets in the voxel table according to different grid positions to obtain multiple data groups; Finding each data group to be screened whose number of position data sets is not unique from all data groups; For each of the data groups to be screened, each pair of pending position data sets with voxel overlap in the data group to be screened is found and each pair of pending position data sets is combined or filtered until there is no voxel overlap between any two position data sets in the data group to be screened.

5. The method according to claim 4, characterized in that The shape of the voxel is a regular tetrahedron, and the position data set further includes the top surface side edge distance between any vertex of the top surface of the regular tetrahedron corresponding to the voxel and the geometric center point, and the bottom surface side edge distance between any vertex of the bottom surface of the regular tetrahedron and the geometric center point; The step of finding each pending position data set with voxel overlap in the data group to be screened and combining or filtering each pending position data set comprises: For any two to-be-screened position data sets in the to-be-screened voxel group, a first top surface side edge distance and a first bottom surface side edge distance are obtained from one of the to-be-screened position data sets, and a second top surface side edge distance and a second bottom surface side edge distance are obtained from the other to-be-screened position data set; If the second bottom surface side edge distance is greater than the first top surface side edge distance and the first bottom surface side edge distance is greater than the second top surface side edge distance, it is determined that there is a voxel overlap between the two to-be-screened voxels represented by the two to-be-screened position data sets, a grid position is extracted from any to-be-screened position data set, the grid position, the first top surface side edge distance and the second bottom surface side edge distance are saved to obtain a new position data set, and the two to-be-screened position data sets are replaced by the new position data set; If the first bottom surface side edge distance is greater than the second top surface side edge distance and the two bottom surface side edge distances are greater than the first top surface side edge distance, it is determined that there is a voxel overlap between the two to-be-screened voxels represented by the two to-be-screened position data sets, a grid position is extracted from any to-be-screened position data set, the grid position, the second top surface side edge distance and the first bottom surface side edge distance are saved to obtain a new position data set, and the two to-be-screened position data sets are replaced by the new position data set; If the second top surface side edge distance is greater than the first top surface side edge distance and the first bottom surface side edge distance is greater than the second bottom surface side edge distance, it is determined that there is a voxel overlap between the two to-be-screened voxels represented by the two to-be-screened position data sets, and the to-be-screened position data set including the second top surface side edge distance and the second bottom surface side edge distance is deleted; If the first top surface side edge distance is greater than the second top surface side edge distance and the two bottom surface side edge distances are greater than the first bottom surface side edge distance, it is determined that there is voxel overlap between the two voxels to be screened represented by the two data sets of position to be screened, and the data set of position to be screened including the first top surface side edge distance and the first bottom surface side edge distance is deleted.

6. The method according to claim 1, characterized in that The step of searching for a voxel path from the starting voxel to the ending voxel using an A* algorithm based on the voxel table comprises: Taking the starting point voxel as the current voxel; Based on the voxel table, obtaining each adjacent voxel of the current voxel; Based on a preset jump height, each pending voxel that can be traveled is selected from all adjacent voxels; Calculate the cost value of each pending voxel, and select the pending voxel with the smallest cost value as the next hop voxel of the current voxel; Determine whether the adjacent voxels of the next-hop voxel include the end point voxel; If the neighboring voxels of the next-hop voxel do not include the end-point voxel, the next-hop voxel is used as a new current voxel and the step of obtaining each neighboring voxel of the current voxel based on the voxel table is returned to be executed until the neighboring voxels of the next-hop voxel include the end-point voxel; If the adjacent voxels of the next-hop voxel include the destination voxel, a voxel path from the start voxel to the destination voxel is obtained.

7. The method according to claim 6, characterized in that The shape of the voxel is a regular tetrahedron, and the position data set includes the grid position of the grid corresponding to the voxel on the peripheral polyhedron of the obstacle model, the top surface side edge distance between any vertex of the top surface of the regular tetrahedron corresponding to the voxel and the geometric center point, and the bottom surface side edge distance between any vertex of the bottom surface of the regular tetrahedron and the geometric center point; each face of the peripheral polyhedron includes a plurality of grids; The step of selecting each pending voxel that can be moved from all adjacent voxels based on the preset jump height includes: For each of the adjacent voxels, the difference between the bottom side edge distances of the adjacent voxel and the current voxel is calculated to obtain a height difference between the adjacent voxel and the current voxel, and if the height difference is lower than the preset jump height, the adjacent voxel is used as a target adjacent voxel; Obtaining the grid position in the position data set corresponding to each target adjacent voxel, and taking each target adjacent voxel that is unique in the grid position among all target adjacent voxels as a pending voxel that can be moved; If there are two target adjacent voxels whose corresponding grid positions are the same, determine the near-center voxel and the far-center voxel in the two target adjacent voxels, and use the far-center voxel as the pending voxel that can be moved; Calculating the gap distance between the near-center voxel and the far-center voxel, and calculating the entrance width of the virtual character entering the gap space formed between the near-center voxel and the far-center voxel from the current voxel; If the entrance width and the gap spacing are not less than the passing width of the virtual character, the near-center voxel is used as a pending voxel that can be moved.

8. A voxelized pathfinding device, characterized in that: include: An acquisition module, used to acquire the starting point and the end point of the virtual character on the surface of the obstacle model; A voxelization module, configured to voxelize the obstacle model based on the geometric center point of the obstacle model to obtain a voxel table; the voxel table includes a plurality of position data sets, each position data set is used to reflect the position of a voxel; Pathfinding module, used to: Based on the voxel table, determining the starting voxel and the ending voxel corresponding to the travel starting point and the travel ending point respectively; Based on the voxel table, using the A* algorithm to find the voxel path from the starting voxel to the end voxel; The voxel path is converted into a travel path from the travel start point to the travel end point.

9. An electronic device, characterized in that: include: A memory and a processor, wherein the memory stores a software program, and when the electronic device is running, the processor executes the software program to implement the voxelized pathfinding method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the voxelized pathfinding method according to any one of claims 1 to 7 is implemented.