Particle collision method, device and equipment based on physical simulation and storage medium

By applying a particle collision method based on physical simulation in a particle special effect system, using initial parameters and external force parameters combined with collision detection algorithms and models, the problem that traditional methods cannot truly simulate the dynamic behavior of particles is solved, and the accuracy of particle collision effect and the fidelity of simulation are improved.

CN119784911AActive Publication Date: 2025-04-08SHENZHEN RENDERBUS TECH

Patent Information

Application Number
CN202411665968.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2025-04-08
Estimated Expiration
2044-11-20

AI Technical Summary

Technical Problem

Traditional particle special-effect systems lack consideration of particle physical properties when simulating particle collisions, and cannot truly simulate the dynamic behavior of particles, such as rotation, deformation or breaking, resulting in the inability to realistically simulate complex phenomena.

Method used

Through a physical simulation method, the current parameters of the particle system are determined using the initial parameters and external force parameters of the particle system, and combined with the preset collision detection algorithm and collision model, the target collision parameters of the particle are updated, so as to more accurately simulate the motion state of the particle under the action of force.

Benefits of technology

It improves the accuracy of particle collision effect, makes the simulation more realistic, and provides strong technical support for the simulation of complex physical phenomena.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119784911A_ABST
    Figure CN119784911A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of particle simulation, and discloses a particle collision method, device and equipment based on physical simulation and a storage medium, and the method comprises the steps: determining the current parameter of each particle based on the initial parameter and external force parameter of each particle in a particle system; detecting collision information between the particles and / or collision information between the particles and other objects in the particle system through a collision detection algorithm; and updating the target collision parameter of each particle based on the collision model, the current parameter and the collision information. Through the above mode, by considering the initial parameters and the external force parameters of the particles, the motion state of the particles under the stress effect is simulated more accurately, and the collision information between the particles and between the particles and other objects in the system is detected by adopting the preset collision detection algorithm, so that the simulation effect is more vivid; powerful technical support is provided for simulating complex physical phenomena, and the accuracy of the particle collision effect is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of particle simulation technology, and in particular to a particle collision method, device, equipment and storage medium based on physical simulation. Background Art

[0002] In the field of computer graphics and visual effects, particle systems are widely used to simulate various natural phenomena and special effects, such as fire, smoke, water flow, explosion, etc. Particle systems achieve these effects by generating and managing a large number of particles in three-dimensional space, each of which has properties such as position, speed, color, size, etc. However, traditional particle special effects systems usually use a simplified method to deal with collisions between particles, simply detecting whether particles are in contact with other particles or objects in the scene, without further simulating the real physical collision response. When detecting a collision, traditional particle systems often simply handle the collision event, such as by rebounding or stopping the movement of particles, without considering the physical properties of particles, such as mass, elasticity and friction. Due to the lack of consideration of the physical properties of particles, traditional methods cannot simulate the real dynamic behavior of particles after collision, such as rotation, deformation or breakage. Due to the above limitations, traditional particle special effects often cannot achieve realistic effects when simulating complex phenomena, such as the fluttering of cloth and the splashing of liquid. Therefore, how to simulate particle collisions through existing physical methods to improve the accuracy of particle collision effects has become a technical problem that needs to be solved urgently. Summary of the invention

[0003] The present application provides a particle collision method, device, equipment and storage medium based on physical simulation, which simulates particle collision through existing physical methods to improve the accuracy of particle collision effects.

[0004] In a first aspect, the present application provides a particle collision method based on physical simulation, the method comprising:

[0005] Determining current parameters of each particle in the particle system based on initial parameters of each particle and external force parameters;

[0006] Detecting collision information between the particles and / or collision information between the particles and other objects in the particle system by using a preset collision detection algorithm;

[0007] Based on the preset collision model, the current parameters and the collision information, the target collision parameters of each particle are updated.

[0008] In a second aspect, the present application further provides a particle collision device based on physical simulation, the device comprising:

