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

By using a physics-based particle collision method, which utilizes the initial parameters and external force parameters of particles, combined with a preset collision detection algorithm and model, particle collisions are accurately simulated. This solves the problem of unrealistic particle collision effects in traditional methods and achieves a more realistic simulation effect.

CN119784911BActive Publication Date: 2025-11-07SHENZHEN RENDERBUS TECH
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Traditional particle effects systems lack consideration of particle physics properties when simulating particle collisions, making it impossible to realistically simulate the dynamic behavior of particles after a collision, such as rotation, deformation, or breakage, and thus failing to achieve realistic and complex phenomena.

Method used

By using a physics-based simulation method, the initial parameters and external force parameters of the particles are combined with a preset collision detection algorithm and model to detect and update the collision information of the particles, and accurately simulate the motion state of the particles under force.

Benefits of technology

It improves the accuracy of particle collision effects, making the simulation more realistic and better able to simulate complex physical phenomena.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119784911B_ABST
    Figure CN119784911B_ABST
Patent Text Reader

Abstract

The application 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, the method comprises the following steps: determining current parameters of each particle in a particle system based on initial parameters and external force parameters of each particle; detecting collision information between each particle and / or collision information between the particle and other objects in the particle system through a collision detection algorithm; and updating target collision parameters of each particle based on a collision model, the current parameters and the collision information. In the foregoing manner, the initial parameters and the external force parameters of the particles are considered to more accurately simulate the motion state of the particles under the action of force, a preset collision detection algorithm is used to detect the collision information between the particles and between the particles and other objects in the system, the simulation effect is more realistic, 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 technical field of particle simulation, in particular to a particle collision method and device based on physical simulation, equipment and storage medium. BACKGROUND

[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 particle having properties such as position, velocity, color, size, etc. However, when dealing with collisions between particles, traditional particle effect systems usually adopt a simplified method, only detecting whether a particle comes into contact with other particles or objects in the scene, without further simulating real physical collision response. When detecting collisions, traditional particle systems often simply handle collision events, such as bouncing or stopping the motion 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, the traditional method cannot simulate the real dynamic behavior of particles after collision, such as rotation, deformation or fragmentation. Due to the above limitations, traditional particle effects often cannot achieve realistic effects when simulating complex phenomena, such as the flowing of cloth, the splashing of liquid, etc. Therefore, how to simulate particle collisions through existing physical methods to improve the accuracy of particle collision effects has become a technical problem to be solved at present. SUMMARY

[0003] The present application provides a particle collision method and device based on physical simulation, which simulates particle collisions 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] Based on the initial parameters and external force parameters of each particle in the particle system, determine the current parameters of each particle;

[0006] Detect 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;

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

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

[0009] A current parameter determination module is configured to determine a current parameter of each particle in the particle system based on an initial parameter and an external force parameter of each particle in the particle system;

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

[0011] A target collision parameter updating module is configured to update a 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 further provides a computer device, which comprises a memory and a processor; the memory is configured to store a computer program; and the processor is configured 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, which stores a computer program; and the computer program is configured to enable a processor to implement the particle collision method based on physical simulation as described above when executed by the processor.

[0014] The present application discloses a particle collision method based on physical simulation, a device, a computer device and a storage medium. The particle collision method based on physical simulation comprises determining a current parameter of each particle in a particle system based on an initial parameter and an external force parameter of each particle in the particle system; detecting collision information between each particle and / or between the particle and other objects in the particle system by using a preset collision detection algorithm; and updating a target collision parameter of each particle based on a preset collision model, the current parameter and the collision information. In this way, the initial parameter and the external force parameter of the particle are considered to more accurately simulate the motion state of the particle under the action of force. The preset collision detection algorithm is used to detect the collision information between the particles and between the particle and other objects in the system, so that the simulation effect is more realistic. The present application provides strong technical support for simulating complex physical phenomena and improves the accuracy of the particle collision effect. BRIEF DESCRIPTION OF DRAWINGS

