Collision processing method and device in game, electronic equipment and storage medium

By generating a first and second capsule collider for virtual characters and combining them with attenuation coefficients to simulate the rebound effects in different areas, the problem of unrealistic rebounds after object collisions is solved, improving the realism of the game graphics and detection efficiency.

CN116135272BActive Publication Date: 2025-12-16NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111361473.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-17
Publication Date
2025-12-16
Estimated Expiration
2041-11-17

AI Technical Summary

Technical Problem

Existing object collision analysis technology fails to properly set up colliders, resulting in unrealistic bounce effects after object collisions and distorted game graphics.

Method used

By generating a first capsule collider for the virtual character and a second capsule collider based on the trajectory of the circular object, the collision point is determined, and the bounce result is set according to the type of collider region, including different attenuation coefficients to simulate the bounce effect in different regions.

Benefits of technology

It improves the realism of the bounce effect after an object collision, enhances the realism of the game graphics, reduces the number of colliders, and improves the efficiency and accuracy of collision detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116135272B_ABST
    Figure CN116135272B_ABST
Patent Text Reader

Abstract

The application provides a collision processing method and device in a game, an electronic device and a storage medium. A graphical user interface is provided by a terminal device, the graphical user interface includes at least one virtual character and at least one circular object colliding with the virtual character. The method includes: determining a collision point position in response to intersection of a first capsule collision body corresponding to the virtual character and a second capsule collision body; the second capsule collision body is generated according to a running track of the circular object; determining a region type of a region to which the collision point position belongs; and determining a rebound result of the circular object for display of the graphical user interface according to the region type. The method can improve the authenticity of the rebound performance of the object after collision and avoid distortion of the game picture.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the game technical field, and in particular to a collision processing method and device in a game, an electronic device and a storage medium. BACKGROUND

[0002] In a ball game, the collision between a ball and a human body is a very common scene. Generally speaking, for such a physical problem, the game generally binds a collision body to an object for physical simulation. For example, when a ball collides with a human body, the system performs physical operations according to preset parameters, and the rebound result can be obtained.

[0003] However, the existing object collision analysis technology does not reasonably set the collision body, and does not analyze the rebound effect of the object collision based on the reasonable collision body, so that the rebound performance when the collision occurs is not real enough.

[0004] Therefore, the existing object collision analysis technology has the technical problem that the rebound performance after the object collision is not real due to the unreasonable setting of the collision body, and the game picture is distorted. SUMMARY

[0005] Therefore, it is necessary to provide a collision processing method and device in a game, an electronic device and a storage medium to reasonably set the collision body of two objects to be detected for collision, improve the realness of the rebound performance after the object collision, and improve the game picture distortion problem.

[0006] In a first aspect, the present application provides a collision processing method in a game, which provides a graphical user interface through a terminal device, the graphical user interface includes at least one virtual character and at least one circular object colliding with the virtual character, and the method comprises the following steps:

[0007] In response to the intersection of the first capsule collision body and the second capsule collision body corresponding to the virtual character, the position of the collision point is determined; wherein the second capsule collision body is generated according to the running track of the circular object;

[0008] The region type of the region to which the collision point position belongs is determined.

[0009] According to the region type, the rebound result of the circular object for the graphical user interface to display is determined.

[0010] In some embodiments of the present application, the first capsule of the virtual role is generated by: obtaining animation features of the virtual role, the animation features including animation categories, animation information, and bone information; in a preset capsule library, screening a capsule that matches the animation categories and the animation information as a target capsule; wherein the target capsule includes a truncated capsule composed of curved surfaces and planes; and generating the first capsule according to the target capsule and the bone information.

[0011] In some embodiments of the present application, the first capsule is generated according to the target capsule and the bone information, including: determining a preset collision body radius corresponding to the target capsule; and generating the first capsule according to the collision body radius and the bone information; wherein the curved surface area and the plane area of the first capsule are calculated according to the collision body radius and a rotation matrix of the curved surface or the plane.

[0012] In some embodiments of the present application, in response to the collision intersection of the first capsule and the second capsule corresponding to the virtual role, the collision point position is determined by: in response to the collision intersection of the first capsule and the second capsule corresponding to the virtual role, constructing an axis distance function according to the second capsule and the first capsule; and analyzing the axis distance function and a preset collision intersection constraint condition to determine the collision point position.

[0013] In some embodiments of the present application, in response to the collision intersection of the first capsule and the second capsule corresponding to the virtual role, the axis distance function is constructed according to the second capsule and the first capsule, including: in response to the collision intersection of the first capsule and the second capsule corresponding to the virtual role, determining a collision tangent point in the second capsule; and determining a distance minimum point in the first capsule relative to the collision tangent point; wherein the distance minimum point and the collision tangent point are points on the axis of the respective capsule; and constructing a function relative to the origin of the coordinate system in the spatial coordinate system according to the distance minimum point and the collision tangent point to obtain the axis distance function.

[0014] In some embodiments of the present application, the collision point position is determined by analyzing the axis distance function and the preset collision intersection constraint condition, including: extracting an axis distance vector in the axis distance function and the collision intersection constraint condition; substituting the axis distance function into the collision intersection constraint condition to obtain a deformed collision intersection constraint condition for the axis distance vector; and analyzing the deformed collision intersection constraint condition to obtain the collision point position.

[0015] In some embodiments of the present application, the bounce result of the circular object for display by the graphical user interface is determined according to the region type, including: obtaining the bounce speed vector and the bounce rotation speed scalar of the circular object according to the region type; determining the bounce speed vector and the bounce rotation speed scalar as the bounce result; wherein the region type includes a front region of the collision body, a side region of the collision body and a back region of the collision body divided by the curvature value of the surface of the collision body.

[0016] In some embodiments of the present application, the bounce speed vector and the bounce rotation speed scalar of the circular object are obtained according to the region type, including: screening the attenuation coefficient matched with the region type in the preset attenuation coefficient library; obtaining the initial speed vector and the initial rotation speed scalar of the circular object before the virtual character collides; and processing the initial speed vector and the initial rotation speed scalar respectively according to the attenuation coefficient to obtain the bounce speed vector and the bounce rotation speed scalar.

