Virtual gun shooting display method and apparatus, computer device, and computer program

The virtual gun shooting display method addresses the monotony of existing simulations by incorporating gun body and muzzle recoil animations, enhancing the realism and user experience of virtual shooting in virtual scenes.

JP7697034B2Active Publication Date: 2025-06-23TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2023558858
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2021-06-18
Filing Date
2022-05-12
Publication Date
2025-06-23
Estimated Expiration
2042-05-12

AI Technical Summary

Technical Problem

Existing virtual gun shooting simulations in virtual scenes rely on simple front-back displacement of the virtual gun, which is monotonous and fails to provide a realistic sense of impact during shooting.

Method used

A shooting display method and device for a virtual gun that includes displaying a virtual gun in a virtual scene, controlling it to perform continuous shooting, and displaying gun body recoil animation or muzzle recoil animation in response to each shot, using variation curves in the X-axis and Y-axis directions to simulate realistic recoil.

Benefits of technology

The method enhances the realism of continuous shooting by the virtual gun, improving the user's sense of impact and shooting experience through more dynamic and realistic recoil animations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007697034000019
    Figure 0007697034000019
  • Figure 0007697034000020
    Figure 0007697034000020
  • Figure 0007697034000021
    Figure 0007697034000021
Patent Text Reader

Abstract

This application discloses a method and device for displaying shooting of a virtual gun, a computer device, and a storage medium in the technical field of virtual scenes. The method includes a step of displaying a virtual gun in a virtual scene (320), a step of controlling the virtual gun to perform continuous shooting in the virtual scene (340), and a step of displaying at least one of a barrel recoil animation and a muzzle recoil animation of the virtual gun in response to the virtual gun firing once during the continuous shooting (360), where the barrel recoil animation is an animation in which the barrel of the virtual gun fluctuates according to a fluctuation curve in at least one direction of the X-axis and the Y-axis, and the muzzle recoil animation is an animation in which the muzzle of the virtual gun fluctuates according to a fluctuation curve centered on the root node of the virtual gun, where the X-axis indicates the horizontal recoil direction of the virtual gun, and the Y-axis indicates the vertical recoil direction of the virtual gun. According to this application, the impact feeling when shooting with a virtual gun can be better shown.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application claims priority based on a Chinese patent application filed on June 18, 2021, with an application number of 202110679160.3 and an invention title of "Shooting Display Method and Device for Virtual Gun, Computer Equipment, and Storage Medium", and all of its content is incorporated herein by reference.

[0002] This application relates to the technical field of virtual scenes, and in particular, to a shooting display method and device for a virtual gun, computer equipment, and a storage medium.

Background Art

[0003] The sense of impact means giving the user a feeling of shooting with a real gun through feedback in dimensions such as animation, sound effects, and special effects in a virtual scene. For example, in a shooting game, a real shooting feeling is fed back to the user who fired through gunshots, gun vibration animation, special effects when hitting the target after shooting, etc. In related technologies, by simulating the recoil generated when shooting with a virtual gun through the front-back displacement of the virtual gun, the user is given a sense of impact when shooting. However, the simple front-back displacement of the virtual gun seems monotonous in representing the recoil of the virtual gun. In a virtual scene, how to better show the sense of impact when shooting with a virtual gun is a problem to be solved.

Summary of the Invention

[0004] Embodiments of this application provide a shooting display method and device for a virtual gun, computer equipment, and a storage medium that can better show the sense of impact when shooting with a virtual gun. The above technical aspects are as follows.

Means for Solving the Problems

[0005] According to one aspect of this application, a shooting display method for a virtual gun executed by a computer device, displaying a virtual gun in a virtual scene; Controlling the virtual gun to perform continuous shooting in a virtual scene; Displaying at least one of the gun body recoil animation and muzzle recoil animation of the virtual gun in response to the virtual gun firing once during continuous shooting. The gun body recoil animation is an animation in which the gun body of the virtual gun varies according to a variation curve in at least one of the X-axis and Y-axis directions, and the muzzle recoil animation is an animation in which the muzzle of the virtual gun varies according to a variation curve around the root node of the virtual gun. The X-axis indicates the horizontal recoil direction of the virtual gun, and the Y-axis indicates the vertical recoil direction of the virtual gun, thereby providing a shooting display method for the virtual gun.

[0006] According to another aspect of the present application, there is provided a shooting display device for a virtual gun, a display module for displaying a virtual gun in a virtual scene; a control module for controlling the virtual gun to perform continuous shooting in the virtual scene. The display module is further configured to display at least one of the gun body recoil animation and muzzle recoil animation of the virtual gun in response to the virtual gun firing once during continuous shooting. The gun body recoil animation is an animation in which the gun body of the virtual gun varies according to a variation curve in at least one of the X-axis and Y-axis directions, and the muzzle recoil animation is an animation in which the muzzle of the virtual gun varies according to a variation curve around the root node of the virtual gun. The X-axis indicates the horizontal recoil direction of the virtual gun, and the Y-axis indicates the vertical recoil direction of the virtual gun, thereby providing a shooting display device for the virtual gun.

[0007] According to a further aspect of the present application, there is provided a computer device comprising a processor and a memory, wherein the memory stores at least one instruction that, when loaded and executed by the processor, implements the shooting display method for a virtual gun according to each aspect of the present application.

[0008] According to a further aspect of the present application, there is provided a computer-readable storage medium storing computer instructions that, when loaded and executed by a processor, implement the virtual gun shooting display method according to each aspect of the present application.

[0009] According to a further aspect of the present application, there is provided a computer program product including computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and by executing the computer instructions, causes the computer device to execute the virtual gun shooting display method described above.

Advantages of the Invention

[0010] Embodiments of the present application have at least the following beneficial effects. When a virtual gun is displayed in a virtual scene and continuous shooting is performed by controlling the virtual gun, at least one of the gun body recoil animation and muzzle recoil animation of the virtual gun is displayed, so that the animation expression of continuous shooting by the virtual gun conforms to a realistic shooting reaction expression, improving the hitting feeling when the user performs simulated shooting using the virtual gun.

Brief Description of the Drawings

[0011]

Figure 1

Figure 2

Figure 3

Figure 4

Figure 5

Figure 6

Figure 7

Figure 8

Figure 9

Figure 10

Figure 11

Figure 12

Figure 13

Figure 14

MODE FOR CARRYING OUT THE INVENTION

[0012] Hereinafter, in order to facilitate understanding of the aspects shown in the embodiments of the present application, the terms appearing in the embodiments of the present application will be described.

[0013] A virtual scene is a virtual world that is displayed (or provided) when an application program is executed on a terminal.

[0014] Exemplarily, this virtual world may be a world that simulates the real world, or a three-dimensional world that is semi-simulated and semi-fictional, or a purely fictional three-dimensional world.

[0015] Exemplarily, this virtual world may be any one of a two-dimensional virtual world, a 2.5-dimensional virtual world, and a three-dimensional virtual world.

[0016] Optionally, this virtual world may also be used for battles in the virtual world between at least two virtual characters, and this virtual world has virtual resources that can be used by at least two virtual characters.

[0017] A virtual character refers to a movable object in the virtual world. This movable object may be at least one of a virtual person, a virtual animal, and an anime character. Optionally, when the virtual world is a three-dimensional virtual world, the virtual character may be a three-dimensional solid model, and each virtual character has its own shape and volume in the three-dimensional virtual world so as to occupy a part of the space in the three-dimensional virtual world. Optionally, the virtual character may be a three-dimensional character created based on three-dimensional human body skeleton technology, and this virtual character realizes different external images by wearing different skins. In some implementation forms, the virtual character may be realized using a 2.5-dimensional or two-dimensional model, but the embodiments of the present application are not limited thereto.

[0018] In the shooting display method of a virtual gun in the related art, during continuous shooting by the virtual gun, the recoil of the virtual gun is shown by displaying an animation in which the virtual gun moves back and forth. However, showing the recoil of the virtual gun in such a way is very monotonous, and the user cannot obtain a sense of experience as if actually shooting. In contrast, in the method proposed in the present application, by displaying at least one of the muzzle recoil animation and the gun body recoil animation during continuous shooting by the virtual gun, the continuous shooting process by the virtual gun is made more realistic.

[0019] FIG. 1 shows a configuration block diagram of a computer system according to an exemplary embodiment of the present application. This computer system 100 includes a terminal 110 and a server 120.