[0009] A current parameter determination module, used to determine the current parameters of each particle in the particle system based on the initial parameters of each particle and the external force parameters;

[0010] A collision information detection module, used to detect collision information between the particles and / or collision information between the particles and other objects in the particle system by using a preset collision detection algorithm;

[0011] The target collision parameter updating module is used to update the target collision parameter of each particle based on a preset collision model, the current parameter and the collision information.

[0012] In a third aspect, the present application also provides a computer device, comprising a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement the particle collision method based on physical simulation as described above when executing the computer program.

[0013] In a fourth aspect, the present application further 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 processor implements the particle collision method based on physical simulation as described above.

[0014] The present application discloses a particle collision method, device, equipment and storage medium based on physical simulation, wherein the particle collision method based on physical simulation includes determining the current parameters of each particle based on the initial parameters and external force parameters of each particle in the particle system; detecting the collision information between each particle and / or the collision information between the particle and other objects in the particle system through a preset collision detection algorithm; and updating the target collision parameters of each particle based on a preset collision model, the current parameters and the collision information. In the above manner, the present application more accurately simulates the motion state of particles under the action of force by considering the initial parameters and external force parameters of the particles, and uses a preset collision detection algorithm to detect the collision information between particles and between particles and other objects in the system, so that the simulation effect is more realistic, providing strong technical support for simulating complex physical phenomena, and improving the accuracy of particle collision effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0016] Figure 1is a schematic flow chart of a particle collision method based on physical simulation provided by the first embodiment of the present application;

[0017] Figure 2 is a schematic flow chart of a particle collision method based on physical simulation provided by the second embodiment of the present application;

[0018] Figure 3 is a schematic flow chart of a particle collision method based on physical simulation provided in the third embodiment of the present application;

[0019] Figure 4 A schematic block diagram of a particle collision device based on physical simulation provided in an embodiment of the present application;

[0020] Figure 5 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0021] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0022] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0023] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0024] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0025] The embodiments of the present application provide a particle collision method, device, equipment and storage medium based on physical simulation. Among them, the particle collision method based on physical simulation can be applied to a server, by considering the initial parameters and external force parameters of the particles, more accurately simulating the motion state of the particles under the action of force, using a preset collision detection algorithm to detect the collision information between particles and between particles and other objects in the system, making the simulation effect more realistic, providing strong technical support for simulating complex physical phenomena, and improving the accuracy of particle collision effects. Among them, the server can be an independent server or a server cluster.

[0026] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0027] See also Figure 1 , Figure 1 This is a schematic flow chart of a particle collision method based on physical simulation provided by the first embodiment of the present application. The particle collision method based on physical simulation can be applied to a server, and is used to more accurately simulate the motion state of particles under the action of forces by considering the initial parameters and external force parameters of the particles, and to detect collision information between particles and between particles and other objects in the system using a preset collision detection algorithm, so that the simulation effect is more realistic, providing strong technical support for simulating complex physical phenomena, and improving the accuracy of particle collision effects.

[0028] like Figure 1 As shown, the particle collision method based on physical simulation specifically includes steps S10 to S30.

[0029] Step S10, determining the current parameters of each particle in the particle system based on the initial parameters of each particle and the external force parameters;

[0030] Step S20, detecting collision information between the particles and / or collision information between the particles and other objects in the particle system by using a preset collision detection algorithm;

[0031] Step S30: updating the target collision parameter of each particle based on the preset collision model, the current parameter and the collision information.

[0032] In one embodiment, the initial state of the particle system is defined, including the initial parameters of each particle such as the position, velocity, mass, and shape, and the external force parameters acting on the particle system are determined, such as gravity, wind force, and electromagnetic force. According to the application scenario of the particle system, the simulation environment is set, including boundary conditions, the existence of other objects, and their properties. According to Newton's laws of motion or other physical laws, combined with the initial parameters of the particles and the external force parameters, the motion trajectory and current state of each particle are calculated. The data structures required by the collision detection algorithm, such as the BVH tree or the bounding box, are implemented and initialized to optimize the collision detection process.

