Shooting method and device in virtual scene, equipment, medium and program product
By realizing the function of virtual objects shooting outside in the virtual vehicle in a virtual scene, the problem of virtual objects in the prior art need to be protruded to shoot is solved, and the shooting efficiency and human-computer interaction efficiency are improved.
Patent Information
- Application Number
- CN202311724892.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-14
- Publication Date
- 2025-06-17
AI Technical Summary
In the prior art, virtual objects in virtual vehicles need to first come out and then shoot outside the virtual vehicles, resulting in low shooting efficiency and human-computer interaction efficiency.
In a virtual scene, the virtual object can directly respond to the instructions of the shooting control, control the virtual object to shoot the outside within the virtual vehicle, and the entire virtual object is located inside the virtual vehicle.
The shooting operation process in virtual scenes is simplified, the shooting efficiency and human-computer interaction efficiency are improved, and the hardware resource utilization rate of electronic devices is optimized.
Smart Images

Figure CN120154913A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technologies, and in particular, to a shooting method, apparatus, electronic device, computer-readable storage medium, and computer program product in a virtual scenario. Background Art
[0002] In related art games, when a player controls a virtual object to ride in a virtual vehicle and wants to shoot outside the virtual vehicle, the player needs to first control the virtual object to lean out of the virtual vehicle based on a control, and then control the virtual object that pops out of the virtual vehicle to shoot outside the virtual vehicle. However, such a shooting method is too cumbersome, resulting in low shooting efficiency and human-computer interaction efficiency in the virtual scenario. Summary of the Invention
[0003] Embodiments of the present application provide a shooting method, apparatus, electronic device, computer-readable storage medium, and computer program product in a virtual scenario, which can improve the shooting efficiency and human-computer interaction efficiency in the virtual scenario.
[0004] The technical solution of the embodiments of the present application is implemented as follows:
[0005] Embodiments of the present application provide a shooting method in a virtual scenario, including:
[0006] In a virtual scenario, display a virtual vehicle, a virtual object located in the virtual vehicle, and a shooting control;
[0007] In response to a shooting instruction triggered based on the shooting control, control the virtual object to shoot outside the virtual vehicle;
[0008] Wherein, during the shooting process of the virtual object, the whole of the virtual object is located inside the virtual vehicle.
[0009] Embodiments of the present application provide a shooting apparatus in a virtual scenario, including:
[0010] A display module, configured to display a virtual vehicle, a virtual object located in the virtual vehicle, and a shooting control in a virtual scenario;
[0011] A control module, configured to control the virtual object to shoot outside the virtual vehicle in response to a shooting instruction triggered based on the shooting control; wherein, during the shooting process of the virtual object, the whole of the virtual object is located inside the virtual vehicle.
[0012] In the above solution, the device further includes a second control module, which is configured to control the virtual object to keep the shooting prop in a folded and lifted state when there is an obstacle directly in front of the virtual object; wherein, the distance between the shooting prop in the folded and lifted state and the virtual object is less than the distance between the shooting prop in the normal lifted state and the virtual object; the control module is further configured to, in response to a shooting instruction triggered based on a shooting control, control the virtual object to use the shooting prop in the folded and lifted state to shoot at the exterior of the virtual vehicle.
[0013] In the above solution, the virtual object is equipped with a shooting prop, and the device further includes a third control module, which is configured to control the virtual object to keep the shooting prop in a retracted state when the orientation of the virtual object is within a target angle range; the control module is further configured to, in response to a shooting instruction triggered based on a shooting control, control the virtual object to gradually switch the state of the shooting prop from the retracted state to the lifted state; during the process of switching the state of the shooting prop from the retracted state to the lifted state, control the virtual object to use the shooting prop to shoot at the exterior of the virtual vehicle.
[0014] In the above solution, the device further includes a fourth control module, which is configured to control the virtual object to switch the state of the shooting prop from the lifted state to the retracted state when the virtual object finishes shooting at the exterior of the virtual vehicle.
[0015] In the above solution, the virtual object realizes shooting at the exterior of the virtual vehicle based on a shooting prop, and the device further includes a configuration module, which is configured to, in response to a component configuration operation for the shooting prop, control the virtual object to configure key components of the shooting prop; wherein, the key components of the shooting prop include at least one of the following: a scope, a virtual sub-prop corresponding to the shooting prop, a silencer, and a virtual gunstock.
[0016] In the above solution, the configuration module is further configured to, when the shooting prop equipped by the virtual object is in the retracted state, in response to a configuration operation for the shooting prop, control the virtual object to gradually switch the state of the shooting prop from the retracted state to the lifted state; during the process of switching the state of the shooting prop from the retracted state to the lifted state, control the virtual object to configure the components of the shooting prop.
[0017] In the above solution, the virtual object realizes shooting at the exterior of the virtual vehicle based on a shooting prop, and the shooting prop includes at least one key component; the device further includes a detection module configured to detect the states of the respective key components of the shooting prop to obtain a detection result; wherein, the states include a normal state and a to-be-configured state; when the detection result indicates that a target key component among the at least one key component is in the to-be-configured state, a configuration prompt message is displayed, and the configuration prompt message is used to prompt to configure the target key component.
[0018] In the above solution, the virtual object is equipped with a shooting prop, and the shooting prop is in a retracted state; the device further includes a fifth control module configured to, in response to a view conversion instruction for the virtual object, control the virtual object to perform a view conversion; when the orientation of the virtual object after the view conversion is not within a target angle range, control the virtual object to switch the state of the shooting prop from the retracted state to a lifted state; the control module is further configured to, in response to a shooting instruction triggered based on a shooting control, control the virtual object to use the shooting prop in the lifted state to shoot at the exterior of the virtual vehicle.
[0019] In the above solution, the display module is further configured to display a virtual vehicle and a virtual object located outside the virtual vehicle in the virtual scene; wherein, when the virtual object is located outside the virtual vehicle, the shooting prop equipped by the virtual object is in the lifted state; in response to a vehicle entry instruction for the virtual object, control the virtual object to enter the virtual vehicle, and control the virtual object to switch the state of the shooting prop from the lifted state to the retracted state.
[0020] In the above solution, the lifted state includes a folded and lifted state, and the distance between the shooting prop in the folded and lifted state and the virtual object is less than the distance between the shooting prop in the normal lifted state and the virtual object; the fifth control module is further configured to, when the orientation of the virtual object after the view conversion is not within a target angle range, in response to an obstacle existing directly in front of the virtual object, control the virtual object to switch the state of the shooting prop from the retracted state to the folded and lifted state; the control module is further configured to, in response to a shooting instruction triggered based on a shooting control, control the virtual object to use the shooting prop in the folded and lifted state to shoot at the exterior of the virtual vehicle.
[0021] In the above solution, the virtual object is equipped with a shooting prop, and the shooting prop is in a retracted state; the control module is further configured to, in response to a shooting instruction triggered based on a shooting control, obtain a first shooting animation and a state transition animation; wherein, the first shooting animation is used to indicate the process of the virtual object performing a shooting operation using the shooting prop in a lifted state when the virtual object is inside the virtual vehicle, and the state transition animation is used to indicate the process of the virtual object switching the state of the shooting prop from a retracted state to a lifted state inside the virtual vehicle; fuse the first shooting animation and the state transition animation to obtain a target shooting animation; wherein, the target shooting animation is used to indicate the animation process of the virtual object shooting the outside of the virtual vehicle using the shooting prop during the process of switching the state of the shooting prop from a retracted state to a lifted state when the virtual object is inside the virtual vehicle; play the target shooting animation to display the process of the virtual object shooting the outside of the virtual vehicle.
[0022] In the above solution, the first shooting animation includes a plurality of first shooting image frames, the state transition animation includes a plurality of state transition image frames, and the number of first shooting image frames included in the first shooting animation is the same as the number of state transition image frames included in the state transition animation; the control module is further configured to perform the following processing for each of the first shooting image frames included in the first shooting animation to obtain a plurality of fused image frames: obtain the timestamp of the first shooting image frame, and based on the timestamp, obtain the state transition image frame with the same timestamp from the state transition animation; obtain the first weight of the first shooting image frame and the second weight of the state transition image frame, and based on the first weight and the second weight, fuse the first shooting image frame and the state transition image frame to obtain a fused image frame; combine the plurality of fused image frames to obtain the target shooting animation.
[0023] In the above solution, the control module is further configured to obtain a first pose animation of the virtual object, a second shooting animation of the virtual object, and a second pose animation of the virtual object; wherein, the first pose animation is used to indicate the pose of the virtual object when equipping a shooting prop in a lifted state outside the virtual vehicle, the second shooting animation is used to indicate the process of the virtual object performing a shooting operation using the shooting prop in a lifted state outside the virtual vehicle, the second pose animation is used to indicate the pose of the virtual object when equipping a shooting prop in a lifted state inside the virtual vehicle, and the upper body pose of the virtual object in the first pose animation is the same as that of the virtual object in the second pose animation; superimpose the first pose animation, the second shooting animation, and the second pose animation to obtain the first shooting animation.
[0024] In the above solution, the first shooting animation includes a plurality of first shooting image frames, and the second shooting animation includes a plurality of second shooting image frames; the control module is further configured to perform the following processing on each of the second shooting image frames included in the second shooting animation to obtain a plurality of first shooting image frames: obtain the value of the pose parameter of the virtual object in the second shooting image frame and the value of the pose parameter of the virtual object in the first pose animation; subtract the pose parameter of the virtual object in the second shooting image frame from the value of the pose parameter of the virtual object in the first pose animation to obtain a pose difference; obtain the value of the pose parameter of the virtual object in the second pose animation, and add the pose difference to the value of the pose parameter of the virtual object in the second pose animation to obtain a first shooting image frame; combine the plurality of first shooting image frames to obtain the first shooting animation.
[0025] In the above solution, the lifted state includes one of a folded lifted state and a normal lifted state, and the distance between the shooting prop in the folded lifted state and the virtual object is less than the distance between the shooting prop in the normal lifted state and the virtual object; the state switching animation includes a first state switching animation and a second state switching animation. The first state switching animation is used to indicate the process of switching the state of the shooting prop from the stowed state to the folded lifted state when the virtual object is inside the virtual vehicle, and the second state switching animation is used to indicate the process of switching the shooting prop from the stowed state to the normal lifted state when the virtual object is inside the virtual vehicle; the control module is further configured to detect the lifted state of the shooting prop in response to a shooting instruction triggered based on a shooting control, and obtain a detection result, where the detection result is used to indicate whether there is contact with other objects when the shooting prop is in the lifted state; if the detection result indicates that there is contact with other objects when the shooting prop is in the lifted state, determine that the lifted state of the shooting prop is the folded lifted state, and obtain the first shooting animation and the first state switching animation; if the detection result indicates that there is no contact with other objects when the shooting prop is in the lifted state, determine that the lifted state of the shooting prop is the normal lifted state, and obtain the first shooting animation and the second state switching animation.
[0026] In the above solution, the control module is further configured to obtain the length of the shooting prop and the distance between the virtual object and the other object; compare the length of the shooting prop with the distance; if the comparison result indicates that the length of the shooting prop is less than the distance, obtain a detection result indicating that there is no contact with the other object when the shooting prop is in the lifted state; if the comparison result indicates that the length of the shooting prop is not less than the distance, obtain a detection result indicating that there is contact with the other object when the shooting prop is in the lifted state.
[0027] In the above solution, the folded and lifted state includes a backward folded state and a rotated folded state. The distance between the shooting prop in the backward folded and lifted state and the virtual object is less than the distance between the shooting prop in the normal lifted state and the virtual object; the distance between the shooting prop in the rotated folded and lifted state and the virtual object is less than the distance between the shooting prop in the normal lifted state and the virtual object, and the shooting prop is rotated compared to the shooting prop in the normal lifted state; the first state switching animation includes a third state switching animation and a fourth state switching animation. The third state switching animation is used to indicate the process of switching the state of the shooting prop from the retracted state to the backward folded state when the virtual object is inside the virtual vehicle, and the fourth state switching animation is used to indicate the process of switching the state of the shooting prop from the retracted state to the rotated folded state when the virtual object is inside the virtual vehicle; the control module is further configured to obtain the contact point between the shooting prop and other objects, and obtain the distance between the contact point and the virtual camera corresponding to the virtual scene; if the distance is not greater than the distance threshold, determine that the folded and lifted state of the shooting prop is the backward folded state, and obtain the first shooting animation and the third state switching animation; if the distance is greater than the distance threshold, determine that the folded and lifted state of the shooting prop is the rotated folded state, and obtain the first shooting animation and the fourth state switching animation.
[0028] An embodiment of the present application provides an electronic device, including:
[0029] A memory for storing computer-executable instructions;
[0030] A processor for implementing the shooting method in the virtual scene provided by the embodiment of the present application when executing the computer-executable instructions stored in the memory.
[0031] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions for causing a processor to implement the shooting method in the virtual scene provided by the embodiment of the present application when executed.
[0032] An embodiment of the present application provides a computer program product, which includes computer-executable instructions stored in a computer-readable storage medium. The processor of the electronic device reads the computer-executable instructions from the computer-readable storage medium, and the processor executes the computer-executable instructions, so that the electronic device executes the shooting method in the virtual scene provided by the embodiment of the present application.
[0033] The embodiment of the present application has the following beneficial effects:
[0034] When the virtual object is located in the virtual vehicle, it can directly respond to the shooting instruction triggered by the shooting control to control the virtual object to shoot outside the virtual vehicle. At the same time, during the shooting process of the virtual object, the whole virtual object is located inside the virtual vehicle. In this way, compared with the related technology where the virtual object in the virtual vehicle must first lean out and then perform the shooting operation outside the virtual vehicle, the operation of controlling the virtual object to lean out is reduced, and the operation process of the shooting process in the virtual scene is simplified. This not only improves the shooting efficiency in the shooting scene, but also improves the human-computer interaction efficiency and the utilization rate of the hardware resources of the electronic device. Description of the Drawings
[0035] Figure 1 is a schematic structural diagram of the shooting system 100 in the virtual scene provided by the embodiment of the present application;
[0036] Figure 2 is a schematic structural diagram of the electronic device provided by the embodiment of the present application;
[0037] Figure 3 is a schematic flowchart of the shooting method in the virtual scene provided by the embodiment of the present application;
[0038] Figure 4 is a schematic diagram of the virtual vehicle, the virtual object located in the virtual vehicle, and the shooting control provided by the embodiment of the present application;
[0039] Figure 5 is a schematic diagram of shooting props in different states provided by the embodiment of the present application;
[0040] Figure 6 is a schematic diagram of the shooting prop provided by the embodiment of the present application;
[0041] Figure 7 is a schematic flowchart of the process of controlling the virtual object to shoot outside the virtual vehicle provided by the embodiment of the present application;
[0042] Figure 8 is a schematic diagram of the acquisition process of the first shooting animation provided by the embodiment of the present application;
[0043] Figure 9 is a schematic diagram of the first posture animation and the second posture animation provided by the embodiment of the present application;
[0044] Figure 10 is a schematic flowchart of the acquisition process of the state switching animation provided by the embodiment of the present application;
[0045] Figure 11 is a schematic diagram of the state switching of the shooting prop provided by the embodiment of the present application;
[0046] Figure 12It is a technical architecture diagram for general operations performed by players provided in an embodiment of this application;
[0047] Figure 13 It is a schematic diagram of the update process of TakeupTime provided in an embodiment of this application. Specific implementation manners
[0048] In order to make the objectives, technical solutions, and advantages of this application clearer, the following will further describe this application in detail with reference to the accompanying drawings. The described embodiments should not be regarded as limitations to this application. All other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of this application.
[0049] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments. However, it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and they can be combined with each other without conflict.
[0050] In the following description, the terms "first / second / third" are only used to distinguish similar objects and do not represent a specific order for the objects. It can be understood that "first / second / third" can be interchanged with a specific order or sequence when permitted, so that the embodiments of this application described here can be implemented in an order other than that illustrated or described here.
[0051] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0052] Before further elaborating on the embodiments of this application, the nouns and terms involved in the embodiments of this application are explained. The nouns and terms involved in the embodiments of this application are subject to the following explanations.
[0053] 1) In response to, which is used to represent the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more operations to be executed can be real-time or can have a set delay; without special instructions, there is no limitation on the execution order of multiple operations to be executed.
[0054] 2) The client, also known as the user side, refers to the program that provides local services corresponding to the server. Except for some applications that can only run locally, it is generally installed on the terminal and needs to cooperate with the server to run. That is, there needs to be a corresponding server and service program in the network to provide corresponding services. In this way, a specific communication connection needs to be established between the client and the server side to ensure the normal operation of the application program. For example, a virtual scene client (such as a game client).
[0055] 3) Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science. It attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a way similar to human intelligence. Artificial intelligence also studies the design principles and implementation methods of various intelligent machines to enable the machines to have the functions of perception, reasoning and decision-making.
[0056] 4) A virtual scene is a virtual scene displayed (or provided) when the application program runs on the terminal. The virtual scene can be a simulation environment of the real world, a semi-simulated and semi-fictional virtual environment, or a purely fictional virtual environment. The virtual scene can be any one of a two-dimensional virtual scene, a 2.5D virtual scene or a three-dimensional virtual scene.
[0057] For example, the virtual scene can include the sky, land, ocean, etc. The land can include environmental elements such as deserts and cities. Users can control virtual objects to carry out activities in the virtual scene. The activities include but are not limited to at least one of adjusting body posture, crawling, walking, running, cycling, jumping, driving, picking up, shooting, attacking, and throwing. The virtual scene can be displayed from the first-person perspective (for example, playing the virtual object in the game from the user's own perspective); it can also be displayed from the third-person perspective (for example, the user chasing the virtual object in the game to play the game); it can also be displayed from a bird's-eye view. The above perspectives can be switched arbitrarily.
[0058] 5) Virtual objects, images of various people and objects that can interact in a virtual scene, or movable objects in a virtual scene. The movable objects can be virtual characters, virtual animals, cartoon characters, etc., such as: people, animals, plants, oil drums, walls, stones, vehicles, etc. displayed in a virtual scene. The virtual object can be a virtual image in the virtual scene that represents the user. A virtual scene can include multiple virtual objects, each of which has its own shape and volume in the virtual scene and occupies a part of the space in the virtual scene.
[0059] For example, the virtual object may be a user character controlled by an operation on the client, an artificial intelligence (AI) set in a virtual scene through training, or a non-player character (NPC) set in a virtual scene interaction. The number of virtual objects participating in the interaction in the virtual scene may be preset or dynamically determined according to the number of clients joining the interaction.
[0060] 6) Third-person perspective: the in-game camera is positioned a certain distance behind the player character, and the character and all combat elements in the surrounding environment can be seen in the screen.
[0061] 7) First-person perspective: the in-game camera is at the player character’s eye position, and the character’s body parts and all combat elements in the surrounding environment can be seen in the picture.
[0062] 8) The folded and raised state is a solution for dealing with the problem of penetration between the shooting prop and the obstacle due to obstruction. When the shooting prop is blocked by an obstacle, it enters the folded and raised state, that is, the shooting prop will first retract a certain distance; if the retracted distance is too much, the shooting prop will be rotated, that is, the shooting prop will be turned sideways.
[0063] 9) The stowed state is used to solve the problem of penetration between the shooting props and the internal structure of the vehicle body due to obstruction when the shooting props are on the vehicle. When the shooting props and the internal structure of the vehicle body are intertwined too much, the problem cannot be solved well by only using the folded and raised state. At this time, when certain conditions are met, the character will enter another action of holding the shooting props and put the shooting props down, that is, the stowed state. In the stowed state, general operations based on the shooting props, such as changing bullets and shooting, cannot be performed.
[0064] 10) Virtual camera is a "camera" set up in computer animation software or virtual engine. The role of virtual camera in expressing viewpoint during animation is equivalent to that of traditional camera. The shooting objects of virtual camera and physical camera are completely different, but the functions are extremely similar. Physical camera shoots real people or actually built scenes, while virtual camera shoots models built in 3D software, which can realize infinite possibilities. Virtual camera is presented in the form of icon in virtual engine, and also has parameters such as lens, focal length, focus, aperture, depth of field, etc. It can realize camera actions such as "push, pull, shake, move, follow, swing, rise, fall, and comprehensive movement", and can realize shooting effects that are difficult or even impossible to achieve with physical camera, such as passing through walls, keyholes, objects, etc. The parameters that need to be adjusted for physical camera are distributed on the body of physical camera and need manual operation. The camera parameters of the virtual camera are buttons or numerical input bars integrated on the panel. The operator only needs to input parameters or drag the mouse. Sometimes a few key frames can determine the movement path of the virtual camera. In actual shooting, physical cameras often require stabilizers or motion control systems. Even so, the shaking of the picture still exists.
[0065] 11) Frame time, the time a frame takes
[0066] 12) Pose, the position, rotation and scale of the character skeleton. Together, these information define the state of a virtual object in three-dimensional space.
[0067] 13) Animation resources: art resources used for animation performance in the game.
[0068] 14) Animation overlay, which can overlay the difference between two animations into a new animation.
[0069] 15) Animation blending: two animations can be blended into a new animation through weights. The Transform of the new animation bone is the weighted sum of the two bones.
[0070] 16) BasePose: The initial pose in the entire animation pipeline is generally called the base pose, and various superpositions can be performed later.
[0071] 17) Superimposed animation resources. When animations are superimposed, the animation resource obtained by subtracting the difference between two animations is the superimposed animation resource.
[0072] See also Figure 1 , Figure 1It is a schematic architecture diagram of the shooting system 100 in the virtual scenario provided by the embodiments of the present application. The terminal (the terminal 400 is exemplarily shown). The terminal 400 is connected to the server 200 through the network 300. Among them, the network 300 can be a wide area network or a local area network, or a combination of the two, and uses a wireless or wired link to implement data transmission.
[0073] Among them, the server 200 is used to send the scene data corresponding to the virtual scenario including the virtual vehicle, the virtual object located in the virtual vehicle, and the shooting control to the terminal 400;
[0074] The terminal 400 is used to receive the scene data corresponding to the virtual scenario including the virtual vehicle, the virtual object located in the virtual vehicle, and the shooting control; based on the scene data, display the virtual scenario; in the virtual scenario, display the virtual vehicle, the virtual object located in the virtual vehicle, and display the shooting control; in response to the shooting instruction triggered based on the shooting control, control the virtual object to shoot outside the virtual vehicle; among them, during the shooting process of the virtual object, the whole of the virtual object is located inside the virtual vehicle.
[0075] In some embodiments, the server 200 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery network (CDN, Content Deliver Network), and big data and artificial intelligence platforms. The terminal 400 can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a set-top box, a smart voice interaction device, a smart home appliance, a virtual reality device, a vehicle-mounted terminal, an aircraft, a portable music player, a personal digital assistant, a dedicated messaging device, a portable game device, a smart speaker, and a smart watch, etc., but is not limited thereto. The terminal and the server can be directly or indirectly connected through wired or wireless communication methods, which are not limited in the embodiments of the present application.
[0076] Next, the electronic device for implementing the shooting method in the virtual scenario provided by the embodiments of the present application will be described. See Figure 2 , Figure 2 It is a schematic structural diagram of the electronic device provided by the embodiments of the present application. The electronic device can be a server or a terminal. Taking the terminal shown in Figure 1 as an example, Figure 2The electronic device shown includes: at least one processor 410, a memory 450, at least one network interface 420, and a user interface 430. Each component in the terminal 400 is coupled together through a bus system 440. It can be understood that the bus system 440 is used to implement the connection and communication between these components. In addition to the data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clear illustration, in Figure 2 all kinds of buses are labeled as the bus system 440.
[0077] The processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0078] The user interface 430 includes one or more output devices 431 that enable the display of media content, including one or more speakers and / or one or more visual display screens. The user interface 430 also includes one or more input devices 432, including user interface components that assist the user in input, such as a keyboard, a mouse, a microphone, a touch screen display, a camera, other input buttons, and controls.
[0079] The memory 450 can be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memories, hard disk drives, optical disk drives, etc. Optionally, the memory 450 includes one or more storage devices that are physically located far from the processor 410.
[0080] The memory 450 includes volatile memory or non-volatile memory, and can also include both volatile and non-volatile memory. The non-volatile memory can be a read-only memory (ROM, Read Only Memory), and the volatile memory can be a random access memory (RAM, Random Access Memory). The memory 450 described in the embodiments of the present application is intended to include any suitable type of memory.
[0081] In some embodiments, the memory 450 is capable of storing data to support various operations. Examples of these data include programs, modules, and data structures, or subsets or supersets thereof, which are described below by way of example.
[0082] An operating system 451, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;
[0083] A network communication module 452 for reaching other electronic devices via one or more (wired or wireless) network interfaces 420. Exemplary network interfaces 420 include: Bluetooth, Wireless Fidelity (WiFi), and Universal Serial Bus (USB), etc.
[0084] A presentation module 453 for enabling the display of information (e.g., a user interface for operating peripheral devices and displaying content and information) via one or more output devices 431 associated with the user interface 430 (such as a display screen, a speaker, etc.).
[0085] An input processing module 454 for detecting and translating one or more user inputs or interactions from one of one or more input devices 432.
[0086] In some embodiments, the device provided by the embodiments of the present application may be implemented in software. Figure 2 A shooting device 455 in a virtual scene stored in the memory 450 is shown. It may be software in the form of a program and a plug-in, etc., including the following software modules: a display module 4551 and a control module 4552. These modules are logical, so they can be combined arbitrarily or further split according to the functions to be implemented. The functions of each module will be described below.
[0087] In other embodiments, the device provided by the embodiments of the present application may be implemented in hardware. As an example, the shooting device in the virtual scene provided by the embodiments of the present application may be a processor in the form of a hardware decoding processor, which is programmed to execute the shooting method in the virtual scene provided by the embodiments of the present application. For example, a processor in the form of a hardware decoding processor may employ one or more Application Specific Integrated Circuits (ASICs), DSPs, Programmable Logic Devices (PLDs), Complex Programmable Logic Devices (CPLDs), Field-Programmable Gate Arrays (FPGAs), or other electronic components.
[0088] In some embodiments, a terminal or a server may implement the shooting method in the virtual scenario provided in the embodiments of the present application by running a computer program. For example, the computer program may be a native program or a software module in an operating system; it may be a local (Native) application (APP, Application), that is, a local client, that is, a program that needs to be installed in the operating system to run, such as an instant messaging APP or a web browser APP; it may also be a small program, that is, a program that only needs to be downloaded to a browser environment to run; it may also be a small program that can be embedded in any APP. In short, the above computer program may be any form of client, module, or plug-in.
[0089] Based on the above description of the shooting system and electronic device in the virtual scenario provided in the embodiments of the present application, the shooting method in the virtual scenario provided in the embodiments of the present application will be described below. In actual implementation, the shooting method in the virtual scenario provided in the embodiments of the present application may be implemented by a terminal or a server alone, or by the cooperation of a terminal and a server, taking the Figure 1 terminal 400 in to execute the shooting method in the virtual scenario provided in the embodiments of the present application alone as an example for description. Refer to Figure 3 , Figure 3 is a schematic flowchart of the shooting method in the virtual scenario provided in the embodiments of the present application. Next, the steps shown in Figure 3 will be described.
[0090] Step 101, the terminal displays a virtual vehicle, a virtual object located in the virtual vehicle, and a shooting control in the virtual scenario.
[0091] In actual implementation, an application program that supports the virtual scenario is installed on the terminal. The application program may be any one of a first-person shooting game, a third-person shooting game, a multiplayer online tactical battle game, a virtual reality application program, a three-dimensional map program, or a multiplayer gunfight survival game. The user can use the terminal to operate the virtual object located in the virtual scenario to carry out activities.
[0092] When the user opens the application program on the terminal and the terminal runs the application program, the terminal presents the picture of the virtual scenario (such as a driving game scenario). Here, the picture of the virtual scenario is obtained by observing the virtual scenario from the perspective of the first-person object or from the third-person perspective. The picture of the virtual scenario includes virtual objects. The virtual object may be a player character controlled by the current player, or a player character controlled by other players (teammates) in the same group as the current player; and the virtual vehicle can assist the player character to move in the virtual scenario. Common virtual vehicles include virtual cars, virtual boats, virtual airplanes, etc. The embodiments of the present application do not make any limitations on this.
[0093] In actual implementation, in a virtual scene, a virtual vehicle, a virtual object located in the virtual vehicle, and a shooting control are displayed. Exemplarily, refer to Figure 4 , Figure 4 which is a schematic diagram of the virtual vehicle, the virtual object located in the virtual vehicle, and the shooting control provided by an embodiment of the present application. Based on Figure 4 , Figure 4 the image in a of is obtained by observing the virtual scene from the first-person perspective of the virtual object. The shooting control is indicated by the dashed box 401. Figure 4 the image in b of is obtained by observing the virtual scene from the third-person perspective of the virtual object. The shooting control is indicated by the dashed box 402, and the virtual object is indicated by 403.
[0094] In actual implementation, the virtual object is equipped with a shooting prop. When the virtual object is inside the virtual vehicle, the shooting prop is in a retracted state or a lifted state. Among them, the retracted state indicates that the shooting prop is in a standby state or an unused state, such as the state where the virtual object carries the shooting prop on the back, or the state where the virtual object places the shooting prop on the leg or in the virtual backpack, or the state where the virtual object places the shooting prop on the seat of the virtual vehicle, etc. The lifted state includes a folded-lifted state and a normal-lifted state. The distance between the shooting prop in the folded-lifted state and the virtual object is less than the distance between the shooting prop in the normal-lifted state and the virtual object. In this way, the problem of penetration with the front obstacle when lifting the shooting prop is avoided through the folded state.
[0095] At the same time, the folded-lifted state includes a backward-shifted folded state and a rotated folded state. Among them, the distance between the shooting prop in the backward-shifted folded-lifted state and the virtual object is less than the distance between the shooting prop in the normal-lifted state and the virtual object; the distance between the shooting prop in the rotated folded-lifted state and the virtual object is less than the distance between the shooting prop in the normal-lifted state and the virtual object, and it is rotated compared to the shooting prop in the normal-lifted state.
[0096] Exemplarily, refer to Figure 5 , Figure 5 which is a schematic diagram of the shooting prop in different states provided by an embodiment of the present application. Based on Figure 5 , Figure 5 the shooting prop in a of is in the normal-lifted state, Figure 5 the shooting prop in b of is in the backward-shifted folded state, Figure 5 the shooting prop in c of is in the rotated folded state.
[0097] It should be noted that the operation process of the shooting prop in the lifted state mentioned in the implementation of this application is used to indicate that when the shooting prop is in the folded and lifted state or in the normal lifted state, the shooting prop can perform the corresponding operation process. Correspondingly, the operation process of the shooting prop in the folded and lifted state mentioned in the implementation of this application is used to indicate that when the shooting prop is in the rearward folding state or in the rotational folding state, the shooting prop can perform the corresponding operation process.
[0098] In actual implementation, before the virtual object enters the virtual vehicle, the virtual object is equipped with a shooting prop, which can be in the lifted state or in the stowed state. When the virtual object enters the virtual vehicle and is located in the co-pilot position of the virtual vehicle, regardless of the state of the shooting prop equipped by the virtual object outside the virtual vehicle, when the virtual object enters the virtual vehicle, the shooting prop is default in the lifted state; when the virtual object enters the virtual vehicle and is located in the rear row position of the virtual vehicle, that is, the non-driving position and the non-co-pilot position, regardless of the state of the shooting prop equipped by the virtual object outside the virtual vehicle, when the virtual object enters the virtual vehicle, the shooting prop is default in the stowed state.
[0099] In some embodiments, when the shooting prop equipped by the virtual object outside the virtual vehicle is in the lifted state and the virtual object enters the virtual vehicle and is located in the rear row position of the virtual vehicle, in the virtual scene, the process of displaying the virtual vehicle and the virtual object located in the virtual vehicle can be that, in the virtual scene, the virtual vehicle and the virtual object located outside the virtual vehicle are displayed; wherein, when the virtual object is located outside the virtual vehicle, the shooting prop equipped by the virtual object is in the lifted state; in response to the vehicle entry instruction for the virtual object, control the virtual object to enter the virtual vehicle, and control the virtual object to switch the state of the shooting prop from the lifted state to the stowed state.
[0100] In actual implementation, as described above, when the virtual object enters the virtual vehicle, the shooting prop is default in the stowed state, that is, the virtual object is equipped with a shooting prop and the shooting prop is in the stowed state; at this time, the perspective of the virtual object can also be switched, so as to switch the perspective of the first virtual object. Specifically, in response to the perspective conversion instruction for the virtual object, control the virtual object to perform perspective conversion; when the orientation of the virtual object after perspective conversion is not within the target angle range, control the virtual object to switch the state of the shooting prop from the stowed state to the lifted state; thus, in the subsequent process of controlling the virtual object to shoot the outside of the virtual vehicle in response to the shooting instruction triggered by the shooting control, it can be that in response to the shooting instruction triggered by the shooting control, control the virtual object to use the shooting prop in the lifted state to shoot the outside of the virtual vehicle.
[0101] It should be noted that the target angle range is preset. When the virtual object enters the virtual vehicle, a coordinate system is constructed with the virtual object as the origin and the driving direction of the virtual vehicle as the longitudinal coordinate axis. After controlling the virtual object to perform a perspective transformation in response to a perspective transformation instruction for the virtual object, based on the constructed coordinate system, the angle corresponding to the orientation of the virtual object after the perspective transformation is obtained, and it is determined whether this angle is within the target angle range. Thus, when this angle is not within the target angle range, the virtual object is controlled to switch the state of the shooting prop from the stowed state to the lifted state, and when this angle is within the target angle range, the virtual object is controlled to keep the state of the shooting prop as the stowed state. Here, the angle corresponding to the orientation is the included angle between the orientation and the longitudinal coordinate. At the same time, the target angle range can also be preset, such as from 0 degrees to 45 degrees.
[0102] It should be noted that when the orientation of the virtual object is within the target angle range, it is used to indicate that the virtual object is facing the inside of the virtual vehicle, which means that the virtual object has no intention of shooting outside the virtual vehicle. Therefore, the virtual object is controlled to keep the state of the shooting prop as the stowed state; when the orientation of the virtual object is not within the target angle range, it is used to indicate that the virtual object is facing the outside of the virtual vehicle, which means that the virtual object has an intention of shooting outside the virtual vehicle. Therefore, the virtual object is controlled to switch the state of the shooting prop from the stowed state to the lifted state, facilitating the virtual object to shoot outside the virtual vehicle.
[0103] In actual implementation, as described above, the lifted state includes the folded-lifted state, and the distance between the shooting prop in the folded-lifted state and the virtual object is less than the distance between the shooting prop in the normal lifted state and the virtual object; thus, when the orientation of the virtual object after the perspective transformation is not within the target angle range, the process of controlling the virtual object to switch the state of the shooting prop from the stowed state to the lifted state can be that when the orientation of the virtual object after the perspective transformation is not within the target angle range, in response to an obstacle existing in the direct front of the virtual object, the virtual object is controlled to switch the state of the shooting prop from the stowed state to the folded-lifted state; thus, the process of controlling the virtual object to use the shooting prop in the lifted state to shoot outside the virtual vehicle in response to a shooting instruction triggered by a shooting control can be that in response to a shooting instruction triggered by a shooting control, the virtual object is controlled to use the shooting prop in the folded-lifted state to shoot outside the virtual vehicle;
[0104] Alternatively, when the orientation of the virtual object after perspective transformation is not within the target angle range, in response to the absence of an obstacle in front of the virtual object, control the virtual object to switch the state of the shooting prop from the stowed state to the normal lifted state; thus, in response to a shooting instruction triggered based on the shooting control, the process of controlling the virtual object to use the shooting prop in the lifted state to shoot the exterior of the virtual vehicle can be to control the virtual object to use the shooting prop in the normal lifted state to shoot the exterior of the virtual vehicle in response to a shooting instruction triggered based on the shooting control.
[0105] In some other embodiments, when the shooting prop equipped by the virtual object outside the virtual vehicle is in the stowed state and the virtual object is located in the co-pilot position of the virtual vehicle after entering the virtual vehicle, the virtual object is equipped with a shooting prop. In the virtual scene, the process of displaying the virtual vehicle and the virtual object located in the virtual vehicle can be to display the virtual vehicle and the virtual object located outside the virtual vehicle in the virtual scene; wherein, when the virtual object is located outside the virtual vehicle, the shooting prop equipped by the virtual object is in the stowed state; in response to a vehicle entry instruction for the virtual object, control the virtual object to enter the virtual vehicle and control the virtual object to switch the state of the shooting prop from the stowed state to the lifted state.
[0106] Exemplarily, refer to Figure 6 , Figure 6 which is a schematic diagram of the shooting prop provided by the embodiments of the present application. Based on Figure 6 , when the shooting prop equipped by the virtual object outside the virtual vehicle is in the stowed state and the virtual object is located in the co-pilot position of the virtual vehicle after entering the virtual vehicle, control the virtual object to switch the state of the shooting prop from the stowed state to the lifted state as shown in Figure 6 .
[0107] It should be noted that since there is a front row seat in front of the rear row position, when the virtual object is located in the rear row position after entering the virtual vehicle, the shooting prop is default to be in the stowed state, while there is glass in front of the co-pilot position, which can be used to observe the exterior of the virtual vehicle and shoot. Therefore, when the virtual object is located in the co-pilot position after entering the virtual vehicle, the shooting prop is default to be in the lifted state.
[0108] Meanwhile, as described above, the raised state includes a folded raised state, and the distance between the shooting prop in the folded raised state and the virtual object is less than the distance between the shooting prop in the normal raised state and the virtual object. Thus, in response to a vehicle entry instruction for the virtual object, when controlling the virtual object to enter the virtual vehicle and controlling the virtual object to switch the state of the shooting prop from the stowed state to the raised state, the process of controlling the virtual object to switch the state of the shooting prop from the stowed state to the raised state can be as follows: when there is an obstacle directly in front of the virtual object, control the virtual object to switch the state of the shooting prop from the stowed state to the folded raised state; when there is no obstacle directly in front of the virtual object, control the virtual object to switch the state of the shooting prop from the stowed state to the normal raised state.
[0109] In addition, when performing a perspective transformation on the virtual object, in response to a perspective transformation instruction for the virtual object, control the virtual object to perform a perspective transformation. If there is no obstacle directly in front of the virtual object, control the virtual object to keep the shooting prop in the normal raised state, such as maintaining the normal raised state (i.e., there was no obstacle directly in front of the virtual object before the perspective transformation) or controlling the virtual object to switch the state of the shooting prop from the folded raised state to the normal raised state (i.e., there was an obstacle directly in front of the virtual object before the perspective transformation and the shooting prop was originally in the folded raised state). Or, if there is an obstacle directly in front of the virtual object, control the virtual object to keep the shooting prop in the folded raised state, such as maintaining the folded raised state (i.e., there was an obstacle directly in front of the virtual object before the perspective transformation) or controlling the virtual object to switch the state of the shooting prop from the normal raised state to the folded raised state (i.e., there was no obstacle directly in front of the virtual object before the perspective transformation and the shooting prop was originally in the normal raised state).
[0110] It should be noted that for the process of determining the state of the shooting prop based on whether the orientation of the virtual object is within the target angle range, it is applicable to the virtual object located in the rear row. Since the shooting prop equipped by the virtual object in the co-pilot position is in the raised state, regardless of whether the orientation of the virtual object in the co-pilot position is within the target angle range, the shooting prop of the virtual object is in the raised state. Only based on whether there is an obstacle in front of the virtual object, it is determined whether the raised state of the shooting prop is the normal raised state or the folded raised state.
[0111] Exemplarily, if the virtual vehicle is a car, when the virtual object is in the co-pilot position, the obstacle in front of the virtual object can be the windshield directly in front of the virtual object before the perspective transformation, or the side glass directly in front of the virtual object after the perspective transformation; when the virtual object is in the rear row, the obstacle in front of the virtual object can be the seat directly in front of the virtual object before the perspective transformation, or the side glass directly in front of the virtual object after the perspective transformation.
[0112] It should be noted that the obstacle is determined based on the length of the shooting prop and the distance between the virtual object and other objects. The process of determining the obstacle will be described later and will not be elaborated here.
[0113] In actual implementation, as described above, in the virtual scene, after displaying the virtual vehicle, the virtual object in the virtual vehicle, and the shooting control, regardless of whether the virtual object is in the co-pilot position or the rear row position, or whether the perspective is switched, when there is an obstacle directly in front of the virtual object, the virtual object is controlled to keep the shooting prop in the folded-up state; among them, as described above, the distance between the shooting prop in the folded-up state and the virtual object is less than the distance between the shooting prop in the normal-up state and the virtual object; thus, in the subsequent process of controlling the virtual object to shoot outside the virtual vehicle in response to the shooting instruction triggered by the shooting control, it can be to control the virtual object to use the shooting prop in the folded-up state to shoot outside the virtual vehicle in response to the shooting instruction triggered by the shooting control.
[0114] It should be noted that when the virtual object is in the rear row position, when there is an obstacle directly in front of the virtual object, the process of controlling the virtual object to keep the shooting prop in the folded-up state is as described above. After controlling the virtual object to switch the perspective, if the orientation of the virtual object is not within the target angle range, the virtual object is controlled to switch the state of the shooting prop from the stowed state to the folded-up state; if the orientation of the virtual object is within the target angle range, the virtual object is controlled to keep the state of the shooting prop in the stowed state.
[0115] When the virtual object is in the co-pilot position, if there is an obstacle directly in front of the virtual object when the virtual object enters the virtual vehicle, the process of controlling the virtual object to keep the shooting prop in the folded-up state is as described above. If the virtual object has not switched the perspective and there is an obstacle directly in front of the virtual object, the shooting prop is defaulted to the folded-up state. Or as described above, if there is an obstacle directly in front of the virtual object after the virtual object has switched the perspective, the folded-up state is maintained or the virtual object is controlled to switch the state of the shooting prop from the normal-up state to the folded-up state.
[0116] In some embodiments, before subsequently controlling the virtual object to shoot outside the virtual vehicle in response to the shooting instruction triggered by the shooting control, it is also possible to control the virtual object to aim outside the virtual vehicle in response to the aiming instruction for the outside of the virtual vehicle, so that after aiming, the virtual object is controlled to shoot outside the virtual vehicle in response to the shooting instruction triggered by the shooting control.
[0117] It should be noted that the aiming instruction can be triggered by an operation of switching the perspective of the virtual object, that is, the aiming instruction can be regarded as the perspective switching instruction described above, such as taking the perspective switching process as the aiming process (when a telescopic sight is not required); it can also be triggered based on the aiming control, such as before or after the perspective switching process, in response to a triggering operation on the aiming control, receiving the aiming instruction (when a telescopic sight is required).
[0118] In some embodiments, if the shooting prop is in a stowed state, the process of controlling the virtual object to aim at the outside of the virtual vehicle in response to an aiming instruction for the outside of the virtual vehicle may be that when the shooting prop equipped by the virtual object is in the stowed state, in response to the aiming instruction for the outside of the virtual vehicle, controlling the virtual object to gradually switch the state of the shooting prop from the stowed state to the lifted state; during the process of the state of the shooting prop switching from the stowed state to the lifted state, controlling the virtual object to aim at the outside of the virtual vehicle.
[0119] In some other embodiments, if the shooting prop is in the lifted state, the process of controlling the virtual object to aim at the outside of the virtual vehicle in response to an aiming instruction for the outside of the virtual vehicle may be that when the shooting prop equipped by the virtual object is in the lifted state, in response to the aiming instruction for the outside of the virtual vehicle, directly controlling the virtual object to aim at the outside of the virtual vehicle.
[0120] In some embodiments, the virtual object realizes shooting at the outside of the virtual vehicle based on the shooting prop. Before subsequently controlling the virtual object to shoot at the outside of the virtual vehicle in response to a shooting instruction triggered by the shooting control, it is also possible to control the virtual object to configure the key components of the shooting prop in response to a component configuration operation on the shooting prop; among them, the key components of the shooting prop include at least one of the following: telescopic sight, virtual sub-prop corresponding to the shooting prop, silencer, virtual gunstock.
[0121] It should be noted that the telescopic sight here can be a 2x telescopic sight, 4x telescopic sight, 6x telescopic sight or 8x telescopic sight, etc., and the virtual sub-prop can be the virtual bullet corresponding to the shooting prop. Therefore, the component configuration operation for the shooting prop can be an operation of reloading the shooting prop, an operation of assembling the telescopic sight, virtual gunstock and silencer, etc.
[0122] In actual implementation, in response to a configuration operation for a shooting prop, the process of controlling a virtual object to configure the components of the shooting prop can be as follows: when the shooting prop equipped by the virtual object is in a retracted state, in response to the configuration operation for the shooting prop, control the virtual object to gradually switch the state of the shooting prop from the retracted state to the lifted state; during the process of the state of the shooting prop switching from the retracted state to the lifted state, control the virtual object to configure the components of the shooting prop.
[0123] It should be noted that when the virtual object configures the shooting prop, the shooting prop needs to be in the lifted state. When a configuration operation for the shooting prop in the lifted state is received, directly control the virtual object to configure the components of the shooting prop; when a configuration operation for the shooting prop in the retracted state is received, automatically control the virtual object to gradually switch the state of the shooting prop from the retracted state to the lifted state; during the process of the state of the shooting prop switching from the retracted state to the lifted state, control the virtual object to configure the components of the shooting prop.
[0124] In this way, compared with the related technology where the shooting prop in the retracted state needs to be lifted first and then the shooting prop is configured, in this application, during the process of the state of the shooting prop switching from the retracted state to the lifted state, the virtual object is controlled to configure the components of the shooting prop, which shortens the time for configuring the components of the shooting prop, improves the efficiency of configuring the components of the shooting prop, and at the same time reduces the operation of the user to control the virtual object to switch the state of the shooting prop from the retracted state to the lifted state, and also improves the human-computer interaction efficiency.
[0125] In some embodiments, the virtual object realizes shooting outside the virtual vehicle based on the shooting prop, and the shooting prop includes at least one key component; further, the states of the respective key components of the shooting prop can be detected to obtain a detection result; wherein, the state includes a normal state and a state to be configured; when the detection result indicates that a target key component among at least one key component is in the state to be configured, a configuration prompt message is displayed, and the configuration prompt message is used to prompt to configure the target key component.
[0126] It should be noted that, as described above, the key components of the shooting prop include at least one of the following: telescopic sight, virtual sub-prop corresponding to the shooting prop, silencer, virtual gunstock. For the telescopic sight, the normal state is used to indicate that the shooting prop is equipped with a telescopic sight, and the to-be-configured state is used to indicate that the shooting prop is not equipped with a telescopic sight. For the virtual sub-prop, the normal state is used to indicate that the virtual sub-prop loaded by the shooting prop reaches the maximum capacity, and the to-be-configured state is used to indicate that the virtual sub-prop loaded by the shooting prop does not reach the maximum capacity and can continue to be loaded. For the silencer, the normal state is used to indicate that the shooting prop is equipped with a silencer, and the to-be-configured state is used to indicate that the shooting prop is not equipped with a silencer. For the virtual gunstock, the normal state is used to indicate that the shooting prop is equipped with a virtual gunstock, and the to-be-configured state is used to indicate that the shooting prop is not equipped with a virtual gunstock.
[0127] In actual implementation, the timing for detecting the states of the key components of the shooting prop can be to perform the detection after each shooting operation, or it can be that the user manually triggers the detection process for the states of the key components of the shooting prop. In this regard, the embodiments of the present application do not make any limitations.
[0128] Step 102, in response to a shooting instruction triggered based on a shooting control, control the virtual object to shoot at the outside of the virtual vehicle; wherein, during the shooting process of the virtual object, the whole body of the virtual object is located inside the virtual vehicle.
[0129] It should be noted that the shooting instruction is triggered by a click operation on the shooting control. The fact that the whole body of the virtual object is located inside the virtual vehicle is used to indicate that the entire body of the virtual object is inside the virtual vehicle; controlling the virtual object to shoot at the outside of the virtual vehicle can be to shoot at a second virtual object outside the virtual vehicle, or to directly shoot outside the virtual vehicle. In this regard, the embodiments of the present application do not make any limitations.
[0130] It should be noted that when controlling the virtual object to shoot at the outside of the virtual vehicle is to shoot at a second virtual object outside the virtual vehicle, the second virtual object can be a player character controlled by another player in an enemy camp with the player character controlled by the current player, or an AI-controlled object for players to interact with in the virtual scene, or an NPC in the virtual scene, etc.
[0131] In some embodiments, the virtual object is equipped with a shooting prop. When the orientation of the virtual object is within the target angle range, the shooting prop of the virtual object can also be controlled to be in a retracted state. Thus, in the process of controlling the virtual object to shoot the exterior of the virtual vehicle in response to a shooting instruction triggered by a shooting control, it can be that, in response to a shooting instruction triggered by a shooting control, the virtual object is controlled to gradually switch the state of the shooting prop from the retracted state to the lifted state; during the process of switching the state of the shooting prop from the retracted state to the lifted state, the virtual object is controlled to use the shooting prop to shoot the exterior of the virtual vehicle.
[0132] It should be noted that, as described above, the target angle range is preset. When the virtual object is inside the virtual vehicle, a coordinate system is constructed with the virtual object as the origin and the driving direction of the virtual vehicle as the longitudinal coordinate axis. Then, based on the constructed coordinate system, the angle corresponding to the orientation of the virtual object is obtained, and it is determined whether this angle is within the target angle range. Thus, when the orientation of the virtual object is within the target angle range, the shooting prop of the virtual object is controlled to be in a retracted state. As described above, the current orientation of the virtual object can be the orientation of the virtual object after perspective conversion or the orientation of the virtual object without perspective conversion. At the same time, before controlling the virtual object to put the shooting prop in a retracted state, the shooting prop of the virtual object can be in a lifted state or in a retracted state.
[0133] It should be noted that when the virtual object shoots the exterior of the virtual vehicle, the shooting prop needs to be in a lifted state. When a shooting instruction triggered by a shooting control is received when the shooting prop is in a lifted state, the virtual object is directly controlled to shoot the exterior of the virtual vehicle; when a shooting instruction triggered by a shooting control is received when the shooting prop is in a retracted state, the virtual object is automatically controlled to gradually switch the state of the shooting prop from the retracted state to the lifted state; during the process of switching the state of the shooting prop from the retracted state to the lifted state, the virtual object is controlled to shoot the exterior of the virtual vehicle.
[0134] In this way, compared with the related art where the shooting prop in the retracted state needs to be lifted first before shooting at the enemy and where one needs to lean out first before shooting at the enemy, in the present application, during the process of switching the state of the shooting prop from the retracted state to the lifted state, the virtual object is controlled to shoot the exterior of the virtual vehicle, reducing the operations for the user to control the virtual object to switch the state of the shooting prop from the retracted state to the lifted state and the operation of leaning out, and also improving the human-computer interaction efficiency.
[0135] In actual implementation, after controlling the virtual object to use the shooting prop to shoot the exterior of the virtual vehicle, it can also be that when the virtual object finishes shooting the exterior of the virtual vehicle, the virtual object is controlled to switch the state of the shooting prop from the lifted state to the retracted state.
[0136] It should be noted that during the process of the virtual object completing the shooting outside the virtual vehicle, if the orientation of the virtual object has been within the target angle range, the shooting completion duration is displayed. The shooting completion duration is used to indicate the duration from the end moment value of the shooting operation to the current moment. When the shooting completion duration reaches the target completion duration, the virtual object is automatically controlled to switch the state of the shooting prop from the lifted state to the stowed state; if the orientation of the virtual object changes and is not within the target angle range, the virtual object is controlled to keep the state of the shooting prop in the lifted state.
[0137] In actual implementation, as described above, when the shooting prop is in the lifted state and a shooting instruction triggered by the shooting control is received, the virtual object is directly controlled to shoot outside the virtual vehicle; when the shooting prop is in the stowed state and a shooting instruction triggered by the shooting control is received, the virtual object is automatically controlled to gradually switch the state of the shooting prop from the stowed state to the lifted state, and during the process of the state of the shooting prop switching from the stowed state to the lifted state, the virtual object is controlled to shoot outside the virtual vehicle. Next, based on the above two situations respectively, the process of controlling the virtual object to shoot outside the virtual vehicle in response to a shooting instruction triggered by the shooting control is described.
[0138] In some embodiments, the virtual object is equipped with a shooting prop, and the shooting prop is in the stowed state; refer to Figure 7 , Figure 7 which is a schematic flowchart of the process of controlling the virtual object to shoot outside the virtual vehicle provided by the embodiments of the present application. Based on Figure 7 , step 102 can be implemented through the following steps.
[0139] Step 1021, in response to a shooting instruction triggered by the shooting control, obtain the first shooting animation and the state switching animation.
[0140] Among them, the first shooting animation is used to indicate the process of the virtual object performing a shooting operation using the lifted shooting prop when the virtual object is inside the virtual vehicle, and the state switching animation is used to indicate the process of the virtual object switching the state of the shooting prop from the stowed state to the lifted state inside the virtual vehicle.
[0141] It should be noted that the animation durations of the first shooting animation and the state switching animation are the same, and the number of image frames included in each is the same, that is, the frame rates of the first shooting animation and the state switching animation are the same.
[0142] In actual implementation, for the process of obtaining the first shooting animation, refer to Figure 8 , Figure 8 which is a schematic diagram of the process of obtaining the first shooting animation provided by the embodiments of the present application. Based onFigure 8 The process of obtaining the first shooting animation provided by the embodiments of the present application can be implemented by the following steps.
[0143] Step 10211a: Obtain the first posture animation of the virtual object, the second shooting animation of the virtual object, and the second posture animation of the virtual object.
[0144] Among them, the first posture animation is used to indicate the posture when the virtual object is outside the virtual vehicle and equips the shooting prop in the lifted state. The second shooting animation is used to indicate the process of the virtual object performing a shooting operation using the lifted shooting prop when the virtual object is outside the virtual vehicle. The second posture animation is used to indicate the posture when the virtual object is inside the virtual vehicle and equips the shooting prop in the lifted state. The upper body postures of the virtual object in the first posture animation and the virtual object in the second posture animation are the same.
[0145] It should be noted that the first posture animation is used to indicate a basic posture, that is, the posture when the virtual object outside the virtual vehicle lifts the shooting prop. The second posture animation is also used to indicate a basic posture, that is, the posture when the virtual object inside the virtual vehicle lifts the shooting prop. The upper body postures of the virtual object in the first posture animation and the virtual object in the second posture animation are the same, while the lower body postures are different. For example, the lower body of the virtual object in the first posture animation is in a standing state, while the lower body of the virtual object in the second posture animation is in a sitting posture. Exemplarily, see Figure 9 , Figure 9 is a schematic diagram of the first posture animation and the second posture animation provided by the embodiments of the present application. Based on Figure 9 , what 901 indicates is the first posture animation, and what 902 indicates is the second posture animation.
[0146] Step 10212a: Superimpose the first posture animation, the second shooting animation, and the second posture animation to obtain the first shooting animation.
[0147] In actual implementation, the process of superimposing the first posture animation, the second shooting animation, and the second posture animation to obtain the first shooting animation can be to subtract the posture parameters of the virtual object in the second shooting animation from the posture parameters of the virtual object in the first posture animation to obtain the superimposed animation resource; then superimpose the superimposed animation resource on the virtual object in the second posture animation to obtain the first shooting animation.
[0148] It should be noted that the first shooting animation includes multiple first shooting image frames, and the second shooting animation includes multiple second shooting image frames. Therefore, the process of superimposing the first pose animation, the second shooting animation, and the second pose animation to obtain the first shooting animation can be performed frame by frame. Specifically, the process of superimposing the first pose animation, the second shooting animation, and the second pose animation to obtain the first shooting animation can be to perform the following processing for each second shooting image frame included in the second shooting animation to obtain multiple first shooting image frames: obtain the value of the pose parameter of the virtual object in the second shooting image frame and the value of the pose parameter of the virtual object in the first pose animation; subtract the pose parameter of the virtual object in the second shooting image frame from the value of the pose parameter of the virtual object in the first pose animation to obtain a pose difference; obtain the value of the pose parameter of the virtual object in the second pose animation, and add the pose difference to the value of the pose parameter of the virtual object in the second pose animation to obtain the first shooting image frame; combine multiple first shooting image frames to obtain the first shooting animation.
[0149] It should be noted that in the above process, the process of subtracting the pose parameter of the virtual object in the second shooting animation from the pose parameter of the virtual object in the first pose animation to obtain the superimposed animation resource, that is, for each second shooting image frame included in the second shooting animation, perform the following processing: obtain the value of the pose parameter of the virtual object in the second shooting image frame and the value of the pose parameter of the virtual object in the first pose animation; subtract the pose parameter of the virtual object in the second shooting image frame from the value of the pose parameter of the virtual object in the first pose animation to obtain a pose difference; determine multiple pose differences as the superimposed animation resource; and the process of superimposing the superimposed animation resource onto the virtual object in the second pose animation to obtain the first shooting animation, that is, obtain the value of the pose parameter of the virtual object in the second pose animation, and add the pose difference to the value of the pose parameter of the virtual object in the second pose animation to obtain the first shooting image frame; combine multiple first shooting image frames to obtain the first shooting animation.
[0150] It should be noted that the pose parameter in the above process can be used to indicate each part of the body of the corresponding virtual object, and the value of the pose parameter can be used to indicate the movement amplitude of the corresponding part.
[0151] In actual implementation, as described above, the lifted state includes one of the folded lifted state and the normal lifted state, and the distance between the shooting prop in the folded lifted state and the virtual object is less than the distance between the shooting prop in the normal lifted state and the virtual object; and the state transition animation includes a first state transition animation and a second state transition animation. The first state transition animation is used to indicate the process of switching the state of the shooting prop from the stowed state to the folded lifted state when the virtual object is inside the virtual vehicle, and the second state transition animation is used to indicate the process of switching the shooting prop from the stowed state to the normal lifted state when the virtual object is inside the virtual vehicle; based on this, for the process of obtaining the state transition animation, see Figure 10 , Figure 10 is a schematic flowchart of the process of obtaining the state transition animation provided by an embodiment of the present application. Based on Figure 10 , the process of obtaining the state transition animation provided by an embodiment of the present application can be implemented through the following steps.
[0152] Step 10211b, in response to a shooting instruction triggered based on a shooting control, detect the lifted state of the shooting prop to obtain a detection result, and the detection result is used to indicate whether there is contact with other objects when the shooting prop is in the lifted state.
[0153] It should be noted that the other object can be the object closest to the shooting prop inside the virtual vehicle. When there is contact between the shooting prop in the normal lifted state and the other object, the other object can be regarded as the obstacle described above.
[0154] In actual implementation, the process of detecting the lifted state of the shooting prop to obtain a detection result can be to obtain the length of the shooting prop, the distance between the virtual object and the other object, and compare the length of the shooting prop with the distance; if the comparison result indicates that the length of the shooting prop is less than the distance, obtain a detection result indicating that there is no contact with other objects when the shooting prop is in the lifted state; if the comparison result indicates that the length of the shooting prop is not less than the distance, obtain a detection result indicating that there is contact with other objects when the shooting prop is in the lifted state.
[0155] It should be noted that whether there is contact between the shooting prop and other objects when the shooting prop is in the lifted state indicates whether there is contact between the shooting prop in the normal lifted state and other objects.
[0156] Step 10212b, if the detection result indicates that there is contact between the shooting prop and other objects when the shooting prop is in the lifted state, determine the lifted state of the shooting prop as the folded lifted state, and obtain the first shooting animation and the first state transition animation.
[0157] It should be noted that when the detection result indicates that the shooting prop is in the lifted state and in contact with other objects, it is determined that the lifted state of the shooting prop is the folded and lifted state. As described above, that is, the shooting prop is retracted backward in the direction of the virtual object, so as to avoid the penetration phenomenon caused by the shooting prop and other objects.
[0158] In actual implementation, as described above, the folded and lifted state includes the backward movement and folding state and the rotation and folding state. The distance between the shooting prop in the backward movement, folding and lifting state and the virtual object is less than the distance between the shooting prop in the normal lifted state and the virtual object; the distance between the shooting prop in the rotation and folding lifted state and the virtual object is less than the distance between the shooting prop in the normal lifted state and the virtual object, and it is rotated compared with the shooting prop in the normal lifted state; the first state switching animation includes the third state switching animation and the fourth state switching animation. The third state switching animation is used to indicate the process of switching the state of the shooting prop from the retracted state to the backward movement and folding state when the virtual object is inside the virtual vehicle. The fourth state switching animation is used to indicate the process of switching the state of the shooting prop from the retracted state to the rotation and folding state when the virtual object is inside the virtual vehicle.
[0159] Therefore, the process of obtaining the first shooting animation and the first state switching animation can be to obtain the contact point between the shooting prop and other objects, and obtain the distance between the contact point and the virtual camera corresponding to the virtual scene; if the distance is not greater than the distance threshold, it is determined that the folded and lifted state of the shooting prop is the backward movement and folding state, and the first shooting animation and the third state switching animation are obtained; if the distance is greater than the distance threshold, it is determined that the folded and lifted state of the shooting prop is the rotation and folding state, and the first shooting animation and the fourth state switching animation are obtained.
[0160] It should be noted that the contact point between the shooting prop and other objects is used to indicate the contact point and the penetration position between the shooting prop and other objects if the virtual object is not controlled to keep the shooting prop in the folded and lifted state; if the distance does not exceed the distance threshold, only the shooting prop needs to be displaced backward by the first target distance, that is, it is determined that the folded and lifted state of the shooting prop is the backward movement and folding state, and the third state switching animation is obtained, so as to control the virtual object to keep the shooting prop in the backward movement and folding state; if the distance exceeds the distance threshold, the shooting prop needs to be rotated according to the preset angle, and at the same time, the shooting prop is displaced backward by the second target distance, it is determined that the folded and lifted state of the shooting prop is the rotation and folding state, and the fourth state switching animation is obtained, so as to control the virtual object to keep the shooting prop in the rotation and folding state, that is, to avoid penetration through rotation. Among them, the second target distance is less than the first target distance.
[0161] Step 10213b, if the detection result indicates that the shooting prop is in the lifted state and has no contact with other objects, determine that the lifted state of the shooting prop is the normal lifted state, and obtain the first shooting animation and the second state transition animation.
[0162] Step 1022, fuse the first shooting animation and the state transition animation to obtain the target shooting animation.
[0163] Among them, the target shooting animation is used to indicate the animation process in which when the virtual object is inside the virtual vehicle, during the process of switching the state of the shooting prop from the stowed state to the lifted state, the shooting prop is used to shoot the outside of the virtual vehicle.
[0164] In actual implementation, the first shooting animation includes multiple first shooting image frames, the state transition animation includes multiple state transition image frames, and the number of first shooting image frames included in the first shooting animation is the same as the number of state transition image frames included in the state transition animation; thus, the process of fusing the first shooting animation and the state transition animation to obtain the target shooting animation can be to perform the following processing for each first shooting image frame included in the first shooting animation to obtain multiple fused image frames: obtain the timestamp of the first shooting image frame, and based on the timestamp, obtain the state transition image frame with the same timestamp from the state transition animation; obtain the first weight of the first shooting image frame and the second weight of the state transition image frame, and based on the first weight and the second weight, fuse the first shooting image frame and the state transition image frame to obtain the fused image frame; combine the multiple fused image frames to obtain the target shooting animation.
[0165] It should be noted that starting from the earliest timestamp, the first shooting image frames are processed frame by frame according to the order of the timestamps. The sum of the first weight and the second weight is 1. The first weights corresponding to different first shooting image frames can be the same or different, and the second weights corresponding to different state transition image frames can also be the same or different, that is, during the fusion process, the first weight and the second weight are variable;
[0166] For example, for the first shooting image frame corresponding to the earliest timestamp, the virtual object is in the posture of shooting with the shooting prop in the lifted state, while in the state transition image frame corresponding to the same timestamp, the virtual object is just picking up the shooting prop in the stowed state. At this time, the content of the state transition image frame is mainly shown in the corresponding fused image frame, so the second weight can be set to 0.9, and the first weight can be 0.1;
[0167] For the first shooting image frame corresponding to the middle timestamp, the virtual object is in a shooting posture using a shooting prop in the lifted state, while in the state transition image frame corresponding to the corresponding timestamp, the virtual object is in a state between the stowed state and the lifted state of the shooting prop. At this time, the corresponding fused image frame needs to display the content of the state transition image frame and the content of the first shooting image frame simultaneously. Then, the second weight can be set to 0.5, and the first weight can be 0.5;
[0168] For the first shooting image frame corresponding to the end timestamp, the virtual object is in a shooting posture using a shooting prop in the lifted state, while in the state transition image frame corresponding to the corresponding timestamp, the virtual object has just put the shooting prop in the lifted state. At this time, the content of the first shooting image frame is mainly displayed in the corresponding fused image frame. Then, the second weight can be set to 0.1, and the first weight can be 0.9.
[0169] In this way, through the first weight and the second weight, the fusion effect of the image frames is made smoother and meets the requirements of the actual scene.
[0170] In actual implementation, when the first shooting image frame corresponding to the last timestamp is obtained and the corresponding fused image frame is determined, multiple fused image frames are combined to obtain the target shooting animation.
[0171] Step 1023, play the target shooting animation to display the process of the virtual object shooting at the outside of the virtual vehicle.
[0172] In some other embodiments, the virtual object is equipped with a shooting prop, and the shooting prop is in the lifted state. Thus, in response to a shooting instruction triggered by a shooting control, the process of controlling the virtual object to shoot at the outside of the virtual vehicle can be that, in response to a shooting instruction triggered by a shooting control, obtain the first shooting animation, and then play the first shooting animation to display the process of the virtual object shooting at the outside of the virtual vehicle; wherein, the process of obtaining the first shooting animation is as described above, and this application embodiment will not elaborate on it.
[0173] In this way, based on the shooting animation process of the virtual object being outside the virtual vehicle, determine the shooting animation process of the virtual object being inside the virtual vehicle. Compared with the related art solution that requires additional production of shooting animation resources for the virtual object being on the virtual vehicle, a large amount of resources are saved, and resource consumption and performance overhead are reduced.
[0174] In some embodiments, as described above, the process of controlling a virtual object to aim at the outside of a virtual vehicle and the process of configuring the components of a shooting prop can also be during the process of the state of the shooting prop switching from the stowed state to the lifted state. Therefore, for the process of controlling a virtual object to aim at the outside of a virtual vehicle in response to an aiming instruction for the outside of the virtual vehicle, it can also be to obtain a first aiming animation and a state switching animation in response to the aiming instruction for the outside of the virtual vehicle; wherein, the first aiming animation is used to indicate the process of a virtual object performing an aiming operation on the outside of the virtual vehicle using the shooting prop in the lifted state when the virtual object is inside the virtual vehicle, and the state switching animation is used to indicate the process of the virtual object switching the state of the shooting prop from the stowed state to the lifted state inside the virtual vehicle; fusing the first aiming animation and the state switching animation to obtain a target aiming animation; wherein, the target aiming animation is used to indicate the process of a virtual object performing an aiming operation on the outside of the virtual vehicle using the shooting prop in the lifted state during the process of switching the state of the shooting prop from the stowed state to the lifted state when the virtual object is inside the virtual vehicle; playing the target aiming animation to display the process of the virtual object aiming at the outside of the virtual vehicle using the shooting prop in the lifted state;
[0175] Correspondingly, for the process of controlling a virtual object to configure the key components of a shooting prop in response to a component configuration operation for the shooting prop, it can also be to obtain a first configuration animation and a state switching animation in response to the component configuration operation for the shooting prop; wherein, the first configuration animation is used to indicate the process of a virtual object performing a configuration operation on the shooting prop in the lifted state when the virtual object is inside the virtual vehicle, and the state switching animation is used to indicate the process of the virtual object switching the state of the shooting prop from the stowed state to the lifted state inside the virtual vehicle; fusing the first configuration animation and the state switching animation to obtain a target configuration animation; wherein, the target configuration animation is used to indicate the process of a virtual object performing a configuration operation on the shooting prop in the lifted state during the process of switching the state of the shooting prop from the stowed state to the lifted state when the virtual object is inside the virtual vehicle; playing the target configuration animation to display the process of configuring the shooting prop in the lifted state.
[0176] It should be noted that the process of obtaining the first aiming animation and the state switching animation and the process of the first configuration animation and the state switching animation are similar to the process of obtaining the first shooting animation and the state switching animation described above, and the process of fusing the first aiming animation and the state switching animation to obtain the target aiming animation and the process of fusing the first configuration animation and the state switching animation to obtain the target configuration animation are also similar to the process of fusing the first shooting animation and the state switching animation to obtain the target shooting animation described above. For this, the embodiments of the present application will not be elaborated.
[0177] Applying the above embodiments of the present application, when the virtual object is located in the virtual vehicle, it can directly respond to the shooting instruction triggered by the shooting control to control the virtual object to shoot outside the virtual vehicle. At the same time, during the shooting process of the virtual object, the whole virtual object is located inside the virtual vehicle. In this way, compared with the related art solution in which the virtual object in the virtual vehicle must first lean out and then perform the shooting operation outside the virtual vehicle, the operation of controlling the virtual object to lean out is reduced, and the operation process of the shooting process in the virtual scene is simplified. This not only improves the shooting efficiency in the shooting scene, but also improves the human-computer interaction efficiency and the utilization rate of the hardware resources of the electronic device.
[0178] Next, an exemplary application of the embodiments of the present application in an actual application scenario will be described.
[0179] In the games of the related art, when a player controls a virtual object to ride in a virtual vehicle and wants to shoot outside the virtual vehicle, the player needs to first control the virtual object to lean out of the virtual vehicle based on the control, and then control the virtual object that has leaned out of the virtual vehicle to shoot outside the virtual vehicle, or first lift the shooting prop and then shoot. However, there are problems such as difficult resource reuse and the shooting prop passing through the vehicle body. Especially for games with a complex action system, supporting the same operations in the vehicle requires doubling the animation resources, and the implementation cost is very high, resulting in low shooting efficiency and human-computer interaction efficiency in the virtual scene.
[0180] Based on this, the embodiments of the present application provide a solution that can shoot in the vehicle and perform general character operations. By mechanisms such as retracting the shooting prop and folding and lifting the shooting prop, the problem of the shooting prop passing through the vehicle body is avoided. And when lifting the shooting prop, through program processing, most of the animations during normal combat can be reused in the vehicle without the need to produce additional resources, saving art manpower, package size, and runtime memory. And when adding new functions later, there is no need to perform additional processing on the vehicle. In this way, there is no need to lean out to shoot, enabling the character to perform the same operations as on the ground only by sitting in the vehicle, and there is no need to repeatedly produce resources.
[0181] Next, the technical solution of the present application will be described from the product side.
[0182] In the technical solution of the present application, the shooting prop can be in a normal state (normal lifted state), a retracted state, and a folded state (folded and lifted state). Refer to Figure 11 , Figure 11 which is a schematic diagram of the state switching of the shooting prop provided by the embodiments of the present application. Based on Figure 11, in the technical solution of this application, if the shooting prop is switched from the normal state to the retracted state or the folded state, it can be achieved through steps 1101 to 1105. Specifically, first, control the character (virtual object) controlled by the player to put the shooting prop in the normal state. Then, when the orientation of the character is within a certain angle (target angle range), control the character to switch the state of the shooting prop from the normal state to the retracted state; when the orientation of the character is not within a certain angle, determine whether there is an obstacle in front of the character. When there is an obstacle in front of the character, control the character to switch the state of the shooting prop from the normal state to the folded state. When there is no obstacle in front of the character, control the character to keep the shooting prop in the normal state. In this way, according to the "character orientation" and "whether there is an obstacle in front", it can be automatically determined which action state to enter, and no player operation intervention is required for either, so the experience is quite automated. Secondly, this application can automatically perform free switching among the three states, and the action performance is also very smooth.
[0183] During actual implementation, when the player needs to perform various operations (general operations such as using props and reloading), refer to Figure 12 , Figure 12 is the technical architecture diagram for the player to perform general operations provided by the embodiment of this application. Based on Figure 12 , when the player needs to perform general operations, first determine the current state of the shooting prop, and then based on the current state, obtain the animation to be played. Specifically, when the shooting prop is in the normal state, if the character needs to perform general operations, obtain the animation when the character performs general actions with the shooting prop in the normal state; when the shooting prop is in the folded state, if the character needs to perform general operations, obtain the animation when the character performs general actions with the shooting prop in the folded state; when the shooting prop is in the retracted state, if the character needs to perform general operations, first determine whether there is an obstacle in front of the character. If there is an obstacle in front of the character, obtain the animation when the character performs general actions during the process of switching the state of the shooting prop from the retracted state to the folded state, as well as the animation of switching the state of the shooting prop from the retracted state to the folded state. If there is no obstacle in front of the character, obtain the animation when the character performs general actions during the process of switching the state of the shooting prop from the retracted state to the normal state, as well as the animation of switching the state of the shooting prop from the retracted state to the normal state. Then play the obtained animation. In this way, not only can a large amount of resources be saved, directly reusing the existing ground action assets, but also there is no restriction on the player's state. The player can use the same operations as on the ground in the vehicle under any conditions, and the player's camera or character position will not be forcibly changed.
[0184] It should be noted that the animation of the shooting prop in the folded state does not need to be specifically produced, but is obtained by rotating or offsetting the shooting prop held by the character in the animation of the shooting prop in the normal state, that is, the animation of the shooting prop in the folded state is obtained by updating the animation of the shooting prop in the normal state.
[0185] Next, the technical solution of this application will be described from the technical side.
[0186] The technical solution of this application realizes the first-person combat mode in the vehicle, does not require leaning out to shoot, and can reuse common animation resources in the vehicle for the same operations, such as reloading, inspecting shooting props, etc., without the need to produce additional art resources. The implementation is mainly divided into three parts:
[0187] 1. Reusing resources on the vehicle for common operations (reusing the upper body of BasePose, )
[0188] 2. The three states of retracting, normal, and folding on the vehicle and the mutual conversion between them
[0189] First, the process of resource reuse on the vehicle will be described. First, the animations when not in the vehicle are mainly based on two states, namely, with empty hands (i.e., retracting the shooting prop) and equipped with the shooting prop (i.e., lifting the shooting prop). These two states have their own BasePoses, which are completely standing states. For example, actions such as taking medicine and climbing are superimposed animation resources on the BasePose of empty hands, while operations related to the shooting prop such as reloading, inspecting the shooting prop, and shooting are superimposed animation resources on the BasePose of equipped with the shooting prop.
[0190] Secondly, since the character on the vehicle needs to sit on the seat, the BasePose is different from that on the ground. Therefore, if you want to reuse the superimposed animation resources such as taking medicine and reloading on the ground, you need to have the same BasePose as on the ground, which is obviously impossible. However, actions such as taking medicine and reloading only use the bones of the upper body, and when the character sits on the vehicle, only the lower body needs to fit with the vehicle. Therefore, first generate the BasePose of the vehicle (the second pose animation), and copy the upper body of the BasePose of the non-vehicle (the first pose animation) to the BasePose of the vehicle. Taking the BasePose of equipped with the shooting prop as an example, the BasePose of the non-vehicle and the BasePose on the vehicle are as Figure 9 shown. Based on Figure 9, it can be seen that the upper bodies of the two animations are exactly the same. In terms of the bone hierarchy, that is, the upper body and its child bones are exactly the same. Here, the characteristic of the superimposed animation is the difference between the two animations. For the animation resources such as reloading and using medicine for non-vehicles, the difference from the non-vehicle BasePose is actually only the upper body that is different. Therefore, the BasePose of the above vehicle can directly use all the superimposed animations when using non-vehicles, including using medicine, reloading, inspecting shooting props, etc.
[0191] Then, the design and implementation process of the three states of the shooting prop on the vehicle, namely retracting, normal lifting, and folding lifting, will be described. In terms of the result, the final achieved effect is: given an angle range, the player will be forced to retract the shooting prop onto the leg within the specified angle range, and will automatically lift the shooting prop outside the angle range, at which time the player can fire. Outside these two states, if it is detected that the shooting prop will collide with the collider, folding processing will be performed.
[0192] During actual implementation, an animation resource is used to implement the actions of retracting and lifting the shooting prop. First, the art staff designed a Takeup animation. Playing it forward from the front to the back is the process of lifting the shooting prop; while playing it backward from the back to the front is the process of retracting the shooting prop. And in order to obtain the information of whether it is fully lifted or fully lowered, and to better connect during subsequent general operations, therefore, instead of using the normal animation playback node here, the EvaluateSequence node is used. Among them, the EvaluateSequence node samples the Pose of that frame from the corresponding time point of the animation resource through the input time. Therefore, when switching between the two behaviors of retracting and lifting the shooting prop on the vehicle, essentially the same animation is used, but sampled from different time points of the animation.
[0193] During actual implementation, two variables are maintained at the upper layer of the entire vehicle animation system, namely bShouldPutDown and TakeupTime. bShouldPutDown indicates whether the shooting prop needs to be retracted currently. The judgment condition is whether the current angle is within the set range. If not, the value is False. TakeupTime is the time point to be sampled input to the EvaluateSequence. For retracting and lifting the shooting prop, it can be increased or decreased frame by frame according to bShouldPutDown.
[0194] As an example, the process of performing general operations will be described using the reloading operation as an example. When putting away the shooting prop on the vehicle, if operations such as reloading are to be performed, the shooting prop needs to be lifted first and then the operation can be done. After the operation is completed, it is determined whether to put away the shooting prop again according to the current orientation. Therefore, there are two core concerns in the process of performing general operations in this application: one is that the operation time of performing general operations on the vehicle should be the same as that when performing general operations outside the vehicle, that is, the gameplay of general operations should not be affected by the actions of lifting and putting away the shooting prop; the other is that the whole process should be coherent and there should be no jumps. Therefore, the final solution adopted is that when putting away the prop for reloading, the reloading action outside the vehicle will be calculated first, then mixed with the BasePose of the vehicle, and the TakeupTime will be incremented; when the reloading is completed, the TakeupTime will be set to the length of the Takeup animation, that is, the end, and then the normal process of putting away the shooting prop will be followed. Here, since the Poses of different general operations are different during reloading, it can only be done through a mixing method. But after that, the normal animation of putting away the shooting prop can be played, and at this time, it returns to the normal process of switching the states of putting away the shooting prop and lifting the shooting prop.
[0195] See Figure 13 , Figure 13 is a schematic diagram of the update process of TakeupTime provided by an embodiment of this application. Based on Figure 13 , the update process of TakeupTime provided by an embodiment of this application is implemented through steps 1301 to 1304. Specifically, the obtained frame time is updated, and then it is judged whether a general operation is currently being performed. If a general operation is being performed, the next frame time is obtained. Then, based on the obtained next frame time, it is judged whether the general operation is over. When it is over, the end frame time is obtained, and then the normal process of putting away the shooting prop is followed. When it is not over, the processing of this frame time is ended, and the obtained frame time is updated again. If a general operation is not being performed, it is judged whether the shooting prop should be put away. When the shooting prop should be put away, it means that the general operation has been completed, and the previous frame time is obtained, that is, the takeup animation is played in reverse. When the shooting prop should not be put away, the next frame time is obtained. Then, based on the obtained next frame time, it is judged whether the general operation is over. When it is over, the end frame time is obtained, and then the normal process of putting away the shooting prop is followed. When it is not over, the processing of this frame time is ended, and the obtained frame time is updated again.
[0196] It should be noted that the frame time here is the time of each image frame. The next frame time is obtained by adding the unit frame time to the current frame time. Correspondingly, the previous frame time is obtained by subtracting the unit frame time from the current frame time. At the same time, after obtaining the frame time here, the image frame corresponding to this frame time in the animation can be determined, so as to process the image frame, that is, based on the image frame, to control the character to perform general operations during the process of the state of the shooting prop changing from being retracted to being lifted.
[0197] It should be noted that for the folded state of the shooting prop, the folded state itself is a function that exists when it is not a vehicle. Its purpose is to prevent the shooting prop from penetrating the collision body. Connecting the system of folding the shooting prop on the vehicle can ensure that there will be no penetration phenomenon during the complex retraction and lifting of the shooting prop and general operations. The folded shooting prop can be understood as a kind of post-processing. After the calculation of retracting and lifting the shooting prop and general operations is completed, it is calculated whether the shooting prop is in the folded state according to the position and orientation of the shooting prop at this time. It is equivalent to making a certain offset or rotation additionally after the animation calculation. Specifically, a ray is shot from the root point of the shooting prop, that is, the position of the character, in the direction of the shooting prop's orientation. The length of the ray is the length of the collision body of the shooting prop. If there is a contact point, it means that the shooting prop needs to be folded and lifted. According to the distance from the contact point to the virtual camera, if the distance does not exceed a certain range, only the shooting prop needs to be displaced backward by the corresponding distance (retracted folding state); if the distance exceeds a certain range, the shooting prop needs to be rotated by a preset value, and at this time only a small backward displacement needs to be set (rotated folding state), that is, mainly through rotation to avoid penetration.
[0198] In this way, this solution can implement first-person perspective shooting and other general operations inside the vehicle on a mobile platform, improve the fluency of the state conversion process of the shooting prop, and basically reuse the resources when it is not a vehicle. Compared with the related art where additional animation resources need to be created for the vehicle on the vehicle, this application saves a large amount of resources and has lower performance overhead.
[0199] Applying the above embodiments of the present application, when the virtual object is located in the virtual vehicle, it can directly respond to the shooting instruction triggered by the shooting control to control the virtual object to shoot outside the virtual vehicle. At the same time, during the shooting process of the virtual object, the whole of the virtual object is located inside the virtual vehicle. In this way, compared with the solution in the related art where the virtual object in the virtual vehicle must first lean out and then perform the shooting operation outside the virtual vehicle, the operation of controlling the virtual object to lean out is reduced, and the operation process of the shooting process in the virtual scene is simplified, which not only improves the shooting efficiency in the shooting scene, but also improves the human-computer interaction efficiency and the utilization rate of the hardware resources of the electronic device.
[0200] Next, the exemplary structure of the shooting device 455 in the virtual scene provided by the embodiments of the present application implemented as a software module will be further described. In some embodiments, as Figure 2 shown, the software module in the shooting device 455 in the virtual scene stored in the memory 450 may include:
[0201] A display module 4551, configured to display a virtual vehicle, a virtual object located in the virtual vehicle, and shooting controls in the virtual scene;
[0202] A control module 4552, configured to control the virtual object to shoot outside the virtual vehicle in response to a shooting instruction triggered based on the shooting control; wherein, during the shooting process of the virtual object, the whole of the virtual object is located inside the virtual vehicle.
[0203] In some embodiments, the device further includes a second control module, configured to control the virtual object to put the shooting prop in a folded and lifted state when there is an obstacle directly in front of the virtual object; wherein, the distance between the shooting prop in the folded and lifted state and the virtual object is less than the distance between the shooting prop in the normal lifted state and the virtual object; the control module 4552 is further configured to control the virtual object to use the shooting prop in the folded and lifted state to shoot outside the virtual vehicle in response to a shooting instruction triggered based on the shooting control.
[0204] In some embodiments, the virtual object is equipped with a shooting prop, and the device further includes a third control module, configured to control the virtual object to put the shooting prop in a retracted state when the orientation of the virtual object is within a target angle range; the control module 4552 is further configured to control the virtual object to gradually switch the state of the shooting prop from the retracted state to the lifted state in response to a shooting instruction triggered based on the shooting control; during the process of switching the state of the shooting prop from the retracted state to the lifted state, control the virtual object to use the shooting prop to shoot outside the virtual vehicle.
[0205] In some embodiments, the device further includes a fourth control module, configured to control the virtual object to switch the state of the shooting prop from the lifted state to the retracted state when the virtual object finishes shooting outside the virtual vehicle.
[0206] In some embodiments, the virtual object implements shooting at the exterior of the virtual vehicle based on a shooting prop, and the device further includes a configuration module configured to control the virtual object to configure key components of the shooting prop in response to a component configuration operation on the shooting prop; wherein, the key components of the shooting prop include at least one of the following: a telescopic sight, a virtual sub-prop corresponding to the shooting prop, a silencer, and a virtual gunstock.
[0207] In some embodiments, the configuration module is further configured to, when the shooting prop equipped by the virtual object is in a stowed state, in response to a configuration operation on the shooting prop, control the virtual object to gradually switch the state of the shooting prop from the stowed state to a raised state; and during the process of the state of the shooting prop being switched from the stowed state to the raised state, control the virtual object to configure the components of the shooting prop.
[0208] In some embodiments, the virtual object implements shooting at the exterior of the virtual vehicle based on a shooting prop, and the shooting prop includes at least one key component; the device further includes a detection module configured to detect the states of the respective key components of the shooting prop to obtain a detection result; wherein, the states include a normal state and a state to be configured; when the detection result indicates that a target key component among the at least one key component is in the state to be configured, a configuration prompt message is displayed, and the configuration prompt message is used to prompt to configure the target key component.
[0209] In some embodiments, the virtual object is equipped with a shooting prop, and the shooting prop is in a stowed state; the device further includes a fifth control module configured to control the virtual object to perform a perspective conversion in response to a perspective conversion instruction for the virtual object; when the orientation of the virtual object after the perspective conversion is not within a target angle range, control the virtual object to switch the state of the shooting prop from the stowed state to a raised state; the control module 4552 is further configured to control the virtual object to use the shooting prop in the raised state to shoot at the exterior of the virtual vehicle in response to a shooting instruction triggered based on a shooting control.
[0210] In some embodiments, the display module 4551 is further configured to display a virtual vehicle and a virtual object located outside the virtual vehicle in the virtual scene; wherein, when the virtual object is located outside the virtual vehicle, the shooting prop equipped by the virtual object is in the raised state; in response to a vehicle entry instruction for the virtual object, control the virtual object to enter the virtual vehicle, and control the virtual object to switch the state of the shooting prop from the raised state to the stowed state.
[0211] In some embodiments, the lifted state includes a folded-lifted state, and the distance between the shooting prop in the folded-lifted state and the virtual object is less than the distance between the shooting prop in the normal lifted state and the virtual object; the fifth control module is further configured to, when the orientation of the virtual object after perspective conversion is not within the target angle range, in response to the presence of an obstacle directly in front of the virtual object, control the virtual object to switch the state of the shooting prop from the retracted state to the folded-lifted state; the control module 4552 is further configured to, in response to a shooting instruction triggered based on a shooting control, control the virtual object to use the shooting prop in the folded-lifted state to shoot the exterior of the virtual vehicle.
[0212] In some embodiments, the virtual object is equipped with a shooting prop, and the shooting prop is in a retracted state; the control module 4552 is further configured to, in response to a shooting instruction triggered based on a shooting control, obtain a first shooting animation and a state-switching animation; wherein, the first shooting animation is used to indicate the process of the virtual object performing a shooting operation using the shooting prop in the lifted state when the virtual object is inside the virtual vehicle, and the state-switching animation is used to indicate the process of the virtual object switching the state of the shooting prop from the retracted state to the lifted state inside the virtual vehicle; fuse the first shooting animation and the state-switching animation to obtain a target shooting animation; wherein, the target shooting animation is used to indicate the animation process of the virtual object shooting the exterior of the virtual vehicle using the shooting prop during the process of switching the state of the shooting prop from the retracted state to the lifted state when the virtual object is inside the virtual vehicle; play the target shooting animation to display the process of the virtual object shooting the exterior of the virtual vehicle.
[0213] In some embodiments, the first shooting animation includes a plurality of first shooting image frames, the state-switching animation includes a plurality of state-switching image frames, and the number of first shooting image frames included in the first shooting animation is the same as the number of state-switching image frames included in the state-switching animation; the control module 4552 is further configured to perform the following processing for each of the first shooting image frames included in the first shooting animation to obtain a plurality of fused image frames: obtain the timestamp of the first shooting image frame, and based on the timestamp, obtain the state-switching image frame with the same timestamp from the state-switching animation; obtain the first weight of the first shooting image frame and the second weight of the state-switching image frame, and based on the first weight and the second weight, fuse the first shooting image frame and the state-switching image frame to obtain a fused image frame; combine the plurality of fused image frames to obtain the target shooting animation.
[0214] In some embodiments, the control module 4552 is further configured to obtain a first pose animation of the virtual object, a second shooting animation of the virtual object, and a second pose animation of the virtual object; wherein, the first pose animation is used to indicate the pose when the virtual object is outside the virtual vehicle and equips the shooting prop in a lifted state, the second shooting animation is used to indicate the process of the virtual object performing a shooting operation using the shooting prop in a lifted state when the virtual object is outside the virtual vehicle, the second pose animation is used to indicate the pose when the virtual object is inside the virtual vehicle and equips the shooting prop in a lifted state, and the upper body pose of the virtual object in the first pose animation is the same as that of the virtual object in the second pose animation; superimpose the first pose animation, the second shooting animation, and the second pose animation to obtain the first shooting animation.
[0215] In some embodiments, the first shooting animation includes a plurality of first shooting image frames, and the second shooting animation includes a plurality of second shooting image frames; the control module 4552 is further configured to perform the following processing on each of the second shooting image frames included in the second shooting animation to obtain a plurality of first shooting image frames: obtain the value of the pose parameter of the virtual object in the second shooting image frame and the value of the pose parameter of the virtual object in the first pose animation; subtract the pose parameter of the virtual object in the second shooting image frame from the value of the pose parameter of the virtual object in the first pose animation to obtain a pose difference; obtain the value of the pose parameter of the virtual object in the second pose animation, and add the pose difference to the value of the pose parameter of the virtual object in the second pose animation to obtain a first shooting image frame; combine the plurality of first shooting image frames to obtain the first shooting animation.
[0216] In some embodiments, the lifted state includes one of a folded lifted state and a normal lifted state, and the distance between the shooting prop in the folded lifted state and the virtual object is less than the distance between the shooting prop in the normal lifted state and the virtual object; the state switching animation includes a first state switching animation and a second state switching animation. The first state switching animation is used to indicate the process of switching the state of the shooting prop from the stowed state to the folded lifted state when the virtual object is inside the virtual vehicle, and the second state switching animation is used to indicate the process of switching the shooting prop from the stowed state to the normal lifted state when the virtual object is inside the virtual vehicle; the control module 4552 is further configured to detect the lifted state of the shooting prop in response to a shooting instruction triggered based on a shooting control, and obtain a detection result, where the detection result is used to indicate whether there is contact with other objects when the shooting prop is in the lifted state; if the detection result indicates that there is contact with other objects when the shooting prop is in the lifted state, determine that the lifted state of the shooting prop is the folded lifted state, and obtain the first shooting animation and the first state switching animation; if the detection result indicates that there is no contact with other objects when the shooting prop is in the lifted state, determine that the lifted state of the shooting prop is the normal lifted state, and obtain the first shooting animation and the second state switching animation.
[0217] In some embodiments, the control module 4552 is further configured to obtain the length of the shooting prop and the distance between the virtual object and the other object; compare the length of the shooting prop with the distance; if the comparison result indicates that the length of the shooting prop is less than the distance, obtain a detection result indicating that there is no contact with the other object when the shooting prop is in the lifted state; if the comparison result indicates that the length of the shooting prop is not less than the distance, obtain a detection result indicating that there is contact with the other object when the shooting prop is in the lifted state.
[0218] In some embodiments, the folded and lifted state includes a rearward folding state and a rotational folding state. The distance between the shooting prop in the rearward folded and lifted state and the virtual object is less than the distance between the shooting prop in the normal lifted state and the virtual object. The distance between the shooting prop in the rotational folded and lifted state and the virtual object is less than the distance between the shooting prop in the normal lifted state and the virtual object, and the shooting prop in the rotational folded and lifted state is rotated compared to the shooting prop in the normal lifted state. The first state transition animation includes a third state transition animation and a fourth state transition animation. The third state transition animation is used to indicate the process of switching the state of the shooting prop from the stowed state to the rearward folding state when the virtual object is inside the virtual vehicle. The fourth state transition animation is used to indicate the process of switching the state of the shooting prop from the stowed state to the rotational folding state when the virtual object is inside the virtual vehicle. The control module 4552 is further configured to obtain the contact point between the shooting prop and other objects, and obtain the distance between the contact point and the virtual camera corresponding to the virtual scene. If the distance is not greater than a distance threshold, determine that the folded and lifted state of the shooting prop is the rearward folding state, and obtain the first shooting animation and the third state transition animation. If the distance is greater than the distance threshold, determine that the folded and lifted state of the shooting prop is the rotational folding state, and obtain the first shooting animation and the fourth state transition animation.
[0219] An embodiment of the present application provides a computer program product, which includes computer-executable instructions stored in a computer-readable storage medium. The processor of the electronic device reads the computer-executable instructions from the computer-readable storage medium, and the processor executes the computer-executable instructions, so that the electronic device executes the shooting method in the virtual scene as described above in the embodiments of the present application.
[0220] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, where the computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, the processor will be caused to execute the shooting method in the virtual scene provided by the embodiments of the present application. For example, Figure 3 the shooting method in the virtual scene shown.
[0221] In some embodiments, the computer-readable storage medium may be a read-only memory (ROM), random access memory (RAM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), flash memory, magnetic surface memory, optical disc, or a memory such as a CD-ROM; it may also be various devices including one or any combination of the above memories.
[0222] In some embodiments, the computer-executable instructions may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including being deployed as an independent program or being deployed as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0223] As an example, the computer-executable instructions may or may not correspond to a file in the file system, may be stored as part of a file that stores other programs or data, for example, stored in one or more scripts in a hypertext markup language (HTML) document, stored in a single file dedicated to the program under discussion, or stored in multiple cooperating files (for example, files that store one or more modules, subroutines, or code portions).
[0224] As an example, the computer-executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one location, or, on multiple electronic devices distributed at multiple locations and interconnected by a communication network.
[0225] In summary, the embodiments of the present application have the following beneficial effects:
[0226] (1) Compared with the solution in the related art where the virtual object in the virtual vehicle must first lean out and then perform the shooting operation outside the virtual vehicle, the operation of controlling the virtual object to lean out is reduced, and the operation process of the shooting process in the virtual scene is simplified. This not only improves the shooting efficiency in the shooting scene, but also improves the human-computer interaction efficiency and the utilization rate of the hardware resources of the electronic device.
[0227] (2) Through the first weight and the second weight, the fusion effect of the image frames is made smoother and meets the requirements of the actual scene.
[0228] (3) Based on the shooting animation process when the virtual object is outside the virtual vehicle, determine the shooting animation process when the virtual object is inside the virtual vehicle. Compared with the related art solution that requires additional production of shooting animation resources for the virtual object on the virtual vehicle, a large amount of resources are saved, and resource consumption and performance overhead are reduced.
[0229] It should be noted that in the embodiments of the present application, relevant data such as obtaining the operation data of the user is involved. When the embodiments of the present application are applied to specific products or technologies, user permission or consent needs to be obtained, and the collection, use, and processing of relevant data need to comply with relevant laws, regulations, and standards in relevant countries and regions.
[0230] The above are only the embodiments of the present application and are not intended to limit the protection scope of the present application. Any modifications, equivalent replacements, and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.
Claims
1. A shooting method in a virtual scenario, characterized in that, The method includes: In a virtual scenario, display a virtual vehicle, a virtual object located in the virtual vehicle, and a shooting control; In response to a shooting instruction triggered based on the shooting control, control the virtual object to shoot outside the virtual vehicle; Wherein, during the shooting process of the virtual object, the whole of the virtual object is located inside the virtual vehicle.
2. The method according to claim 1, characterized in that, The virtual object is equipped with a shooting prop. After displaying the virtual vehicle, the virtual object located in the virtual vehicle, and the shooting control in the virtual scenario, the method further includes: When there is an obstacle in front of the virtual object, control the virtual object to put the shooting prop in a folded and lifted state; Wherein, the distance between the shooting prop in the folded and lifted state and the virtual object is less than the distance between the shooting prop in the normal lifted state and the virtual object; The step of, in response to a shooting instruction triggered based on the shooting control, controlling the virtual object to shoot outside the virtual vehicle includes: In response to a shooting instruction triggered based on the shooting control, control the virtual object to use the shooting prop in the folded and lifted state to shoot outside the virtual vehicle.
3. The method according to claim 1, characterized in that, The virtual object is equipped with a shooting prop. After displaying the virtual vehicle, the virtual object located in the virtual vehicle, and the shooting control in the virtual scenario, the method further includes: When the orientation of the virtual object is within a target angle range, control the virtual object to put the shooting prop in a retracted state; The step of, in response to a shooting instruction triggered based on the shooting control, controlling the virtual object to shoot outside the virtual vehicle includes: In response to a shooting instruction triggered based on the shooting control, control the virtual object to gradually switch the state of the shooting prop from the retracted state to the lifted state; During the process of switching the state of the shooting prop from the retracted state to the lifted state, control the virtual object to use the shooting prop to shoot outside the virtual vehicle.
4. The method according to claim 3, characterized in that, After the step of controlling the virtual object to use the shooting prop to shoot outside the virtual vehicle, the method further includes: When the virtual object finishes shooting outside the virtual vehicle, control the virtual object to switch the state of the shooting prop from the lifted state to the retracted state.
5. The method according to claim 1, characterized in that, Before the step of, in response to a shooting instruction triggered based on the shooting control, controlling the virtual object to shoot outside the virtual vehicle, where the virtual object realizes shooting outside the virtual vehicle based on the shooting prop, the method further includes: In response to a component configuration operation for the shooting prop, control the virtual object to configure key components of the shooting prop; Wherein, the key components of the shooting prop include at least one of the following: a scope, a virtual sub-prop corresponding to the shooting prop, a silencer, a virtual gunstock.
6. The method according to claim 5, characterized in that, The step of, in response to a configuration operation for the shooting prop, controlling the virtual object to configure components of the shooting prop includes: When the shooting prop equipped by the virtual object is in the retracted state, in response to a configuration operation for the shooting prop, control the virtual object to gradually switch the state of the shooting prop from the retracted state to the lifted state; During the process of the state of the shooting prop switching from the retracted state to the lifted state, control the virtual object to configure the components of the shooting prop.
7. The method according to claim 1, characterized in that, The virtual object realizes shooting at the outside of the virtual vehicle based on the shooting prop, and the shooting prop includes at least one key component; The method further includes: Detect the states of the respective key components of the shooting prop to obtain a detection result; wherein, the states include a normal state and a state to be configured; When the detection result indicates that a target key component among the at least one key component is in the state to be configured, display a configuration prompt message for prompting configuration of the target key component.
8. The method according to claim 1, characterized in that, The virtual object is equipped with a shooting prop, and the shooting prop is in the retracted state; Before controlling the virtual object to shoot at the outside of the virtual vehicle in response to a shooting instruction triggered based on a shooting control, the method further includes: In response to a perspective conversion instruction for the virtual object, control the virtual object to perform perspective conversion; When the orientation of the virtual object after perspective conversion is not within a target angle range, control the virtual object to switch the state of the shooting prop from the retracted state to the lifted state; The controlling the virtual object to shoot at the outside of the virtual vehicle in response to a shooting instruction triggered based on a shooting control includes: In response to a shooting instruction triggered based on a shooting control, control the virtual object to use the shooting prop in the lifted state to shoot at the outside of the virtual vehicle.
9. The method according to claim 8, wherein The displaying a virtual vehicle and a virtual object located in the virtual vehicle in the virtual scene includes: In the virtual scene, display a virtual vehicle and a virtual object located outside the virtual vehicle; Wherein, when the virtual object is located outside the virtual vehicle, the shooting prop equipped by the virtual object is in the lifted state; In response to a vehicle entry instruction for the virtual object, control the virtual object to enter the virtual vehicle, and control the virtual object to switch the state of the shooting prop from the lifted state to the retracted state.
10. The method according to claim 8, wherein The lifted state includes a folded-lifted state and a normal-lifted state, and the distance between the shooting prop in the folded-lifted state and the virtual object is less than the distance between the shooting prop in the normal-lifted state and the virtual object; The when the orientation of the virtual object after perspective conversion is not within a target angle range, controlling the virtual object to switch the state of the shooting prop from the retracted state to the lifted state includes: When the orientation of the virtual object after perspective conversion is not within a target angle range, in response to an obstacle existing directly in front of the virtual object, control the virtual object to switch the state of the shooting prop from the retracted state to the folded-lifted state; In response to a shooting instruction triggered based on a shooting control, controlling the virtual object to use the shooting prop in the lifted state to shoot the exterior of the virtual vehicle, includes: In response to a shooting instruction triggered based on a shooting control, controlling the virtual object to use the shooting prop in the folded and lifted state to shoot the exterior of the virtual vehicle.
11. The method according to claim 1, wherein The virtual object is equipped with a shooting prop, and the shooting prop is in a stowed state; In response to a shooting instruction triggered based on a shooting control, controlling the virtual object to shoot the exterior of the virtual vehicle, includes: In response to a shooting instruction triggered based on a shooting control, obtaining a first shooting animation and a state transition animation; Wherein, the first shooting animation is used to indicate the process of the virtual object performing a shooting operation using the shooting prop in the lifted state when the virtual object is inside the virtual vehicle, and the state transition animation is used to indicate the process of the virtual object switching the state of the shooting prop from the stowed state to the lifted state inside the virtual vehicle; Fusing the first shooting animation and the state transition animation to obtain a target shooting animation; Wherein, the target shooting animation is used to indicate the animation process of the virtual object shooting the exterior of the virtual vehicle using the shooting prop during the process of switching the state of the shooting prop from the stowed state to the lifted state when the virtual object is inside the virtual vehicle; Playing the target shooting animation to display the process of the virtual object shooting the exterior of the virtual vehicle.
12. The method according to claim 11, wherein The first shooting animation includes a plurality of first shooting image frames, the state transition animation includes a plurality of state transition image frames, and the number of first shooting image frames included in the first shooting animation is the same as the number of state transition image frames included in the state transition animation; Fusing the first shooting animation and the state transition animation to obtain a target shooting animation, includes: For each of the first shooting image frames included in the first shooting animation, perform the following processing respectively to obtain a plurality of fused image frames: Obtain the timestamp of the first shooting image frame, and based on the timestamp, obtain the state transition image frame with the same timestamp from the state transition animation; Obtain the first weight of the first shooting image frame and the second weight of the state transition image frame, and based on the first weight and the second weight, fuse the first shooting image frame and the state transition image frame to obtain a fused image frame; Combining a plurality of fused image frames to obtain the target shooting animation.
13. The method according to claim 11, wherein Obtaining the first shooting animation, includes: Obtaining the first pose animation of the virtual object, the second shooting animation of the virtual object, and the second pose animation of the virtual object; Among them, the first posture animation is used to indicate the posture when the virtual object equips the shooting prop in the lifted state when outside the virtual vehicle. The second shooting animation is used to indicate the process of the virtual object performing a shooting operation using the shooting prop in the lifted state when outside the virtual vehicle. The second posture animation is used to indicate the posture when the virtual object equips the shooting prop in the lifted state when inside the virtual vehicle. The upper body postures of the virtual object in the first posture animation and the virtual object in the second posture animation are the same; Overlay the first posture animation, the second shooting animation, and the second posture animation to obtain the first shooting animation.
14. The method according to claim 13, wherein The first shooting animation includes a plurality of first shooting image frames, and the second shooting animation includes a plurality of second shooting image frames; The overlaying of the first posture animation, the second shooting animation, and the second posture animation to obtain the first shooting animation includes: For each of the second shooting image frames included in the second shooting animation, perform the following processing respectively to obtain a plurality of first shooting image frames: Obtain the value of the posture parameter of the virtual object in the second shooting image frame and the value of the posture parameter of the virtual object in the first posture animation; Subtract the posture parameter of the virtual object in the second shooting image frame from the value of the posture parameter of the virtual object in the first posture animation to obtain a posture difference; Obtain the value of the posture parameter of the virtual object in the second posture animation, and add the posture difference to the value of the posture parameter of the virtual object in the second posture animation to obtain a first shooting image frame; Combine a plurality of first shooting image frames to obtain the first shooting animation.
15. The method according to claim 11, wherein The lifted state includes one of a folded lifted state and a normal lifted state. The distance between the shooting prop in the folded lifted state and the virtual object is less than the distance between the shooting prop in the normal lifted state and the virtual object; The state switching animation includes a first state switching animation and a second state switching animation. The first state switching animation is used to indicate the process of switching the state of the shooting prop from a stowed state to a folded lifted state when the virtual object is inside the virtual vehicle. The second state switching animation is used to indicate the process of switching the shooting prop from a stowed state to a normal lifted state when the virtual object is inside the virtual vehicle; Responding to a shooting instruction triggered based on a shooting control to obtain the first shooting animation and the state switching animation includes: Responding to a shooting instruction triggered based on a shooting control, detecting the lifted state of the shooting prop to obtain a detection result, where the detection result is used to indicate whether there is contact with other objects when the shooting prop is in the lifted state; If the detection result indicates that there is contact with other objects when the shooting prop is in the lifted state, determine that the lifted state of the shooting prop is the folded and lifted state, and obtain the first shooting animation and the first state transition animation; If the detection result indicates that there is no contact with other objects when the shooting prop is in the lifted state, determine that the lifted state of the shooting prop is the normal lifted state, and obtain the first shooting animation and the second state transition animation.
16. The method according to claim 15, wherein, The detection of the lifted state of the shooting prop to obtain a detection result includes: Obtain the length of the shooting prop and the distance between the virtual object and the other object; Compare the length of the shooting prop with the distance; If the comparison result indicates that the length of the shooting prop is less than the distance, obtain a detection result indicating that there is no contact with the other object when the shooting prop is in the lifted state; If the comparison result indicates that the length of the shooting prop is not less than the distance, obtain a detection result indicating that there is contact with the other object when the shooting prop is in the lifted state.
17. The method according to claim 15, wherein, The folded and lifted state includes a backward movement and folding state and a rotation and folding state. The distance between the shooting prop in the backward movement and folding lifted state and the virtual object is less than the distance between the shooting prop in the normal lifted state and the virtual object; The distance between the shooting prop in the rotation and folding lifted state and the virtual object is less than the distance between the shooting prop in the normal lifted state and the virtual object, and it has rotated compared to the shooting prop in the normal lifted state; The first state transition animation includes a third state transition animation and a fourth state transition animation. The third state transition animation is used to indicate the process of switching the state of the shooting prop from the retracted state to the backward movement and folding state when the virtual object is inside the virtual vehicle. The fourth state transition animation is used to indicate the process of switching the state of the shooting prop from the retracted state to the rotation and folding state when the virtual object is inside the virtual vehicle; The obtaining of the first shooting animation and the first state transition animation includes: Obtain the contact point between the shooting prop and the other object, and obtain the distance between the contact point and the virtual camera corresponding to the virtual scene; If the distance is not greater than the distance threshold, determine that the folded and lifted state of the shooting prop is the backward movement and folding state, and obtain the first shooting animation and the third state transition animation; If the distance is greater than the distance threshold, determine that the folded and lifted state of the shooting prop is the rotation and folding state, and obtain the first shooting animation and the fourth state transition animation.
18. A shooting device in a virtual scenario, characterized in that, The device includes: A display module for displaying a virtual vehicle, a virtual object located in the virtual vehicle, and a shooting control in a virtual scene; A control module, configured to control the virtual object to shoot at the exterior of the virtual vehicle in response to a shooting instruction triggered based on a shooting control; wherein, during the shooting process of the virtual object, the whole of the virtual object is located inside the virtual vehicle.
19. An electronic device, characterized in that, Comprising: A memory, configured to store computer-executable instructions; A processor, configured to implement the shooting method in the virtual scenario according to any one of claims 1 to 17 when executing the computer-executable instructions stored in the memory.
20. A computer-readable storage medium, characterized in that, Stored with computer-executable instructions, configured to cause the processor to implement the shooting method in the virtual scenario according to any one of claims 1 to 17 when executed.
21. A computer program product, including computer-executable instructions, characterized in that, When the computer-executable instructions are executed by the processor, the shooting method in the virtual scenario according to any one of claims 1 to 17 is implemented.