[0020] A client 111 that supports a virtual environment is installed and executed on the terminal 110, and this client 111 may be a multiplayer online battle program. When the terminal 110 executes the client 111, the user interface of the client 111 is displayed on the screen of the terminal 110. This client may be any of a battle royale shooting game, a virtual reality (VR) application program, an augmented reality (AR) program, a three-dimensional map program, a virtual reality game, an augmented reality game, a first-person shooting game (FPS), a third-person shooting game (TPS), a multiplayer online battle arena game (MOBA), and a simulation game (SLG). In this embodiment, the case where this client is a role-playing game will be described as an example. The terminal 110 is a terminal used by the user 112, and the user 112 uses the terminal 110 to control the activities of a virtual character located in the virtual environment, and the virtual character may be called the master control virtual character of the user 112. The activities of the virtual character include at least one of adjusting the body posture, hopping, walking, running, riding, flying, jumping, driving, picking up, shooting, attacking, and throwing, but are not limited thereto. Generally speaking, the virtual character is a virtual character such as a simulation human character or an anime character.

[0021] Although only one terminal is shown in FIG. 1, in different embodiments, there are multiple other terminals 140 that can access the server 120. Optionally, there may be one or more terminals 140 that are terminals corresponding to developers. The terminals 140 are installed with a client development and editing platform that supports the virtual environment. The developer can edit and update the client on the terminal 140 and transmit the updated client installation package to the server 120 via a wired or wireless network. The terminal 110 can download the client installation package from the server 120 to implement the update of the client.

[0022] The terminal 110 and the terminal 140 are connected to the server 120 via a wireless network or a wired network.

[0023] The server 120 includes at least one of a single server, multiple servers, a cloud computing platform, and a virtualization center. The server 120 provides background services to the client that supports the 3D virtual environment. Optionally, the server 120 may undertake the main computing work, and the terminal undertakes the secondary computing work, or the server 120 undertakes the secondary computing work, and the terminal undertakes the main computing work, or the server 120 and the terminal may perform collaborative computing by means of a distributed computing architecture.

[0024] In one general example, server 120 includes a processor 122, a user account database 123, a battle service module 124, and a user-oriented input / output interface (I / O interface) 125. The processor 122 loads instructions stored in the server 120 and processes data in the user account database 123 and the battle service module 124. The user account database 123 stores data of user accounts used by terminals 110 and 140, such as avatars of user accounts, nicknames of user accounts, combat power indexes of user accounts, and service areas where user accounts exist. The battle service module 124 provides a plurality of battle rooms for users to fight, such as 1V1 battles, 3V3 battles, 5V5 battles, etc. The user-oriented I / O interface 125 establishes communication with terminals 110 and / or 140 via a wireless network or a wired network to exchange data.

[0025] FIG. 2 shows an interface schematic diagram of a shooting display method of a virtual gun according to an exemplary embodiment of the present application.

[0026] As shown in FIG. 2, a virtual gun and an arm of a virtual character that controls this virtual gun are displayed in the virtual scene. The contact point between the left hand of the virtual character and the virtual gun is selected as the root node of the virtual gun, and the coordinate system of the virtual gun is established. The direction in which the virtual gun moves back and forth is defined as the Z-axis direction, the direction in which the virtual gun moves up and down under the influence of vertical recoil is defined as the Y-axis direction, and the direction in which the virtual gun moves left and right under the influence of horizontal recoil is defined as the X-axis direction.

[0027] It should be noted that the root node may also be the contact point between the right hand of the virtual character and the virtual gun, the center point of the virtual gun, etc., and the coordinate system may also be a polar coordinate system, etc. However, the present application does not limit the selection of the root node and the establishment of the coordinate system. In the following text, only the example where the root node is the contact point between the left hand of the virtual character and the virtual gun and the coordinate system is a standard Cartesian coordinate system will be used for explanation.

[0028] Figure 3 shows a flowchart of a shooting display method for a virtual gun according to an exemplary embodiment of the present application. Exemplarily, this method will be described by taking as an example the execution by the terminal 110 (or the client within the terminal 110) shown in FIG. 1. This method includes the following steps 320 to 360.

[0029] In step 320, a virtual gun in the virtual scene is displayed.

[0030] The terminal displays the virtual scene in the currently running client and the virtual gun in the virtual scene.

[0031] Exemplarily, take as an example that the currently running client is a first-person shooting game. The terminal displays the virtual scene in the game and the virtual gun in the virtual scene. The terminal may further display the arm of the virtual character holding the virtual gun in the virtual scene, or the virtual character holding the virtual gun, etc. Also, the user graphical interface displayed by the terminal may further include operation controls such as shooting controls.

[0032] In step 340, the virtual gun is controlled to perform continuous shooting in the virtual scene.

[0033] There are various ways to control the virtual gun to perform continuous shooting in the virtual scene. For example, the user can control the virtual gun to perform continuous shooting in the virtual scene by means of click operations, pressing operations, double-click operations, voice operations, gaze control, somatosensory control, etc. Or, in the assisted shooting mode, the client automatically controls the virtual gun to perform continuous shooting in the virtual scene.

[0034] Exemplarily, the user controls the virtual gun to perform continuous shooting in the virtual scene by pressing the shooting control in the user graphical interface. Or, the user controls the virtual gun to perform continuous shooting in the virtual scene by continuously clicking the shooting control in the user graphical interface. Or, the user selects the assisted shooting mode, and the client automatically controls the gun to perform continuous shooting in the virtual scene.

[0035] This application does not limit the method of controlling the virtual gun to perform continuous shooting in the virtual scene.

[0036] In step 360, in response to the virtual gun firing once during continuous shooting, at least one of the gun body recoil animation and the muzzle recoil animation of the virtual gun is displayed.

[0037] The gun body recoil animation is an animation in which the gun body of the virtual gun varies according to a variation curve in at least one of the X-axis and Y-axis directions. The X-axis indicates the horizontal recoil direction of the virtual gun, and the Y-axis indicates the vertical recoil direction of the virtual gun.

[0038] The muzzle recoil animation is an animation in which the muzzle of the virtual gun varies according to a variation curve centered on the root node of the virtual gun. That is, by rotating around the root node of the virtual gun, the variation of the muzzle is realized, and the variation of the muzzle follows the variation curve.

[0039] Exemplarily, the variation curves in the gun body recoil animation and the muzzle recoil animation may be sine curves, and the amplitude, frequency, base amplitude, and sine of the sine curve may be set according to the actual situation. For example, different amplitudes and frequencies are set for virtual guns of different model numbers. Also, for example, when different accessories are arranged on the same model number of virtual gun, different base widths are set. Also, for example, when the same virtual gun varies in the X-axis direction, that is, varies under the influence of horizontal recoil, the sine of the sine curve is adjusted, and so on.

[0040] This application does not impose any restrictions on the method for determining the variable curve.

[0041] Exemplarily, when the variable curve in the gun body recoil animation and the muzzle recoil animation is a sine curve, in response to the virtual gun firing once during continuous shooting, a gun body recoil animation is displayed in which the gun body of the virtual gun varies according to a sine curve in at least one of the X-axis and Y-axis directions. At this time, the gun body of the virtual gun varies according to a sine curve, providing a specific variation pattern of the gun body, and the variation pattern of the sine curve conforms to the reaction expression of real shooting.

[0042] Exemplarily, based on the number of shots fired corresponding to the current shot in continuous shooting, a basic width of the virtual gun and a recoil factor of the virtual gun that is positively correlated with the number of shots fired are determined. Based on the basic width of the virtual gun and the recoil factor of the virtual gun, a first sine curve is determined, and a gun body recoil animation is displayed in which the gun body of the virtual gun varies according to the first sine curve in the X-axis direction. Alternatively, based on the number of shots fired corresponding to the current shot in continuous shooting, a basic width of the virtual gun and a recoil factor of the virtual gun that is positively correlated with the number of shots fired are determined. Based on the basic width of the virtual gun and the recoil factor of the virtual gun, a second sine curve is determined, and a gun body recoil animation is displayed in which the gun body of the virtual gun varies according to the second sine curve in the Y-axis direction. Alternatively, based on the number of shots fired corresponding to the current shot in continuous shooting, a basic width of the virtual gun and a recoil factor of the virtual gun that is positively correlated with the number of shots fired are determined. Based on the basic width of the virtual gun and the recoil factor of the virtual gun, a first sine curve and a second sine curve are respectively determined, and a gun body recoil animation is displayed in which the gun body of the virtual gun varies according to the first sine curve in the X-axis direction while varying according to the second sine curve in the Y-axis direction.