[0033] Use the preset collision detection algorithm to traverse the particle system and detect potential collisions between particles and between particles and other objects in the system. For each particle, check whether its boundary volume intersects with other particles or objects in the system to determine whether a collision has occurred. Record the detected collision information, including collision time, location, particles or objects involved in the collision, dynamic parameters before the collision, etc.

[0034] According to the preset collision model, combined with the current parameters and collision information of the particle, the collision response is calculated. The collision model can include elastic collision, inelastic collision, viscous collision, etc., as well as the update of particle velocity, angle, deformation and other parameters after the collision. According to the collision response calculation results, the target collision parameters of the particle are updated, such as the new position, velocity, shape change, etc., to ensure that the updated parameters comply with the laws of physics and the constraints of the simulation environment.

[0035] For example, suppose you are designing a fire effect in a scene where flame particles collide with each other. You can follow the following specific implementation steps:

[0036] 1. Initialize the particle system:

[0037] Define the initial position, speed, mass and other parameters of the flame particles, and establish a physical simulation environment.

[0038] 2. Update particle status:

[0039] According to the initial position and velocity of the flame particle, the acceleration of the flame particle is calculated and its velocity and position are updated.

[0040] 3. Collision detection:

[0041] Traverse each flame particle and detect whether there is a collision between it and the surrounding particles.

[0042] 4. Collision response:

[0043] For flame particles that collide, the rebound, friction, deformation and other effects of the particles after the collision are calculated according to the type of collision and the properties of the collision object, and the speed and position of the particles are updated.

[0044] 5. Loop iteration:

[0045] Repeat steps 2 to 4 above, and iterate the simulation algorithm to simulate the real collision effect between flame particles. You can set the simulation time or termination condition as needed. In the specific implementation process, you can also adjust and optimize parameters according to special effect requirements, such as adjusting the mass of particles, collision force field, friction coefficient, etc., to achieve a more ideal collision effect.

[0046] This embodiment discloses a particle collision method, device, equipment and storage medium based on physical simulation. The particle collision method based on physical simulation includes determining the current parameters of each particle based on the initial parameters and external force parameters of each particle in the particle system; detecting the collision information between each particle and / or the collision information between the particle and other objects in the particle system through a preset collision detection algorithm; and updating the target collision parameters of each particle based on a preset collision model, the current parameters and the collision information. In the above manner, the present application more accurately simulates the motion state of particles under the action of force by considering the initial parameters and external force parameters of the particles, and uses a preset collision detection algorithm to detect the collision information between particles and between particles and other objects in the system, so that the simulation effect is more realistic, providing strong technical support for simulating complex physical phenomena, and improving the accuracy of particle collision effects.

[0047] See also Figure 2 , Figure 2 This is a schematic flow chart of a particle collision method based on physical simulation provided by the second embodiment of the present application. The particle collision method based on physical simulation can be applied to a server, and is used to more accurately simulate the motion state of particles under the action of forces by considering the initial parameters and external force parameters of the particles, and to detect the collision information between particles and between particles and other objects in the system using a preset collision detection algorithm, so that the simulation effect is more realistic, providing strong technical support for simulating complex physical phenomena, and improving the accuracy of particle collision effects.

[0048] based on Figure 1 The embodiment shown, this embodiment Figure 2 As shown, step S20 includes steps S201 to S204.

[0049] Step S201, defining each particle and each other object as a bounding box by using the bounding box collision detection algorithm;

[0050] Step S202, determining each of the bounding boxes within a preset range around each of the particles as a related bounding box;

[0051] Step S203, traversing each of the related bounding boxes, and calculating the intersection information between each of the related bounding boxes and the bounding box corresponding to the particle;

[0052] Step S204: Determine the collision information according to the intersection information.

