Optimization method, system and storage medium for path points in automatic path finding of virtual scenes

By setting an encirclement for the model in a virtual scene and calculating the tangent intersection point, and optimizing the automatic pathfinding path, the problem of excessive rotation and stun caused by traditional automatic pathfinding is solved, and a softer lens steering and lower stun feel is achieved.

CN119169233BActive Publication Date: 2025-04-08VSWORK NETWORK TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411668043.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-04-08
Estimated Expiration
2044-11-21

AI Technical Summary

Technical Problem

Traditional automatic pathfinding cannot consider the condition of lens steering in virtual environments, causing the user to rotate the lens too much when the character walks to the edge of the obstacle, causing a sense of dizziness.

Method used

By presetting the enclosure for all models in the virtual scene, instead of obstacles, and calculating the intersection point between the tangent line of the enclosure and the straight line path, selecting the intersection point with the angle smaller than the preset threshold and closest to the enclosure as the reference point, adjusting the initial path point to generate the final path point.

Benefits of technology

While ensuring the shortest path, reduce the amplitude and frequency of lens steering and reduce the user's vertigo.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119169233B_ABST
    Figure CN119169233B_ABST
Patent Text Reader

Abstract

The invention discloses an optimization method, system and storage medium for path points when a virtual scene is automatically found, and belongs to the field of automatic path finding technology. The method includes: setting an encirclement for all models in the virtual scene in advance; calculating the straight path between the initial point and the target point, setting a number of path points that evenly divide the straight path, and saving all path points as initial path points; obtaining the edge point coordinates of the encirclement on the straight path; calculating the intersection of the tangent of all edge points of the encirclement and the straight path according to the edge point coordinates, calculating the angle between all tangents and the straight path, selecting the intersection whose angle is less than a preset angle threshold and closest to the encirclement as a reference point, recording the edge point on the tangent as an adjustment point; adjusting the initial path point, deleting the path point between the two reference points, and adding the reference point and the adjustment point to generate the final path point. The invention reduces the visual dizziness by reducing the turning angle of the user during automatic path finding.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automatic path finding technology, and in particular to a method, system and storage medium for optimizing path points during automatic path finding in a virtual scene. Background Art

[0002] Automatic pathfinding in virtual scenes refers to the function of enabling virtual characters (such as characters in games, user representatives in virtual reality (VR), etc.) to automatically find and follow the shortest or optimal path to the target location in a computer-generated virtual environment through specific algorithms and technical means. This function is widely used in many fields, including but not limited to online games, virtual reality experiences, virtual training, etc.

[0003] After the traditional automatic pathfinding is completed in the virtual environment modeling, the path planning algorithm is loaded. The path planning algorithm is responsible for finding the shortest or optimal path from the starting point to the end point in the virtual environment. And the algorithm will consider multiple factors such as terrain, obstacles, path length, etc. to calculate the most suitable path. However, the existing path planning algorithm can only meet the shortest path while avoiding obstacles. When the actual user uses this algorithm, the field of view lens will rotate with the character. The traditional path planning algorithm turns around when the character walks to the edge of the obstacle. This action will cause the lens to turn. If the turn is large or the frequency of turning in a short distance is high, the lens turning angle and turning frequency will increase, which will cause the user to feel dizzy and other discomfort when watching the field of view. Summary of the invention

[0004] The purpose of the present invention is to solve the problem that the path planning during the above-mentioned automatic path finding cannot take into account the conditions of lens turning, which easily causes dizziness to the user, and to propose a method, system and storage medium for optimizing path points during automatic path finding in a virtual scene. The method has the advantages of ensuring smooth lens turning when planning the shortest path and reducing the feeling of dizziness.

[0005] In a first aspect, the present invention achieves the above-mentioned purpose through the following technical solutions, a method for optimizing path points during automatic pathfinding in a virtual scene, the method comprising the following steps:

[0006] Pre-setting an encirclement for all models in the virtual scene, wherein the range of the encirclement is at least larger than the maximum occlusion range of the model in the virtual scene;

[0007] Calculate a straight line path between an initial point and a target point, set a number of path points that evenly divide the straight line path, and save all the path points as initial path points, where the initial point is the current position of the user in the virtual scene, and the target point is the end point of the automatic path finding;

[0008] Acquire information of an encirclement on the straight path, the information including coordinates of edge points of the encirclement;