[0043] In the above, the manner in which the gun body of the virtual gun varies in the X-axis and Y-axis has been exemplified in detail. However, when specifically implemented, the gun body of the virtual gun will vary according to at least one of them.

[0044] Optionally, at the time of this shooting, determine the moving direction along the X-axis of the virtual gun. If the moving direction along the X-axis of the virtual gun does not match the variation direction of the first sine curve, the sine of the first sine curve may be changed. At this time, the barrel of the virtual gun will conform to the recoil expression during real shooting. The violent shaking due to the recoil during real shooting has a very complex shaking pattern and there may be irregular shaking. Continuously changing the sine of the first sine curve can be used to simulate the irregular shaking.

[0045] Exemplarily, in response to a single shooting during continuous shooting of the virtual gun, display a muzzle recoil animation in which the muzzle of the virtual gun varies according to a sine curve centered on the root node of the virtual gun.

[0046] Exemplarily, based on the number of shots already fired corresponding to this shooting in continuous shooting, determine the basic width of the virtual gun and the recoil factor of the virtual gun that is positively correlated with the number of shots already fired. Based on the basic width of the virtual gun and the recoil factor of the virtual gun, determine a third sine curve, and display a muzzle recoil animation in which the muzzle of the virtual gun varies according to the third sine curve centered on the root node of the virtual gun.

[0047] Optionally, determine the first muzzle position of the virtual gun, which is the position where the muzzle of the virtual gun is located at the current time, and the second muzzle position of the virtual gun, which is the position where the muzzle of the virtual gun is located at the next time, based on the muzzle recoil animation. Obtain the barrel position of the virtual gun, create a first vector in which the barrel position points to the first muzzle position and a second vector in which the barrel position points to the second muzzle position, and determine the included angle between the first vector and the second vector as the rotation amount of the muzzle of the virtual gun with respect to the barrel of the virtual gun.

[0048] Optionally, a threshold number of continuous shootings by the virtual gun may be set in advance. When the number of shootings already performed in continuous shooting does not exceed the threshold number, a basic animation in which the virtual gun performs continuous shooting is displayed. The basic animation is an animation in which the gun body moves back and forth when the virtual gun performs continuous shooting. When the number of shootings already performed in continuous shooting exceeds the threshold number, at least one of a gun body recoil animation and a muzzle recoil animation is superimposed on the basic animation in which the virtual gun performs continuous shooting, and the superimposed animation is displayed. As described above, by providing a possible form of the display timing of the recoil animation, the shooting process is rich in expression effects and conforms to the realistic recoil expression during shooting.

[0049] Exemplarily, the threshold number of continuous shootings by the virtual gun is set in advance to 5 times. When the number of shootings already performed is 5 or less, only the basic animation in which the virtual gun performs continuous shooting is displayed, that is, only the animation in which the gun body moves back and forth due to the action of recoil when the virtual gun performs continuous shooting is displayed. When the number of shootings already performed is greater than 5, at least one of a gun body recoil animation and a muzzle recoil animation is superimposed on the basic animation in which the virtual gun performs continuous shooting, and the superimposed animation is displayed. For example, the displacement in which the gun body moves back and forth during continuous shooting of the virtual gun is determined from the basic animation, and then the displacements in the horizontal recoil direction and the vertical recoil direction of the virtual gun are determined from the gun body recoil animation, and the rotation angle of the virtual gun centered on the root node of the virtual gun is determined from the muzzle recoil animation. After superimposing the displacement and the rotation angle, the position and posture of the virtual gun are determined.

[0050] The threshold number of continuous shootings by the preset virtual gun may be adjusted according to the actual situation, and the present application does not limit the setting method and the magnitude of the numerical value of the threshold number.

[0051] As described above, in the embodiment of the present application, a virtual gun in a virtual scene is displayed, the virtual gun is controlled to perform continuous shooting in the virtual scene, and in response to a single shot during continuous shooting, at least one of the gun body recoil animation and the muzzle recoil animation of the virtual gun is displayed, thereby providing a shooting expression method of a virtual gun that simulates a realistic gun recoil expression. When the user controls the virtual gun to perform continuous shooting, the user can obtain a realistic shooting feeling, and the impact feeling during continuous shooting is improved.

[0052] FIG. 4 shows a schematic diagram of an animation expression framework of a shooting display method of a virtual gun according to an exemplary embodiment of the present application. Taking the main weapon as the M2 type virtual gun as an example, the animation expression during the shooting of the virtual gun is shown.

[0053] Exemplarily, the animation during the shooting of the virtual gun is expressed by the motion curves of different nodes. Here, the different nodes include the bone nodes of the virtual gun and the body nodes of the virtual character who shoots using this virtual gun, and the motion curves include a position curve, a rotation curve, and a scale curve.

[0054] Generally speaking, in FIG. 4, in the shooting display animation of the virtual gun, the position, rotation, and scale curves of three body nodes (spine, neck, left arm) of the virtual character who shoots with this virtual gun are shown. As can be seen from this figure, curve 20 to curve 22 are respectively the spine position curve, spine rotation curve, and spine scale curve of the virtual character, curve 23 to curve 25 are respectively the neck position curve, neck rotation curve, and neck scale curve of the virtual character, and curve 26 to curve 28 are respectively the left arm position curve, left arm rotation curve, and left arm scale curve of the virtual character. In this way, the shooting display animation of the virtual gun is realized by the motion curves of multiple body nodes of the virtual character and multiple bone nodes of the virtual gun.

[0055] Figure 4 shows only one of the possible animation expressions. Similarly, by selecting the bone nodes of the virtual gun, the movement of the virtual gun can be expressed. For example, select the root node, muzzle, and trigger of the virtual gun, and animate the movement of the virtual gun according to the respective position curve, rotation curve, and scale curve.

[0056] The larger the number of selected body nodes of the virtual character or bone nodes of the virtual gun, the more realistic and delicate the animation expression becomes, while the consumption of computing resources and memory resources increases.

[0057] As can be seen from Figure 4, the animation displayed during shooting with the virtual gun is shown by the motion curves of different nodes. Therefore, parameters such as the amplitude and offset of the motion curves in different states may be set according to the actual situation of the gun.

[0058] Figure 5 shows an interface schematic diagram for setting the recoil animation of the virtual gun in different states according to an exemplary embodiment of the present application.

[0059] Generally speaking, set the parameters in the normal state 32 of the virtual gun (that is, the scope is not opened during shooting) and the aiming state 34 (that is, the scope is opened for aimed shooting). These parameters include the basic offset ratio, curve amplitude ratio, startup time, return time, etc. The basic offset ratio refers to the basic offset value of the fluctuation curve, the curve amplitude ratio refers to the amplitude of the fluctuation curve, the startup time refers to the time required for the virtual gun to shoot from the startup state, and the return time refers to the time required for the virtual gun to return from the offset position.

[0060] Generally, FIG. 5 shows a mode in which the basic offset ratio, curve amplitude ratio, start-up time, and return time of the virtual gun when shooting in the normal state 32 are all set to be larger than those in the aiming state 34. That is, the amplitude and offset of the motion curve when the virtual gun shoots in the normal state 32 are larger than the amplitude and offset of the motion curve in the aiming state 34, and the start-up time and return time of the virtual gun in the normal state 32 are both larger than the start-up time and return time in the aiming state 34.

[0061] Generally, FIG. 5 further shows one possible continuous variation curve 36 during shooting by the virtual gun obtained by the above settings. As can be seen from the continuous variation curve 36, the virtual gun varies left and right in the X-axis direction (i.e., the horizontal direction), that is, the recoil of the virtual gun in the horizontal direction alternates left and right, and the virtual gun varies only in one direction in the Y-axis direction (i.e., the vertical direction), that is, the recoil of the virtual gun in the vertical direction is always vertically upward.

[0062] The variation curve 38 is an enlarged view of a section of the continuous variation curve 36, and from the variation curve 38, the approximate form of the variation curve of the virtual gun set in this example can be determined.

[0063] FIG. 6 shows a flowchart of a shooting display method for a virtual gun according to an exemplary embodiment of the present application. Exemplarily, this method will be described by taking the execution by the terminal 110 (or the client in the terminal 110) shown in FIG. 1 as an example. This method includes the following steps 620 to step 664.