[0053] In one embodiment, for each particle and other object in the particle system, a bounding box (such as an axis-aligned bounding box AABB or an oriented bounding box OBB) is defined, which can completely contain the geometric shape of the particle or object. A preset range is set for each particle. This range determines which other particles or objects' bounding boxes need to be considered for intersection detection with the bounding box of the current particle. For each particle, the bounding boxes of all other particles and objects within its preset range are identified, and these bounding boxes are considered to be bounding boxes associated with the particle.

[0054] For each particle, traverse all its related bounding boxes and prepare to calculate the intersection information. For each pair of particle bounding boxes and related bounding boxes, calculate the intersection information between them, including checking whether the two bounding boxes intersect. If so, calculate the overlapping area of ​​the bounding boxes and record the detailed information of the intersection, such as the location, size and shape of the intersection.

[0055] Based on the calculated intersection information, the collision information between particles is determined to confirm whether two particles have collided. If a collision occurs, the time, position, particles involved in the collision, and the strength and direction of the collision are recorded.

[0056] The present embodiment discloses a particle collision method, device, equipment and storage medium based on physical simulation, wherein the particle collision method based on physical simulation includes determining the current parameters of each particle based on the initial parameters and external force parameters of each particle in the particle system; defining each particle and each other object as a bounding box through the bounding box collision detection algorithm; determining each bounding box within a preset range around each particle as a related bounding box; traversing each related bounding box, calculating the intersection information between each related bounding box and the bounding box corresponding to the particle; determining the collision information according to the intersection information; and updating the target collision parameters of each particle based on the preset collision model, the current parameters and the collision information. In the above manner, the present application more accurately simulates the motion state of the particle under the action of force by considering the initial parameters and external force parameters of the particle, and uses a preset collision detection algorithm to detect the collision information between particles and between particles and other objects in the system, so that the simulation effect is more realistic, providing strong technical support for simulating complex physical phenomena, and improving the accuracy of particle collision effects.

[0057] See also Figure 3 , Figure 3This is a schematic flow chart of a particle collision method based on physical simulation provided by the third embodiment of the present application. The particle collision method based on physical simulation can be applied to a server, and is used to more accurately simulate the motion state of particles under the action of forces by considering the initial parameters and external force parameters of the particles, and to detect collision information between particles and between particles and other objects in the system using a preset collision detection algorithm, so that the simulation effect is more realistic, providing strong technical support for simulating complex physical phenomena, and improving the accuracy of particle collision effects.

[0058] based on Figure 1 The embodiment shown, this embodiment Figure 3 As shown, step S20 includes steps S205 to S207.

[0059] Step S205, constructing a BVH tree with each particle as a root node in the particle system;

[0060] Step S206: starting from the root node in each of the BVH trees, traversing the BVH trees, and detecting whether there are other nodes in the BVH trees by using the BVH tree collision detection algorithm, wherein the boundary volume of the other nodes intersects with the boundary volume of the root node;

[0061] Step S207: If there are other nodes in the BVH tree, determine the collision information according to the other nodes and the root node.

[0062] In one embodiment, for each particle in the particle system, a BVH tree with the particle as the root node is constructed, the boundary volume (such as a bounding box) of the particle is used as the boundary volume of the root node, and the particle set is recursively divided into two groups, each group is used as a child node, and each child node also has a corresponding boundary volume. The segmentation process continues until each node contains only one particle or a preset node size limit is reached.

[0063] Select a particle's BVH tree as the reference tree, take the root node of the tree as the starting point, and recursively traverse each node of the BVH tree from the root node. For each node, check whether its bounding volume intersects with the bounding volumes of nodes in other BVH trees.

[0064] Using the BVH tree collision detection algorithm, compare the bounding volume of the current node with the bounding volumes of other BVH tree nodes in the system. If the bounding volumes of two nodes intersect, the two nodes are considered potential collision nodes. Record all other nodes that intersect with the bounding volume of the current node.

[0065] For each pair of intersecting nodes, the collision information between their corresponding particles is determined, including calculation of the collision point, collision time, collision force and direction, etc.