[0017] In some embodiments of the present application, the attenuation coefficient includes a speed attenuation coefficient, and the speed attenuation coefficient includes a normal speed attenuation coefficient and a tangent speed attenuation coefficient; wherein the bounce speed vector and the bounce rotation speed scalar are obtained by processing the initial speed vector and the initial rotation speed scalar respectively according to the attenuation coefficient, including: decomposing the initial speed vector into a normal initial speed vector according to the normal direction information of the tangent point of collision in the second capsule collision body; obtaining the tangent initial speed vector by obtaining the difference between the initial speed vector and the normal initial speed vector; obtaining the first product value between the tangent initial speed vector and the tangent speed attenuation coefficient, and obtaining the second product value between the normal initial speed vector and the normal speed attenuation coefficient; and determining the sum of the first product value and the second product value as the bounce speed vector.

[0018] In some embodiments of the present application, the attenuation coefficient further includes a rotation speed attenuation coefficient, and the rotation speed attenuation coefficient includes a vertical rotation speed attenuation coefficient and a horizontal rotation speed attenuation coefficient, and the method further includes: determining the initial vertical rotation speed and the initial horizontal rotation speed in the initial rotation speed scalar; obtaining the bounce vertical rotation speed by multiplying the initial vertical rotation speed by the vertical rotation speed attenuation coefficient; obtaining the bounce horizontal rotation speed by multiplying the initial horizontal rotation speed by the horizontal rotation speed attenuation coefficient; and determining the bounce vertical rotation speed and the bounce horizontal rotation speed as the bounce rotation speed scalar.

[0019] In the second aspect, the present application provides a collision processing device in a game, which provides a graphical user interface containing at least one virtual character and at least one circular object colliding with the virtual character, including:

[0020] A collision point determination module is configured to determine the position of the collision point in response to the intersection of the first capsule collision body corresponding to the virtual character and the second capsule collision body; wherein the second capsule collision body is generated according to the running track of the circular object.

[0021] a region type determination module configured to determine a region type of a region to which the collision point position belongs;

[0022] a bounce result determination module configured to determine a bounce result of the circular object for display by the graphical user interface according to the region type.

[0023] In a third aspect, the present application provides an electronic device, comprising:

[0024] one or more processors;

[0025] a memory; and one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the collision processing method in the game.

[0026] In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program, and the computer program is loaded by a processor to execute the steps of the collision processing method in the game.

[0027] In a fifth aspect, the present application provides a computer program product or a computer program, which comprises computer instructions stored in a computer-readable storage medium. The processor of the electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to enable the electronic device to execute the method provided in the first aspect.

[0028] The collision processing method, device, electronic device and storage medium in the game, the terminal determines the collision point position by responding to the intersection of the first capsule collision body and the second capsule collision body corresponding to the virtual character, and then determines the region type of the region to which the collision point position belongs, so as to determine the bounce result of the circular object for display by the graphical user interface according to the region type. In this way, the collision body of the virtual character is set to the first capsule collision body with the smallest internal component being a truncated capsule, and the collision body of the circular object is set to the second capsule collision body generated according to the running track, which not only reasonably sets the collision body, but also can perform targeted bounce analysis on different collision body regions, effectively improves the bounce performance authenticity after object collision, and improves the distortion problem of the game picture. BRIEF DESCRIPTION OF DRAWINGS

[0029] In order to more clearly illustrate the technical solutions in 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 only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0030] Figure 1 is a flow diagram of a collision processing method in a game provided by an embodiment of the present application;

[0031] Figure 2 is a top view diagram of a first capsule collision body provided by an embodiment of the present application;

[0032] Figure 3 is a structural diagram of a first capsule collision body provided by an embodiment of the present application;

[0033] Figure 4 is a structural diagram of a collision intersection detection step provided by an embodiment of the present application;

[0034] Figure 5 is a planar effect diagram of a rebound after a circular object collision provided by an embodiment of the present application;

[0035] Figure 6 is a structural diagram of a collision processing apparatus in a game provided by an embodiment of the present application;

[0036] Figure 7 is a structural diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0037] 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 skilled in the art without creative work fall within the scope of protection of the present application.

[0038] In the description of the present application, the terms “first” and “second” are used only for the purpose of description, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with “first” and “second” can explicitly or implicitly include one or more of the features. In the description of the present application, the meaning of “multiple” is two or more, unless otherwise specifically limited.

[0039] It should be noted that the collision processing method in the embodiments of the present application can run on a local terminal device or a server. When the game data processing method runs on a server, it can be a cloud game.

[0040] In an optional embodiment, cloud gaming refers to a game mode based on cloud computing. In the running mode of cloud gaming, the running subject of the game program and the presentation subject of the game picture are separated, and the storage and running of the game data processing method are completed on the cloud gaming server. The cloud gaming client is used for data receiving, sending and game picture presentation. For example, the cloud gaming client can be a display device close to the user side with data transmission function, such as a mobile terminal, a television, a computer, a palm computer, etc. However, the cloud gaming server in the cloud is used for game data processing. When playing the game, the player operates the cloud gaming client to send operation instructions to the cloud gaming server, the cloud gaming server runs the game according to the operation instructions, encodes and compresses the game picture and other data, returns them to the cloud gaming client through the network, and finally decodes and outputs the game picture through the cloud gaming client.

[0041] In an optional embodiment, the local terminal device stores a game program and is used for presenting a game picture. The local terminal device is used for interacting with the player through a graphical user interface, that is, a conventional game program is downloaded and installed on an electronic device and is run. The way in which the local terminal device provides the graphical user interface to the player can include various ways, for example, the graphical user interface can be rendered and displayed on the display screen of the terminal, or the graphical user interface can be provided to the player through holographic projection. For example, the local terminal device can include a display screen used for presenting a graphical user interface including a game picture, and a processor used for running the game, generating the graphical user interface and controlling the display of the graphical user interface on the display screen.

[0042] The following will be described in detail respectively. However, it should be noted that the order of the following embodiments does not limit the preferred order of the embodiments.

[0043] Reference Figure 1 , Figure 1 A flowchart of a collision processing method in a game provided by an embodiment of the present application is shown. A graphical user interface is provided by a terminal device, wherein the terminal device can be the local terminal device mentioned above or the client device in the cloud interaction system mentioned above. The game scene of the game includes at least one virtual character and at least one circular object colliding with the virtual character. The method includes steps S101-S103, which are as follows.

[0044] S101, in response to the intersection of the first capsule collision body corresponding to the virtual character and the second capsule collision body, the position of the collision point is determined; wherein the second capsule collision body is generated according to the running track of the circular object.

[0045] The game scene related to the embodiments of the present application includes at least one virtual character. The virtual character can be a game virtual unit controlled by a player through a terminal, or a non-player character (NPC) pre-set by a game developer in a specific game scene.