[0064] In step 620, a virtual gun in a virtual scene is displayed.

[0065] Reference may be made to step 420, but the description is omitted here.

[0066] In step 640, the virtual gun is controlled to perform continuous shooting in the virtual scene.

[0067] Refer to step 440, but the description is omitted here.

[0068] In step 662, in response to the virtual gun firing once during continuous firing, a muzzle recoil animation is displayed in which the muzzle of the virtual gun varies according to a sine curve in at least one of the X-axis and Y-axis directions.

[0069] Hereinafter, the variation of the muzzle of the virtual gun according to a sine curve in the X-axis direction and the Y-axis direction will be described respectively.

[0070] (1) Fig. 7 shows a flowchart for displaying a muzzle recoil animation in which the muzzle of the virtual gun varies according to a first sine curve in the X-axis direction in response to the virtual gun firing once during continuous firing.

[0071] In step 6621, based on the number of shots fired corresponding to the current shot in continuous firing, the basic width of the virtual gun and the recoil factor of the virtual gun are determined, and the recoil factor is positively correlated with the number of shots fired.

[0072] First, the determination of the basic width of the virtual gun will be described.

[0073] In one embodiment, the basic width of the virtual gun is a function value calculated from a sine curve. Exemplarily, the sine curve is given by the formula

Equation

[0074] Next, the determination of the recoil factor of the virtual gun will be described.

[0075] In one embodiment, the horizontal recoil factor RecoilFactor can be determined by the formula RecoilFactor = RecoilLateralBase * RecoilLateralBaseScale + RecoilLateralModifier * (number of shots fired - 1). Here, RecoilLateralBase represents the basic value of the horizontal recoil, RecoilLateralBaseScale represents the scale of the basic value of the horizontal recoil, and RecoilLateralModifier represents the adjustment value of the horizontal recoil. As can be seen from the calculation formula of the recoil factor, the recoil factor has a positive correlation with the number of shots fired, that is, the more shots are fired, the larger the recoil factor becomes.

[0076] The above three parameters may be flexibly set according to the actual situation. In one possible embodiment, the value of the curve amplitude ratio in FIG. 5 is used as RecoilLateralBase, the value of the basic offset ratio in FIG. 5 is used as RecoilLateralBaseScale, and the value of RecoilLateralModifier is determined based on the number and type of accessories in the virtual gun. The present application does not limit the selection method of the parameters in the calculation formula of the recoil factor.

[0077] Exemplarily, record the time of the first shot among consecutive n shots. For the i-th shot among consecutive n shots, subtract the time of the first shot from the time of the i-th shot to obtain the time difference Δt from the time of the first shot. Or, multiply the time interval between two adjacent shots in consecutive shooting by a virtual gun preset by the number of shooting intervals, that is, i - 1, to obtain the time difference Δt between the i-th shot and the first shot. Then, substitute Δt into the formula

Equation

[0078] Exemplarily, by substituting the number of shots fired i into the calculation formula of the recoil factor, the recoil factor RecoilFactor of the i-th shot is determined.

[0079] In step 6622, a first sine curve is determined based on the basic width of the virtual gun and the recoil factor of the virtual gun.

[0080] In one embodiment, a first product of the basic width of the virtual gun and the recoil factor is calculated, and the first product is used as the maximum fluctuation width of the first sine curve.

[0081] Exemplarily, a sine curve in which the barrel of the virtual gun fluctuates in the X-axis direction is

Number

[0082] Exemplarily, in step 6621, the basic width A0 and the recoil factor RecoilFactor of the i-th shot are determined, and the actual fluctuation width A1 of the i-th shot is determined from the formula A1 = A0 * RecoilFactor.

[0083] Exemplarily, the time t0 of the i-th shot and the actual fluctuation width A1 of the i-th shot are substituted into the created sine curve to obtain the first sine curve

Number

[0084] In another embodiment, the basic width of the virtual gun is used as the maximum fluctuation width of the first sine curve, and the recoil factor is used as the angular velocity of the first sine curve.

[0085] Exemplarily, a sine curve in which the barrel of the virtual gun fluctuates in the X-axis direction is

Number

[0086] As described above, two forms are provided for determining the first sine curve, where the recoil factor is a factor for changing the width or the recoil factor is a factor for changing the angular velocity. Also, by providing two forms for changing the fluctuation curve, the finally generated fluctuation curve is rich in expression effects and conforms to the realistic recoil expression during shooting.

[0087] In step 6623, the moving direction along the X-axis of the virtual gun during this shooting is determined.

[0088] The recoil in the X-axis direction of the virtual gun, that is, the recoil in the horizontal direction, changes the direction between left and right. Therefore, it is necessary to adjust the first sine curve according to the moving direction along the X-axis of the virtual gun during this shooting.

[0089] Exemplarily, during the i-th shooting, a tangent line is made to the current motion curve of the virtual gun, and the moving direction along the X-axis of the current virtual gun is judged based on the slope of the tangent line. For example, if the slope is positive, it is judged that the virtual gun moves to the right along the X-axis. If the slope is negative, it is judged that the virtual gun moves to the left along the X-axis.

[0090] This application does not limit the method for judging the moving direction along the X-axis of the virtual gun.

[0091] In step 6624, when the moving direction along the X-axis of the virtual gun during this shooting does not match the fluctuation direction of the first sine curve, the sine of the first sine curve is changed.

[0092] In step 6623, the moving direction of the virtual gun along the X-axis during the current shooting is determined. If this moving direction does not match the variation direction of the first sine curve, the sine of the first sine curve is changed, that is, the variation direction of the first sine curve is adjusted.

[0093] Exemplarily, if the slope of the tangent line of the motion curve during the i-th shooting of the virtual gun is negative, it is determined that the virtual gun moves left along the X-axis. On the other hand, since the first sine curve varies to the right, at this time, the sine of the first sine curve is

Number

[0094] In step 6625, a recoil animation in which the virtual gun varies along the X-axis according to the first sine curve is displayed.

[0095] After determining the first sine curve of the virtual gun according to the above steps, a recoil animation in which the virtual gun varies along the X-axis according to the first sine curve is displayed.

[0096] (2) Fig. 8 shows a flowchart for displaying a recoil animation in which the barrel of the virtual gun varies along the Y-axis according to a second sine curve in response to a single shot during continuous shooting of the virtual gun.

[0097] The steps for determining the second sine curve may refer to the steps for the first sine curve, but the difference is only the set parameters. Different parameters can be selected according to the actual situation. For example, different values A of the width can be set for the sine curve m(t), etc. can be selected.

[0098] Since the recoil in the Y-axis direction, that is, the vertical direction, is always vertically upward, when determining the second sine curve in which the virtual gun varies in the Y-axis direction, it is not necessary to adjust the second sine curve based on the moving direction of the virtual gun. That is, steps 6623 and 6624 in the above procedure (1) can be omitted.

[0099] In step 6626, based on the number of previous shots corresponding to the current shot in continuous shooting, the basic width of the virtual gun and the recoil factor of the virtual gun are determined, and the recoil factor is positively correlated with the number of previous shots.

[0100] Reference may be made to step 6621, but the description is omitted here.

[0101] In step 6627, a second sine curve is determined based on the basic width of the virtual gun and the recoil factor of the virtual gun.

[0102] In one embodiment, a second product of the basic width of the virtual gun and the recoil factor is calculated, and the second product is used as the maximum fluctuation width of the second sine curve. Alternatively, the basic width of the virtual gun is used as the maximum fluctuation width of the second sine curve, and the recoil factor is used as the angular velocity of the second sine curve.

[0103] Specifically, reference may be made to step 6622, but the description is omitted here.

[0104] In step 6628, a gun body recoil animation is displayed in which the virtual gun varies in the Y-axis direction according to the second sine curve.

[0105] Reference may be made to step 6625, but the description is omitted here.

[0106] Note that, either one of Step 6621 to Step 6625 and Step 6626 to Step 6628 may be selected and executed, or both may be executed without limiting the execution order of both. That is, only the first sine curve is determined, and a muzzle recoil animation in which the virtual gun varies according to the first sine curve in the X-axis direction is displayed, or only the second sine curve is determined, and a muzzle recoil animation in which the virtual gun varies according to the second sine curve in the Y-axis direction is displayed, or the first sine curve and the second sine curve are each determined, and a muzzle recoil animation in which the barrel of the virtual gun varies according to the second sine curve in the Y-axis direction while varying according to the first sine curve in the X-axis direction can be displayed.