[0066] The present embodiment discloses a particle collision method, device, equipment and storage medium based on physical simulation. The particle collision method based on physical simulation includes determining the current parameters of each particle based on the initial parameters and external force parameters of each particle in the particle system; constructing a BVH tree with each particle as a root node in the particle system; traversing the BVH tree with the root node as the starting point in each BVH tree, and detecting whether there are other nodes in the BVH tree through the BVH tree collision detection algorithm, wherein the boundary volume of the other node intersects with the boundary volume of the root node; if there are other nodes in the BVH tree, determining the collision information according to the other node and the root node; and updating the target collision parameters of each particle based on a preset collision model, the current parameters and the collision information. Through the above method, the present application more accurately simulates the motion state of particles under the action of force by considering the initial parameters and external force parameters of the particles, and uses a preset collision detection algorithm to detect collision information between particles and between particles and other objects in the system, making the simulation effect more realistic, providing strong technical support for simulating complex physical phenomena, and improving the accuracy of particle collision effects.

[0067] based on Figure 1 In the embodiment shown, in this embodiment, after step S30, the following steps are included:

[0068] determining a particle state of the particle based on the target collision parameter;

[0069] According to the particle state, it is determined whether to perform an iterative collision test on the particle.

[0070] The present embodiment discloses a particle collision method, device, equipment and storage medium based on physical simulation, wherein the particle collision method based on physical simulation includes determining the current parameters of each particle based on the initial parameters and external force parameters of each particle in the particle system; detecting the collision information between each particle and / or the collision information between the particle and other objects in the particle system through a preset collision detection algorithm; updating the target collision parameters of each particle based on a preset collision model, the current parameters and the collision information; determining the particle state of the particle based on the target collision parameters; and judging whether to perform an iterative collision test on the particle according to the particle state. In the above manner, the present application more accurately simulates the motion state of the particle under the action of force by considering the initial parameters and external force parameters of the particle, and uses a preset collision detection algorithm to detect the collision information between particles and between particles and other objects in the system, so that the simulation effect is more realistic, providing strong technical support for simulating complex physical phenomena, and improving the accuracy of the particle collision effect.

[0071] In a more preferred embodiment, judging whether to perform an iterative collision test on the particle according to the particle state includes:

[0072] When the particle state is a stable state, stopping the iterative collision test on the particle;

[0073] In the case where the particle state is an unstable state, the starting step is: based on a preset collision model, the current parameters and the collision information, updating the target collision parameters of each particle.

[0074] Specifically, the target collision parameters of each particle are obtained from the collision detection algorithm. The parameters include the expected collision time, collision position, collision object, collision force, etc. According to the target collision parameters, the state of the particle is updated, the position of the particle is adjusted to reflect the new position after the collision, and the speed and direction of the particle are updated to simulate the movement after the collision.

[0075] Evaluate the current state of the particle, including its position, velocity, acceleration, and other relevant physical properties. Based on the particle state and target collision parameters, determine whether the particle has collided or is about to collide. If the particle state indicates that a collision has occurred, decide whether further iterative collision testing is needed based on the nature and outcome of the collision. If the particle state indicates that a collision is about to occur, plan to perform iterative collision testing in future time steps.

[0076] Based on any of the above embodiments, in this embodiment, before step S10, the following steps are included:

[0077] The particle system is initialized by a preset physical engine to determine initial parameters of each particle in the particle system, wherein the initial parameters include initial position parameters, initial velocity parameters and / or initial mass parameters.

[0078] Specifically, according to the needs and characteristics of the particle system, select a suitable physics engine that can handle the dynamic simulation of particles, including collision detection, force calculation, etc., and determine the basic properties of particles, including shape, size, material, etc. These properties will affect the physical behavior of particles. Set the initial position parameters, initial velocity parameters and initial mass parameters for each particle in the particle system, including the magnitude and direction of the velocity.

[0079] In a more preferred embodiment, step S10 includes:

[0080] Acquiring the external force parameters, wherein the external force parameters include gravity parameters, wind force parameters and / or friction force parameters;