[0046] The collision body can be a model used for collision detection instead of a virtual object in a game. The virtual object in the game can include, but is not limited to, a virtual character in the game and a virtual object in the game. In the game, the virtual character can be a virtual character corresponding to a user, i.e., a person in the game. The virtual object can be a model simulating a real object in the real world. In the embodiments of the present application, the virtual object mainly refers to a circular object, which can include, but is not limited to, a football, a basketball, a volleyball, a table tennis ball, etc.

[0047] Specifically, in a game scene, in order to form a more realistic game effect, the model corresponding to a game character or a game object is generally complex and has a large number of faces. Therefore, a collision body with a small number of faces and a simple model is needed to replace the virtual object for collision detection. The first capsule collision body can be used to distinguish the body parts of the virtual character, and a capsule body (also referred to as a truncated capsule body) containing curved surfaces and planes is independently set, for example, the first capsule collision body of the virtual character A has two, which are located at the torso and the left leg.

[0048] Further, refer to Figure 2 , Figure 2 The first capsule collision body provided in the embodiments of the present application is shown in a top view. The first capsule collision body is different from the traditional capsule body in that the faces are curved surfaces, but there are mutually symmetrical planes and mutually symmetrical curved surfaces. The planes are mainly used to be close to the front chest and back of the human body, and can also be used to be close to each part of the human body, which is equivalent to partitioning different parts, for example, the flat part of the human torso is relatively large, and the plane can be set to be relatively large, while the flat part of the human foot and hand is relatively small, and the front plane can be set to be relatively small.

[0049] In a specific implementation, since the existing object collision analysis technology does not reasonably set the collision body, for example, the collision body of a ball is generally set as a spherical body, which is extremely easy to penetrate the model when the ball moves too fast; for another example, a human body is regarded as a single capsule body, which cannot simulate the behavior of swinging limbs, but if the human body is regarded as multiple capsule bodies, such as a torso, an arm, and a thigh, the multiple collision bodies not only increase the performance consumption, but also cause the collision effect to be distorted due to the shapes that cannot completely fit the human body.

[0050] Therefore, the embodiment of the present application proposes to model the trajectory of the ball as a capsule and model each body part of the player as a truncated capsule in the game scene where the virtual character is regarded as a player and the circular object is regarded as a ball. In this way, not only can continuous detection be supported even in the case of high ball speed, avoiding the phenomenon of penetration of the bounce result presented by the terminal, but also the number of collision bodies can be reduced while achieving optimal detection effect, improving the efficiency and accuracy of collision detection, and improving the realism of the game picture in the terminal.

[0051] More specifically, the terminal mentioned in the embodiment can be the local terminal device mentioned above, or the client device in the cloud interaction system mentioned above. The operating system of the terminal can include Android, IOS, Windows Phone, Windows, etc., and can generally support the running of various game applications. The game application is run on the terminal, and the graphical user interface (User Interface, UI) is rendered on the display screen of the terminal. The content displayed by the graphical user interface at least partially contains a part or all of the game scene. The specific form of the game scene can be square, or other shapes such as circle, triangle, etc.

[0052] Further, the virtual character can be presented through the graphical user interface. The presented content can include the whole virtual character, or part of the virtual character. For example, in a third-person perspective game, the content presented by the graphical user interface can include the whole virtual character, or, in a first-person perspective game, the content presented by the graphical user interface can include part or part of the virtual character. The specific application is not limited.

[0053] In one embodiment, the first capsule collision body of the virtual character is generated by: obtaining animation features of the virtual character, the animation features including animation category, animation information and bone information; in a preset capsule collision body library, screening out a capsule collision body matched with the animation category and the animation information as a target capsule collision body; wherein the target capsule collision body includes a truncated capsule composed of curved surfaces and planes; generating the first capsule collision body according to the target capsule collision body and the bone information.

[0054] The animation feature can refer to various pre-processed data information such as animation category, animation information, and usable animation skeleton. The animation feature generated for different animations is different. The animation feature contains the meaning of the animation resource for the game, from which it can be inferred that which collision body is suitable at this time. It is true that the highest level collision body can be used at any time, and a separate collision body is generated for any joint of the human body, including the head, fingers, and the like, but this will greatly increase the consumption of program running. Therefore, analyzing the animation category, animation information, and skeleton information to generate the collision body of the virtual character can reduce additional consumption while ensuring the main focus and basic coverage.

[0055] The animation category can be an animation category distinguished based on the action form of the virtual character in different game scenes. For example, if the virtual character is a player and the circular object is a football, the animation category includes but is not limited to passing, shooting, and saving. The animation information can be action information subdivided to each part of the virtual character, including but not limited to left leg interception and right leg interception. The skeleton information can be represented by x, y, and z coordinates in a spatial coordinate system. The coordinates mark the position of the axis of the collision body in space.

[0056] In a specific implementation, in order to obtain the first capsule collision body, the terminal first needs to read the animation feature from the pre-processed animation resource. The pre-processing of the animation resource can be performed by the terminal or by other devices. The pre-processing step includes not only the marking of the animation category, such as passing, shooting, and saving, but also the marking of the animation information, such as left leg interception / right leg interception, and even the conversion of the relative displacement of the specified skeleton in the animation file into game data export. The animation resource can refer to a series of data adopted by the game after the original animation action file is pre-processed and enters the game, including the action of the animation and additional information after pre-processing, which collectively becomes the animation resource.

[0057] Further, after the terminal obtains the animation feature including the animation category, the animation information, and the skeleton information, the target capsule collision body required to obtain the first capsule collision body can be determined in any of the following ways: (1) in a preset capsule collision body library containing a plurality of capsule collision bodies, according to the animation category and the animation information as the primary key, the capsule collision body matching the animation category and the animation information is queried and filtered out as the target capsule collision body; (2) any query method with the animation category and the animation information as input is selected, such as using a random forest algorithm, which can be implemented in Python software or other software, which is not limited here. At this time, the target capsule collision body can be one or more, but the capsule collision body for the virtual character trunk part should be included, and other capsule collision bodies can be for other parts of the virtual character.

[0058] Further, after the terminal acquires the target capsule collider as shown in Figure 2 Fig. 3, the first capsule collider creation position in the space coordinate system relied on by the game scene can be determined in combination with the skeleton information contained in the animation feature, and then the first capsule collider is generated according to the position. The first capsule collider generation step involved in the embodiment will be described in detail below.

[0059] In one embodiment, the step of generating the first capsule collider according to the target capsule collider and the skeleton information includes: determining that the target capsule collider corresponds to a pre-stored collider radius; generating the first capsule collider according to the collider radius and the skeleton information; wherein the curved surface area and the plane area of the first capsule collider are calculated according to the collider radius and the rotation matrix of the curved surface or the plane.