[0009] Calculate the intersection points of the tangents of all edge points of the encirclement and the straight path according to the edge point coordinates, calculate the angles between all the tangents and the straight path, select the intersection points whose angles are less than a preset angle threshold and closest to the encirclement as reference points, record the edge points on the tangents as adjustment points, and the number of the reference points and the adjustment points are both two and symmetrical with the encirclement;

[0010] The initial path point is adjusted, the path point between the two reference points is deleted, and the reference point and the adjustment point are added to generate the final path point.

[0011] Preferably, the method also includes setting a minimum radius of the encirclement, and determining whether the maximum occlusion range of the model is smaller than the encirclement of the minimum radius. If so, the range of the encirclement is set according to the minimum radius; otherwise, the range of the encirclement is set according to the maximum occlusion range of the model.

[0012] Preferably, the method of pre-setting encirclements for all models in the virtual scene includes manual marking or program marking, and the program marking method is:

[0013] When building a virtual scene, save the location information of the model;

[0014] Set the radius of the encirclement and calculate the center coordinates of the model's location information. The calculation method is: connect the two farthest vertices of the model on the ground, calculate the midpoint between the two vertices, and use the coordinates of the midpoint as the center coordinates;

[0015] With the central coordinate as the center of the encirclement, an encirclement is generated on the plane where the bottom of the model is located when the radius is known.

[0016] Preferably, the method further includes obtaining the center coordinates of the encirclement, and if the straight line path passes through the center coordinates, calculating the direction vectors of all adjustment points and the center coordinates, retaining any two adjustment points with the same direction according to the direction vectors, and deleting other adjustment points.

[0017] Preferably, the method further comprises the user walking along an edge point between the two adjustment points.

[0018] Preferably, the method for calculating the intersection points of the tangent lines of all edge points of the encirclement and the straight line path according to the edge point coordinates is:

[0019] Select a point on the straight path and send rays to all edge points of the encirclement;

[0020] Calculate the intersection point of the ray and the encirclement. If the intersection point is only the edge point, record the ray as the tangent line and the point on the straight line path as the intersection point.

[0021] Calculate all points on the straight line path in sequence and record the intersection points and tangent lines.

[0022] In a second aspect, the present invention achieves the above-mentioned purpose through the following technical solutions: a system for optimizing path points during automatic path finding in a virtual scene, the system comprising:

[0023] The encirclement setting unit is used to pre-set an encirclement for all models in the virtual scene, and the range of the encirclement is at least greater than

[0024] The maximum occlusion range of the model in the virtual scene;

[0025] An initial path point calculation unit is used to calculate a straight path between an initial point and a target point, set a number of path points that evenly divide the straight path, and save all the path points as initial path points, wherein the initial point is the current position of the user in the virtual scene, and the target point is the end point of the automatic path finding;

[0026] An edge point unit, used to obtain information of an encirclement on the straight path, wherein the information includes coordinates of edge points of the encirclement;

[0027] A reference point and adjustment point calculation unit, used to calculate the intersection points of the tangents of all edge points of the encirclement and the straight path according to the edge point coordinates, calculate the angles between all the tangents and the straight path, select the intersection point whose angle is less than a preset angle threshold and is closest to the encirclement as the reference point, record the edge point on the tangent as the adjustment point, and the number of the reference points and the adjustment points are both two and symmetrical with the encirclement;

[0028] The final path point calculation unit adjusts the initial path point, deletes the path point between the two reference points, and adds the reference point and the adjustment point to generate the final path point.

[0029] Preferably, the system further comprises obtaining the center coordinates of the encirclement, and if the straight line path passes through the center coordinates, calculating the direction vectors of all adjustment points and the center coordinates, retaining any two adjustment points with the same direction according to the direction vectors, and deleting other adjustment points.

[0030] Preferably, the system also includes the user's walking path between the two adjustment points being walking along an edge point between the adjustment points.

[0031] In a third aspect, the present invention achieves the above-mentioned purpose through the following technical scheme: a storage medium having a computer program stored thereon, which, when the computer program is executed by a processor, implements the method for optimizing path points during automatic pathfinding in a virtual scene as described in the first aspect.

[0032] Compared with the prior art, the present invention has the following beneficial effects:

[0033] The present invention sets an encirclement around all models in a scene and replaces obstacles with the encirclement. Since the outer edge of the encirclement is an arc, the lens steering changes slowly when the user finds a way along the outer edge. Compared with the traditional method of suddenly turning when reaching the edge of the obstacle, the field of view lens rotation is softer. Moreover, when an encirclement on a straight path is identified, a tangent with a smaller deflection angle and the intersection with the straight path closest to the encirclement is calculated, and then the user moves to the edge of the encirclement along the tangent. This allows the user to achieve the shortest moving path within a smaller steering range. This path optimization method can greatly reduce the visual dizziness caused by automatic path finding. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 This is a flow chart of the method for optimizing path points during automatic path finding in a virtual scene of the present invention.