[0081] According to preset physical laws, the initial parameters and the external force parameters, the current position parameter, the current speed parameter and / or the current mass parameter of the particle are updated.

[0082] Specifically, determine the type of external force acting on the particle system, including gravity, wind force, friction, etc. For each external force, obtain its parameters, such as the magnitude and direction of gravitational acceleration, the magnitude and direction of wind speed, friction coefficient, etc.

[0083] Ensure that the initial position parameters, initial velocity parameters, and initial mass parameters of each particle have been set, and determine the physical laws that will be used to update the particle parameters, such as Newton's laws of motion, fluid dynamics equations, etc.

[0084] According to the external force parameters and the current state of the particles, the influence of each external force on the particles is calculated. For gravity, the acceleration it produces on the particles is calculated; for wind force, the magnitude and direction of the wind force are calculated according to the wind speed and the surface area and shape of the particles; for friction, the friction force is calculated according to the friction coefficient and the relative motion between the particles and the contact surface.

[0085] See also Figure 4 , Figure 4 The embodiment of the present application provides a schematic block diagram of a particle collision device based on physical simulation, and the particle collision device based on physical simulation is used to execute the aforementioned particle collision method based on physical simulation. The particle collision device based on physical simulation can be configured on a server.

[0086] like Figure 4 As shown, the particle collision device 400 based on physical simulation includes:

[0087] A current parameter determination module 410 is used to determine the current parameters of each particle in the particle system based on the initial parameters of each particle and the external force parameters;

[0088] A collision information detection module 420, configured to detect collision information between the particles and / or collision information between the particles and other objects in the particle system by using a preset collision detection algorithm;

[0089] The target collision parameter updating module 430 is used to update the target collision parameter of each particle based on a preset collision model, the current parameter and the collision information.

[0090] Furthermore, the collision information detection module 420 includes:

[0091] A bounding box definition unit, used to define each of the particles and each of the other objects as a bounding box by using the bounding box collision detection algorithm;

[0092] A related bounding box determining unit, used for determining each of the bounding boxes within a preset range around each of the particles as a related bounding box;

[0093] An intersection information calculation unit, used for traversing each of the related bounding boxes, and calculating the intersection information between each of the related bounding boxes and the bounding box corresponding to the particle;

[0094] A collision information determining unit is used to determine the collision information according to the intersection information.

[0095] Furthermore, the collision information detection module 420 includes:

[0096] A BVH tree construction unit, used for constructing a BVH tree with each particle as a root node in the particle system;

[0097] Another node detection unit is used to traverse the BVH tree starting from the root node in each of the BVH trees, and detect whether there are other nodes in the BVH tree by using the BVH tree collision detection algorithm, wherein the boundary volume of the other node intersects with the boundary volume of the root node;

[0098] A collision information determining unit is used to determine the collision information according to other nodes and the root node if there are other nodes in the BVH tree.

[0099] Furthermore, the particle collision device 400 based on physical simulation includes:

[0100] A particle state determination module, used for determining the particle state of the particle based on the target collision parameter;

[0101] The iterative collision test judgment module is used to judge whether to perform an iterative collision test on the particle according to the particle state.

[0102] Furthermore, the iterative collision test judgment module includes:

[0103] A stop iteration unit, used for stopping the iterative collision test on the particle when the particle state is in a stable state;

[0104] The iteration unit is used to start the step of updating the target collision parameters of each particle based on a preset collision model, the current parameters and the collision information when the particle state is an unstable state.

[0105] Furthermore, the particle collision device 400 based on physical simulation includes:

[0106] The initial parameter determination module is used to initialize the particle system through a preset physical engine to determine the initial parameters of each particle in the particle system, wherein the initial parameters include initial position parameters, initial velocity parameters and / or initial mass parameters.

[0107] Furthermore, the current parameter determination module 410 includes:

[0108] An external force parameter acquisition unit, used to acquire the external force parameters, wherein the external force parameters include gravity parameters, wind force parameters and / or friction force parameters;