[0060] The collider radius can be a basic radius preset according to each body part of the virtual character, which mainly refers to the minor axis radius of the capsule collider, but is not limited to also include the major axis radius of the capsule collider.

[0061] In a specific implementation, after the terminal analyzes and determines the target capsule collider required to generate the first capsule collider, only the number of colliders of the first capsule collider required subsequently, such as single body, double body, three bodies, etc., is determined. On this basis, the collider radius of the target capsule collider needs to be extracted from the pre-set collider radius library, and then the front area, side area and back area of the first capsule collider are determined through calculation rotation. That is, the first capsule collider can be generated by using the skeleton information, the collider radius and the surface area of each collider.

[0062] For example, referring to Figure 3 In the space coordinate system relied on by the game scene, the normal direction of the front face of the first capsule collider is considered as the facing direction of the virtual character, and the collider axis perpendicular to the ground plane is considered as the default state. The rotation matrix of the direction and the axis direction of the current collider is calculated, and the front normal of the collider is calculated by acting on the human facing vector. Accordingly, the plane area covered by AB and CD as shown in Figure 2 Fig. 4 can be obtained.

[0063] In a specific implementation, the second capsule collider is generated according to the running track of the circular object. The reason is that if the circular object is regarded as a sphere, it is easy to appear through the mold when the circular object runs very fast, and then continuous detection cannot be realized. The through mold can be understood as the phenomenon that many 3D games, objects or people, are caused by collision volume setting errors, such as when the ball speed is very fast, the N frame ball is located at point P, and the N+1 frame ball is located at Q. The PQ line penetrates the human body.

[0064] Further, the collision detection of the two capsule bodies A and B, i.e., the first capsule collision body and the second capsule collision body, is equivalent to finding a pair of points with the closest distance on two line segments (the axes of the two capsule bodies), and if the distance of the pair of points is less than the sum of the radii of the capsule bodies A and B, it indicates that the collision intersects. It should be noted that the embodiment of the present application does not explain in detail how to determine whether the first capsule collision body and the second capsule collision body intersect after the collision in the following text, but sets the case that the first capsule collision body and the second capsule collision body intersect after the collision, and analyzes and determines the position of the collision point on the first capsule collision body. In actual application, if it is necessary to determine whether the first capsule collision body and the second capsule collision body intersect after the collision, it can be determined whether there is a solution for the position of the collision point based on the axis distance function and the collision intersection constraint condition, and if there is no solution, it indicates that the two do not intersect. For the determination steps of the position of the collision point, reference can be made to Figure 4 , Figure 4 which is a structural schematic diagram of the collision intersection detection steps provided by the embodiment of the present application. The present application will be described in detail below in combination with Figure 4 how to determine the position of the collision point.

[0065] In one embodiment, step S101 comprises: in response to the collision intersection of the first capsule collision body and the second capsule collision body corresponding to the virtual role, constructing an axis distance function according to the second capsule collision body and the first capsule collision body; and analyzing the axis distance function and a preset collision intersection constraint condition to determine the position of the collision point.

[0066] In specific implementation, reference can be made to Figure 4 , Figure 4 which presents a picture of the collision intersection of the first capsule collision body and the second capsule collision body, defines the central axis of the virtual role as the central axis of the ball as the hitting point as B, and the nearest point on the human body as P.

[0067] Specifically, the embodiment of the present application proposes to find a pair of points PB in the case that A and B intersect, P is on , B is on , and P is the nearest point to point B on . The point B in the pair of points PB is regarded as the center position of the ball when the collision occurs. and are perpendicular to each other, and the central axes of the first capsule collision body and the second capsule collision body are perpendicular to each other, and then the origin O in the space coordinate system on which the game scene relies can be used to construct the axis distance function between the second capsule collision body and the first capsule collision body, so as to solve the axis distance function under the limitation of the collision intersection constraint condition, and finally obtain the position of the collision point.

[0068] In one embodiment, the step of constructing the axial distance function according to the second capsule collision body and the first capsule collision body in response to the respective central axes of the first capsule collision body and the second capsule collision body being perpendicular to each other includes: determining a collision tangent point in the second capsule collision body in response to the respective central axes of the first capsule collision body and the second capsule collision body being perpendicular to each other; and determining a distance minimum point in the first capsule collision body relative to the collision tangent point; wherein the distance minimum point and the collision tangent point are points on the central axes of the respective capsule collision bodies; and constructing a function relative to the origin of the coordinate system in the spatial coordinate system according to the distance minimum point and the collision tangent point to obtain the axial distance function.

[0069] wherein the collision tangent point can be the hit point B, and the distance minimum point can be the nearest point P to the hit point B, B is on and P is on .

[0070] Specifically, the axial distance function constructed according to the distance minimum point P and the collision tangent point B has the following expression:

[0071]

[0072] wherein α and β are both preset length factors, and the specific values thereof can be obtained through multiple experiments.

[0073] In one embodiment, the step of analyzing the axial distance function and the preset collision intersection constraint condition to determine the collision point position includes: extracting an axial distance vector in the axial distance function and the collision intersection constraint condition; substituting the axial distance function into the collision intersection constraint condition to obtain a deformed collision intersection constraint condition for the axial distance vector; and analyzing the deformed collision intersection constraint condition to obtain the collision point position.

[0074] wherein the axial distance vector can be represented as which is determined by the length and direction between the two points B and P.

[0075] Specifically, the collision intersection constraint condition has the following expression:

[0076]

[0077] In a specific implementation, substituting the axial distance function into the collision intersection constraint condition can obtain the deformed collision intersection constraint condition, which has the following expression:

[0078]

[0079] wherein C1 is C1 is C1 is C1 is C1 is C1 is

[0080] S102, determine the region type of the collision body region to which the collision point position belongs.

[0081] wherein, refer to Figure 2 The region type of the collision body region includes a collision body front region, a collision body side region, and a collision body back region. The collision body front region and the collision body back region are both planar regions, and the collision body side region is a curved surface region.

[0082] In a specific implementation, each body part (such as a hand, a head, a foot, etc.) of the virtual character can constitute a first capsule collision body. If there is only one first capsule collision body, the terminal only needs to determine the collision body region (such as the collision body front region, or the collision body side region, or the collision body back region) to which the collision point position belongs. If there are multiple first capsule collision bodies, the terminal not only needs to determine the target collision body to which the collision point position belongs, but also needs to determine the region type of the collision body region on the target collision body where the collision point position is located. The reason is that different attenuation coefficients can be set for different capsule collision bodies, and different attenuation coefficients can be set for each collision body region on each capsule collision body.