[0107] This application does not limit the selection and execution order of the above steps.

[0108] Note that, the modes of respectively determining the above-mentioned first sine curve and second sine curve are In one embodiment, it includes steps of calculating a first product of the basic width of the virtual gun and the recoil factor, taking the first product as the maximum fluctuation width of the first sine curve, calculating a second product of the basic width of the virtual gun and the recoil factor, and taking the second product as the maximum fluctuation width of the second sine curve. In another embodiment, it includes steps of taking the basic width of the virtual gun as the maximum fluctuation width of the first sine curve, taking the recoil factor as the angular velocity of the first sine curve, taking the basic width of the virtual gun as the maximum fluctuation width of the second sine curve, and taking the recoil factor as the angular velocity of the second sine curve.

[0109] Specifically, reference may be made to Step 6622, but the description is omitted here.

[0110] In Step 664, in response to the virtual gun firing once during continuous firing, a muzzle recoil animation in which the muzzle of the virtual gun varies according to a sine curve centered on the root node of the virtual gun is displayed.

[0111] FIG. 9 shows a flowchart for displaying a muzzle recoil animation in which, in response to a single shot during continuous firing of a virtual gun, the muzzle of the virtual gun varies according to a sine curve centered on the root node of the virtual gun. At this time, the muzzle of the virtual gun varies according to the sine curve, providing a specific variation pattern of the muzzle, and the variation pattern of the sine curve conforms to the recoil expression of a real shot.

[0112] In step 6641, based on the number of shots already fired corresponding to the current shot in continuous firing, the basic width of the virtual gun and the recoil factor of the virtual gun are determined, and the recoil factor is positively correlated with the number of shots already fired.

[0113] Reference may be made to step 6621, but the description is omitted here.

[0114] In step 6642, a third sine curve is determined based on the basic width of the virtual gun and the recoil factor of the virtual gun.

[0115] In one embodiment, a third product of the basic width of the virtual gun and the recoil factor is calculated, and the third product is used as the maximum variation width of the third sine curve, or Or, In another embodiment, the basic width of the virtual gun is used as the maximum variation width of the third sine curve, and the recoil factor is used as the angular velocity of the third sine curve.

[0116] As described above, two forms for determining a third sine curve are provided, where the recoil factor is a factor for changing the width or the recoil factor is a factor for changing the angular velocity, and by providing two forms for changing the variation curve, the finally generated variation curve is rich in expression effect and conforms to the recoil expression during real shooting.

[0117] Specifically, reference may be made to step 6622, but the description is omitted here.

[0118] In step 6643, the first muzzle position and the second muzzle position of the virtual gun are determined based on the muzzle recoil animation, and the position of the barrel of the virtual gun is obtained.

[0119] The first muzzle position is the position where the muzzle of the virtual gun is located at the current time, and the second muzzle position is the position where the muzzle of the virtual gun is located at the next time, that is, the target movement position of the muzzle of the virtual gun.

[0120] The first muzzle position where the muzzle of the virtual gun is located at the current time and the position of the barrel of the virtual gun are obtained. The position of the barrel of the virtual gun can be represented by the root node of the virtual gun.

[0121] Based on the third sine curve obtained in step 6642, the second muzzle position where the muzzle of the virtual gun is located at the next time is determined. Here, the next time may be the next frame, or the next time at an interval of several frames.

[0122] In step 6644, a first vector in which the barrel position points to the first muzzle position and a second vector in which the barrel position points to the second muzzle position are created.

[0123] Exemplarily, the position of the root node of the virtual gun is used to represent the position of the barrel of the virtual gun. A first vector in which the barrel position points to the first muzzle position and a second vector in which the barrel position points to the second muzzle position are created, that is, a first vector in which the root node position of the virtual gun points to the first muzzle position and a second vector in which the root node position of the virtual gun points to the second muzzle position are created.

[0124] In step 6645, the included angle between the first vector and the second vector is determined as the amount of rotation of the muzzle of the virtual gun with respect to the barrel of the virtual gun.

[0125] vector

number

[0126] [Mathematics] Here, atan2 represents the arctangent function, [Mathematics] represents a unit vector, * represents the dot product of vectors, and the result is a single number. × represents the cross product of vectors, and the result is a single vector. norm() is a function that gives the length and magnitude of a vector.

[0127] Determine the included angle between the first vector and the second vector calculated by the above formula as the rotation amount of the muzzle of the virtual gun with respect to the barrel of the virtual gun.

[0128] In step 6646, display a muzzle recoil animation in which the muzzle of the virtual gun varies according to a third sine curve centered on the root node of the virtual gun.

[0129] Display a muzzle recoil animation in which the muzzle of the virtual gun varies according to a third sine curve centered on the root node of the virtual gun. The realization of such a muzzle recoil animation depends on the rotation amount of the muzzle of the virtual gun with respect to the barrel of the virtual gun determined in step 6645. At this time, obtain the rotation amount of the muzzle of the virtual gun with respect to the barrel of the virtual gun, use this to determine the angular relationship between the muzzle and the barrel, and reproduce the muzzle recoil animation according to the angular relationship between the muzzle and the barrel. Since both the muzzle and the barrel are parts of the virtual gun, the strict positional relationship between the two must be considered when reproducing the recoil animation. Moreover, the unity and coordination of the recoil animations of the two must be ensured.

[0130] Note that it should be noted that either Step 662 or Step 664 may be selected and executed, or both may be executed. That is, only Step 662 may be executed to display the recoil animation of the virtual gun, or only Step 664 may be executed to display the muzzle recoil animation of the virtual gun, or regardless of the execution order, both Step 662 and Step 664 may be executed to superimpose and display the recoil animation and the muzzle recoil animation. The present application does not impose any restrictions on the selection and execution order of the above steps.

[0131] As described above, in the embodiment of the present application, a virtual gun in a virtual scene is displayed, and control is performed to perform continuous shooting in the virtual scene. After one shot in the continuous shooting, at least one of a first sine curve in which the virtual gun varies in the X-axis direction, a second sine curve in which the virtual gun varies in the Y-axis direction, and a third sine curve in which the muzzle varies is calculated, and an animation corresponding to the calculated sine curve is displayed, thereby providing a shooting display method for a virtual gun that conforms to a real shooting and enabling the user to feel a stronger sense of impact during virtual shooting.

[0132] FIGS. 10 to 12 show flowcharts of a shooting display method for a virtual gun according to an exemplary embodiment of the present application. In this embodiment, a first-person shooting game is taken as an example, and the shooting count threshold is 5 times. Exemplarily, this method will be described by taking as an example being executed by the terminal 110 (or the client in the terminal 110) shown in FIG. 1. This method includes the following steps 700 to 750b.

[0133] FIG. 10 shows an overall flowchart of an embodiment of the present application.

[0134] Step 700: Start.

[0135] Exemplarily, a virtual gun in a virtual scene is displayed.

[0136] Step 710: Fire.

[0137] Exemplarily, a virtual gun in a virtual scene is controlled to perform continuous shooting.

[0138] Step 720: Calculate the recoil of the basic animation part.

[0139] The basic animation is an animation in which the gun barrel moves back and forth when the virtual gun performs continuous shooting.

[0140] Exemplarily, the displacement of the virtual gun on the Z-axis, that is, the displacement data of the gun barrel moving back and forth when the virtual gun performs continuous shooting, is determined by the animation curve in the basic animation.

[0141] Step 730: Increase the number of rapid fires by 1.

[0142] After this shooting, the number of shots fired, that is, the number of rapid fires, has increased by 1.

[0143] Exemplarily, assuming that shooting has been continuously performed i times before this shooting, after this shooting, the number of shots fired increases by 1, that is, i = i + 1.

[0144] Step 740: Determine whether the number of rapid fires is greater than 5.

[0145] In this embodiment, since the number threshold is set to 5, it is determined whether the number of shots fired is greater than 5.

[0146] Exemplarily, when the number of rapid fires, that is, the number of shots fired, is 5 or less, only the basic animation of the virtual gun performing continuous shooting is displayed, and the process returns to Step 720. When the number of rapid fires, that is, the number of shots fired, is greater than 5, at least one of the gun barrel recoil animation and the muzzle recoil animation is superimposed on the basic animation of the virtual gun performing continuous shooting.