[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[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 by the third embodiment of the present application;

[0019] Figure 4 is a schematic block diagram of a particle collision device based on physical simulation provided by the embodiments of the present application;

[0020] Figure 5 is a schematic block diagram of a computer device provided by the embodiments of the present application. DETAILED DESCRIPTION

[0021] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.

[0022] The flow chart shown in the drawings is only an example and does not necessarily include all the contents and operations / steps, nor does it necessarily be executed in the described order. For example, some operations / steps can be further decomposed, combined or partially merged, so that the actual execution order can be changed according to the actual situation.

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

[0024] It should also be understood that the term "and / or" used in the present application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.

[0025] Embodiments of the present application provide a particle collision method based on physical simulation, a device, equipment and a storage medium. The particle collision method based on physical simulation can be applied to a server, initial parameters and external force parameters of particles are considered to more accurately simulate the motion state of the particles under the action of force, a preset collision detection algorithm is used to detect collision information between the particles and between the particles and other objects in the system, the simulation effect is more realistic, strong technical support is provided for simulating complex physical phenomena, and the accuracy of the particle collision effect is improved. The server can be a standalone server or a server cluster.

[0026] Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The following embodiments and features in the embodiments can be combined with each other without conflict.

[0027] Please refer to Figure 1 , Figure 1 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, initial parameters and external force parameters of particles are considered to more accurately simulate the motion state of the particles under the action of force, a preset collision detection algorithm is used to detect collision information between the particles and between the particles and other objects in the system, the simulation effect is more realistic, strong technical support is provided for simulating complex physical phenomena, and the accuracy of the particle collision effect is improved.

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

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

[0030] Step S20, through a preset collision detection algorithm, collision information between each particle and / or between the particle and other objects in the particle system is detected;

[0031] Step S30, based on a preset collision model, the current parameters and the collision information, target collision parameters of each particle are updated.

[0032] In one embodiment, the initial state of the particle system is defined, including the initial parameters of each particle such as position, velocity, mass, shape, etc., and the external force parameters acting on the particle system are determined, such as gravity, wind, electromagnetic force, etc. 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, the initial parameters and external force parameters of the particles are combined to calculate the motion trajectory and current state of each particle. The data structures required to implement and initialize the collision detection algorithm, such as BVH tree or bounding box, are implemented to optimize the collision detection process.

[0033] Using the preset collision detection algorithm, the particle system is traversed to detect potential collisions between particles and other objects in the system. For each particle, check whether its bounding volume intersects with other particles or objects in the system to determine whether a collision occurs. Record the detected collision information, including collision time, position, particles or objects involved in the collision, dynamic parameters before collision, etc.

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

[0035] For example, assume that a flame effect in a scene is designed, where collisions occur between flame particles. The following specific implementation steps can be followed:

[0036] 1. Initialize the particle system:

[0037] Define the initial position, velocity, mass, etc. of the flame particles and establish a physical simulation environment.

[0038] 2. Update the particle state:

[0039] Calculate the acceleration of the flame particles based on their initial position and velocity and update their velocity and position.

[0040] 3. Collision detection:

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

[0042] 4. Collision response:

[0043] For the flame particles that have collided, calculate the bounce, friction and deformation effects of the particles after collision according to the type of collision and the properties of the colliding objects, and update the velocity and position of the particles.

[0044] 5. Loop iteration:

[0045] Repeat steps 2-4 above, simulate the real collision effect between flame particles by iterative running of the simulation algorithm. The simulation time or termination condition can be set as needed. In the specific implementation process, parameter adjustment and optimization can also be combined with special effect requirements, such as adjusting the mass of the particles, the collision force field, the friction coefficient, etc., to achieve a more ideal collision effect.

[0046] The embodiment discloses a particle collision method and device based on physical simulation, equipment and storage medium, the particle collision method based on physical simulation includes determining the current parameters of each particle in the particle system based on the initial parameters and external force parameters of each particle; through a preset collision detection algorithm, the collision information between each particle and / or the collision information between the particle and other objects in the particle system is detected; based on the preset collision model, the current parameters and the collision information, the target collision parameters of each particle are updated. Through the above-mentioned mode, the initial parameters and external force parameters of the particles are considered, the motion state of the particles under the action of force is more accurately simulated, the preset collision detection algorithm is used to detect the collision information between the particles and between the particles and other objects in the system, so that the simulation effect is more realistic, which provides strong technical support for simulating complex physical phenomena and improves the accuracy of the particle collision effect.

[0047] Please refer to Figure 2 , 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. The particle collision method based on physical simulation can be applied in a server, which is used to more accurately simulate the motion state of particles under the action of force by considering the initial parameters and external force parameters of the particles, detect the collision information between the particles and between the particles and other objects in the system by using a preset collision detection algorithm, make the simulation effect more realistic, provide strong technical support for simulating complex physical phenomena, and improve the accuracy of the particle collision effect.

[0048] Based on the embodiment shown in Figure 1 , the embodiment shown in Figure 2 , step S20 includes steps S201-S204.

[0049] Step S201, each of the particles and each of the other objects is defined as a bounding box by the bounding box collision detection algorithm;

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

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

[0052] Step S204, determining 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, which determines which other particle or object 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, which are considered as related bounding boxes of the particle.

[0054] For each particle, all its related bounding boxes are traversed to prepare for the calculation of intersection information, for each pair of particle bounding box and related bounding box, the intersection information between them is calculated, including checking whether the two bounding boxes intersect, if they intersect, the overlapping area of the bounding boxes is calculated, and detailed information of the intersection is recorded, such as the position, size and shape of the intersection.

[0055] According to the calculated intersection information, the collision information between the particles is determined to confirm whether the two particles have collided, if they have collided, information such as the time, position, particles involved in the collision, intensity and direction of the collision is recorded.

[0056] The embodiment discloses a particle collision method, device and equipment based on physical simulation and a storage medium. The particle collision method based on physical simulation comprises determining current parameters of each particle in a particle system based on initial parameters and external force parameters of the particles; defining each particle and each other object as a bounding box through a 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 to calculate 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 target collision parameters of each particle based on a preset collision model, the current parameters and the collision information. In this way, the initial parameters and external force parameters of the particles are considered to more accurately simulate the motion state of the particles under the action of force, the preset collision detection algorithm is used to detect the collision information between the particles and between the particles and other objects in the system, the simulation effect is more realistic, strong technical support is provided for simulating complex physical phenomena, and the accuracy of the particle collision effect is improved.

[0057] Please refer to Figure 3 , Figure 3is a schematic flowchart of a particle collision method based on physical simulation provided by a third embodiment of the present application. The particle collision method based on physical simulation can be applied in a server, for more accurately simulating the motion state of particles under force action by considering the initial parameters and external force parameters of the particles, detecting the collision information between particles and other objects in the system by 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 effect.

[0058] Based on Figure 1 In the embodiment shown, the embodiment has Figure 3 As shown in the embodiment, 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 BVH tree, traversing the BVH tree, and detecting whether there is another node 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;

[0061] Step S207, if there is another node in the BVH tree, determining the collision information according to the other node and the root node.

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

[0063] A BVH tree of a particle is selected as a reference tree, and the root node of the tree is taken as a starting point, starting from the root node, recursively traversing each node of the BVH tree, and for each node, checking whether its boundary volume intersects with the boundary volume of the node in other BVH trees.

[0064] Using the BVH tree collision detection algorithm, the boundary volume of the current node is compared with the boundary volume of other BVH tree nodes in the system, and if the boundary volumes of the two nodes intersect, the two nodes are considered as potential collision nodes. All other nodes whose boundary volumes intersect with the boundary volume of the current node are recorded.

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

[0066] The embodiment discloses a particle collision method and device based on physical simulation, equipment and a storage medium. The particle collision method based on physical simulation comprises determining current parameters of each particle in a particle system based on initial parameters and external force parameters of each particle; constructing a BVH tree with each particle as a root node in the particle system; starting from the root node in each BVH tree, traversing the BVH tree, and detecting whether there is another node in the BVH tree through a BVH tree collision detection algorithm, wherein the boundary volume of the other node intersects with the boundary volume of the root node; if there is another node in the BVH tree, determining collision information according to the other node and the root node; and updating target collision parameters of each particle based on a preset collision model, the current parameters and the collision information. In the foregoing manner, the initial parameters and the external force parameters of the particles are considered to more accurately simulate the motion state of the particles under the action of force, a preset collision detection algorithm is used to detect the collision information between the particles and between the particles and other objects in the system, the simulation effect is more realistic, strong technical support is provided for simulating complex physical phenomena, and the accuracy of the particle collision effect is improved.

[0067] Based on Figure 1 In the embodiment shown in the figure, the step S30 is followed by:

[0068] Based on the target collision parameters, the particle state of the particle is determined.

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

[0070] The embodiment discloses a particle collision method and device based on physical simulation, equipment and a storage medium. The particle collision method based on physical simulation comprises determining current parameters of each particle in a particle system based on initial parameters and external force parameters of each particle; detecting collision information between each particle and / or between the particle and other objects in the particle system through a preset collision detection algorithm; updating target collision parameters of each particle based on a preset collision model, the current parameters and the collision information; determining a 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 foregoing manner, the initial parameters and the external force parameters of the particles are considered to more accurately simulate the motion state of the particles under the action of force, a preset collision detection algorithm is used to detect the collision information between the particles and between the particles and other objects in the system, the simulation effect is more realistic, strong technical support is provided for simulating complex physical phenomena, and the accuracy of the particle collision effect is improved.

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

[0072] stopping the iterative collision test on the particle in the case that the state of the particle is a stable state;

[0073] starting the step of updating the target collision parameter of each particle based on the preset collision model, the current parameter and the collision information in the case that the state of the particle is an unstable state.

[0074] Specifically, the target collision parameter of each particle is obtained from the collision detection algorithm, including the expected collision time, the collision position, the collision object, the collision force and the like, the state of the particle is updated according to the target collision parameter, 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 motion after the collision.

[0075] The current state of the particle is evaluated, including the position, the speed, the acceleration and other related physical properties, whether the particle has collided or is about to collide is judged based on the state of the particle and the target collision parameter, if the state of the particle indicates that the collision has occurred, whether further iterative collision test is needed is determined according to the nature and result of the collision, and if the state of the particle indicates that the collision is about to occur, the iterative collision test is planned to be performed in the future time step.

[0076] Based on any of the above embodiments, in this embodiment, step S10 further comprises:

[0077] initializing the particle system by a preset physical engine to determine the initial parameters of each particle in the particle system, wherein the initial parameters include the initial position parameter, the initial speed parameter and / or the initial mass parameter.

[0078] Specifically, a suitable physical engine is selected according to the requirements and characteristics of the particle system, which can process the dynamics simulation of the particle, including the collision detection and the force calculation, the basic properties of the particle are determined, including the shape, the size and the material, which will affect the physical behavior of the particle, and the initial position parameter, the initial speed parameter and the initial mass parameter of each particle in the particle system are set, including the size and direction of the speed.

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

[0080] obtaining the external force parameter, wherein the external force parameter includes the gravity parameter, the wind force parameter and / or the friction force parameter;

[0081] According to the preset physical law, 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, the type of external force acting on the particle system is determined, including gravity, wind force and friction force, etc. For each type of external force, its parameters are obtained, such as the size and direction of gravitational acceleration, the size and direction of wind speed, the friction coefficient, etc.

[0083] It is ensured that the initial position parameter, the initial speed parameter and the initial mass parameter of each particle have been set, and the physical law to be used to update the particle parameters is determined, such as Newton's law of motion, fluid dynamics equation, etc.

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

[0085] Please refer to Figure 4 , Figure 4 An embodiment of the present application provides a schematic block diagram of a particle collision device based on physical simulation, which is used to execute the aforementioned particle collision method based on physical simulation. Wherein, the particle collision device based on physical simulation can be configured in a server.

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

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

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

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

[0090] Further, the collision information detection module 420 comprises:

[0091] A bounding box definition unit is configured to define each particle and each other object as a bounding box by using the bounding box collision detection algorithm.

[0092] A relevant bounding volume determination unit is configured to determine each bounding volume within a preset range around each particle as a relevant bounding volume.

[0093] An intersection information calculation unit is configured to traverse each relevant bounding volume and calculate intersection information between each relevant bounding volume and a bounding volume corresponding to the particle.

[0094] A collision information determination unit is configured to determine the collision information according to the intersection information.

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

[0096] A BVH tree construction unit is configured to construct a BVH tree with each particle as a root node in the particle system.

[0097] An other node detection unit is configured to traverse the BVH tree from the root node as a starting point, and detect whether there is an other node 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.

[0098] A collision information determination unit is configured to determine the collision information according to the other node and the root node if there is an other node in the BVH tree.

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

[0100] A particle state determination module is configured to determine a particle state of the particle based on the target collision parameter.

[0101] An iterative collision test judgment module is configured to judge whether to perform iterative collision test on the particle according to the particle state.

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

[0103] A stop iteration unit is configured to stop iterative collision test on the particle in the case that the particle state is a stable state.

[0104] An iteration unit is configured to start the step of updating the target collision parameter of each particle based on a preset collision model, the current parameter and the collision information in the case that the particle state is an unstable state.

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

[0106] An initial parameter determination module is configured to determine initial parameters of each particle in the particle system by initializing the particle system through a preset physics engine, wherein the initial parameters include initial position parameters, initial velocity parameters and / or initial mass parameters.

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

[0108] An external force parameter acquisition unit is configured 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 configured to update the current position parameters, the current velocity parameters and / or the current mass parameters of the particles according to the preset physical law, the initial parameters and the external force parameters.

[0110] It should be noted that, for the convenience and brevity of description, the specific working processes of the above-described device and modules can refer to the corresponding processes in the foregoing method embodiments, which will not be described herein.

[0111] The above-described device can be implemented in the form of a computer program, which can run on a computer device as shown in Figure 5 .

[0112] Please refer to Figure 5 , Figure 5 is a structural schematic block diagram of a computer device provided by an embodiment of the present application. The computer device can be a server.

[0113] Please refer to Figure 5 , the computer device includes a processor, a memory and a network interface connected through a system bus, wherein the memory can 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, which, when executed, can cause the processor to execute any kind of particle collision method based on physical simulation.

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

[0116] The internal memory provides an environment for the running of the computer program in the non-volatile storage medium, which, when executed by the processor, can cause the processor to execute any kind of particle collision method based on physical simulation.

[0117] The network interface is configured to perform network communication, such as sending assigned tasks, etc. Those skilled in the art can understand that,Figure 5 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can 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 can be a central processing unit (CPU), and the processor can 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. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.

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

[0120] Based on the initial parameters and external force parameters of each particle in the particle system, the current parameters of each particle are determined.

[0121] By using a preset collision detection algorithm, collision information between each particle and / or between the particle and other objects in the particle system is detected.

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

[0123] In one embodiment, by using a preset collision detection algorithm, collision information between each particle and / or between the particle and other objects in the particle system is detected, which is configured to:

[0124] Each particle and each other object is defined as a bounding box by using the bounding box collision detection algorithm.

[0125] Each bounding box within a preset range around each particle is determined as a relevant bounding box.

[0126] Each relevant bounding box is traversed to calculate intersection information between each relevant bounding box and the bounding box corresponding to the particle.

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

[0128] In one embodiment, the collision information between each of the particles and / or the collision information between each of the particles and other objects in the particle system is detected by a preset collision detection algorithm, and the method is further configured to:

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

[0130] traversing the BVH tree from the root node in each of the BVH trees, and detecting whether there is another node in the BVH tree by the BVH tree collision detection algorithm, wherein the bounding volume of the other node intersects with the bounding volume of the root node;

[0131] if there is another node in the BVH tree, determining the collision information according to the other node and the root node.

[0132] In one embodiment, after updating the target collision parameter of each of the particles based on the preset collision model, the current parameter and the collision information, the method is further configured to:

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

[0134] judging whether to perform an iterative collision test on the particle according to the particle state.

[0135] In one embodiment, judging whether to perform an iterative collision test on the particle according to the particle state, the method is further configured to:

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

[0137] starting the step of updating the target collision parameter of each of the particles based on the preset collision model, the current parameter and the collision information when the particle state is an unstable state.

[0138] In one embodiment, before determining the current parameter of each of the particles in the particle system based on the initial parameter and the external force parameter of each of the particles in the particle system, the method is further configured to:

[0139] initializing the particle system by a preset physics engine to determine the initial parameter of each of the particles in the particle system, wherein the initial parameter includes an initial position parameter, an initial velocity parameter and / or an initial mass parameter.

[0140] In one embodiment, before determining the current parameter of each of the particles in the particle system based on the initial parameter and the external force parameter of each of the particles in the particle system, the method is further configured to:

[0141] acquire the external force parameter, wherein the external force parameter comprises a gravity parameter, a wind force parameter, and / or a friction force parameter;

[0142] update the current position parameter, the current velocity parameter, and / or the current mass parameter of the particle according to a preset physical law, the initial parameters, and the external force parameter.

[0143] In an embodiment of the present application, a computer readable storage medium is also provided, which stores a computer program. The computer program comprises program instructions. The processor executes the program instructions to implement any of the particle collision methods based on physical simulation provided in the embodiments of the present application.

[0144] The computer readable storage medium can be an internal storage unit of the computer device, for example, a hard disk or a memory of the computer device. The computer readable storage medium can also be an external storage device of the computer device, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, and the like.

[0145] The above merely provides a specific implementation of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art 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 encompassed in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method for simulating particle collisions based on physical analogies, characterized in that, The method comprises: determining current parameters of each particle in the particle system based on initial parameters and external force parameters of each particle in the particle system; detecting collision information between each particle and / or between each particle and other objects in the particle system by using a preset collision detection algorithm; updating target collision parameters of each particle based on a preset collision model, the current parameters and the collision information; wherein the preset collision detection algorithm comprises a bounding volume collision detection algorithm, and the detecting of the collision information between each particle and / or between each particle and other objects in the particle system by using the preset collision detection algorithm comprises: defining each particle and each other object as a bounding volume by using the bounding volume collision detection algorithm; determining each bounding volume within a preset range around each particle as a relevant bounding volume; traversing each relevant bounding volume to calculate intersection information between each relevant bounding volume and a bounding volume corresponding to the particle; determining the collision information according to the intersection information; wherein before the determining of the current parameters of each particle in the particle system based on the initial parameters and the external force parameters, the method comprises: initializing the particle system by using a preset physics engine to determine initial parameters of each particle in the particle system, wherein the initial parameters comprise initial position parameters, initial velocity parameters and / or initial mass parameters; wherein the current parameters comprise current position parameters, current velocity parameters and / or current mass parameters, and the determining of the current parameters of each particle in the particle system based on the initial parameters and the external force parameters comprises: obtaining the external force parameters, wherein the external force parameters comprise gravity parameters, wind force parameters and / or friction force parameters; updating the current position parameters, the current velocity parameters and / or the current mass parameters of each particle according to a preset physical law, the initial parameters and the external force parameters.

2. The physically analog-based particle collision method of claim 1, wherein, The preset collision detection algorithm comprises a bounding volume hierarchy (BVH) tree collision detection algorithm, and the detecting of the collision information between each particle and / or between each particle and other objects in the particle system by using the preset collision detection algorithm further comprises: constructing a BVH tree with each particle as a root node in the particle system; traversing the BVH tree from the root node as a starting point in each BVH tree to detect whether there is another node in the BVH tree by using the BVH tree collision detection algorithm, wherein a bounding volume of the other node intersects with a bounding volume of the root node; if there is another node in the BVH tree, determining the collision information according to the other node and the root node.

3. The physically-simulated particle collision method of claim 1, wherein, After the updating of the target collision parameters of each particle based on the preset collision model, the current parameters and the collision information, the method comprises: determining a particle state of each particle based on the target collision parameters; judging whether to perform an iterative collision test on each particle according to the particle state.

4. The physically simulated particle collision method of claim 3, wherein, The judging of whether to perform the iterative collision test on each particle according to the particle state comprises: In a case where the particle state is a stable state, stopping iterative collision testing on the particles; In a case where the particle state is an unstable state, starting a step of updating a target collision parameter of each of the particles based on a preset collision model, the current parameter, and the collision information.

5. A particle collision device based on physical simulation, characterized by, Comprise: A current parameter determination module configured to determine a current parameter of each of the particles based on an initial parameter and an external force parameter of each of the particles in a particle system; A collision information detection module configured to detect collision information between each of the particles and / or between the particles and other objects in the particle system by using a preset collision detection algorithm; A target collision parameter update module configured to update a target collision parameter of each of the particles based on a preset collision model, the current parameter, and the collision information; The collision information detection module comprises: A bounding box definition unit configured to define each of the particles and each of the other objects as a bounding box by using the bounding box collision detection algorithm; A related bounding box determination unit configured to determine each of the bounding boxes within a preset range around each of the particles as a related bounding box; An intersection information calculation unit configured to traverse each of the related bounding boxes and calculate intersection information between each of the related bounding boxes and a bounding box corresponding to the particle; A collision information determination unit configured to determine the collision information according to the intersection information; The particle collision device based on physical simulation comprises: An initial parameter determination module configured to determine an initial parameter of each of the particles in a particle system by using a preset physical engine for initialization processing of the particle system, wherein the initial parameter comprises an initial position parameter, an initial velocity parameter, and / or an initial mass parameter; The current parameter determination module comprises: An external force parameter acquisition unit configured to acquire the external force parameter, wherein the external force parameter comprises a gravity parameter, a wind force parameter, and / or a friction force parameter; A current parameter determination unit configured to update a current position parameter, a current velocity parameter, and / or a current mass parameter of the particle according to a preset physical law, each of the initial parameters, and each of the external force parameters.

6. A computer device, comprising: The computer device comprises a memory and a processor; The memory is configured to store a computer program; 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 4 when executing the computer program.

7. A computer readable storage medium characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to make the processor implement the particle collision method based on physical simulation according to any one of claims 1 to 4.

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