[0083] S103, determine the rebound result of the circular object for the graphical user interface to display according to the region type.

[0084] In a specific implementation, the prior art generally uses the following scheme for the physical operation of collision, that is, by setting a static friction coefficient, a dynamic friction coefficient, and a rebound coefficient to affect the operation result of the physical formula. However, the physical formula is essentially used in a time-continuous situation, and the time in the game cannot be infinitely differentiated. There is a lower limit of differentiation, that is, the minimum update interval of the game physics system. Therefore, using pure physical operation for finite element analysis simulation cannot guarantee convergence, and the prior art cannot simulate the complex friction condition of the human body surface. Different parts of the body cannot be distinguished in terms of material, and the relationship between the ball speed and the energy attenuation on different components, and the relationship between the ball rotation speed and the energy attenuation on different components cannot be controlled by parameters. Therefore, the anisotropy of the human body surface to the ball rebound cannot be simulated, resulting in unrealistic rebound performance and distorted game picture after the object collision.

[0085] Therefore, the present application proposes to consider the difference between the collision points located on the human body parts, and configure anisotropic rebound parameters for different regions of the human body, so as to achieve a realistic rebound effect. The rebound result includes the speed and rotation speed of the circular object after rebound, which can be displayed through the graphical user interface. Details will be described below.

[0086] In one embodiment, step S103 comprises: obtaining the rebound velocity vector and the rebound rotation speed scalar of the circular object according to the region type; determining the rebound velocity vector and the rebound rotation speed scalar as the rebound result; wherein the region type comprises a front region of the collision body, a side region of the collision body, and a back region of the collision body divided by the surface curvature value of the collision body.

[0087] wherein the rebound velocity vector can be represented as "V'", the rebound rotation speed scalar can be divided into a vertical rotation speed and a horizontal rotation speed, the vertical rotation speed can be represented as "R'ball_h", and the horizontal rotation speed can be represented as "R'ball_v".

[0088] In a specific implementation, the terminal can obtain different parameters for different region types to obtain the rebound velocity vector and the rebound rotation speed scalar, and the velocity and the rotation speed each actually include parameters in at least two directions. The analysis of the rebound result can be superimposed according to the parameters in each direction, and details are described below.

[0089] In one embodiment, the step of obtaining the rebound velocity vector and the rebound rotation speed scalar of the circular object according to the region type comprises: screening out an attenuation coefficient matched with the region type in a preset attenuation coefficient library; obtaining an initial velocity vector and an initial rotation speed scalar of the circular object before the virtual character collides; and processing the initial velocity vector and the initial rotation speed scalar respectively according to the attenuation coefficient to obtain the rebound velocity vector and the rebound rotation speed scalar.

[0090] In a specific implementation, to obtain the rebound velocity vector and the rebound rotation speed scalar, the terminal first needs to determine the initial velocity vector and the initial rotation speed scalar, the initial velocity vector can be represented as "Vball", the initial rotation speed scalar can be represented as "Rball_h" and "Rball_h", and the current region type is taken as a primary key to find the corresponding attenuation coefficient in the attenuation coefficient library.

[0091] In this way, the initial velocity vector "Vball" and the initial rotation speed scalar "Rball_h, Rball_h" can be analyzed to obtain the rebound velocity vector "V'" and the rebound rotation speed scalar "R'ball_h, R'ball_v" under the action of the corresponding attenuation coefficient.

[0092] In one embodiment, the attenuation coefficient includes a speed attenuation coefficient, the speed attenuation coefficient including a normal speed attenuation coefficient and a tangent speed attenuation coefficient; wherein the initial speed vector and the initial rotation speed scalar are processed according to the attenuation coefficient respectively to obtain the rebound speed vector and the rebound rotation speed scalar, including: performing vector decomposition on the initial speed vector according to the normal direction information of the collision tangent point in the second capsule collision body to obtain a normal initial speed vector of the initial speed vector; obtaining a tangent initial speed vector by obtaining the difference between the initial speed vector and the normal initial speed vector; obtaining a first product value between the tangent initial speed vector and the tangent speed attenuation coefficient, and obtaining a second product value between the normal initial speed vector and the normal speed attenuation coefficient; determining the sum of the first product value and the second product value as the rebound speed vector.

[0093] Wherein, the attenuation coefficient includes a speed attenuation coefficient, the speed attenuation coefficient including a normal speed attenuation coefficient "fnormal" and a tangent speed attenuation coefficient "ftangent".

[0094] In a specific implementation, the calculation formula of the rebound speed vector is as follows:

[0095] Vball normal = Vball · Normal

[0096] Vball tangent = Vball - Vball normal

[0097] V' = Vball normal * fnormal + Vball tangent * ftangent

[0098] Wherein, Normal is the normal of the hitting point B, and Vball is the initial speed vector. Please refer to Figure 5 , DE is the ball incidence direction, and EJ is the exit direction. After vector decomposition is performed on DE, the normal direction is attenuated to obtain EI, and the tangent direction is attenuated to obtain EH, and the sum is EJ.

[0099] It should be noted that the above formula is only a basic formula, which is mainly used to explain how to obtain the rebound result. Because in the game, there are many judgment conditions for avoiding boundary errors, such as ensuring that the rebound speed of the ball exists a lower limit, which cannot be included in the formula, and the specific adjustment is made according to the actual game scene. In addition, increasing the normal direction attenuation will absorb more normal collisions, and increasing the tangent direction will absorb more collisions when the ball body rubs the human body surface. The proportion of the normal coefficient and the tangent coefficient will change the angle of the ball after rebounding, so that his rebound is distinguished from the completely elastic collision.

[0100] It should be noted that although the speed vector presented above only considers the tangential and normal effects, it does not exclude the consideration of the tangential effect on the normal and / or the normal effect on the tangential in other embodiments, and even the effect of the rotational speed can also be considered, which is not limited in the present application.

[0101] In one embodiment, the attenuation coefficient further includes a rotational speed attenuation coefficient, the rotational speed attenuation coefficient includes a vertical rotational speed attenuation coefficient and a horizontal rotational speed attenuation coefficient, and the method further includes: determining an initial vertical rotational speed and an initial horizontal rotational speed in the initial rotational speed scalar; obtaining a product of the initial vertical rotational speed and the vertical rotational speed attenuation coefficient to obtain a rebound vertical rotational speed; obtaining a product of the initial horizontal rotational speed and the horizontal rotational speed attenuation coefficient to obtain a rebound horizontal rotational speed; and determining the rebound vertical rotational speed and the rebound horizontal rotational speed as the rebound rotational speed scalar.