[0147] Step 750a: Calculate the variation of the gun barrel.

[0148] For details, refer to the description of FIG. 11 below.

[0149] Step 750b: Calculate the muzzle movement.

[0150] For details, refer to the description of FIG. 12 below.

[0151] Note that either Step 750a or Step 750b may be selected and executed, or both may be executed. It should be noted that when both Step 750a and Step 750b are executed, the execution order is not limited. This application does not impose any restrictions on the selection and execution order of the calculation of the gun body movement and the muzzle movement.

[0152] FIG. 11 shows the detailed steps for calculating the gun body movement in the embodiment of this application.

[0153] Step 850: Start.

[0154] Step 851: Record the firing time.

[0155] Exemplarily, for the i-th shot among n consecutive shots, the firing time, which is the shooting time, is denoted as t0.

[0156] Step 852: Obtain shooting data and create the current firing curve.

[0157] Obtain shooting data including the number of shots fired, the time from the first shot, the current time, etc.

[0158] The current firing curve is

Number

[0159] Note that the current firing curve here includes at least one of the current firing curves in the horizontal direction and the current firing curve in the vertical direction.

[0160] Step 853: Calculate the recoil factor.

[0161] Exemplarily, taking the recoil factor in the horizontal direction as an example, the recoil factor is determined by the formula RecoilFactor = RecoilLateralBase * RecoilLateralBaseScale + RecoilLateralModifier * (i - 1). Here, RecoilLateralBase represents the basic value of the recoil in the horizontal direction, RecoilLateralBaseScale represents the scale of the basic value of the recoil in the horizontal direction, and RecoilLateralModifier represents the adjustment value of the recoil in the horizontal direction. As can be seen from the calculation formula of the recoil factor, the recoil factor has a positive correlation with the number of shots fired, that is, the more shots are fired, the larger the recoil factor.

[0162] Since the recoil factor in the vertical direction is similar to that in the horizontal direction, the description is omitted here.

[0163] Step 854: Calculate the current actual variation width.

[0164] Equation of the sine curve

Number

[0165] Based on the above basic width A0 and recoil factor RecoilFactor, determine the actual fluctuation width A1 = A0 * RecoilFactor, where A1 is the actual fluctuation width of the fluctuation curve after this shooting.

[0166] Step 855: Determine the current firing curve.

[0167] Substitute the parameters obtained from the above calculation into the current firing curve M(t) created in step 852 to obtain the current firing curve

Number

[0168] Note that the firing curve M(t) includes at least one of the current firing curve in the horizontal direction and the current firing curve in the vertical direction.

[0169] Step 856: Determine whether it is recoil in the horizontal direction.

[0170] Since the recoil in the vertical direction is always upward and the recoil in the horizontal direction may be bidirectional, it is necessary to determine whether it is recoil in the horizontal direction, that is, whether the current firing curve in step 855 corresponds to the fluctuation curve in the horizontal direction.

[0171] If it is the fluctuation curve in the horizontal direction, execute step 857. If it is the fluctuation curve in the vertical direction, directly determine the current firing curve as the fluctuation curve in the vertical direction, that is, the second sine curve described in the above embodiment.

[0172] Step 857: Modify the curve based on the moving direction of the virtual gun.

[0173] At the time of this shooting, make a tangent to the current motion curve of the virtual gun, and determine the moving direction of the current virtual gun in the horizontal direction based on the slope of the tangent. For example, if the slope is positive, it is determined that the virtual gun moves to the right in the horizontal direction. If the slope is negative, it is determined that the virtual gun moves to the left in the horizontal direction.

[0174] When the virtual gun moves to the right, keep the curve as it is. When the virtual gun moves to the left, in order to ensure that the variation direction of the variable curve coincides with the moving direction of the virtual gun, change the sign of the variable curve, that is, change the current firing curve determined in step 855 to

Number

[0175] In step 857, a horizontal variable curve, that is, the first sine curve described in the above-described embodiment, is obtained.

[0176] FIG. 12 shows detailed steps for calculating the muzzle variation in the embodiment of the present application.

[0177] Step 950: Start.

[0178] Step 951: Calculate the current firing curve of the muzzle.

[0179] Since the method for calculating the current firing curve of the muzzle is similar to the steps shown in FIG. 11, the description is omitted here.

[0180] Step 952: Obtain the gun body position.

[0181] Exemplarily, the gun body position is obtained by the basic animation. Or, by superimposing the gun body recoil animation on the basic animation, the gun body position is obtained from the superimposed animation.

[0182] Exemplarily, the position of the root node of the virtual gun is used to represent the gun body position of the virtual gun.

[0183] Step 953: Obtain the muzzle position.

[0184] Exemplarily, based on the current firing curve of the muzzle, the muzzle position is obtained, which includes the first muzzle position where the muzzle is currently located and the second muzzle position where the muzzle will be located at the next moment, i.e., the target movement position of the muzzle.

[0185] Step 954: Create a vector from the gun body to the muzzle.

[0186] Exemplarily, the root node of the virtual gun creates a first vector pointing to the first muzzle position of the virtual gun, and this is represented as vector

Number

Number

[0187] Step 955: Obtain an angle based on the calculation formula of the included angle.

[0188] Since the current firing curve of the muzzle needs to be represented by a rotation centered on the root node of the virtual gun, it is necessary to calculate the rotation angle centered on the root node of the virtual gun.

[0189] An angle is obtained based on the first vector and the second vector according to the following formula.

[0190]

Number

Number

[0191] As described above, in the embodiment of the present application, taking a first-person shooting game as an example, a procedure for determining and displaying a gun body recoil animation and a muzzle recoil animation is shown, and by providing a shooting display method for a virtual gun, the shooting display of the virtual gun is made to conform to a more realistic shooting scene, thereby improving the realistic shooting feeling obtained when the user performs simulated shooting.

[0192] The following is an embodiment of the apparatus of the present application that can be used to implement the method embodiment of the present application. For details not disclosed in the embodiment of the apparatus of the present application, reference may be made to the embodiment of the method of the present application.

[0193] FIG. 13 is a configuration block diagram of a shooting display device for a virtual gun according to an exemplary embodiment of the present application. This device includes a display module 1020 for displaying the virtual gun in a virtual scene, and a control module 1040 for controlling the virtual gun to perform continuous shooting in the virtual scene. The display module 1020 further displays at least one of the gun body recoil animation and the muzzle recoil animation of the virtual gun in response to the virtual gun firing once during the continuous shooting. The gun body recoil animation is an animation in which the gun body of the virtual gun varies according to a variation curve in at least one of the X-axis and Y-axis directions, and the muzzle recoil animation is an animation in which the muzzle of the virtual gun varies according to a variation curve centered on the root node of the virtual gun. The X-axis indicates the horizontal recoil direction of the virtual gun, and the Y-axis indicates the vertical recoil direction of the virtual gun.

[0194] In one possible design, the display module 1020 displays the gun body recoil animation in which the gun body of the virtual gun varies according to a sine curve in at least one of the X-axis and Y-axis directions in response to the virtual gun firing once during the continuous shooting.

[0195] In one possible design, the display module includes a determination sub-module 1022 and a display sub-module 1024. The determination sub-module 1022 determines the basic width of the virtual gun and the recoil factor of the virtual gun that is positively correlated with the number of shots fired based on the number of shots fired corresponding to the current shot in the continuous shooting. The determination sub-module 1022 further determines a first sine curve based on the basic width of the virtual gun and the recoil factor of the virtual gun. The display sub-module 1024 displays the barrel recoil animation in which the barrel of the virtual gun varies according to the first sine curve in the X-axis direction. Alternatively, the determination sub-module 1022 determines the basic width of the virtual gun and the recoil factor of the virtual gun that is positively correlated with the number of shots fired based on the number of shots fired corresponding to the current shot in the continuous shooting. The determination sub-module 1022 further determines a second sine curve based on the basic width of the virtual gun and the recoil factor of the virtual gun. The display sub-module 1024 displays the barrel recoil animation in which the barrel of the virtual gun varies according to the second sine curve in the Y-axis direction. Alternatively, the determination sub-module 1022 determines the basic width of the virtual gun and the recoil factor of the virtual gun that is positively correlated with the number of shots fired based on the number of shots fired corresponding to the current shot in the continuous shooting. The determination sub-module 1022 further determines a first sine curve and a second sine curve based on the basic width of the virtual gun and the recoil factor of the virtual gun. The display sub-module 1024 displays the barrel recoil animation in which the barrel of the virtual gun varies according to the second sine curve in the Y-axis direction while varying according to the first sine curve in the X-axis direction.