[0035] Figure 2 Schematic diagram for selecting reference points and tangent lines of the present invention.

[0036] Figure 3 This is a schematic diagram of the final path points generated by the present invention.

[0037] Figure 4 It is a schematic diagram of the state in which the straight path of the present invention passes through the center of the encirclement.

[0038] Figure 5 This is a schematic diagram of the composition of the optimization system for path points during automatic path finding in a virtual scene of the present invention. DETAILED DESCRIPTION

[0039] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. 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.

[0040] Example 1

[0041] like Figure 1 As shown, a method for optimizing path points when automatically finding a path in a virtual scene comprises the following steps:

[0042] Step S1, pre-set an encirclement for all models in the virtual scene, and the range of the encirclement is at least larger than the maximum occlusion range of the model in the virtual scene. In the construction of the virtual scene, the scene is arranged by building models in the scene. Due to the various styles of models in the scene, some models are irregular models, and there are some irregular contact surfaces such as corners. These models will become obstacles during automatic pathfinding. The traditional automatic pathfinding planning algorithm only bypasses the obstacle when the user walks to the edge of the obstacle. If the contact surface of the obstacle is irregularly curved, it is inevitable that the user needs to keep turning to bypass the obstacle. In this way, the field of view lens follows the turning, causing the picture to rotate continuously, which brings a sense of dizziness. The surrounding of the model is changed into a regular arc shape by the encirclement, so that even if the traditional pathfinding algorithm is used, the user can realize the smooth turning of the user in the process of bypassing the obstacle. In order to ensure that the encirclement can completely wrap the model, the range of the encirclement is at least larger than the maximum occlusion range of the model in the virtual scene.

[0043] Step S2, calculate the straight path between the initial point and the target point, set a number of path points that evenly divide the straight path, and save all the path points as initial path points, the initial point is the current position of the user in the virtual scene, the target point is the end point of automatic path finding, and the starting position and the stopping position need to be obtained at the beginning of automatic path finding. The straight path formed by the initial point and the target point is the shortest path between the starting point and the end point. Here, this shortest path is saved as the initial path, because the straight path in this step is the ideal shortest path. In actual applications, there may be obstacles blocking the user's progress.

[0044] Step S3, obtaining information of the encirclement on the straight path, the information including the edge point coordinates of the encirclement. This step identifies whether there is an obstacle blocking the model. Because an encirclement is set outside the model, the information of the encirclement is identified here to determine whether there is an obstacle blocking the model. If there is an encirclement on the straight path, the edge point coordinates of the encirclement are obtained. The encirclement is a circle surrounding the model, so the boundary of the circle is composed of several points, and the position information of these points is the edge point coordinates.

[0045] Step S4, calculating the intersection points of the tangents of all edge points of the encirclement and the straight path according to the edge point coordinates, calculating the angles between all the tangents and the straight path, selecting the intersection points whose angles are less than a preset angle threshold and closest to the encirclement as reference points, recording the edge points on the tangents as adjustment points, the number of the reference points and the adjustment points are both two and symmetrical with the encirclement. The encirclement blocks the user from passing through. The solution is to bypass the encirclement. The encirclement is different from the actual model because the actual model may be irregular in shape. If the user goes around the model closely, the irregular edges will cause the user's character to turn the body many times, which will cause the field of view lens to rotate at a high frequency, thus giving the user a dizzy visual experience. By setting an encirclement, the user can bypass the obstacle and bypass a regular arc obstacle. This can effectively reduce the character's unnecessary turning movements and reduce visual dizziness. Since the encirclement is a circle, each circle has countless tangents passing through the straight path. In order to avoid the user from having to turn a large amplitude when reaching the edge of the encirclement from the straight path, a pre-set angle threshold is selected. For example, the angle threshold can be set to 30°. When the user deflects 30°, the rotation amplitude of the field of view will not be too large, so it will not cause dizziness. Since several points on the straight path have tangents less than the angle threshold, such as Figure 2 As shown, on the straight path AB, there are two tangents l1 and l2 that satisfy the condition that the angle between the tangent and the straight line AB is less than the threshold. According to the principle that the straight line between two points is the shortest, in order to ensure that the path for the user to reach the edge of the encirclement is the shortest, the intersection a2 is closer to the intersection a1, so that the length of the path l2 that needs to be walked diagonally is less than l1. It is more appropriate to choose a2 as the reference point here. Moreover, the straight line AB passes through the encirclement, and the area of ​​the encirclement on the l2 side is smaller than the area on the l1 side. Using the nearest intersection as the reference point, it is easier to avoid long-distance paths, making the path more suitable.