[0102] Wherein, the attenuation coefficient includes a rotational speed attenuation coefficient, and the rotational speed attenuation coefficient includes a vertical rotational speed attenuation coefficient "rhf" and a horizontal rotational speed attenuation coefficient "rvf".

[0103] In a specific implementation, the calculation formula of the rebound rotational speed scalar is as follows:

[0104] R′ball_h=Rball_h·rhf

[0105] R′ball_v=Rball_h·rvf

[0106] Wherein, "Rball_h" is the initial vertical rotational speed, "Rball_h" is the initial horizontal rotational speed, "R′ball_h" is the rebound vertical rotational speed, and "R′ball_v" is the rebound horizontal rotational speed.

[0107] It should be noted that the present application proposes that the speed of the player can be considered before obtaining the rebound result, that is, the initial speed of the virtual character before colliding with the circular object is considered, which is also added to the rebound result in the form of a coefficient to make the rebound performance more realistic. In addition, the present application also proposes that the collision with multiple collision bodies in the same frame can be considered, and the rebound will be based on the most serious intersection of one cylinder, for example, in multiple axis distances BP, the axis distance is the shortest, which is considered as the most serious intersection, and the remaining axis distance can be ignored.

[0108] The collision processing method in the game has the advantages that the collision body of the virtual character is set as the first capsule collision body with the internal minimum component being a truncated capsule, and the collision body of the circular object is set as the second capsule collision body generated according to the running track, so that the collision bodies are reasonably set, and the specific rebound analysis can be performed on different collision body regions, the rebound performance after object collision is improved, the game picture distortion problem is improved, the problem that the circular object cannot be continuously detected is solved, and the problem of the circular object penetrating the virtual character after collision is avoided.

[0109] To better implement the collision processing method in the game provided in the embodiments of the application, on the basis of the collision processing method in the game provided in the embodiments of the application, the embodiments of the application further provide a collision processing device in a game, which provides a graphical user interface, and the graphical user interface includes at least one virtual character and at least one circular object colliding with the virtual character, as shown in Figure 6 The collision processing device 600 in the game includes:

[0110] The collision point determination module 610 is configured to determine a collision point position in response to the first capsule collision body and the second capsule collision body of the virtual character colliding with each other, and the second capsule collision body is generated according to the running track of the circular object.

[0111] The region type determination module 620 is configured to determine a region type of a collision body region to which the collision point position belongs.

[0112] The rebound result determination module 630 is configured to determine a rebound result of the circular object for display by the graphical user interface according to the region type.

[0113] In one embodiment, the collision processing device 600 in the game further includes a capsule body acquisition module configured to acquire animation features of the virtual character, the animation features including an animation category, animation information, and bone information, filter out a capsule collision body matching the animation category and the animation information from a preset capsule collision body library as a target capsule collision body, and generate the first capsule collision body according to the target capsule collision body and the bone information, wherein the target capsule collision body includes a truncated capsule composed of a curved surface and a plane.

[0114] In an embodiment, the capsule obtaining module is further configured to determine that the target capsule collider corresponds to a pre-stored collider radius; generate a first capsule collider according to the collider radius and the bone information; and wherein a curved surface area and a plane area of the first capsule collider are calculated according to the collider radius and a rotation matrix of the curved surface or the plane.

[0115] In an embodiment, the collision point determining module 610 is further configured to, in response to the first capsule collider and the second capsule collider corresponding to the virtual character colliding with each other, construct an axis distance function formula according to the second capsule collider and the first capsule collider; and analyze the axis distance function formula and a preset collision intersection constraint condition to determine the collision point position.

[0116] In an embodiment, the collision point determining module 610 is further configured to, in response to the first capsule collider and the second capsule collider corresponding to the virtual character colliding with each other, determine a collision tangent point in the second capsule collider; and determine a distance minimum point in the first capsule collider relative to the collision tangent point; wherein the distance minimum point and the collision tangent point are respectively points on the axis of the respective capsule colliders; and construct a function formula relative to an origin of a coordinate system in the spatial coordinate system according to the distance minimum point and the collision tangent point to obtain the axis distance function formula.

[0117] In an embodiment, the collision point determining module 610 is further configured to extract an axis distance vector in the axis distance function formula and the collision intersection constraint condition; and substitute the axis distance function formula into the collision intersection constraint condition to obtain a deformed collision intersection constraint condition for the axis distance vector; and analyze the deformed collision intersection constraint condition to obtain the collision point position.

[0118] In an embodiment, the rebound result determining module 630 is further configured to determine a rebound velocity vector and a rebound rotation speed scalar of the circular object according to the region type; and determine the rebound velocity vector and the rebound rotation speed scalar as the rebound result; wherein the region type includes a front surface region, a side surface region, and a back surface region of the collider divided by a surface curvature value of the collider.

[0119] In an embodiment, the rebound result determining module 630 is further configured to screen an attenuation coefficient matching the region type from a preset attenuation coefficient library; obtain an initial velocity vector and an initial rotation speed scalar of the circular object before the virtual character collides with the circular object; and process the initial velocity vector and the initial rotation speed scalar according to the attenuation coefficient to obtain the rebound velocity vector and the rebound rotation speed scalar.

[0120] In one embodiment, the attenuation coefficient includes a speed attenuation coefficient, the speed attenuation coefficient includes a normal speed attenuation coefficient and a tangent speed attenuation coefficient, and the bounce result determination module 630 is further configured to perform vector decomposition on the initial speed vector according to normal direction information of the tangential point of collision in the second capsule collision body to obtain a normal initial speed vector of the initial speed vector; obtain a tangent initial speed vector by obtaining a difference between the initial speed vector and the normal initial speed vector; obtain a first product value between the tangent initial speed vector and the tangent speed attenuation coefficient, and obtain a second product value between the normal initial speed vector and the normal speed attenuation coefficient; and determine a sum of the first product value and the second product value as the bounce speed vector.

[0121] In one embodiment, the attenuation coefficient further includes a rotation speed attenuation coefficient, the rotation speed attenuation coefficient includes a vertical rotation speed attenuation coefficient and a horizontal rotation speed attenuation coefficient, and the bounce result determination module 630 is further configured to determine an initial vertical rotation speed and an initial horizontal rotation speed in the initial rotation speed scalar; obtain a bounce vertical rotation speed by obtaining a product of the initial vertical rotation speed and the vertical rotation speed attenuation coefficient; obtain a bounce horizontal rotation speed by obtaining a product of the initial horizontal rotation speed and the horizontal rotation speed attenuation coefficient; and determine the bounce vertical rotation speed and the bounce horizontal rotation speed as the bounce rotation speed scalar.