[0196] In one possible design, the determination sub-module 1022 further calculates a first product of the basic width of the virtual gun and the recoil factor, and uses the first product as the maximum variation width of the first sine curve.

[0197] In one possible design, the determination sub-module 1022 further sets the basic width of the virtual gun as the maximum fluctuation width of the first sine curve, and sets the recoil factor as the angular velocity of the first sine curve.

[0198] In one possible design, the determination sub-module 1022 further calculates a second product of the basic width of the virtual gun and the recoil factor, and sets the second product as the maximum fluctuation width of the second sine curve.

[0199] In one possible design, the determination sub-module 1022 further sets the basic width of the virtual gun as the maximum fluctuation width of the second sine curve, and sets the recoil factor as the angular velocity of the second sine curve.

[0200] In one possible design, the determination sub-module 1022 further calculates a first product of the basic width of the virtual gun and the recoil factor, sets the first product as the maximum fluctuation width of the first sine curve, calculates a second product of the basic width of the virtual gun and the recoil factor, and sets the second product as the maximum fluctuation width of the second sine curve.

[0201] In one possible design, the determination sub-module 1022 sets the basic width of the virtual gun as the maximum fluctuation width of the first sine curve, sets the recoil factor as the angular velocity of the first sine curve, sets the basic width of the virtual gun as the maximum fluctuation width of the second sine curve, and sets the recoil factor as the angular velocity of the second sine curve.

[0202] In one possible design, the display module further includes a change sub-module 1026. The determination sub-module 1022 determines the moving direction along the X-axis of the virtual gun during the current shooting. When the moving direction along the X-axis of the virtual gun does not match the fluctuation direction of the first sine curve, the change sub-module 1026 changes the sine of the first sine curve.

[0203] In one possible design, the display module 1020 displays the muzzle recoil animation in which the muzzle of the virtual gun varies according to a sine curve centered on the root node of the virtual gun in response to the virtual gun firing once during the continuous firing.

[0204] In one possible design, the determination sub-module 1022 determines the basic width of the virtual gun and the recoil factor of the virtual gun that is positively correlated with the number of shots fired based on the number of shots fired corresponding to the current shot in the continuous firing. The determination sub-module 1022 further determines a third sine curve based on the basic width of the virtual gun and the recoil factor of the virtual gun. The display sub-module 1024 displays the muzzle recoil animation in which the muzzle of the virtual gun varies according to the third sine curve centered on the root node of the virtual gun.

[0205] In one possible design, the display module further includes an acquisition sub-module 1028 and a creation sub-module 1030. The determination sub-module 1022 determines a first muzzle position of the virtual gun, which is the position where the muzzle of the virtual gun is located at the current time, and a second muzzle position of the virtual gun, which is the position where the muzzle of the virtual gun is located at the next time, based on the muzzle recoil animation. The acquisition sub-module 1028 acquires the position of the barrel of the virtual gun. The creation sub-module 1030 creates a first vector in which the barrel position points to the first muzzle position and a second vector in which the barrel position points to the second muzzle position. The determination sub-module 1022 determines the included angle between the first vector and the second vector as the rotation amount of the muzzle of the virtual gun with respect to the barrel of the virtual gun.

[0206] In one possible design, when the number of fired shots of the continuous shooting does not exceed the shot count threshold, the display module 1020 displays an animation in which the barrel of the virtual gun moves back and forth when the virtual gun performs continuous shooting, and displays the basic animation of the virtual gun performing continuous shooting. Further, when the number of fired shots of the continuous shooting exceeds the shot count threshold, the display module 1020 superimposes at least one of the barrel recoil animation and the muzzle recoil animation on the basic animation of the virtual gun performing continuous shooting, and displays the superimposed animation.

[0207] FIG. 14 is a schematic configuration diagram of a terminal shown in an exemplary embodiment of the present application. The terminal 1300 includes a central processing unit (CPU) 1301, a system memory 1304 including a random access memory (RAM) 1302 and a read-only memory (ROM) 1303, and a system bus 1305 connecting the system memory 1304 and the central processing unit 1301. The terminal 1300 further includes a basic input / output system (Input / Output, I / O system) 1306 that supports information transmission between elements in the computer device, and a mass storage device 1307 for storing an operating system 1313, an application program 1314, and other program modules 1315.

[0208] The basic input / output system 1306 includes a display 1308 for displaying information and an input device 1309 such as a mouse or keyboard for the user to input information. Both the display 1308 and the input device 1309 are connected to the central processing unit 1301 via an input / output controller 1310 connected to the system bus 1305. The basic input / output system 1306 may further include an input / output controller 1310 for receiving and processing inputs from a plurality of other devices such as a keyboard, a mouse, or an electronic stylus. Similarly, the input / output controller 1310 further provides outputs to a display panel, a printer, or other types of output devices.

[0209] The mass storage device 1307 is connected to the central processing unit 1301 via a mass storage controller (not shown) connected to the system bus 1305. The mass storage device 1307 and its associated computer-readable medium provide non-volatile memory for the computer device 1300. That is, the mass storage device 1307 may include a computer-readable medium (not shown) such as a hard disk or a Compact Disc Read-Only Memory (CD-ROM) drive.

[0210] Without loss of generality, the computer-readable medium can comprise a computer storage medium and a communication medium. A computer storage medium includes any method or technology implemented in volatile and nonvolatile, removable and non-removable media that stores information such as computer-readable instructions, data structures, program modules, or other data. Computer storage media includes RAM, ROM, erasable programmable read only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), CD-ROM, digital video disc (DVD), or other optical storage device, magnetic tape cassette, magnetic tape, magnetic disk storage or other magnetic storage device. Of course, those skilled in the art will understand that the computer storage media is not limited to the several mentioned above. The system memory 1304 and the mass storage device 1307 described above can be collectively referred to as memory.

[0211] According to various embodiments of the present disclosure, the computer device 1300 may operate connected to a remote computer device on a network via a network such as the Internet. That is, the computer device 1300 may be connected to the network 1311 via a network interface unit 1312 connected to the system bus 1305, or may be connected to another type of network or remote computer device system (not shown) using the network interface unit 1312.

[0212] The memory further includes one or more programs stored in the memory, and the central processing unit 1301 realizes all or part of the steps in the shooting display method of the virtual gun described above by executing the one or more programs.

[0213] In an exemplary embodiment, there is further provided a computer-readable storage medium storing at least one instruction, at least one segment of a program, a code set, or a set of instructions that, when loaded and executed by a processor, implement a method for displaying the firing of a virtual gun according to the embodiments of each of the methods described above.

[0214] In an exemplary embodiment, there is further provided a computer program product or a computer program comprising computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions so that the computer device executes the method for displaying the firing of a virtual gun described in the above aspects.

Claims

1. A method for displaying the shooting of a virtual gun executed by a terminal, comprising: displaying the virtual gun in a virtual scene; controlling the virtual gun to perform continuous shooting in the virtual scene; displaying at least one of a recoil animation of the gun body and a muzzle recoil animation of the virtual gun in response to the virtual gun firing once during the continuous shooting; including the recoil animation of the gun body is an animation in which the gun body of the virtual gun varies according to a variation curve in at least one direction of the X-axis and the Y-axis; the muzzle recoil animation is an animation in which the muzzle of the virtual gun varies according to a variation curve around the root node of the virtual gun; the X-axis indicates the horizontal recoil direction of the virtual gun, and the Y-axis indicates the vertical recoil direction of the virtual gun; The step of displaying the recoil animation of the gun body of the virtual gun in response to the virtual gun firing once during the continuous shooting includes: displaying the recoil animation of the gun body in which the gun body of the virtual gun varies according to a sine curve in at least one direction of the X-axis and the Y-axis in response to the virtual gun firing once during the continuous shooting; The step of displaying the recoil animation of the gun body in which the gun body of the virtual gun varies according to a sine curve in at least one direction of the X-axis and the Y-axis in response to the virtual gun firing once during the continuous shooting includes: determining a basic width of the virtual gun and a recoil factor of the virtual gun that is positively correlated with the number of shots fired based on the number of shots fired corresponding to the current shot in the continuous shooting, determining a first sine curve based on the basic width of the virtual gun and the recoil factor of the virtual gun, and displaying the recoil animation of the gun body of the virtual gun varying according to the first sine curve in the X-axis direction; or Based on the number of previous shots corresponding to the current shot in the continuous shooting, determining a basic width of the virtual gun and a recoil factor of the virtual gun that is positively correlated with the number of previous shots, determining a second sine curve based on the basic width of the virtual gun and the recoil factor of the virtual gun, and displaying the barrel recoil animation in which the barrel of the virtual gun varies according to the second sine curve in the Y-axis direction. Or, Based on the number of previous shots corresponding to the current shot in the continuous shooting, determining a basic width of the virtual gun and a recoil factor of the virtual gun that is positively correlated with the number of previous shots, determining a first sine curve and a second sine curve respectively based on the basic width of the virtual gun and the recoil factor of the virtual gun, and displaying the barrel recoil animation in which the barrel of the virtual gun varies according to the second sine curve in the Y-axis direction while varying according to the first sine curve in the X-axis direction. The method includes the steps.