[0046] like Figure 3 As shown, when the straight line AB passes through the encirclement, there will be two tangents, l2 and l3, which both satisfy that the angle between the straight line path is less than the preset threshold and the intersection point is closest to the encirclement. Each tangent has an intersection point with the encirclement. P1 is the intersection point of L2 and the encirclement, and P2 is the intersection point of L3 and the encirclement. Still based on the principle that the straight line between two points is the shortest, when the user bypasses the obstacle, returning to the straight line path as soon as possible is the optimal path. When the deflection angle is small, the distance from P2 to A3 is the shortest. Therefore, after bypassing the obstacle, the user can also return to the initial trajectory without a large rotation of the view angle and continue to move towards the target point.

[0047] Step S5, adjusting the initial path points, deleting the path points between the two reference points, and adding the reference points and the adjustment points to generate the final path points. Based on the reference points and adjustment points calculated in step S3, the initial path is optimized, such as Figure 3 As shown, the user automatically finds the path between A and B along A-a2-P2-a3-B according to the location of the final path point.

[0048] In order to avoid the distance between the reference point and the adjustment point being too close, which would cause the field of view lens to turn twice in a short distance, the method also includes setting the minimum radius of the encirclement, judging whether the maximum occlusion range of the model is smaller than the encirclement with the minimum radius, and if so, the range of the encirclement is set according to the minimum radius; otherwise, the range of the encirclement is set according to the maximum occlusion range of the model. In this way, when there are fewer obstacles, the user's character can be prevented from turning back and forth in a short distance process, alleviating the visual dizziness caused by high-frequency shaking of the lens.

[0049] The encirclement is to transform the irregular edge models in the scene into regular arc edges. The method of pre-setting encirclements for all models in the virtual scene includes manual marking or program marking. The program marking method is:

[0050] When building a virtual scene, save the location information of the model;

[0051] Set the radius of the encirclement and calculate the center coordinates of the model's location information. The calculation method is: connect the two farthest vertices of the model on the ground, calculate the midpoint between the two vertices, and use the coordinates of the midpoint as the center coordinates;

[0052] With the central coordinate as the center of the encirclement, an encirclement is generated on the plane where the bottom of the model is located when the radius is known.

[0053] Manual marking is a waste of manpower. It is necessary to consider whether each vertex of the model can be surrounded by an encirclement, and whether the encirclement is the minimum size. When using program marking, batch marking can be performed, but since the radius of the encirclement is set, it cannot be guaranteed that the encirclement is the minimum size that can surround the model. Therefore, in actual applications, the combination of the two can meet more application scenarios.

[0054] Since there are many situations where the model blocks the straight path, the method also includes obtaining the center coordinates of the encirclement. If the straight path passes through the center coordinates, the direction vectors of all adjustment points and the center coordinates are calculated, and any two adjustment points with the same direction are retained according to the direction vectors, and the other adjustment points are deleted. Figure 4As shown, there are two reference points a1 and a2 on the straight path AB, and there are two tangents passing through a1, and the adjustment points on the tangents are p1 and p3 respectively. There are two tangents passing through a2, and the adjustment points on the tangents are p2 and p4 respectively. By calculating the direction vector toward the center of the circle for each adjustment point, it can be obtained that p1 and p2 have the same direction, and p3 and p4 have the same direction. Therefore, only the adjustment points in the same direction are retained. You can choose to save p1 and p2, or p3 and p4. The final generated path is equivalent to choosing a direction to bypass the encirclement. If p1 and p3 are saved, the path optimization cannot be achieved.

[0055] In order to ensure that the user's walking distance is the shortest, the method also includes the user's walking path between the two adjustment points being walking along the edge points between the adjustment points. When bypassing the encirclement, the user chooses to walk along an arc along the edge of the encirclement, which can also make the lens rotation smoother.

[0056] The method for calculating the intersection of the tangent line and the straight line path of all edge points of the encirclement according to the edge point coordinates is:

[0057] Select a point on the straight path and send rays to all edge points of the encirclement;

[0058] Calculate the intersection point of the ray and the encirclement. If the intersection point is only the edge point, record the ray as the tangent line and the point on the straight line path as the intersection point.