[0122] In the above embodiments, the collision processing apparatus can reasonably set the collision bodies of two objects to be subjected to collision detection, improve the authenticity of bounce performance after object collision, and improve the distortion problem of a game picture.

[0123] The specific limitations of the collision processing apparatus can refer to the limitations of the collision processing method described above, and will not be repeated here. Each module in the above collision processing apparatus can be realized by software, hardware, and a combination thereof, in whole or in part. The above modules can be embedded in or independent of the processor in the electronic device in hardware form, or can be stored in the memory in the electronic device in software form, so as to be called and executed by the processor to perform the operations corresponding to each of the above modules.

[0124] In one embodiment, an electronic device is provided, which can be a terminal, and an internal structure diagram of the electronic device can be as shown in Figure 7As shown in the figure. The electronic device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The communication interface of the electronic device is used to communicate with external terminals in a wired or wireless manner. Wireless mode can be achieved through WIFI, operator network, NFC (near field communication) or other technologies. The computer program is executed by the processor to implement a collision processing method in a game. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen. The input device of the electronic device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad provided on the shell of the electronic device, or an external keyboard, touchpad or mouse, etc.

[0125] Those skilled in the art can understand that, Figure 7 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 electronic device to which the scheme of the present application is applied. The specific electronic device can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.

[0126] In one embodiment, an electronic device is also provided, including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps in each of the above method embodiments.

[0127] In one embodiment, a computer readable storage medium is provided, storing a computer program, which is executed by a processor to implement the steps in each of the above method embodiments.

[0128] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, storage, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

[0129] Any combination of the technical features of the above embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist, it should be considered as the scope of the present application.

[0130] The game collision processing method, device, electronic equipment and storage medium provided by the embodiments of the present application are described in detail above, and the principles and implementation modes of the present application are described by applying specific examples. The above embodiment description is only used to help understand the method and core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed, and the above description should not be understood as the limitation of the present application.

Claims

1. A collision processing method in a game, characterized by, The method comprises the following steps: determining a collision point position in response to the intersection of the first capsule collision body and the second capsule collision body corresponding to the virtual character; determining the region type of the collision body region to which the collision point position belongs; determining the bounce result of the circular object for the graphical user interface to display according to the region type; the first capsule collision body of the virtual character is generated by the following way: obtaining the animation features of the virtual character, including animation category, animation information and skeleton information; filtering out the capsule collision body matching the animation category and the animation information in the preset capsule collision body library as the target capsule collision body; wherein the target capsule collision body includes a truncated capsule body composed of curved surfaces and planes; generating the first capsule collision body according to the target capsule collision body and the skeleton information.

2. The method of claim 1, wherein, The method comprises the following steps: determining the collision point position in response to the intersection of the first capsule collision body and the second capsule collision body corresponding to the virtual character; determining the region type of the collision body region to which the collision point position belongs; determining the bounce result of the circular object for the graphical user interface to display according to the region type; 3. The method of claim 1, wherein, the first capsule collision body of the virtual character is generated by the following way: obtaining the animation features of the virtual character, including animation category, animation information and skeleton information; filtering out the capsule collision body matching the animation category and the animation information in the preset capsule collision body library as the target capsule collision body; wherein the target capsule collision body includes a truncated capsule body composed of curved surfaces and planes; 4. The method of claim 3, wherein, generating the first capsule collision body according to the target capsule collision body and the skeleton information. The method comprises the following steps: determining the collision point position in response to the intersection of the first capsule collision body and the second capsule collision body corresponding to the virtual character; determining the region type of the collision body region to which the collision point position belongs; 5. The method of claim 4, wherein, determining the bounce result of the circular object for the graphical user interface to display according to the region type; the first capsule collision body of the virtual character is generated by the following way: obtaining the animation features of the virtual character, including animation category, animation information and skeleton information; filtering out the capsule collision body matching the animation category and the animation information in the preset capsule collision body library as the target capsule collision body; wherein the target capsule collision body includes a truncated capsule body composed of curved surfaces and planes; generating the first capsule collision body according to the target capsule collision body and the skeleton information. The method comprises the following steps: determining the collision point position in response to the intersection of the first capsule collision body and the second capsule collision body corresponding to the virtual character; determining the region type of the collision body region to which the collision point position belongs; determining the bounce result of the circular object for the graphical user interface to display according to the region type; the first capsule collision body of the virtual character is generated by the following way: obtaining the animation features of the virtual character, including animation category, animation information and skeleton information; filtering out the capsule collision body matching the animation category and the animation information in the preset capsule collision body library as the target capsule collision body; wherein the target capsule collision body includes a truncated capsule body composed of curved surfaces and planes; generating the first capsule collision body according to the target capsule collision body and the skeleton information. The method comprises the following steps: determining the collision point position in response to the intersection of the first capsule collision body and the second capsule collision body corresponding to the virtual character; determining the region type of the collision body region to which the collision point position belongs; determining the bounce result of the circular object for the graphical user interface to display according to the region type; the first capsule collision body of the virtual character is generated by the following way: obtaining the animation features of the virtual character, including animation category, animation information and skeleton information; filtering out the capsule collision body matching the animation category and the animation information in the preset capsule collision body library as the target capsule collision body; wherein the target capsule collision body includes a truncated capsule body composed of curved surfaces and planes; generating the first capsule collision body according to the target capsule collision body and the skeleton information. The method comprises the following steps: determining the collision point position in response to the intersection of the first capsule collision body and the second capsule collision body corresponding to the virtual character; determining the region type of the collision body region to which the collision point position belongs; determining the bounce result of the circular object for the graphical user interface to display according to the region type; the first capsule collision body of the virtual character is generated by the following way: obtaining the animation features of the virtual character, including animation category, animation information and skeleton information; filtering out the capsule collision body matching the animation category and the animation information in the preset capsule collision body library as the target capsule collision body; wherein the target capsule collision body includes a truncated capsule body composed of curved surfaces and planes; generating the first capsule collision body according to the target capsule collision body and the skeleton information. The method comprises the following steps: determining the collision point position in response to the intersection of the first capsule collision body and the second capsule collision body corresponding to the virtual character; determining the region type of the collision body region to which the collision point position belongs; determining the bounce result of the circular object for the graphical user interface to display according to the region type; the first capsule collision body of the virtual character is generated by the following way: obtaining the animation features of the virtual character, including animation category, animation information and skeleton information; filtering out the capsule collision body matching the animation category and the animation information in the preset capsule collision body library as the target capsule collision body; wherein the target capsule collision body includes a truncated capsule body composed of curved surfaces and planes; generating the first capsule collision body according to the target capsule collision body and the skeleton information. The method comprises the following steps: determining the collision point position in response to the intersection of the first capsule collision body and the second capsule collision body corresponding to the virtual character; determining the region type of the collision body region to which the collision point position belongs; determining the bounce result of the circular object for the graphical user interface to display according to the region type; the first capsule collision body of the virtual character is generated by the following way: obtaining the animation features of the virtual character, including animation category, animation information and skeleton information; filtering out the capsule collision body matching the animation category and the animation information in the preset capsule collision body library as the target capsule collision body; wherein the target capsule collision body includes a truncated capsule body composed of curved surfaces and planes; generating the first capsule collision body according to the target capsule collision body and the skeleton information. The method comprises the following steps: determining the collision point position in response to the intersection of the first capsule collision body and the second capsule collision body corresponding to the virtual character; determining the region type of the collision body region to which the collision point position belongs; determining the bounce result of the circular object for the graphical user interface to display according to the region type; the first capsule collision body of the virtual character is generated by the following way: obtaining the animation features of the virtual character, including animation category, animation information and skeleton information; filtering out the capsule collision body matching the animation category and the animation information in the preset capsule collision body library as the target capsule collision body; wherein the target capsule collision body includes a truncated capsule body composed of curved surfaces and planes; generating the first capsule collision body according to the target capsule collision body and the skeleton information. The method comprises the following steps: determining the collision point position in response to the intersection of the first capsule collision body and the second capsule collision body corresponding to the virtual character; determining the region type of the collision body region to which the collision point position belongs; determining the bounce result of the circular object for the graphical user interface to display according to the region type; the first capsule collision body of the virtual character is generated by the following way: obtaining the animation features of the virtual character, including animation category, animation information and skeleton information; filtering out the capsule collision body matching the animation category and the animation information in the preset capsule collision body library as the target capsule collision body; wherein the target capsule collision body includes a truncated capsule body composed of curved surfaces and planes; generating the first capsule collision body according to the target capsule collision body and the skeleton information. The method comprises the following steps: determining the collision point position in response to the intersection of the first capsule collision body and the second capsule collision body corresponding to the virtual character; determining the region type of the collision body region to which the collision point position belongs; determining the bounce result of the circular object for the graphical user interface to display according to the region type; the first capsule collision body of the virtual character is generated by the following way: obtaining the animation features of the virtual character, including animation category, animation information and skeleton information; filtering out the capsule collision body matching the animation category and the animation information in the preset capsule collision body library as the target capsule collision body; wherein the target capsule collision body includes a truncated capsule body composed of curved surfaces and planes; generating the first capsule collision body according to the target capsule collision body and the skeleton information. The method comprises the following steps: determining the collision point position in response to the intersection of the first capsule collision body and the second capsule collision body corresponding to the virtual character; determining the region type of the collision The axis distance function is substituted into the collision intersection constraint condition according to the axis distance vector, and a deformed collision intersection constraint condition is obtained; The deformed collision intersection constraint condition is analyzed to obtain the position of the collision point.

