A control method and device of a flying prop in a virtual scene, and an electronic device
Patent Information
- Application Number
- CN202310684709.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-09
- Publication Date
- 2026-10-20
- Estimated Expiration
- 2043-06-09
AI Technical Summary
[0052]以上可见,应用本申请实施例提供的方案,可以接收用户发送的针对虚拟场景中的飞行道具的包括方向信息和速度信息的操作指令;之后,响应于上述操作指令,可以控制飞行道具在虚拟场景中,以上述方向信息所指示的方向为起始方向,且以上述速度信息所指示的速度为起始速度,进行基准运动;接着,在该飞行道具在虚拟场景中进行基准运动的运动状态达到预设状态时,可以控制飞行道具进行基准运动与关于与基准运动的运动方向不同的目标方向上的目标速度参数的辅助运动的和运动;其中,目标速度参数包括:目标速度或者目标加速度;进而,在检测到该飞行道具在虚拟场景中的运动状态满足预设停止条件时,便可以控制飞行道具停止运动。
Smart Images

Figure CN116688514B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of game technology, and in particular to a method, device, and electronic device for controlling flying props in a virtual scene. Background Technology
[0002] In various games, users can send operation commands to control game characters in the virtual scene to use various flying props to achieve corresponding game effects.
[0003] Among them, flying props are virtual props that can be used directly or indirectly by game characters in the virtual scene corresponding to the game, and can move in the air in the virtual scene. Examples include cannonballs and smoke bombs in the virtual scene.
[0004] Typically, after receiving the user's operation command for the flying prop in the virtual scene, the system can control the flying prop to fly in the air of the virtual scene with a parabolic trajectory based on the operation command.
[0005] The top-down view of the flight prop's trajectory in the virtual scene is shown in Figure 1(a). The parabolic flight trajectory of the flight prop can be termed projectile motion.
[0006] Therefore, how to control the movement of flying props in virtual scenes, enrich the movement trajectory of flying props, and thus improve the user experience is a technical problem that urgently needs to be solved. Summary of the Invention
[0007] The purpose of this application is to provide a control method, device, and electronic device for flying props in a virtual scene, so as to increase the diversity of the movement trajectory of the flying props and thus improve the user experience. The specific technical solution is as follows:
[0008] In a first aspect, embodiments of this application provide a method for controlling a flying prop in a virtual scene, the method comprising:
[0009] The system receives operation commands from a user for flying props in a virtual scene; wherein the virtual scene is a three-dimensional scene; and the operation commands include: direction information and speed information.
[0010] In response to the operation command, the flight prop is controlled to perform a reference movement in the virtual scene, with the direction indicated by the direction information as the starting direction and the speed indicated by the speed information as the starting speed;
[0011] When the flight prop reaches a preset state during the reference motion, the flight prop is controlled to perform a combined motion of the reference motion and an auxiliary motion with respect to a target velocity parameter in the target direction; wherein the target direction is different from the direction of the reference motion; the target velocity parameter includes: target velocity or target acceleration;
[0012] When the motion state of the flying prop meets the preset stopping conditions, the flying prop is controlled to stop moving.
[0013] Optionally, in one specific implementation, the method further includes:
[0014] During the movement of the flying prop, a scene image including the flying prop is displayed, captured by a preset virtual camera; wherein, the preset virtual camera is a virtual camera set up in the virtual scene for the flying prop.
[0015] Optionally, in one specific implementation, the method further includes:
[0016] Within a preset time period for controlling the flight prop to stop moving, the scene screen of the stopping position reached by the flight prop in the virtual scene is displayed.
[0017] Optionally, in one specific implementation, the target acceleration includes: a first acceleration and a second acceleration, and the target direction includes: a first direction and a second direction;
[0018] The control of the flight prop to perform the base motion and the auxiliary motion with respect to the target velocity parameter in the target direction includes:
[0019] Control the flight prop to perform the base motion and the auxiliary motion with respect to the first acceleration in the first direction;
[0020] When the motion state of the flight prop in the first direction reaches a first preset condition, the flight prop is controlled to perform a combined motion of the reference motion and the auxiliary motion with respect to the second acceleration in the second direction; wherein, the first preset condition includes: a first set speed;
[0021] When the motion state of the flight prop in the second direction reaches the second preset condition, the step of controlling the flight prop to perform the reference motion and the auxiliary motion with respect to the first acceleration in the first direction is returned; wherein, the second preset condition includes: a second set speed.
[0022] Optionally, in one specific implementation, the target speed includes: a first speed and a second speed, and the target direction includes: a third direction and a fourth direction;
[0023] The control of the flight prop to perform the base motion and the auxiliary motion with respect to the target velocity parameter in the target direction includes:
[0024] Control the flight prop to perform the base motion and the auxiliary motion with respect to the first velocity in the third direction;
[0025] When the flight prop reaches a third preset condition in its motion state in the third direction, the flight prop is controlled to perform a combined motion of the reference motion and the auxiliary motion with respect to the second speed in the fourth direction; wherein, the third preset condition includes: a first preset duration;
[0026] When the motion state of the flight prop in the fourth direction reaches the fourth preset condition, the step of controlling the flight prop to perform the reference motion and the auxiliary motion with respect to the first speed in the third direction is returned; wherein, the fourth preset condition includes: a second preset duration.
[0027] Secondly, embodiments of this application provide a control device for a flying prop in a virtual scene, the device comprising:
[0028] The instruction receiving module is used to receive operation instructions sent by the user for flying props in a virtual scene; wherein, the virtual scene is a three-dimensional scene; the operation instructions include: direction information and speed information;
[0029] The instruction response module is used to respond to the operation instruction and control the flight prop to perform a reference movement in the virtual scene, with the direction indicated by the direction information as the starting direction and the speed indicated by the speed information as the starting speed.
[0030] The first control module is configured to, when the flight prop is in the motion state of the reference motion and reaches a preset state, control the flight prop to perform a combined motion of the reference motion and an auxiliary motion with respect to a target velocity parameter in the target direction; wherein the target direction is different from the motion direction of the reference motion; the target velocity parameter includes: target velocity or target acceleration;
[0031] The second control module is used to control the flight prop to stop moving when the motion state of the flight prop is detected to meet the preset stopping conditions.
[0032] Optionally, in one specific implementation, the apparatus further includes:
[0033] The first display module is used to display a scene image including the flying prop captured by a preset virtual camera during the movement of the flying prop; wherein the preset virtual camera is a virtual camera set for the flying prop in the virtual scene.
[0034] Optionally, in one specific implementation, the apparatus further includes:
[0035] The second display module is used to display the scene of the stopping position reached by the flying prop in the virtual scene within a preset time period after controlling the flying prop to stop moving.
[0036] Optionally, in one specific implementation, the target acceleration includes: a first acceleration and a second acceleration, and the target direction includes: a first direction and a second direction;
[0037] The first control module is specifically used for:
[0038] Control the flight prop to perform the base motion and the auxiliary motion with respect to the first acceleration in the first direction;
[0039] When the motion state of the flight prop in the first direction reaches a first preset condition, the flight prop is controlled to perform a combined motion of the reference motion and the auxiliary motion with respect to the second acceleration in the second direction; wherein, the first preset condition includes: a first set speed;
[0040] When the motion state of the flight prop in the second direction reaches the second preset condition, the step of controlling the flight prop to perform the reference motion and the auxiliary motion with respect to the first acceleration in the first direction is returned; wherein, the second preset condition includes: a second set speed.
[0041] Optionally, in one specific implementation, the target speed includes: a first speed and a second speed, and the target direction includes: a third direction and a fourth direction;
[0042] The first control module is specifically used for:
[0043] Control the flight prop to perform the base motion and the auxiliary motion with respect to the first velocity in the third direction;
[0044] When the flight prop reaches a third preset condition in its motion state in the third direction, the flight prop is controlled to perform a combined motion of the reference motion and the auxiliary motion with respect to the second speed in the fourth direction; wherein, the third preset condition includes: a first preset duration;
[0045] When the motion state of the flight prop in the fourth direction reaches the fourth preset condition, the step of controlling the flight prop to perform the reference motion and the auxiliary motion with respect to the first speed in the third direction is returned; wherein, the fourth preset condition includes: a second preset duration.
[0046] Thirdly, embodiments of this application provide an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0047] Memory, used to store computer programs;
[0048] When a processor executes a program stored in memory, it implements the steps of any of the above method embodiments.
[0049] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of any of the above method embodiments.
[0050] Fifthly, embodiments of this application also provide a computer program product containing instructions that, when run on a computer, cause the computer to perform the steps of any of the above method embodiments.
[0051] Beneficial effects of the embodiments in this application:
[0052] As can be seen from the above, by applying the solution provided in this application embodiment, an operation command including direction information and speed information sent by a user for a flying prop in a virtual scene can be received. Then, in response to the above operation command, the flying prop can be controlled to perform a reference movement in the virtual scene, with the direction indicated by the above direction information as the starting direction and the speed indicated by the above speed information as the starting speed. Next, when the motion state of the flying prop in the virtual scene reaches a preset state, the flying prop can be controlled to perform a combined motion of the reference movement and an auxiliary movement with respect to a target speed parameter in a target direction different from the motion direction of the reference movement. The target speed parameter includes a target speed or a target acceleration. Furthermore, when it is detected that the motion state of the flying prop in the virtual scene meets a preset stopping condition, the flying prop can be controlled to stop moving.
[0053] Based on this, by applying the solution provided in the embodiments of this application, while responding to the user's operation commands and controlling the flying prop to perform a baseline motion, it is also possible to control the flying prop to perform auxiliary motion based on a target speed or target acceleration in a motion direction different from the aforementioned baseline motion. In this way, the motion performed by the flying prop is the sum of the aforementioned baseline motion and the aforementioned auxiliary motion, and the trajectory of the flying prop is the trajectory formed by performing the aforementioned sum of motions. This trajectory is more fluid than the trajectory of the baseline motion performed in response to the user's operation commands, thereby allowing the user to experience the diversity and uncertainty of the flying prop's trajectory, thus increasing the game's fun and improving the user experience. Attached Figure Description
[0054] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other embodiments can be obtained based on these drawings.
[0055] Figure 1(a)-Figure 1(c) These are schematic diagrams illustrating the motion trajectory of the flight props provided in the embodiments of this application;
[0056] Figure 2 A flowchart illustrating a method for controlling a flying prop in a virtual scene, provided in an embodiment of this application;
[0057] Figure 3 Another schematic diagram illustrating the motion trajectory of the flight prop provided in the embodiments of this application;
[0058] Figure 4 A flowchart illustrating another method for controlling a flying prop in a virtual scene, provided in an embodiment of this application;
[0059] Figures 5(a)-5(b) These are schematic diagrams illustrating a scene provided in an embodiment of this application;
[0060] Figure 6 A flowchart illustrating another method for controlling a flying prop in a virtual scene, provided in an embodiment of this application;
[0061] Figure 7 A schematic diagram of another scene provided in an embodiment of this application;
[0062] Figure 8 A flowchart illustrating another method for controlling a flying prop in a virtual scene, provided in an embodiment of this application;
[0063] Figure 9A flowchart illustrating a specific example of a control method for a flying prop in a virtual scene provided in this application embodiment;
[0064] Figure 10 Another schematic diagram illustrating the motion trajectory of the flight prop provided in the embodiments of this application;
[0065] Figure 11 A schematic diagram of the structure of a control device for a flying prop in a virtual scene provided in an embodiment of this application;
[0066] Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0067] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of this application.
[0068] Therefore, how to control the movement of flying props in virtual scenes, enrich the movement trajectory of flying props, and thus increase the fun of the game, is a technical problem that urgently needs to be solved.
[0069] To address the aforementioned technical problems, this application provides a method for controlling flying props in a virtual scene.
[0070] This method is applicable to various application scenarios that require control of flying props in virtual scenes. For example, in combat games, it controls the projectiles fired by game characters in virtual scenes; in flight games, it controls the flying props ridden by game characters in virtual scenes.
[0071] Furthermore, this method can be applied to various electronic devices that can run applications that include virtual scenes and flying props within those virtual scenes, such as mobile phones, tablets, and laptops.
[0072] Therefore, the embodiments of this application do not specifically limit the application scenarios and execution entities of the method.
[0073] The control method for a flying prop in a virtual scene provided in this application embodiment may include the following steps:
[0074] The system receives operation commands from a user for flying props in a virtual scene; wherein the virtual scene is a three-dimensional scene; and the operation commands include: direction information and speed information.
[0075] In response to the operation command, the flight prop is controlled to perform a reference movement in the virtual scene, with the direction indicated by the direction information as the starting direction and the speed indicated by the speed information as the starting speed;
[0076] When the flight prop reaches a preset state during the reference motion, the flight prop is controlled to perform a combined motion of the reference motion and an auxiliary motion with respect to a target velocity parameter in the target direction; wherein the target direction is different from the direction of the reference motion; the target velocity parameter includes: target velocity or target acceleration;
[0077] When the motion state of the flying prop meets the preset stopping conditions, the flying prop is controlled to stop moving.
[0078] As can be seen from the above, by applying the solution provided in this application embodiment, an operation command including direction information and speed information sent by a user for a flying prop in a virtual scene can be received. Then, in response to the above operation command, the flying prop can be controlled to perform a reference movement in the virtual scene, with the direction indicated by the above direction information as the starting direction and the speed indicated by the above speed information as the starting speed. Next, when the motion state of the flying prop in the virtual scene reaches a preset state, the flying prop can be controlled to perform a combined motion of the reference movement and an auxiliary movement with respect to a target speed parameter in a target direction different from the motion direction of the reference movement. The target speed parameter includes a target speed or a target acceleration. Furthermore, when it is detected that the motion state of the flying prop in the virtual scene meets a preset stopping condition, the flying prop can be controlled to stop moving.
[0079] Based on this, by applying the solution provided in the embodiments of this application, while responding to the user's operation commands and controlling the flying prop to perform a baseline motion, it can also control the flying prop to perform auxiliary motion based on a target velocity or target acceleration in a motion direction different from the aforementioned baseline motion. Thus, the motion performed by the flying prop is the sum of the aforementioned baseline motion and the aforementioned auxiliary motion, and the trajectory of the flying prop is the trajectory formed by performing the aforementioned sum of motions. Compared to the trajectory obtained by controlling the flying prop to perform a baseline motion in response to the user's operation commands, this trajectory is more fluid, allowing the user to experience the diversity and uncertainty of the flying prop's trajectory, thereby increasing the game's fun and improving the user experience.
[0080] To better understand the control method for flying props in a virtual scene provided in the embodiments of this application, the virtual scene and flying props in the virtual scene involved in the embodiments of this application will be described first.
[0081] A virtual scene is a virtual scene displayed when an application runs on an electronic device. This virtual scene can be an environment that simulates the real world, a semi-simulated / semi-fictional environment, or a purely fictional environment. Furthermore, virtual scenes within the same application can include at least one of two-dimensional, 2.5-dimensional, and three-dimensional scenes; in this embodiment, the virtual scene can be a three-dimensional scene.
[0082] In addition, virtual scenes can include virtual objects and virtual props.
[0083] In this context, a virtual object refers to a virtual character that can move within a virtual scene. This virtual character can be a virtual person, a virtual animal, an anime character, etc. Furthermore, a virtual scene includes multiple virtual objects, each with its own shape and volume, occupying a portion of the space within the virtual scene.
[0084] Optionally, users can select a target object from a number of virtual objects in a virtual scene to represent them, allowing users to manipulate the target object in the virtual scene via an electronic device.
[0085] Virtual items refer to usable props within a virtual environment. Taking combat games as an example, combat games feature throwable items, as well as virtual launchers and virtual launch objects. Virtual launch objects are the objects launched when the virtual launcher is used to execute a launch operation.
[0086] Furthermore, by controlling virtual objects to use virtual props, a certain purpose can be achieved. For example, controlling virtual objects to use virtual smoke bombs can help virtual objects conceal their bodies.
[0087] In addition, virtual props can include ground props and flying props.
[0088] A flying prop refers to a virtual prop in a virtual scene that can be used directly or indirectly by virtual objects and can fly in the virtual scene under the action of external forces. Examples include rockets, cannonballs, and crossbows.
[0089] Taking a game application that includes a 3D virtual scene and flying props in the virtual scene as an example, when users are playing the game, they can send operation commands to the electronic device for the flying props in the virtual scene.
[0090] Optionally, it can be used to send operation commands for flying props to electronic devices by clicking on flying props in a virtual scene or by launching flying props that include flying props with a mouse.
[0091] Optionally, users can send operation commands for flying props to electronic devices by touching flying props in the virtual scene or by using a flying prop launcher that includes flying props.
[0092] Optionally, users can send operation commands for flying props in the virtual scene to electronic devices by selecting the control options related to flying props.
[0093] Furthermore, the operation commands sent by the user can include speed and direction information for the movement of the flying prop.
[0094] In this way, when the electronic device receives the operation command sent by the user, it can respond to the operation command and control the flying props in the virtual scene to move.
[0095] For example, a user can send an operation command, including initial velocity and initial direction information, to an electronic device by selecting a control option related to the projectile. Upon receiving this command, the electronic device can control the target object representing the user in the virtual scene to operate the projectile launcher, guiding it to aim in the direction indicated by the initial direction. Then, when the projectile launcher detects that it has met the preset firing conditions, it can control the projectile to leave the launcher and then move with the initial velocity and initial direction as its starting velocity and starting direction.
[0096] During the projectile motion, the projectile will undergo a parabolic trajectory under the influence of gravity.
[0097] With the initial direction being diagonally upward and the angle between the projectile and the horizontal plane being θ, and the initial velocity being v0, the projectile can be launched diagonally upward. Thus, the projectile will undergo oblique projectile motion with v0 as the initial velocity and diagonally upward as the initial direction. The side view and top view of the projectile's trajectory in the virtual scene are shown in Figure 1(a) and Figure 1(b), respectively.
[0098] Furthermore, as shown in Figure 1(c), the initial velocity v0 of the projectile can be decomposed into a horizontal initial velocity v0cosθ in the horizontal direction and a vertical initial velocity v0sinθ in the vertical direction.
[0099] Based on this, the trajectory equation of the projectile undergoing oblique projectile motion can be expressed as:
[0100]
[0101] Where g is the acceleration due to gravity.
[0102] Furthermore, the range X and altitude Y of this shell can be expressed as follows:
[0103]
[0104]
[0105] Among them, the range X of the shell refers to the horizontal distance between the starting point and the stopping position of the shell in the virtual scene, and the height Y of the shell refers to the highest position reached by the shell in the vertical direction during the oblique projectile motion.
[0106] However, in real-world scenarios, during the movement of a flying prop in a virtual environment, in addition to gravity, it can also be subjected to other forces different from its direction of motion. For example, it may experience air resistance opposite to its direction of motion, or crosswind resistance from a wind direction different from its direction of motion. Therefore, when a flying prop is subjected to other forces, its motion will be affected by these forces, and its trajectory may also change due to the action of these other forces.
[0107] The following, with reference to the accompanying drawings, provides a detailed description of a method for controlling a flying prop in a virtual scene according to an embodiment of this application.
[0108] Figure 2 A flowchart illustrating a method for controlling a flying prop in a virtual scene, as provided in an embodiment of this application, is shown below. Figure 2 As shown, the method may include the following steps S201-S204.
[0109] S201: Receive user-sent operation commands for flying props in a virtual scene;
[0110] The virtual scene is a three-dimensional scene; the operation instructions include: direction information and speed information;
[0111] As mentioned earlier, taking a game application that includes a three-dimensional virtual scene and flying props as an example, when a user wants to experience the game, they can run the game application on an electronic device, and the electronic device can then display the virtual scene corresponding to the application.
[0112] The virtual scene can be a three-dimensional scene.
[0113] When a user wants to control the movement of a flying prop in the virtual scene, they can send operation commands to the electronic device. The electronic device can then receive these commands.
[0114] The aforementioned operation instructions may include direction information and speed information.
[0115] Optionally, when a user sends operation commands to a virtual prop by interacting with it, the electronic device can determine the direction and speed information in the command based on the force of the operation, the duration of the interaction, or the direction of the interaction. If the electronic device supports touchscreen control, the user can interact with the virtual prop using their fingers. In this case, the electronic device can determine the direction and speed information based on the force and direction of the user's finger interaction with the prop.
[0116] S202: In response to the operation command, control the flight prop in the virtual scene to perform a reference movement with the direction indicated by the direction information as the starting direction and the speed indicated by the speed information as the starting speed;
[0117] Upon receiving the aforementioned operation command, in response to the aforementioned operation command, the electronic device can control the flying prop in the virtual scene indicated by the aforementioned operation command to perform a reference movement with the direction indicated by the direction information in the aforementioned operation command as the starting direction and the speed indicated by the aforementioned speed information as the initial speed.
[0118] S203: When the flight prop reaches the preset state of the reference motion, control the flight prop to perform the sum of the reference motion and the auxiliary motion about the target velocity parameter in the target direction;
[0119] The target direction differs from the reference motion direction; the target velocity parameters include: target velocity or target acceleration.
[0120] To increase the diversity of the flight paths of projectiles, and thus enhance the realism and fun of the game, the flight path can be controlled to vary its motion under the influence of forces other than gravity during its baseline motion.
[0121] Since force can change the state of motion of an object, the current state of motion of a flying prop will change under the action of other forces during the reference motion. In other words, the effect of other forces on the flying prop can be reflected in the motion parameters of the flying prop in the direction indicated by the other forces.
[0122] Based on this, in order to simulate the flight prop being acted upon by forces other than gravity, the flight prop can be controlled to perform auxiliary motion with respect to the target velocity parameters in the target direction while performing the baseline motion. That is, the flight prop can be controlled to perform the sum of the baseline motion and the aforementioned auxiliary motion.
[0123] Furthermore, to determine the start time of the combined reference and auxiliary movements of the flight prop during the reference motion, a preset state for initiating these movements can be set. Thus, during the reference motion, it is possible to detect whether the flight prop's motion state has reached this preset state. Furthermore, upon detecting that the flight prop's motion state during the reference motion has reached this preset state, the flight prop can be controlled to perform the combined reference motion and the auxiliary movement relating to the target velocity parameter in the target direction.
[0124] The preset state can be that the duration of the reference motion of the flying prop reaches a preset duration, such as 5ms or 0.1s; or the position of the reference motion of the flying prop reaches a preset position, such as the highest point of the trajectory of the reference motion, 1 / 3 of the range, or 1 / 5 of the range. These are all reasonable and are not specifically limited in this embodiment.
[0125] The aforementioned target speed parameters may include target speed or target acceleration, and the target direction differs from the reference motion direction of the flight prop. For example, when the reference motion direction is diagonally upward, the target direction may be diagonally downward, left, right, etc. In this embodiment, the directions of the target speed and target acceleration are determined by an electronic device; and the target speed parameters can be set according to the running effect of the application, for example, 5 m / s, 10 m / s. 2 These are all reasonable and are not specifically limited in the embodiments of this application.
[0126] Since the motion of the flying prop is the sum of the base motion and the auxiliary motion with respect to the target velocity parameter in the target direction, its trajectory is the composite trajectory of the trajectories of the two motions mentioned above, that is, the trajectory of the sum motion.
[0127] For example, when a projectile is performing a projectile motion, it may be subjected to a crosswind in the horizontal direction, perpendicular to the horizontal direction of the projectile motion. Under the continuous action of this crosswind, the projectile will accelerate in the direction indicated by the crosswind. The projectile will undergo a combined motion of projectile motion and acceleration in the direction indicated by the crosswind; its trajectory is the combined trajectory of the projectile motion and the acceleration. In other words, the projectile's trajectory is the trajectory of the combined projectile motion and acceleration. A top view of the projectile's trajectory is shown below. Figure 3 As shown.
[0128] Optionally, when the target velocity parameter includes the target acceleration, and when the motion state of the flight prop in the reference motion reaches the preset state, the flight prop can be controlled to perform the combined motion of the reference motion and the auxiliary motion with respect to the target acceleration in the target direction.
[0129] When the target velocity parameter includes target acceleration, the flight prop can be controlled to perform a combined motion of the reference motion and the auxiliary motion with respect to the target velocity parameter in the target direction when the reference motion state of the flight prop reaches a preset state. Thus, the flight prop's trajectory is the combined motion of the reference motion and the accelerated motion with respect to the target acceleration in the target direction.
[0130] Optionally, when the target speed parameter includes the target speed, when the motion state of the flight prop in the reference motion reaches the preset state, the flight prop can be controlled to perform the reference motion and the auxiliary motion about the target speed in the target direction.
[0131] When the flight prop reaches a preset state during its baseline motion, it can be controlled to perform a combined motion of the baseline motion and an auxiliary motion relative to the target velocity in the target direction. Thus, the flight prop's trajectory is the combined motion of the baseline motion and the auxiliary motion relative to the target velocity in the target direction.
[0132] Furthermore, since the virtual scene in this embodiment is a three-dimensional scene, the flying prop can move in various directions such as up and down, left and right when it moves in the virtual scene. In this way, the trajectory formed by the flying prop in the virtual scene will be more graceful.
[0133] S204: When the motion state of the flying prop meets the preset stopping conditions, control the flying prop to stop moving.
[0134] To determine when a control projectile should stop moving, preset stopping conditions can be set in advance.
[0135] In this way, during the movement of the flying prop, it is possible to detect whether the movement state of the flying prop meets the aforementioned preset stopping conditions. Furthermore, when it is detected that the movement state of the flying prop meets the aforementioned preset stopping conditions, the flying prop can be controlled to stop moving.
[0136] The aforementioned preset stopping condition can be set according to the desired operating effect of the application. It can be that the movement time of the flying prop reaches a preset time, for example, the movement time of the flying prop reaches 2 seconds; it can also be that the flying prop collides with any object in the virtual scene, for example, the flying prop collides with the target virtual character; it can also be that the movement displacement of the flying prop in a preset direction reaches a preset distance, for example, the movement displacement of the flying prop in the horizontal sub-direction indicated by the speed information reaches a preset distance. These are all reasonable and are not specifically limited in this embodiment.
[0137] Optionally, if the preset stopping condition is a collision with any object in the virtual scene, the projectile can be controlled to stop moving when a collision is detected between the projectile and any object in the virtual scene. For example, the projectile can be controlled to stop moving when a collision with a virtual object, land, or building in the virtual scene is detected.
[0138] Optionally, when the preset stopping condition is that the movement duration reaches a preset duration, the projectile can be controlled to stop moving when the movement duration of the projectile is detected to have reached the preset duration. For example, when the movement duration of the smoke grenade is detected to have reached 2 seconds, the smoke grenade can be controlled to stop moving.
[0139] To enhance the user experience, the flight process and effects of flying props can be displayed on electronic devices. Furthermore, a preset virtual camera can be set up for the flying props within a virtual scene to showcase their flight and effects.
[0140] Setting a preset virtual camera for a flying prop refers to setting up a virtual camera to capture images of the flying prop. This preset virtual camera can be positioned behind the flying prop, maintaining a preset initial distance from it, to capture images of the flying prop.
[0141] Alternatively, in one specific implementation, such as Figure 4 As shown in the embodiment of this application, a method for creating a flying prop in a virtual scene may further include the following step S205:
[0142] S205: During the movement of the flying prop, display the scene image including the flying prop captured by the preset virtual camera;
[0143] The preset virtual camera is a virtual camera set up in the virtual scene for flying props.
[0144] In this specific implementation, in order to show the user the motion process of controlling the flying prop in response to the user's control commands, the scene image of the flying prop captured by a preset virtual camera can be displayed during the movement of the flying prop.
[0145] The so-called display scene screen refers to providing users with scene screens in an application through the display interface of an electronic device, and the display interface can be a UI (User Interface) for user interaction.
[0146] The application can include multiple virtual cameras to provide users with scene views from various perspectives.
[0147] For example, a virtual camera that captures images of a target object in a virtual scene selected by the user can capture the scene of the virtual scene where the target object is located from behind the target object. In this way, when the scene displayed on the display interface is the scene captured by the virtual camera, the user obtains a third-person perspective.
[0148] For example, a virtual camera can be set above the virtual scene to capture the entire or part of the virtual scene. When the scene displayed on the display interface is the scene captured by the virtual camera, the user can see the entire or part of the virtual scene on the display interface, and the user's perspective is an eagle-eye view.
[0149] Based on this, a preset virtual camera can be set up to capture images of the flying props. By displaying the scene images captured by the preset virtual camera, including the flying props, users can intuitively observe the movement of the flying props and the virtual scenes they reach during their movement.
[0150] Optionally, the display interface shows the scene including the flying prop captured by a preset virtual camera that captures images of the flying prop, and the user's perspective is called the flying prop following perspective.
[0151] For example, as shown in Figure 5(a), during the movement of the flying prop 510, a preset virtual camera can capture scene images including the flying prop 510 so that the user can watch the movement of the flying prop 510.
[0152] Optionally, when the flying prop is a prop launched by a launcher, upon receiving an operation command for the flying prop, the scene image of the launcher used to launch the flying prop, captured by a preset virtual camera, can be displayed. For example, as shown in Figure 5(b), upon receiving an operation command for the flying prop, the scene image of the launcher 520 used to launch the flying prop, captured by a preset virtual camera, can be displayed. After the launcher 520 launches the flying prop, the scene image of the flying prop captured by the preset virtual camera can be displayed.
[0153] In this way, by displaying the scene of the launcher used to launch the flying prop captured by the preset virtual camera, as well as the scene of the flying prop during its movement, users can more intuitively watch the launch and movement process of the flying prop, thus improving the user experience.
[0154] Alternatively, in one specific implementation, such as Figure 6 As shown in the embodiment of this application, a method for creating a flying prop in a virtual scene may further include the following step S206:
[0155] S206: Within a preset time period for controlling the flight prop to stop moving, display the scene screen of the stopping position reached by the flight prop in the virtual scene.
[0156] In this specific implementation, in order to demonstrate the effect of using the flying prop to the user, the scene screen of the stopping position reached by the flying prop in the virtual scene can be displayed within a preset time period after controlling the flying prop to stop moving.
[0157] The preset duration can be displayed according to the desired running effect of the application, such as 1 second, 3 seconds, etc., which are all reasonable and are not specifically limited in this application embodiment.
[0158] Typically, while controlling the flying item to stop moving, you can also control the flying item to present the desired usage state at the stopped position, such as smoke grenades emitting smoke or shells exploding.
[0159] Based on this, the scene of the stopping position of the flying prop in the virtual scene can be displayed within a preset time period after controlling the flying prop to stop moving.
[0160] For example, such as Figure 7 As shown, when the projectile is a cannonball, when the cannonball stops moving, it can be controlled to explode at the stopping position. Afterwards, for 1 second after the cannonball stops moving, the scene image of the stopping position of the cannonball in the virtual scene captured by the preset virtual camera can be displayed, that is, the scene image of the explosion position of the cannonball can be displayed.
[0161] In this way, by displaying the scene of where the flying prop stops, users can more intuitively see the effect of the flying prop and the hit situation, thus improving the user experience.
[0162] In addition, to enrich the game visuals and help users understand the trajectory of flying items, a top-down view of the trajectory of the flying item can be displayed in a preset display area.
[0163] For example, a preset display area for displaying the trajectory of a flying prop can be set on the display interface of the application device, and a top view of the trajectory of the flying prop can be displayed within the preset display area.
[0164] Optionally, a top-down view of the flight prop's trajectory can be displayed within a preset display area during the flight prop's movement.
[0165] Optionally, after the flying prop stops moving, a top-down view of the flying prop's trajectory can be displayed in a preset display area.
[0166] Optional, such as Figure 8 As shown in the embodiment of this application, a method for creating a flying prop in a virtual scene may include the following steps S801-S806:
[0167] S801: Receives user-sent operation commands for flying props in a virtual scene;
[0168] The virtual scene is a three-dimensional scene; the operation instructions include: direction information and speed information;
[0169] S802: In response to operation commands, control the flight prop in the virtual scene to perform reference motion with the direction indicated by the direction information as the starting direction and the speed indicated by the speed information as the starting speed;
[0170] S803: When the flight prop reaches the preset state of the reference motion, control the flight prop to perform the sum of the reference motion and the auxiliary motion about the target velocity parameter in the target direction;
[0171] The target direction differs from the reference motion direction; the target velocity parameters include: target velocity or target acceleration.
[0172] S804: During the movement of the flying prop, display the scene image including the flying prop captured by the preset virtual camera;
[0173] The preset virtual camera is a virtual camera set up in the virtual scene for flying props;
[0174] S805: When the motion state of the flying prop meets the preset stopping conditions, control the flying prop to stop moving;
[0175] S806: Within a preset time period for controlling the flight prop to stop moving, display the scene screen of the stopping position reached by the flight prop in the virtual scene.
[0176] The specific implementation methods of steps S801-S806 are the same as those of steps S201-S206, and will not be repeated here.
[0177] Based on this, by applying the solution provided in the embodiments of this application, while responding to the user's operation commands and controlling the flying prop to perform a baseline motion, it is also possible to control the flying prop to perform auxiliary motion based on a target speed or target acceleration in a motion direction different from the aforementioned baseline motion. In this way, the motion performed by the flying prop is the sum of the aforementioned baseline motion and the aforementioned auxiliary motion, and the trajectory of the flying prop is the trajectory formed by performing the aforementioned sum of motions. This trajectory is more fluid than the trajectory of the baseline motion performed in response to the user's operation commands, thereby allowing the user to experience the diversity and uncertainty of the flying prop's trajectory, thus increasing the game's fun and improving the user experience.
[0178] To further increase the diversity of the flight props' trajectories and avoid the flight props' trajectory from always deviating in one direction due to the control of the base motion and the auxiliary motion of the target speed parameter in the target direction, the target direction and target speed parameters can be changed sequentially during the flight props' motion, making the flight props' trajectories more graceful and diverse.
[0179] Optionally, in one specific implementation, when the target velocity parameter includes a target acceleration, the target acceleration may include: a first acceleration and a second acceleration, and the target direction may include: a first direction and a second direction;
[0180] Accordingly, step S203 above, controlling the flight prop to perform a base motion and an auxiliary motion about the target velocity parameter in the target direction, may include the following steps 11-13:
[0181] Step 11: Control the flight prop to perform a base motion and an auxiliary motion with a first acceleration in the first direction;
[0182] Step 12: When the motion state of the flight prop in the first direction reaches the first preset condition, control the flight prop to perform a base motion and an auxiliary motion with a second acceleration in the second direction; wherein, the first preset condition includes: a first set speed;
[0183] Step 13: When the motion state of the flight prop in the second direction reaches the second preset condition, return to the step of controlling the flight prop to perform the reference motion and the auxiliary motion with respect to the first acceleration in the first direction; wherein, the second preset condition includes: a second set speed.
[0184] In this specific implementation, when the target velocity parameter includes a target acceleration, the target acceleration may include a first acceleration and a second acceleration, and the target direction may include a first direction and a second direction. The first acceleration and the second acceleration may be the same acceleration or different accelerations, and the first direction and the second direction are different directions.
[0185] When the flight prop reaches the preset state of the reference motion, the flight prop can be controlled to perform the reference motion and the auxiliary motion with the first acceleration in the first direction.
[0186] To determine the timing of controlling the flight prop to perform a reference motion and an auxiliary motion with a second acceleration in a second direction, a first preset condition can be preset. Then, when controlling the flight prop to perform the sum of the reference motion and the auxiliary motion with a first acceleration in a first direction, it is detected whether the flight prop's motion state meets the first preset condition. Furthermore, when it is detected whether the flight prop's motion state meets the first preset condition, the flight prop can be controlled to perform the sum of the reference motion and the auxiliary motion with a second acceleration in a second direction.
[0187] Furthermore, a second preset condition can be pre-set. This allows the system to detect whether the flight prop's motion state meets the aforementioned second preset condition while controlling the prop to perform a base motion and an auxiliary motion with a second acceleration in the second direction. Consequently, when detecting whether the flight prop's motion state meets the aforementioned second preset condition, the system can control the prop to perform a base motion and an auxiliary motion with a first acceleration in the first direction.
[0188] The first preset condition can be a first preset speed, a third preset duration, or a first preset displacement; while the second preset condition can be a second preset speed, a fourth preset duration, or a second preset displacement. All of these are reasonable and are not specifically limited in this embodiment.
[0189] Furthermore, when the first preset condition can be a first set speed and the second preset condition can be a second set speed, both the first and second set speeds can be set according to direction or acceleration. For example, for direction A, the first set speed in that direction is 30 m / s, and for direction B, the second set speed in that direction is 40 m / s; or for acceleration C, the first set speed corresponding to that acceleration is 40 m / s, and for acceleration D, the second set speed corresponding to that acceleration is 20 m / s, etc. These are all reasonable and are not specifically limited in this application embodiment. In addition, the first set speed and the second set speed can be the same or different.
[0190] In other words, the flight prop can be controlled to perform a base motion and an auxiliary motion with a first acceleration in a first direction. Then, when the speed of the flight prop in the first direction reaches a first preset speed, the flight prop can be controlled to perform a base motion and an auxiliary motion with a second acceleration in a second direction. Next, when the speed of the flight prop in the second direction reaches a second preset speed, the process returns to step 211 above, and the flight prop is controlled to perform a base motion and an auxiliary motion with a first acceleration in the first direction.
[0191] In this way, by setting the first and second preset conditions, it is possible to determine the timing of switching control of the flying prop to perform different movements. Furthermore, during the movement of the flying prop, its trajectory can be formed by multiple segments of different movements, thereby achieving the goal of increasing the diversity of the flying prop's trajectory.
[0192] Optionally, an acceleration range can be set. Each time the control of the flying prop is switched, a selected acceleration can be determined within this range. This allows the flying prop to perform a base motion and an auxiliary motion with respect to the selected acceleration in the switched direction. Thus, when the flying prop is controlled to perform a motion different from the previous one, its trajectory will also differ from the trajectory of the previous motion.
[0193] In this way, by controlling the base motion and the speed of different auxiliary motions of the flying prop, the uncertainty of the flying prop can be increased, making the trajectory of the flying prop more graceful.
[0194] For example, Figure 9 As a specific example of a method for controlling a flight prop, the method for controlling the flight prop in this example may include the following steps S901-S905:
[0195] S901: Determine whether the flight prop has performed the baseline motion for the preset duration; if so, proceed to step S902.
[0196] S902: Controls the flight prop to perform a base motion and an auxiliary motion with respect to the target acceleration in the target direction;
[0197] S903: Determine whether the speed in the target direction has reached the maximum speed; if yes, proceed to step S904; otherwise, proceed to step S902.
[0198] S904: Update the opposite direction of the target direction to the target direction, and return to the steps of controlling the flight prop to perform the reference motion and the auxiliary motion and movement with respect to the target acceleration in the target direction;
[0199] S905: Check if the flight prop meets the preset stopping conditions; if yes, stop the flight; otherwise, return to step S902.
[0200] When controlling the flight prop to perform a reference movement, determine whether the duration of the reference movement reaches the preset duration.
[0201] If the duration of the reference motion of the flying prop reaches the preset duration, the flying prop is controlled to perform a combination of the reference motion and the auxiliary motion related to the target acceleration in the target direction. During the aforementioned combined motion, it is determined whether the flying prop's speed in the target direction reaches its maximum speed.
[0202] If the speed of the flying prop reaches its maximum speed in the target direction, the opposite direction of the target direction is updated to the target direction, and the flying prop is controlled to perform a base motion and an auxiliary motion with respect to the target acceleration in the target direction.
[0203] If the speed of the flying prop in the target direction does not reach the maximum speed, continue to control the flying prop to perform the base motion and the auxiliary motion with respect to the target acceleration in the target direction.
[0204] The system detects whether the flight prop meets the preset stopping conditions. If the flight prop meets the preset stopping conditions, it controls the flight prop to stop flying. If the flight prop does not meet the preset stopping conditions, it continues to control the flight prop to perform the base motion and the auxiliary motion of the target acceleration in the target direction.
[0205] Each time the target direction is updated, an acceleration within a preset acceleration range can be determined as the new target acceleration. Therefore, if the target acceleration is different each time the target direction is changed, the resulting top-down view of the flight path of the projectile will look like this: Figure 10 As shown.
[0206] Furthermore, to avoid a significant difference between the trajectory obtained by controlling the flight prop through both baseline and auxiliary movements and the trajectory obtained by controlling only the baseline movement, which could prevent the flight prop from entering the target area desired by the user, the boundary of the flight prop's trajectory in any target direction can be calculated based on the minimum acceleration within a preset acceleration range and the preset maximum speed achievable by the flight prop. Thus, the trajectory of the flight prop is always controlled within this boundary.
[0207] Optionally, in one specific implementation, when the target speed parameter includes a target speed, the target speed may include: a first speed and a second speed, and the target direction may include: a third direction and a fourth direction;
[0208] Accordingly, step S203 above, controlling the flight prop to perform a base motion and an auxiliary motion with respect to the target velocity parameter in the target direction, may include the following steps 21-23:
[0209] Step 21: Control the flight prop to perform the baseline motion and the auxiliary motion with respect to the first velocity in the third direction upwards;
[0210] Step 22: When the motion state of the flight prop in the third direction reaches the third preset condition, control the flight prop to perform a base motion and an auxiliary motion with a second velocity in the fourth direction; wherein, the third preset condition includes: a first preset duration;
[0211] Step 23: When the motion state of the flight prop in the fourth direction reaches the fourth preset condition, return to the step of controlling the flight prop to perform the reference motion and the auxiliary motion with respect to the first velocity in the third direction; wherein, the fourth preset condition includes: the second preset duration.
[0212] In this specific implementation, when the target speed parameter is a target speed, the target speed may include a first speed and a second speed, and the target direction may include a third direction and a fourth direction. The first speed and the second speed may be the same speed or different speeds, and the third direction and the fourth direction are different directions.
[0213] When the flight prop reaches the preset state of the reference motion, the flight prop can be controlled to perform the reference motion and the auxiliary motion with respect to the first velocity in the third direction.
[0214] To determine the timing of the combined motion of the reference motion and the auxiliary motion with a first velocity in the third direction, a third preset condition can be preset. Then, when controlling the flight prop to perform the combined motion of the reference motion and the auxiliary motion with a first velocity in the third direction, it is detected whether the flight prop's motion state meets the aforementioned third preset condition. Furthermore, when it is detected whether the flight prop's motion state meets the aforementioned third preset condition, the flight prop can be controlled to perform the combined motion of the reference motion and the auxiliary motion with a second velocity in the fourth direction.
[0215] Furthermore, a fourth preset condition can be pre-set. This allows the system to detect whether the flight prop's motion state meets the aforementioned fourth preset condition while controlling the prop to perform a base motion and an auxiliary motion with a second velocity in a fourth direction. Consequently, when detecting whether the flight prop's motion state meets the aforementioned fourth preset condition, the system can control the prop to perform a base motion and an auxiliary motion with a first velocity in a third direction.
[0216] The third preset condition can be either the first preset duration or the third preset displacement; and the fourth preset condition can be either the second preset duration or the fourth preset displacement. These are all reasonable and are not specifically limited in this application embodiment.
[0217] Furthermore, when the third preset condition can be a first preset duration and the fourth preset condition can be a second preset duration, the first and second preset durations can be set according to direction or speed. For example, for direction E, the first preset duration in that direction is 30ms, and for direction F, the second preset duration in that direction is 10ms; or for speed G, the first preset duration corresponding to that speed is 5ms, and for speed H, the second preset duration corresponding to that speed is 20ms, etc. These are all reasonable and are not specifically limited in this embodiment. In addition, the first and second preset durations can be the same or different.
[0218] In other words, the flight prop can be controlled to perform a base motion and an auxiliary motion with a first velocity in a third direction. Then, when the flight prop's motion duration in the third direction reaches a first preset duration, the flight prop can be controlled to perform a base motion and an auxiliary motion with a second velocity in a fourth direction. Next, when the flight prop's motion duration in the fourth direction reaches a second preset duration, the process returns to step 311 above, and the flight prop continues to be controlled to perform a base motion and an auxiliary motion with a first velocity in a third direction.
[0219] In this way, by setting the third and fourth preset conditions, the moment when the control of the flying prop is switched to pass or move can be determined. Furthermore, during the movement of the flying prop, its trajectory can be formed by multiple different movements, thereby increasing the diversity of the flying prop's trajectory.
[0220] Optionally, a speed range can be set. Each time the control of the flying prop is switched, a selected speed can be determined within this range. This allows the flying prop to perform a base motion and an auxiliary motion at the selected speed in the switched direction. Thus, when the flying prop is controlled to perform a motion different from the previous one, its trajectory will also differ from the trajectory of the previous motion.
[0221] In this way, by controlling the flying props to different speeds and altitudes, the unpredictability of the flying props can be increased, making their trajectory more elusive.
[0222] Based on the same inventive concept, and corresponding to the embodiments provided in this application Figure 2 The present invention provides a method for controlling a flying prop in a virtual scene, and also provides a control device for a flying prop in a virtual scene.
[0223] Figure 11 This application provides a schematic diagram of the structure of a control device for a flying prop in a virtual scene, as shown in the embodiment of the present application. Figure 11 As shown in the embodiments of this application, a control device for a flying prop in a virtual scene may include the following modules:
[0224] The instruction receiving module 1110 is used to receive operation instructions sent by the user for flying props in a virtual scene; wherein, the virtual scene is a three-dimensional scene; the operation instructions include: direction information and speed information;
[0225] The instruction response module 1120 is used to respond to the operation instruction and control the flight prop to perform a reference movement in the virtual scene, with the direction indicated by the direction information as the starting direction and the speed indicated by the speed information as the starting speed.
[0226] The first control module 1130 is used to control the flight prop to perform a combined motion of the reference motion and an auxiliary motion about a target velocity parameter in the target direction when the motion state of the reference motion reaches a preset state; wherein the target direction is different from the motion direction of the reference motion; the target velocity parameter includes: target velocity or target acceleration;
[0227] The second control module 1140 is used to control the flight prop to stop moving when the motion state of the flight prop is detected to meet the preset stopping conditions.
[0228] Based on this, by applying the solution provided in the embodiments of this application, while responding to the user's operation commands and controlling the flying prop to perform a baseline motion, it is also possible to control the flying prop to perform auxiliary motion based on a target speed or target acceleration in a motion direction different from the aforementioned baseline motion. In this way, the motion performed by the flying prop is the sum of the aforementioned baseline motion and the aforementioned auxiliary motion, and the trajectory of the flying prop is the trajectory formed by performing the aforementioned sum of motions. This trajectory is more fluid than the trajectory of the baseline motion performed in response to the user's operation commands, thereby allowing the user to experience the diversity and uncertainty of the flying prop's trajectory, thus increasing the game's fun and improving the user experience.
[0229] Optionally, in one specific implementation, the apparatus further includes:
[0230] The first display module is used to display a scene image including the flying prop captured by a preset virtual camera during the movement of the flying prop; wherein the preset virtual camera is a virtual camera set for the flying prop in the virtual scene.
[0231] Optionally, in one specific implementation, the apparatus further includes:
[0232] The second display module is used to display the scene of the stopping position reached by the flying prop in the virtual scene within a preset time period after controlling the flying prop to stop moving.
[0233] Optionally, in one specific implementation, the target acceleration includes: a first acceleration and a second acceleration, and the target direction includes: a first direction and a second direction;
[0234] The first control module 1130 is specifically used for:
[0235] Control the flight prop to perform the base motion and the auxiliary motion with respect to the first acceleration in the first direction;
[0236] When the motion state of the flight prop in the first direction reaches a first preset condition, the flight prop is controlled to perform a combined motion of the reference motion and the auxiliary motion with respect to the second acceleration in the second direction; wherein, the first preset condition includes: a first set speed;
[0237] When the motion state of the flight prop in the second direction reaches the second preset condition, the step of controlling the flight prop to perform the reference motion and the auxiliary motion with respect to the first acceleration in the first direction is returned; wherein, the second preset condition includes: a second set speed.
[0238] Optionally, in one specific implementation, the target speed includes: a first speed and a second speed, and the target direction includes: a third direction and a fourth direction;
[0239] The first control module 1130 is specifically used for:
[0240] Control the flight prop to perform the base motion and the auxiliary motion with respect to the first velocity in the third direction;
[0241] When the flight prop reaches a third preset condition in its motion state in the third direction, the flight prop is controlled to perform a combined motion of the reference motion and the auxiliary motion with respect to the second speed in the fourth direction; wherein, the third preset condition includes: a first preset duration;
[0242] When the motion state of the flight prop in the fourth direction reaches the fourth preset condition, the step of controlling the flight prop to perform the reference motion and the auxiliary motion with respect to the first speed in the third direction is returned; wherein, the fourth preset condition includes: a second preset duration.
[0243] This application also provides an electronic device, such as... Figure 12 As shown, it includes a processor 1201, a communication interface 1202, a memory 1203, and a communication bus 1204. The processor 1201, communication interface 1202, and memory 1203 communicate with each other via the communication bus 1204.
[0244] Memory 1203 is used to store computer programs;
[0245] When the processor 1201 executes the program stored in the memory 1203, it implements the steps of the control method for flying props in any virtual scene provided in the above-described embodiments of this application.
[0246] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0247] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0248] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0249] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0250] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of any of the above-described flight prop control methods.
[0251] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the flight prop control methods described above.
[0252] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0253] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0254] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device embodiments, electronic device embodiments, computer-readable storage medium embodiments, and computer program product embodiments are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0255] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.
Claims
1. A method for controlling a flying prop in a virtual scene, characterized in that, The method includes: The system receives operation commands from a user for flying props in a virtual scene; wherein the virtual scene is a three-dimensional scene; and the operation commands include: direction information and speed information. In response to the operation command, the flight prop is controlled to perform a reference movement in the virtual scene, with the direction indicated by the direction information as the starting direction and the speed indicated by the speed information as the starting speed; When the flight prop reaches a preset state during the reference motion, the flight prop is controlled to perform a combined motion of the reference motion and an auxiliary motion with respect to the target acceleration in the target direction; wherein the target direction is different from the direction of the reference motion. During the movement of the flying prop, if the speed of the flying prop in the target direction reaches its maximum speed, the opposite direction of the target direction is updated to the target direction, and the process returns to the step of controlling the flying prop to perform the base motion and the auxiliary motion with respect to the target acceleration in the target direction. This is to increase the diversity of the flying prop's motion trajectory while preventing the flying prop's motion trajectory from always deviating in one direction, until the motion state of the flying prop is detected to meet the preset stopping conditions, at which point the flying prop is controlled to stop moving. The target acceleration used each time the target direction is updated is determined within a preset acceleration range. During the flight prop's movement, the flight prop's trajectory is restricted to a preset boundary. This preset boundary is calculated based on the minimum acceleration within a preset acceleration range and the maximum speed the flight prop can reach, representing the boundary that the flight prop's trajectory can reach in any target direction.
2. The method according to claim 1, characterized in that, The method further includes: During the movement of the flying prop, a scene image including the flying prop is displayed, captured by a preset virtual camera; wherein, the preset virtual camera is a virtual camera set up in the virtual scene for the flying prop.
3. The method according to claim 1, characterized in that, The method further includes: Within a preset time period for controlling the flight prop to stop moving, the scene screen of the stopping position reached by the flight prop in the virtual scene is displayed.
4. A control device for a flying prop in a virtual scene, characterized in that, The device includes: The instruction receiving module is used to receive operation instructions sent by the user for flying props in a virtual scene; wherein, the virtual scene is a three-dimensional scene; the operation instructions include: direction information and speed information; The instruction response module is used to respond to the operation instruction and control the flight prop to perform a reference movement in the virtual scene, with the direction indicated by the direction information as the starting direction and the speed indicated by the speed information as the starting speed. The first control module is configured to, when the flight prop's motion state reaches a preset state during the reference motion, control the flight prop to perform a sum of the reference motion and an auxiliary motion with a target acceleration in the target direction. During this sum of motions, if the flight prop's speed in the target direction reaches its maximum speed, the opposite direction of the target direction is updated to the target direction, and the process returns to the step of controlling the flight prop to perform the sum of the reference motion and the auxiliary motion with a target acceleration in the target direction. This increases the diversity of the flight prop's trajectory while preventing the trajectory from always deviating in one direction. The target direction is different from the direction of the reference motion. The target acceleration used each time the target direction is updated is determined within a preset acceleration range. The second control module is used to control the flight prop to stop moving when the motion state of the flight prop is detected to meet the preset stopping conditions; During the flight prop's movement, the flight prop's trajectory is restricted to a preset boundary. This preset boundary is calculated based on the minimum acceleration within a preset acceleration range and the maximum speed the flight prop can reach, representing the boundary that the flight prop's trajectory can reach in any target direction.
5. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the method described in any one of claims 1-3.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method described in any one of claims 1-3.
Citation Information
Patent Citations
Virtual item control method and device, computer equipment and storage medium
CN113713382A