2. The method includes At the time of the current shot, determining a moving direction along the X-axis of the virtual gun, and When the moving direction along the X-axis of the virtual gun does not match the variation direction of the first sine curve, further including the step of changing the sine of the first sine curve. The method according to claim 1.

3. The step of determining a first sine curve based on the basic width of the virtual gun and the recoil factor of the virtual gun includes Calculating a first product of the basic width of the virtual gun and the recoil factor, and using the first product as the maximum variation width of the first sine curve, Or, Using the basic width of the virtual gun as the maximum variation width of the first sine curve and using the recoil factor as the angular velocity of the first sine curve. The method according to claim 1.

4. The step of determining a second sine curve based on the basic width of the virtual gun and the recoil factor of the virtual gun includes Calculating a second product of the basic width of the virtual gun and the recoil factor, and using the second product as the maximum fluctuation width of the second sine curve; or using the basic width of the virtual gun as the maximum fluctuation width of the second sine curve, and using the recoil factor as the angular velocity of the second sine curve. The method according to claim 1 includes this step. **Claim 5** The step of determining the first sine curve and the second sine curve respectively based on the basic width of the virtual gun and the recoil factor of the virtual gun includes: Calculating a first product of the basic width of the virtual gun and the recoil factor, using the first product as the maximum fluctuation width of the first sine curve, calculating a second product of the basic width of the virtual gun and the recoil factor, and using the second product as the maximum fluctuation width of the second sine curve; or using the basic width of the virtual gun as the maximum fluctuation width of the first sine curve, using the recoil factor as the angular velocity of the first sine curve, using the basic width of the virtual gun as the maximum fluctuation width of the second sine curve, and using the recoil factor as the angular velocity of the second sine curve. The method according to claim 1 includes this step. **Claim 6** A method for displaying shooting of a virtual gun executed by a terminal, including: displaying the virtual gun in a virtual scene; controlling the virtual gun to perform continuous shooting in the virtual scene; displaying at least one of the gun body recoil animation and the muzzle recoil animation of the virtual gun in response to the virtual gun shooting once during the continuous shooting; including The gun body recoil animation is an animation in which the gun body of the virtual gun fluctuates according to a fluctuation curve in at least one direction of the X-axis and the Y-axis; The muzzle recoil animation is an animation in which the muzzle of the virtual gun fluctuates according to a fluctuation curve centered on the root node of the virtual gun; The X-axis indicates the horizontal recoil direction of the virtual gun, and the Y-axis indicates the vertical recoil direction of the virtual gun. The step of displaying the muzzle recoil animation of the virtual gun in response to the virtual gun firing once during the continuous shooting is: The step of displaying the muzzle recoil animation in which the muzzle of the virtual gun varies according to a sine curve centered on the root node of the virtual gun in response to the virtual gun firing once during the continuous shooting includes: The step of displaying the muzzle recoil animation in which the muzzle of the virtual gun varies according to a sine curve centered on the root node of the virtual gun in response to the virtual gun firing once during the continuous shooting is: The step of determining the basic width of the virtual gun and the recoil factor of the virtual gun that is positively correlated with the number of shots fired based on the number of shots fired corresponding to the current shot in the continuous shooting; The step of determining a third sine curve based on the basic width of the virtual gun and the recoil factor of the virtual gun; The step of displaying the muzzle recoil animation in which the muzzle of the virtual gun varies according to the third sine curve centered on the root node of the virtual gun. A method including this.

7. The step of determining a third sine curve based on the basic width of the virtual gun and the recoil factor of the virtual gun is: The step of calculating a third product of the basic width of the virtual gun and the recoil factor, and using the third product as the maximum variation width of the third sine curve; Or, The step of using the basic width of the virtual gun as the maximum variation width of the third sine curve and the recoil factor as the angular velocity of the third sine curve. The method according to claim 6 including this.

8. The method is: Determining a first muzzle position of the virtual gun, which is the position where the muzzle of the virtual gun is located at the current time, and a second muzzle position of the virtual gun, which is the position where the muzzle of the virtual gun is located at the next time, based on the muzzle recoil animation, and obtaining the position of the barrel of the virtual gun; Creating a first vector in which the barrel position points to the first muzzle position and a second vector in which the barrel position points to the second muzzle position; Determining an included angle between the first vector and the second vector as a rotation amount of the muzzle of the virtual gun with respect to the barrel of the virtual gun, the method according to claim 6, further comprising:

9. A method for displaying shooting of a virtual gun executed by a terminal, comprising: Displaying the virtual gun in a virtual scene; Controlling the virtual gun to perform continuous shooting in the virtual scene; Displaying at least one of the barrel recoil animation and the muzzle recoil animation of the virtual gun in response to the virtual gun firing once during the continuous shooting; Including: The barrel recoil animation is an animation in which the barrel of the virtual gun varies according to a variation curve in at least one direction of the X-axis and the Y-axis; The muzzle recoil animation is an animation in which the muzzle of the virtual gun varies according to a variation curve around the root node of the virtual gun; The X-axis indicates the horizontal recoil direction of the virtual gun, and the Y-axis indicates the vertical recoil direction of the virtual gun; The step of displaying the muzzle recoil animation of the virtual gun in response to the virtual gun firing once during the continuous shooting is: Including the step of displaying the muzzle recoil animation in which the muzzle of the virtual gun varies according to a sine curve around the root node of the virtual gun in response to the virtual gun firing once during the continuous shooting; In response to the virtual gun having fired once during the continuous shooting, the step of displaying at least one of the gun body recoil animation and the muzzle recoil animation of the virtual gun is When the number of shots fired in the continuous shooting does not exceed the shot count threshold, the step of displaying the basic animation in which the virtual gun performs continuous shooting, where the basic animation is an animation in which the gun body moves back and forth when the virtual gun performs continuous shooting, When the number of shots fired in the continuous shooting exceeds the shot count threshold, in addition to the basic animation in which the virtual gun performs continuous shooting, at least one of the gun body recoil animation and the muzzle recoil animation is superimposed, and the superimposed animation is displayed, A method comprising.

10. A shooting display device for a virtual gun, A display module for displaying the virtual gun in a virtual scene, A control module for controlling the virtual gun to perform continuous shooting in the virtual scene, comprising The display module further displays a basic animation in which the gun body moves back and forth when the virtual gun performs continuous shooting when the number of shots fired in the continuous shooting does not exceed the shot count threshold in response to the virtual gun having fired once during the continuous shooting, and displays an animation in which the muzzle recoil animation of the virtual gun is superimposed on the basic animation when the number of shots fired in the continuous shooting exceeds the shot count threshold, The muzzle recoil animation is an animation in which the muzzle of the virtual gun varies according to a variable curve centered on the root node of the virtual gun, and the root node is the contact point between the hand of the virtual character and the virtual gun or the center point of the virtual gun.

11. A computer device comprising a processor, a memory connected to the processor, and program instructions stored in the memory, A computer device, wherein when the program instructions are executed by the processor, the virtual gun shooting display method according to any one of claims 1 to 9 is realized. **Claim 12** A computer program, characterized in that the computer is configured to execute the virtual gun shooting display method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Interface display method and equipment during shooting in virtual environment and storage medium

    CN108815851A

  • Virtual prop control method and device, storage medium and electronic device

    CN110841292A

  • Virtual prop control method and device, terminal and storage medium

    CN112121416A

  • Virtual prop control method and device, computer equipment and storage medium

    CN112169325A