[0109] A current parameter determination unit is used to update the current position parameter, the current speed parameter and / or the current mass parameter of the particle according to preset physical laws, the initial parameters and the external force parameters.

[0110] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device and each module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0111] The above-mentioned device can be implemented in the form of a computer program. Figure 5 Runs on the computer device shown.

[0112] See also Figure 5 , Figure 5 1 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device may be a server.

[0113] See also Figure 5 The computer device includes a processor, a memory and a network interface connected through a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.

[0114] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any particle collision method based on physical simulation.

[0115] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.

[0116] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any particle collision method based on physical simulation.

[0117] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will appreciate that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0118] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0119] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:

[0120] Determining current parameters of each particle in the particle system based on initial parameters of each particle and external force parameters;

[0121] Detecting collision information between the particles and / or collision information between the particles and other objects in the particle system by using a preset collision detection algorithm;

[0122] Based on the preset collision model, the current parameters and the collision information, the target collision parameters of each particle are updated.

[0123] In one embodiment, a preset collision detection algorithm is used to detect collision information between the particles and / or collision information between the particles and other objects in the particle system, so as to achieve:

[0124] Defining each of the particles and each of the other objects as a bounding box by using the bounding box collision detection algorithm;

[0125] Determine each of the bounding boxes within a preset range around each of the particles as a related bounding box;

[0126] Traversing each of the related bounding boxes, and calculating the intersection information between each of the related bounding boxes and the bounding box corresponding to the particle;

[0127] The collision information is determined according to the intersection information.

[0128] In one embodiment, by using a preset collision detection algorithm, collision information between the particles and / or collision information between the particles and other objects in the particle system is detected, which is also used to achieve:

[0129] Constructing a BVH tree with each particle as a root node in the particle system;

[0130] Taking the root node as the starting point in each of the BVH trees, traversing the BVH tree, and detecting whether there are other nodes in the BVH tree by using the BVH tree collision detection algorithm, wherein the boundary volume of the other nodes intersects with the boundary volume of the root node;

[0131] If there are other nodes in the BVH tree, the collision information is determined according to the other nodes and the root node.

[0132] In one embodiment, based on the preset collision model, the current parameters and the collision information, after the target collision parameters of each particle are updated, it is used to achieve:

[0133] determining a particle state of the particle based on the target collision parameter;

[0134] According to the particle state, it is determined whether to perform an iterative collision test on the particle.

[0135] In one embodiment, judging whether to perform iterative collision test on the particle is performed according to the particle state, so as to achieve:

[0136] When the particle state is a stable state, stopping the iterative collision test on the particle;

[0137] In the case where the particle state is an unstable state, the starting step is: based on a preset collision model, the current parameters and the collision information, updating the target collision parameters of each particle.

[0138] In one embodiment, based on the initial parameters and external force parameters of each particle in the particle system, before determining the current parameters of each particle, it is used to implement:

[0139] The particle system is initialized by a preset physical engine to determine initial parameters of each particle in the particle system, wherein the initial parameters include initial position parameters, initial velocity parameters and / or initial mass parameters.

[0140] In one embodiment, based on the initial parameters of each particle in the particle system and the external force parameters, the current parameters of each particle are determined to achieve:

[0141] Acquiring the external force parameters, wherein the external force parameters include gravity parameters, wind force parameters and / or friction force parameters;

[0142] According to preset physical laws, the initial parameters and the external force parameters, the current position parameter, the current speed parameter and / or the current mass parameter of the particle are updated.

[0143] A computer-readable storage medium is also provided in an embodiment of the present application, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and the processor executes the program instructions to implement any particle collision method based on physical simulation provided in the embodiments of the present application.

[0144] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (Smart Medi a Card, SMC), a secure digital (Secure Digital, SD) card, a flash memory card (Flash Card), etc., equipped on the computer device.

[0145] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A particle collision method based on physical simulation, characterized in that: include: Determining current parameters of each particle in the particle system based on initial parameters of each particle and external force parameters; Detecting collision information between the particles and / or collision information between the particles and other objects in the particle system by using a preset collision detection algorithm; Based on the preset collision model, the current parameters and the collision information, the target collision parameters of each particle are updated.