[0059] Calculate all points on the straight line path in sequence and record the intersection points and tangent lines.

[0060] A tangent is a line that has only one common point of intersection with the circle, so if you shoot a ray from any point on the straight line path toward the circle and there is only one intersection, then the ray is proven to be a tangent to the circle.

[0061] Example 2

[0062] like Figure 5 As shown, a system for optimizing path points when automatically finding a path in a virtual scene comprises:

[0063] The encirclement setting unit is used to pre-set an encirclement for all models in the virtual scene, and the range of the encirclement is at least greater than

[0064] The maximum occlusion range of the model in the virtual scene;

[0065] An initial path point calculation unit is used to calculate a straight path between an initial point and a target point, set a number of path points that evenly divide the straight path, and save all the path points as initial path points, wherein the initial point is the current position of the user in the virtual scene, and the target point is the end point of the automatic path finding;

[0066] An edge point unit, used to obtain information of an encirclement on the straight path, wherein the information includes coordinates of edge points of the encirclement;

[0067] A reference point and adjustment point calculation unit, used to calculate the intersection points of the tangents of all edge points of the encirclement and the straight path according to the edge point coordinates, calculate the angles between all the tangents and the straight path, select the intersection point whose angle is less than a preset angle threshold and is closest to the encirclement as the reference point, record the edge point on the tangent as the adjustment point, and the number of the reference points and the adjustment points are both two and symmetrical with the encirclement;

[0068] The final path point calculation unit adjusts the initial path point, deletes the path point between the two reference points, and adds the reference point and the adjustment point to generate the final path point.

[0069] The system also includes obtaining the center coordinates of the encirclement. If the straight path passes through the center coordinates, the direction vectors of all adjustment points and the center coordinates are calculated, and any two adjustment points with the same direction are retained according to the direction vectors, and other adjustment points are deleted.

[0070] The system also includes a walking path of the user between the two adjustment points being walking along an edge point between the adjustment points.

[0071] The system also includes setting a minimum radius of the encirclement, and determining whether the maximum occlusion range of the model is smaller than the encirclement of the minimum radius. If so, the range of the encirclement is set according to the minimum radius; otherwise, the range of the encirclement is set according to the maximum occlusion range of the model.

[0072] The method of pre-setting encirclements for all models in the virtual scene includes manual marking or program marking, and the program marking method is:

[0073] When building a virtual scene, save the location information of the model;

[0074] Set the radius of the encirclement and calculate the center coordinates of the model's location information. The calculation method is: connect the two farthest vertices of the model on the ground, calculate the midpoint between the two vertices, and use the coordinates of the midpoint as the center coordinates;

[0075] With the central coordinate as the center of the encirclement, an encirclement is generated on the plane where the bottom of the model is located when the radius is known.

[0076] The method for calculating the intersection of the tangent line and the straight line path of all edge points of the encirclement according to the edge point coordinates is:

[0077] Select a point on the straight path and send rays to all edge points of the encirclement;

[0078] Calculate the intersection point of the ray and the encirclement. If the intersection point is only the edge point, record the ray as the tangent line and the point on the straight line path as the intersection point.

[0079] Calculate all points on the straight line path in sequence and record the intersection points and tangent lines.

[0080] Embodiment 2 is essentially the same as Embodiment 1, so the specific working principles of each unit will not be described in detail.

[0081] Example 3

[0082] This embodiment proposes a storage medium, which includes a program storage area and a data storage area, wherein the program storage area can store an operating system and programs required for running instant messaging functions, etc.; the data storage area can store various instant messaging information and operation instruction sets, etc. The computer program is stored in the program storage area, and when the computer program is executed by the processor, the method for optimizing path points when automatically finding a path in a virtual scene as described in Example 1 is implemented. The processor may include one or more central processing units, or a digital processing unit, etc.

[0083] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, the embodiments should be considered exemplary and non-restrictive in all respects, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims be included in the present invention.

[0084] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.

Claims