6. The method according to any one of claims 1 to 5, characterized in that, The method further comprises: According to the region type, a rebound speed vector and a rebound rotation speed scalar of the circular object are obtained; The rebound speed vector and the rebound rotation speed scalar are determined as the rebound result; The region type includes a front region, a side region and a back region of the collision body, which are divided according to the surface curvature value of the collision body.

7. The method of claim 6, wherein, The method further comprises: An attenuation coefficient matching the region type is selected from a preset attenuation coefficient library; An initial speed vector and an initial rotation speed scalar of the circular object before the collision with the virtual character are obtained; The initial speed vector and the initial rotation speed scalar are processed according to the attenuation coefficient to obtain the rebound speed vector and the rebound rotation speed scalar.

8. The method of claim 7, wherein, The attenuation coefficient includes a speed attenuation coefficient, which includes a normal speed attenuation coefficient and a tangent speed attenuation coefficient. The method further comprises: According to the normal direction information of the collision tangent point in the second capsule collision body, the initial speed vector is decomposed to obtain a normal initial speed vector of the initial speed vector; A tangent initial speed vector is obtained by subtracting the normal initial speed vector from the initial speed vector; A first product value between the tangent initial speed vector and the tangent speed attenuation coefficient is obtained, and a second product value between the normal initial speed vector and the normal speed attenuation coefficient is obtained; The sum of the first product value and the second product value is determined as the rebound speed vector.

9. The method of claim 8, wherein, The attenuation coefficient further includes a rotation speed attenuation coefficient, which includes a vertical rotation speed attenuation coefficient and a horizontal rotation speed attenuation coefficient. The initial vertical rotation speed and the initial horizontal rotation speed in the initial rotation speed scalar are determined; A rebound vertical rotation speed is obtained by multiplying the initial vertical rotation speed by the vertical rotation speed attenuation coefficient; A rebound horizontal rotation speed is obtained by multiplying the initial horizontal rotation speed by the horizontal rotation speed attenuation coefficient; The rebound vertical rotation speed and the rebound horizontal rotation speed are determined as the rebound rotation speed scalar.

10. A collision processing apparatus in a game, characterized by comprising: A graphical user interface is provided, which includes at least one virtual character and at least one circular object colliding with the virtual character, and the device comprises: The capsule body acquisition module is configured to acquire animation features of the virtual character, the animation features including an animation category, animation information, and bone information; in a preset capsule collision body library, a capsule collision body matching the animation category and the animation information is screened out as a target capsule collision body; the target capsule collision body includes a section capsule body composed of a curved surface and a plane; and a first capsule collision body is generated according to the target capsule collision body and the bone information. The collision point determination module is configured to determine a collision point position in response to the first capsule collision body and the second capsule collision body corresponding to the virtual character colliding with each other; the second capsule collision body is generated according to a running track of the circular object. The region type determination module is configured to determine a region type of a capsule body region to which the collision point position belongs. The rebound result determination module is configured to determine a rebound result of the circular object for display by the graphical user interface according to the region type.

11. An electronic device, comprising: The game device comprises: one or more processors; a memory; and one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the collision processing method in the game according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that, A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in the collision processing method in the game according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Method and system for detecting collision of virtual fitting

    CN106846129A

  • Dynamic collision detection method and device

    CN107145642A