A simulation method, system, device and medium for accurate hitting and damage effect superposition of Y-ray weapons
By combining the hierarchical bounding box and KDTree algorithms, the problems of hit detection and damage effect simulation of Y-ray weapons on three-dimensional models were solved, and accurate ray hit position determination and real ray effect simulation were achieved.
Patent Information
- Application Number
- CN202511006425.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-22
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2045-07-22
AI Technical Summary
Existing technologies cannot accurately determine the impact location of a gamma-ray weapon on a three-dimensional model, cannot simulate the damage effect on specific parts of a complex three-dimensional model, and do not support the superposition of ray heating and cooling effects.
Hit detection is performed using a hierarchical bounding box algorithm, which is combined with KDTree for radius range search to calculate the intersection points between rays and 3D models. The heating and cooling effects of rays are simulated through adjudication in a simulated network environment.
It can accurately determine the impact position of the ray on the three-dimensional model, simulate the real heating and cooling effects of the ray, improve the detection efficiency and present the visual effect of the damage to the specific part in the view.
Smart Images

Figure CN120509221B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of model simulation technology, and in particular to a simulation method, system, device, and medium for accurately hitting and superimposing damage effects of a gamma-ray weapon. Background Art
[0002] Gamma rays are directional, focused, and nearly non-divergent high-energy rays. When they strike an object, they generate high temperatures and damage it. In digital battlefield simulations, high-performance gamma-ray weapon simulations are achieved by performing hit detection between gamma rays and three-dimensional models in space to determine the weapon's impact.
[0003] A common method for ray hit detection is the bounding box algorithm. The basic idea is to use a slightly larger geometric body with simpler characteristics (called a bounding box) to approximately replace the complex geometric model in the simulation. Common bounding box shapes include spheres, AABBs (axis-aligned bounding boxes), and OBBs (oriented bounding boxes).
[0004] Currently, the ray simulations available in the industry mostly use simple ray-geometry simulations, which can only obtain overall damage values, but cannot calculate the damage effects on specific parts, cannot accurately point out the hit locations on the model, and do not support complex three-dimensional models. The damage effect model algorithm used is simple, simulating damage effects with fixed values and hit times, and cannot support the superposition of cooling and heating effects that are closer to real combat. Summary of the Invention
[0005] The object of the present invention is to provide a kind of simulation method and system, equipment and medium of accurate hitting and damage effect superposition of a gamma-ray weapon, to solve the above-mentioned problems in the prior art.
[0006] The present invention is achieved through the following technical solutions:
[0007] In a first aspect, the present invention provides a simulation method for accurately hitting and superimposing damage effects of a gamma-ray weapon, comprising:
[0008] Constructing a simulated three-dimensional model of the target equipment, wherein the simulated three-dimensional model includes vertices, triangular faces, and textures of the model;
[0009] When the simulated 3D model is loaded, the local coordinates of the simulated 3D model corresponding to the pixel points of the map are calculated, and the mapping relationship between the local coordinates and the pixel points is stored to obtain a number of discrete points in the 3D space;
[0010] Store the initial temperature and time stamp of the current simulated 3D model in the map to obtain the initial temperature map and time map;
[0011] Perform intersection detection on the ray and the simulated 3D model through hierarchical bounding boxes to obtain the hit point;
[0012] Performing a radius range search on the discrete points through KDTree to obtain target discrete points within the heating range after the ray hits, and obtaining corresponding target pixel points of the map according to the mapping relationship;
[0013] Traverse the target discrete points within the heating range, update and store the temperature and timestamp corresponding to each target discrete point hit at the corresponding target pixel position, and obtain the updated temperature map and time map. When there is a repeated mapping pixel position in the next hit, call the previously stored time and temperature, calculate the current cooling situation according to the cooling model, and calculate the superposition effect of cooling and this ray heating, and update the temperature and timestamp of the corresponding position;
[0014] While traversing the discrete points to update the temperature, the accumulated data is judged, a damage threshold is set, and it is judged whether it reaches the damage threshold to complete the damage effect simulation.
[0015] Preferably, the performing intersection detection on the ray and the simulated three-dimensional model by using a hierarchical bounding box includes:
[0016] Find the hit model through preliminary hit screening;
[0017] The hit position on the simulated three-dimensional model is further determined by the hit model.
[0018] Preferably, the finding of a hit model through preliminary hit screening includes:
[0019] In the spatial coordinate system, the Y-ray generator mounted on the object generates the ray o+d parameter, where o represents the emission point of the ray and d represents the emission angle of the ray;
[0020] Check whether the rays intersect with the largest bounding box composed of all simulated 3D models. If there is no intersection, the process ends. Otherwise, the intersection is checked with the bounding boxes of the next layer in turn until the last bounding box.
[0021] Intersect the bounding boxes of all models in the last layer and filter out the models whose bounding boxes intersect with the rays.
[0022] Preferably, the further determining the hit position on the simulated three-dimensional model by hitting the model includes;
[0023] Transform the ray o+d parameters to the model space, establish a BVH tree, and calculate whether the Y ray and the triangle bounding box intersect from the tree structure in turn, and obtain multiple intersecting leaf node bounding boxes;
[0024] The intersection of the ray and the triangle in the bounding box is further calculated, and the point closest to the ray is obtained as the hit point.
[0025] Preferably, the method further comprises the following steps:
[0026] The estimated position of the attacked party is obtained through the basic parameters of the attacked party. If the Y-ray emitted by the attacking party can hit the estimated position, the hitting behavior at this time is confirmed in the simulation.
[0027] Preferably, it also includes:
[0028] The hit behavior at this time hits the bounding box of the object, and through space transformation, the ray is transformed to the model space of the hit object;
[0029] A ray generation event is broadcast in the simulation network, where the ray generation event includes the world coordinates of the existing ray, the ID of the suspected hit object, and the ray parameters after being transformed into the local space of the suspected hit object.
[0030] Preferably, it also includes:
[0031] After receiving the ray generation event, all simulation participants in the simulation network display the ray of the hit behavior in the vision of the simulation participants;
[0032] When the attacked party receives the ray generation event, it calculates the hit position and the damage effect on itself based on the local coordinates of the ray, and determines whether it needs to broadcast the damage visual effect.
[0033] In a second aspect, the present invention further provides a simulation system for accurate hits and damage effects superposition of gamma-ray weapons, comprising:
[0034] A model building module is configured to build a simulated three-dimensional model of the target equipment, wherein the simulated three-dimensional model includes vertices, triangles, and textures of the model;
[0035] The simulation loading module is configured to calculate the local coordinates of the simulated 3D model corresponding to the pixels of the texture when the simulated 3D model is loaded, and store the mapping relationship between the local coordinates and the pixels to obtain a plurality of discrete points in the 3D space; store the initial temperature and time stamp of the current simulated 3D model in the texture to obtain an initial temperature map and a time map;
[0036] A hit detection module is configured to perform intersection detection on the ray and the simulated three-dimensional model through a hierarchical bounding box to obtain a hit point;
[0037] The damage effect realization module is configured to perform a radius range search on the discrete points through KDTree to obtain the target discrete points within the heating range after the ray hits, and obtain the target pixel points of the corresponding map according to the mapping relationship; traverse the target discrete points within the heating range, update and store the temperature and time stamp corresponding to each target discrete point hit this time at the corresponding target pixel point position, and obtain an updated temperature map and time map. When there is a repeated map pixel position in the next strike, the previously stored time and temperature are retrieved, the current cooling situation is calculated according to the cooling model, and the superposition effect of cooling and this ray heating is calculated, and the temperature and time stamp of the corresponding position are updated; while traversing the discrete points to update the temperature, the accumulated data is judged, a damage threshold is set, and it is judged whether it reaches the damage threshold to complete the damage effect simulation;
[0038] The simulation effect judgment module is configured to obtain the estimated position of the attacked party through the basic parameters of the attacked party. If the Y-ray can hit the estimated position when the attacking party emits a Y-ray, the hit behavior at this time is confirmed in the simulation; the hit behavior at this time hits the object bounding box, and the ray is transformed into the model space of the hit object through spatial transformation; the ray generation event is broadcast in the simulation network, and the ray generation event includes the world coordinates of the existing ray, the ID of the suspected hit object and the ray parameters after transformation to the local space of the suspected hit object. After all simulation participants in the simulation network receive the ray generation event, the ray of the hit behavior is displayed to the vision of the simulation participants; when the attacked party receives the ray generation event, it calculates the hit position and the damage effect on itself according to the local coordinates of the ray, and determines whether it is necessary to broadcast the damage visual effect.
[0039] In a third aspect, the present invention also provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method for simulating the precise hit and damage effect superposition of a Y-ray weapon is implemented.
[0040] In a fourth aspect, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the simulation method for the precise hit and damage effect superposition of the above-mentioned Y-ray weapon is implemented.
[0041] The technical solution of the present invention has at least the following advantages and beneficial effects:
[0042] The present invention adopts a hierarchical bounding box algorithm for hit detection, which reduces the average search time complexity from O(N) to O(logN) compared to a traversal method, thereby improving detection efficiency. Secondly, during hit detection, two steps are used: finding a hit model through preliminary hit screening and determining a hit position on a simulated three-dimensional model. Hit detection is performed in stages. In the stage of determining the hit position on the simulated three-dimensional model, the hit triangle and the precise hit position are calculated from a BVH tree structure, so that the model can present a visual effect of damage caused by a hit on a specific part in the view. Ultimately, a Y-ray weapon simulation scheme is implemented, and ideas are provided for judging simulation effects in a simulated network environment. The ray hit position can be obtained efficiently and accurately, and the real ray heating and cooling effects can be simulated. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.
[0044] Figure 1 It is a control flow diagram of the present invention;
[0045] Figure 2 Schematic diagram of the bounding box and its tree structure of the present invention. DETAILED DESCRIPTION
[0046] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of 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. Generally, the components of the embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations.
[0047] Independently described modules or submodules may or may not be physically separate; they may be implemented in software or hardware. Some modules or submodules may be implemented in software, with the processor invoking the software to implement the functionality of these modules or submodules, while other modules or submodules may be implemented in hardware, such as hardware circuits. Furthermore, some or all of the modules may be selected based on actual needs to achieve the objectives of the present application.
[0048] Please refer to Figure 1-Figure 2 The present invention provides a simulation method for accurately hitting and superimposing the damage effects of a gamma-ray weapon, comprising:
[0049] S101: constructing a simulated three-dimensional model of a target device, wherein the simulated three-dimensional model includes vertices, triangular faces, and textures of the model;
[0050] Build a 3D model with an external geometry close to the real equipment and UV-unwrap the model so that the model can directly provide vertices, triangles, mapping coordinates (UV coordinates) and other content.
[0051] S102: When the simulated 3D model is loaded, local coordinates of the simulated 3D model corresponding to the pixels of the texture are calculated, and a mapping relationship between the local coordinates and the pixels is stored to obtain a plurality of discrete points in the 3D space;
[0052] Regarding calculating the local coordinates of the simulated 3D model corresponding to the pixel points of the texture, you can first obtain the UV coordinates corresponding to the texture pixels, find the triangular patches corresponding to the UV coordinates, traverse all the triangular patches of the model, check whether the target UV coordinates are within the UV triangle of a certain patch, use the barycentric coordinates to determine whether the UV point is within the triangle, set the UV coordinates of the three vertices of the triangle, and then calculate the barycentric coordinates. Finally, interpolate the local coordinates through the barycentric coordinates.
[0053] S103: storing the initial temperature (set as the ambient temperature) and the timestamp of the current simulated 3D model in the map to obtain an initial temperature map and a time map;
[0054] S104: Perform intersection detection on the ray and the simulated 3D model through bounding volume hierarchies (BVH) to obtain a hit point;
[0055] The Bounding Volume Hierarchy (BVH) is a tree-like data structure used to accelerate spatial queries, such as collision detection and ray intersection testing. It decomposes complex 3D models or scenes into hierarchical, simple bounding volumes (such as spheres and cuboids), significantly improving computational efficiency by quickly eliminating disjoint regions. Specifically, it recursively divides complex geometry into smaller subsets, each represented by a simple bounding volume. This constructs a multi-level bounding relationship from the root node (the entire scene) to the leaf nodes (individual primitives).
[0056] S105: performing a radius range search on the discrete points through KDTree to obtain target discrete points within the heating range after the ray hits, and obtaining corresponding target pixel points of the map according to the mapping relationship;
[0057] Specifically, a KDTree is constructed to recursively partition the discrete point set into a binary tree structure; the partition axis is selected: the dimension with the largest coordinate variance is selected as the partition axis each time (for example, the x / y axis is selected for 2D, and the x / y / z axis is selected for 3D); the partition point is selected: the median point (or an approximate median with less computational effort) is used to divide the point set into two subsets; recursive construction: the left and right subtrees contain the point sets on the left and right sides of the partition, respectively. Given a query point q and a radius r, a search is performed. If the distance from the query point to the partition plane is ≤ the radius r, it means that the ball with q as the center and r as the radius may pass through the plane, and the subtree on the other side needs to be searched.
[0058] S106: Traverse the target discrete points within the heating range, update and store the temperature and timestamp corresponding to each target discrete point hit at the corresponding target pixel position, and obtain an updated temperature map and time map. When there is a repeated mapping pixel position in the next hit, retrieve the previously stored time and temperature, calculate the current cooling status according to the cooling model, and calculate the superposition effect of cooling and the current ray heating, and update the temperature and timestamp of the corresponding position;
[0059] Specifically, for example: at the 0th second, the current temperature at (100, 100) of the temperature graph is 0°C. At this time, a temperature difference of 500°C is generated. Then the temperature at this time is calculated to be 500°C, the temperature of the corresponding position on the temperature graph is updated, and the current timestamp is stored at the corresponding position of the time graph; at the 1st second, a temperature difference of 500°C is generated at (100, 100) of the temperature graph. At this time, the calculation will first query the timestamp at (100, 100) on the time graph, and obtain a time difference of 1 second. Then, the cooling effect is calculated based on the time difference, and it is obtained that the temperature should be reduced by 400°C during this period. Then, the current new temperature difference is added, and the temperature at this time is 500-400+500=600°C. The temperature of the corresponding position on the temperature graph is updated, and the timestamp of the corresponding position on the time graph is updated.
[0060] S107: While traversing the discrete points and updating the temperature, the accumulated data is judged, a damage threshold is set, and it is judged whether it reaches the damage threshold, thereby completing the damage effect simulation.
[0061] The present invention adopts a hierarchical bounding box algorithm for hit detection, which reduces the average search time complexity from O(N) to O(logN) compared to a traversal method, thereby improving detection efficiency. Secondly, during hit detection, two steps are used: finding a hit model through preliminary hit screening and determining a hit position on a simulated three-dimensional model. Hit detection is performed in stages. In the stage of determining the hit position on the simulated three-dimensional model, the hit triangle and the precise hit position are calculated from a BVH tree structure, so that the model can present a visual effect of damage caused by a hit on a specific part in the view. Ultimately, a Y-ray weapon simulation scheme is implemented, and ideas are provided for judging simulation effects in a simulated network environment. The ray hit position can be obtained efficiently and accurately, and the real ray heating and cooling effects can be simulated.
[0062] In an exemplary embodiment of the present invention, the intersection detection between the ray and the simulated three-dimensional model using the hierarchical bounding box includes:
[0063] Find the hit model through preliminary hit screening, i.e. Broad Phase Test;
[0064] The hit position on the simulated 3D model is further determined by the hit model, which is called Narrow Phase Test.
[0065] Specifically, the hit models found through preliminary hit screening include:
[0066] In the space coordinate system (ECEF coordinate system), the Y-ray generator mounted on the object generates the ray o+d (o represents the emission point of the ray, d represents the emission angle of the ray) parameter;
[0067] The intersection detection is performed using the AABB bounding box method. The largest bounding box composed of all simulated 3D models is used to determine whether the rays intersect. If there is no intersection, the process ends. Otherwise, the intersection is determined for the bounding boxes of the next layer in turn until the last layer. Figure 2 The ABC in the left bounding box refer to each three-dimensional model in the space, and the ABC in the right tree structure refer to the leaf nodes corresponding to each three-dimensional model;
[0068] At this time, there may be multiple three-dimensional models in the bounding box. It is necessary to intersect the bounding boxes of all models in this layer and filter out the models whose bounding boxes intersect with the rays.
[0069] Specifically, the hit position on the simulated three-dimensional model is further determined by hitting the model, including;
[0070] Transform the ray o+d parameters to the model space, establish a BVH tree, and calculate whether the Y ray and the triangle bounding box intersect from the tree structure in turn, and obtain multiple intersecting leaf node bounding boxes;
[0071] The intersection of the ray and the triangle in the bounding box is further calculated, and the point closest to the ray is obtained as the hit point.
[0072] An exemplary embodiment of the present invention also includes a gamma-ray weapon simulation effect judgment under a simulated network environment, including:
[0073] The estimated position of the attacked party is obtained through the basic parameters of the attacked party. If the Y-ray emitted by the attacking party can hit the estimated position, the hitting behavior at this time is confirmed in the simulation.
[0074] When the attacker sends out a Y-ray, the position of the attacked party it sees is a false (estimated) position. This false position is inferred from the speed, acceleration, attitude, timestamp and other information transmitted to the attacker through the simulation network. If the Y-ray can hit this false position at this time, then its hit behavior is confirmed in the simulation.
[0075] An exemplary embodiment of the present invention further includes:
[0076] The hit behavior at this time hits the bounding box of the object, and through space transformation, the ray is transformed to the model space of the hit object;
[0077] A ray generation event is broadcast in the simulation network, where the ray generation event includes the world coordinates of the existing ray, the ID of the suspected hit object, and the ray parameters after being transformed into the local space of the suspected hit object.
[0078] Specifically, the hit behavior in this case hits the bounding box of the object. Through spatial transformation, the ray is transformed to the model space of the hit object, and a "ray generated" event is broadcast on the simulation network. The "ray generated" event contains both the world coordinates of the ray, the ID of the suspected hit object, and the ray parameters after transformation to the local space of the suspected hit object.
[0079] An exemplary embodiment of the present invention further includes:
[0080] After receiving the ray generation event, all simulation participants in the simulation network display the ray of the hit behavior in the vision of the simulation participants;
[0081] When the attacked party receives the ray generation event, it calculates the hit position and the damage effect on itself based on the local coordinates of the ray, and determines whether it needs to broadcast the damage visual effect.
[0082] Specifically, upon receiving this event, all simulation participants will display the ray in their own viewports. Upon receiving this event, the victim will calculate the specific impact location and damage to themselves based on the ray's local coordinates. If the simulation requires broadcasting of the damage visual effect, it will be broadcast network-wide, with all simulation participants displaying the damage visual effect at the victim's specific impact location in their own viewports. Otherwise, the damage effect does not need to be broadcast network-wide, remaining visible only to the victim. Furthermore, if the damage effect reaches the damage threshold, the relevant death logic in the simulation will be triggered.
[0083] The present invention also provides a simulation system for accurate hitting and damage effect superposition of a gamma-ray weapon, comprising:
[0084] A model building module is configured to build a simulated three-dimensional model of the target equipment, wherein the simulated three-dimensional model includes vertices, triangles, and textures of the model;
[0085] The simulation loading module is configured to calculate the local coordinates of the simulated 3D model corresponding to the pixels of the texture when the simulated 3D model is loaded, and store the mapping relationship between the local coordinates and the pixels to obtain a plurality of discrete points in the 3D space; store the initial temperature and time stamp of the current simulated 3D model in the texture to obtain an initial temperature map and a time map;
[0086] A hit detection module is configured to perform intersection detection on the ray and the simulated three-dimensional model through a hierarchical bounding box to obtain a hit point;
[0087] The damage effect realization module is configured to perform a radius range search on the discrete points through KDTree to obtain the target discrete points within the heating range after the ray hits, and obtain the target pixel points of the corresponding map according to the mapping relationship; traverse the target discrete points within the heating range, update and store the temperature and time stamp corresponding to each target discrete point hit this time at the corresponding target pixel point position, and obtain an updated temperature map and time map. When there is a repeated map pixel position in the next strike, the previously stored time and temperature are retrieved, the current cooling situation is calculated according to the cooling model, and the superposition effect of cooling and this ray heating is calculated, and the temperature and time stamp of the corresponding position are updated; while traversing the discrete points to update the temperature, the accumulated data is judged, a damage threshold is set, and it is judged whether it reaches the damage threshold to complete the damage effect simulation;
[0088] The simulation effect judgment module is configured to obtain the estimated position of the attacked party through the basic parameters of the attacked party. If the Y-ray can hit the estimated position when the attacking party emits a Y-ray, the hit behavior at this time is confirmed in the simulation; the hit behavior at this time hits the object bounding box, and the ray is transformed into the model space of the hit object through spatial transformation; the ray generation event is broadcast in the simulation network, and the ray generation event includes the world coordinates of the existing ray, the ID of the suspected hit object and the ray parameters after transformation to the local space of the suspected hit object. After all simulation participants in the simulation network receive the ray generation event, the ray of the hit behavior is displayed to the vision of the simulation participants; when the attacked party receives the ray generation event, it calculates the hit position and the damage effect on itself according to the local coordinates of the ray, and determines whether it is necessary to broadcast the damage visual effect.
[0089] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0090] If the integrated unit is implemented as a software functional unit and sold or used as a standalone product, it can be stored on a computer-readable storage medium. This computer software product, stored on a storage medium, includes instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0091] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.
Claims
1. A simulation method for accurate hitting and damage effect superposition of a gamma-ray weapon, characterized in that: include: Constructing a simulated three-dimensional model of the target equipment, wherein the simulated three-dimensional model includes vertices, triangular faces, and textures of the model; When the simulated 3D model is loaded, the local coordinates of the simulated 3D model corresponding to the pixel points of the map are calculated, and the mapping relationship between the local coordinates and the pixel points is stored to obtain a number of discrete points in the 3D space; Store the initial temperature and time stamp of the current simulated 3D model in the map to obtain the initial temperature map and time map; Perform intersection detection on the ray and the simulated 3D model through hierarchical bounding boxes to obtain the hit point; Performing a radius range search on the discrete points through KDTree to obtain target discrete points within the heating range after the ray hits, and obtaining corresponding target pixel points of the map according to the mapping relationship; Traverse the target discrete points within the heating range, update and store the temperature and timestamp corresponding to each target discrete point hit at the corresponding target pixel position, and obtain the updated temperature map and time map. When there is a repeated mapping pixel position in the next hit, call the previously stored time and temperature, calculate the current cooling situation according to the cooling model, and calculate the superposition effect of cooling and this ray heating, and update the temperature and timestamp of the corresponding position; While updating the temperature at discrete points, the accumulated data is judged, a damage threshold is set, and it is judged whether it reaches the damage threshold to complete the damage effect simulation; The intersection detection between the ray and the simulated three-dimensional model by using the hierarchical bounding box includes: Find the hit model through preliminary hit screening; The hit position on the simulated three-dimensional model is further determined by the hit model.
2. The method for simulating the accurate hitting and damage effect superposition of a gamma-ray weapon according to claim 1, wherein: The method of finding a hit model through preliminary hit screening includes: In the spatial coordinate system, the Y-ray generator mounted on the object generates the ray o+d parameter, where o represents the emission point of the ray and d represents the emission angle of the ray; Check whether the rays intersect with the largest bounding box composed of all simulated 3D models. If there is no intersection, the process ends. Otherwise, the intersection is checked with the bounding boxes of the next layer in turn until the last bounding box. Intersect the bounding boxes of all models in the last layer and filter out the models whose bounding boxes intersect with the rays.
3. The method for simulating the accurate hitting and damage effect superposition of a gamma-ray weapon according to claim 2, wherein: The hit position on the simulated three-dimensional model is further determined by hitting the model, including; Transform the ray o+d parameters to the model space, establish a BVH tree, and calculate whether the Y ray and the triangle bounding box intersect from the tree structure in turn, and obtain multiple intersecting leaf node bounding boxes; The intersection of the ray and the triangle in the bounding box is further calculated, and the point closest to the ray is obtained as the hit point.
4. The method for simulating the accurate hitting and damage effect superposition of a gamma-ray weapon according to claim 3, wherein: It also includes the judgment of the simulation effect of Y-ray weapons in a simulated network environment, including: The estimated position of the attacked party is obtained through the basic parameters of the attacked party. If the Y-ray emitted by the attacking party can hit the estimated position, the hitting behavior at this time is confirmed in the simulation.
5. The method for simulating the accurate hitting and damage effect superposition of a gamma-ray weapon according to claim 4, characterized in that: Also includes: The hit behavior at this time hits the bounding box of the object, and through space transformation, the ray is transformed to the model space of the hit object; A ray generation event is broadcast in the simulation network, where the ray generation event includes the world coordinates of the existing ray, the ID of the suspected hit object, and the ray parameters after being transformed into the local space of the suspected hit object.
6. The method for simulating accurate hits and damage effects of a gamma-ray weapon according to claim 5, wherein: Also includes: After receiving the ray generation event, all simulation participants in the simulation network display the ray of the hit behavior in the vision of the simulation participants; When the attacked party receives the ray generation event, it calculates the hit position and the damage effect on itself based on the local coordinates of the ray, and determines whether it needs to broadcast the damage visual effect.
7. A simulation system for accurate hits and damage effects of gamma-ray weapons, characterized in that: include: A model building module is configured to build a simulated three-dimensional model of the target equipment, wherein the simulated three-dimensional model includes vertices, triangles, and textures of the model; The simulation loading module is configured to calculate the local coordinates of the simulated 3D model corresponding to the pixels of the texture when the simulated 3D model is loaded, and store the mapping relationship between the local coordinates and the pixels to obtain a plurality of discrete points in the 3D space; store the initial temperature and time stamp of the current simulated 3D model in the texture to obtain an initial temperature map and a time map; A hit detection module is configured to perform intersection detection on the ray and the simulated three-dimensional model through a hierarchical bounding box to obtain a hit point, including finding a hit model through preliminary hit screening; and further determining a hit position on the simulated three-dimensional model through the hit model; The damage effect realization module is configured to perform a radius range search on the discrete points through KDTree to obtain the target discrete points within the heating range after the ray hits, and obtain the target pixel points of the corresponding map according to the mapping relationship; traverse the target discrete points within the heating range, update and store the temperature and time stamp corresponding to each target discrete point hit this time at the corresponding target pixel point position, and obtain an updated temperature map and time map. When there is a repeated map pixel position in the next strike, the previously stored time and temperature are retrieved, the current cooling situation is calculated according to the cooling model, and the superposition effect of cooling and this ray heating is calculated, and the temperature and time stamp of the corresponding position are updated; while traversing the discrete points to update the temperature, the accumulated data is judged, a damage threshold is set, and it is judged whether it reaches the damage threshold to complete the damage effect simulation; The simulation effect judgment module is configured to obtain the estimated position of the attacked party based on the basic parameters of the attacked party. If the Y-ray emitted by the attacker can hit the estimated position, the hit behavior at this time is confirmed in the simulation; the hit behavior at this time hits the object bounding box, and the ray is transformed into the model space of the hit object through spatial transformation; the ray generation event is broadcast in the simulation network, and the ray generation event includes the world coordinates of the existing ray, the ID of the suspected hit object, and the ray parameters after transformation to the local space of the suspected hit object. After all simulation participants in the simulation network receive the ray generation event, the ray of the hit behavior is displayed in the view of the simulation participants; When the attacked party receives the ray generation event, it calculates the hit position and the damage effect on itself based on the local coordinates of the ray, and determines whether it needs to broadcast the damage visual effect.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, a simulation method for accurately hitting and superimposing the damage effects of a gamma-ray weapon according to any one of claims 1 to 6 is implemented.
9. 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 the processor, it implements a simulation method for accurate hitting and damage effect superposition of a gamma-ray weapon according to any one of claims 1 to 6.
Citation Information
Patent Citations
Armored equipment damage rule analysis method based on simulation experiment
CN104143028A
Method for constructing thermal damage effect model of high-energy laser weapon in multi-physical field
CN116305950A