1. A method for optimizing path points during automatic path finding in a virtual scene, characterized in that: The method comprises the following steps: Pre-setting an encirclement for all models in the virtual scene, wherein the range of the encirclement is at least larger than the maximum occlusion range of the model in the virtual scene; Calculate a straight line path between an initial point and a target point, set a number of path points that evenly divide the straight line path, and save all the path points as initial path points, where the initial point is the current position of the user in the virtual scene, and the target point is the end point of the automatic path finding; Acquire information of an encirclement on the straight path, the information including coordinates of edge points of the encirclement; Calculate the intersection points of the tangents of all edge points of the encirclement and the straight path according to the edge point coordinates, calculate the angles between all the tangents and the straight path, select the intersection points whose angles are less than a preset angle threshold and closest to the encirclement as reference points, record the edge points on the tangents as adjustment points, set the angle threshold to 30°, and the number of the reference points and the adjustment points are both two and symmetrical with the encirclement; The initial path point is adjusted, the path point between the two reference points is deleted, and the reference point and the adjustment point are added to generate the final path point.

2. The method for optimizing path points during automatic path finding in a virtual scene according to claim 1, characterized in that: The method also includes setting a minimum radius of the encirclement, and determining whether the maximum occlusion range of the model is smaller than the encirclement of the minimum radius. If so, the range of the encirclement is set according to the minimum radius; otherwise, the range of the encirclement is set according to the maximum occlusion range of the model.

3. The method for optimizing path points during automatic path finding in a virtual scene according to claim 1, characterized in that: The method of pre-setting encirclements for all models in the virtual scene includes manual marking or program marking, and the program marking method is: When building a virtual scene, save the location information of the model; Set the radius of the encirclement and calculate the center coordinates of the model's location information. The calculation method is: connect the two farthest vertices of the model on the ground, calculate the midpoint between the two vertices, and use the coordinates of the midpoint as the center coordinates; With the central coordinate as the center of the encirclement, an encirclement is generated on the plane where the bottom of the model is located when the radius is known.

4. The method for optimizing path points during automatic path finding in a virtual scene according to claim 1, characterized in that: The method also includes obtaining the center coordinates of the encirclement. If the straight line path passes through the center coordinates, the direction vectors of all adjustment points and the center coordinates are calculated, and any two adjustment points with the same direction are retained according to the direction vectors, and other adjustment points are deleted.

5. The method for optimizing path points during automatic path finding in a virtual scene according to claim 1, characterized in that: The method also includes the user walking along an edge point between the two adjustment points.

6. The method for optimizing path points during automatic path finding in a virtual scene according to claim 1, characterized in that: The method for calculating the intersection of the tangent line and the straight line path of all edge points of the encirclement according to the edge point coordinates is: Select a point on the straight path and send rays to all edge points of the encirclement; Calculate the intersection point of the ray and the encirclement. If the intersection point is only the edge point, record the ray as the tangent line and the point on the straight line path as the intersection point. Calculate all points on the straight line path in sequence and record the intersection points and tangent lines.

7. A system for optimizing path points during automatic path finding in a virtual scene, characterized in that: The system includes: An encirclement setting unit, used to pre-set encirclements for all models in the virtual scene, wherein the range of the encirclement is at least larger than the maximum occlusion range of the model in the virtual scene; An initial path point calculation unit is used to calculate a straight path between an initial point and a target point, set a number of path points that evenly divide the straight path, and save all the path points as initial path points, wherein the initial point is the current position of the user in the virtual scene, and the target point is the end point of the automatic path finding; An edge point unit, used to obtain information of an encirclement on the straight path, wherein the information includes coordinates of edge points of the encirclement; A reference point and adjustment point calculation unit, used to calculate the intersection points of the tangents of all edge points of the encirclement and the straight path according to the edge point coordinates, calculate the angles between all the tangents and the straight path, select the intersection point whose angle is less than a preset angle threshold and is closest to the encirclement as the reference point, record the edge point on the tangent as the adjustment point, and the number of the reference points and the adjustment points are both two and symmetrical with the encirclement; The final path point calculation unit adjusts the initial path point, deletes the path point between the two reference points, and adds the reference point and the adjustment point to generate the final path point.

8. The system for optimizing path points during automatic path finding in a virtual scene according to claim 7, characterized in that: The system also includes obtaining the center coordinates of the encirclement. If the straight path passes through the center coordinates, the direction vectors of all adjustment points and the center coordinates are calculated, and any two adjustment points with the same direction are retained according to the direction vectors, and other adjustment points are deleted.

9. The system for optimizing path points during automatic path finding in a virtual scene according to claim 7, characterized in that: The system also includes a walking path of the user between the two adjustment points being walking along an edge point between the adjustment points.

10. A storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the method for optimizing path points during automatic path finding in a virtual scene as described in any one of claims 1-6 is implemented.

Citation Information

Patent Citations

  • Obstacle avoidance route generation method and device, unmanned equipment and storage medium

    CN112229414A