2. The particle collision method based on physical simulation according to claim 1, characterized in that: The preset collision detection algorithm includes a bounding box collision detection algorithm, and detecting collision information between the particles and / or collision information between the particles and other objects in the particle system by using the preset collision detection algorithm includes: Defining each of the particles and each of the other objects as a bounding box by using the bounding box collision detection algorithm; Determine each of the bounding boxes within a preset range around each of the particles as a related bounding box; Traversing each of the related bounding boxes, and calculating the intersection information between each of the related bounding boxes and the bounding box corresponding to the particle; The collision information is determined according to the intersection information.

3. The particle collision method based on physical simulation according to claim 1, characterized in that: The preset collision detection algorithm includes a boundary volume hierarchy BVH tree collision detection algorithm, and the collision information between the particles and / or the collision information between the particles and other objects in the particle system is detected by the preset collision detection algorithm, and further includes: Constructing a BVH tree with each particle as a root node in the particle system; Taking the root node as the starting point in each of the BVH trees, traversing the BVH tree, and detecting whether there are other nodes in the BVH tree by using the BVH tree collision detection algorithm, wherein the boundary volume of the other nodes intersects with the boundary volume of the root node; If there are other nodes in the BVH tree, the collision information is determined according to the other nodes and the root node.

4. The particle collision method based on physical simulation according to claim 1, characterized in that: After updating the target collision parameter of each particle based on the preset collision model, the current parameter and the collision information, the method includes: determining a particle state of the particle based on the target collision parameter; According to the particle state, it is determined whether to perform an iterative collision test on the particle.

5. The particle collision method based on physical simulation according to claim 4, characterized in that: The step of determining whether to perform an iterative collision test on the particle according to the particle state comprises: When the particle state is a stable state, stopping the iterative collision test on the particle; In the case where the particle state is an unstable state, the starting step is: based on a preset collision model, the current parameters and the collision information, updating the target collision parameters of each particle.

6. The particle collision method based on physical simulation according to any one of claims 1 to 5, characterized in that: Before determining the current parameters of each particle based on the initial parameters and external force parameters of each particle in the particle system, the method includes: The particle system is initialized by a preset physical engine to determine initial parameters of each particle in the particle system, wherein the initial parameters include initial position parameters, initial velocity parameters and / or initial mass parameters.

7. The particle collision method based on physical simulation according to claim 6, characterized in that: The current parameters include current position parameters, current speed parameters and / or current mass parameters. The current parameters of each particle are determined based on the initial parameters and external force parameters of each particle in the particle system, including: Acquiring the external force parameters, wherein the external force parameters include gravity parameters, wind force parameters and / or friction force parameters; According to preset physical laws, the initial parameters and the external force parameters, the current position parameter, the current speed parameter and / or the current mass parameter of the particle are updated.

8. A particle collision device based on physical simulation, characterized in that: include: A current parameter determination module, used to determine the current parameters of each particle in the particle system based on the initial parameters of each particle and the external force parameters; A collision information detection module, used to detect collision information between the particles and / or collision information between the particles and other objects in the particle system by using a preset collision detection algorithm; The target collision parameter updating module is used to update the target collision parameter of each particle based on a preset collision model, the current parameter and the collision information.

9. A computer device, characterized in that: The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is configured to execute the computer program and implement the particle collision method based on physical simulation according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, enables the processor to implement the particle collision method based on physical simulation according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Graphical simulation of objects in a virtual environment

    CN102665836A

  • Particle system and surface geometric model collision stress calculation method based on neural network

    CN114492208A

  • Cloth and fluid collision detection method based on dynamic time step length

    CN118657037A

Cited By

  • Ion implantation simulation method, electronic equipment and storage medium

    CN119989740A

  • Method, Electronic Device, and Storage Medium for Ion Implantation Simulation

    CN119989740B