CN113559515A - Object control method and device, storage medium and electronic equipment - Google Patents

Object control method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN113559515A
CN113559515A CN202110874353.4A CN202110874353A CN113559515A CN 113559515 A CN113559515 A CN 113559515A CN 202110874353 A CN202110874353 A CN 202110874353A CN 113559515 A CN113559515 A CN 113559515A
Authority
CN
China
Prior art keywords
virtual object
target virtual
obstacle
collision
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110874353.4A
Other languages
Chinese (zh)
Other versions
CN113559515B (en
Inventor
刘智洪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202110874353.4A priority Critical patent/CN113559515B/en
Publication of CN113559515A publication Critical patent/CN113559515A/en
Application granted granted Critical
Publication of CN113559515B publication Critical patent/CN113559515B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • A63F13/56Computing the motion of game characters with respect to other game characters, game objects or elements of the game scene, e.g. for simulating the behaviour of a group of virtual soldiers or for path finding
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • A63F13/57Simulating properties, behaviour or motion of objects in the game world, e.g. computing tyre load in a car race game
    • A63F13/577Simulating properties, behaviour or motion of objects in the game world, e.g. computing tyre load in a car race game using determination of contact between game characters or objects, e.g. to avoid collision between virtual racing cars
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/80Special adaptations for executing a specific game genre or game mode
    • A63F13/837Shooting of targets
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/64Methods for processing data by generating or executing the game program for computing dynamical parameters of game objects, e.g. motion determination or computation of frictional forces for a virtual car
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/65Methods for processing data by generating or executing the game program for computing the condition of a game character

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses an object control method and device, a storage medium and electronic equipment. Wherein, the method comprises the following steps: displaying a target virtual object in a moving state in a virtual scene; determining a collision angle between a target virtual object and an obstacle in a virtual scene under the condition that the moving target virtual object collides with the obstacle in the virtual scene; and under the condition that the collision angle reaches the sliding condition, controlling the target virtual object to automatically attach to the barrier and slide and move along the offset direction, wherein the offset direction is determined according to the current moving direction of the target virtual object. The invention solves the technical problem that the control operation of the virtual object when encountering the obstacle has higher operation complexity in the prior art.

Description

Object control method and device, storage medium and electronic equipment
Technical Field
The invention relates to the field of computers, in particular to an object control method and device, a storage medium and electronic equipment.
Background
In the battle interaction scene provided by the shooting game application, a player is often required to hit and kill a target object in the game scene by controlling a virtual object to use a virtual shooting item to obtain the victory of the current shooting game task. In the above shooting game mission, the player often needs to control the virtual object to move in real time in the game scene to hit and kill the target object appearing at different positions. However, the moving virtual object often encounters an obstacle set in the game scene.
In the existing scheme, the moving virtual object decelerates until stopping moving after hitting an obstacle, and can not bypass the current obstacle and continue moving until a player performs direction adjustment operation on a direction key to control the virtual object to move in a direction without the obstacle.
However, the requirement on real-time performance in the interactive process of fight is very high, and if an obstacle set in a virtual scene is encountered, the moving direction of a virtual object needs to be adjusted first, so that the virtual object can move continuously. If the operation level of the player is not high, the virtual object is easy to be stuck at the position of the current obstacle and is finally killed by the enemy. That is, the related art provides a problem that the control operation when the virtual object encounters an obstacle has a high operation complexity.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides an object control method and device, a storage medium and electronic equipment, which are used for at least solving the technical problem that the control operation of a virtual object when encountering an obstacle has higher operation complexity in the related art.
According to an aspect of an embodiment of the present invention, there is provided an object control method including: displaying a target virtual object in a moving state in a virtual scene; determining a collision angle between the target virtual object and an obstacle in the virtual scene when the moving target virtual object collides with the obstacle; and controlling the target virtual object to automatically attach to the obstacle and to slide and move along an offset direction when the collision angle reaches a sliding condition, wherein the offset direction is determined according to the current moving direction of the target virtual object.
According to another aspect of the embodiments of the present invention, there is also provided an object control apparatus including: a display unit for displaying a target virtual object in a moving state in a virtual scene; a first determination unit configured to determine a collision angle between the target virtual object and an obstacle in the virtual scene when the target virtual object is colliding with the obstacle in the virtual scene; and a control unit, configured to control the target virtual object to automatically attach to the obstacle and to slide and move along an offset direction when the collision angle reaches a sliding condition, where the offset direction is determined according to a current moving direction of the target virtual object.
According to still another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium having a computer program stored therein, wherein the computer program is configured to execute the above object control method when running.
According to still another aspect of the embodiments of the present invention, there is also provided an electronic device, including a memory in which a computer program is stored, and a processor configured to execute the object control method described above by the computer program.
In the embodiment of the invention, under the condition that a target virtual object moving in a virtual scene collides with an obstacle in the virtual scene, a collision angle between the target virtual object and the obstacle is determined, and under the condition that the collision angle reaches a sliding condition, the target virtual object is controlled to automatically adhere to the obstacle and slide and move along an offset direction, and the target virtual object can be prevented from being stuck at the obstacle and cannot move without manually adjusting the moving direction of the target virtual object by a user, so that the effect of simplifying the control operation when the target virtual object collides with the obstacle is achieved, and the problem of higher complexity of the object control operation in the related technology is further solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a schematic diagram of a hardware environment for an alternative object control method according to an embodiment of the invention;
FIG. 2 is a flow chart of an alternative object control method according to an embodiment of the invention;
FIG. 3 is a schematic diagram of an alternative object control method according to an embodiment of the invention;
FIG. 4 is a schematic diagram of another alternative object control method according to an embodiment of the invention;
FIG. 5 is a schematic diagram of yet another alternative object control method according to an embodiment of the invention;
FIG. 6 is a schematic diagram of yet another alternative object control method according to an embodiment of the invention;
FIG. 7 is a schematic diagram of yet another alternative object control method according to an embodiment of the invention;
FIG. 8 is a schematic diagram of yet another alternative object control method according to an embodiment of the invention;
FIG. 9 is a schematic diagram of yet another alternative object control method according to an embodiment of the invention;
FIG. 10 is a schematic diagram of yet another alternative object control method according to an embodiment of the invention;
FIG. 11 is a flow chart of another alternative object control method according to an embodiment of the present invention;
FIG. 12 is a schematic diagram of an alternative object control device according to an embodiment of the present invention;
fig. 13 is a schematic structural diagram of an alternative electronic device according to an embodiment of the invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an aspect of the embodiments of the present invention, an object control method is provided, and optionally, as an optional implementation manner, the object control method may be applied to, but is not limited to, an environment as shown in fig. 1. The object control method can be applied, but not limited to, in an object control system in a hardware environment as shown in fig. 1, wherein the object control system can include, but is not limited to, a terminal device 102, a network 104, a server 106, and a database 108. A target client (as shown in fig. 1, the target client takes a game client as an example, and a virtual scene will be presented in a display interface of the target client) that logs in by using a target user account runs in the terminal device 102. The terminal device 102 includes a human-computer interaction screen, a processor and a memory. The human-computer interaction screen is used for displaying a virtual scene (such as a virtual game scene) in the display interface, and a target virtual object 100-1 in a moving state and a pre-configured barrier 100-2 are displayed in the virtual game scene; and is further configured to provide a human-machine interaction interface for receiving a human-machine interaction operation for controlling the target virtual object to perform a predetermined action, such as a shooting action, a moving action, and the like performed in the virtual scene. The processor is used for responding the human-computer interaction operation to generate an interaction instruction and sending the interaction instruction to the server. The memory is used for storing object attribute information (such as state information of the target virtual object) of the target virtual object displayed in the virtual scene and attribute information (such as position information and material information of the obstacle) of the obstacle in the virtual scene.
In addition, the server 106 includes a processing engine therein, and the processing engine is configured to perform a storing or reading operation on the database 108, such as storing the collision angle received from the terminal device 102 in the database, or storing object attribute information of virtual objects respectively controlled by the respective clients in the database. Such as reading the above-mentioned coasting condition for comparison determination from the database. That is, the server 106 may determine whether the collision angle reaches the coasting condition after receiving the collision angle from the terminal device 102 and reading the coasting condition from the database, and in a case where it is determined that the coasting condition is reached, determine that the target virtual object is moved in the terminal device in a manner of following the obstacle and coasting in the offset direction.
The specific process comprises the following steps: in step S102, the target virtual object 100-1 in the moving state is displayed in the virtual scene displayed on the display interface of the target client operated by the terminal device 102. Then, as shown in steps S104-S106, when the terminal device 102 determines that the moving target virtual object 100-1 collides with the obstacle 100-2 in the virtual scene, the collision angle between the target virtual object and the obstacle is determined, and the collision angle is transmitted to the server 106 through the network 104. It should be noted here that, calculating the collision angle between the target virtual object and the obstacle may also be performed by the server 106, for example, the position information of the target virtual object and the position information of the obstacle are synchronously sent to the server 106 in real time, the server determines whether the two collide, and in case of determining that the collision occurs, the collision angle between the two is calculated.
The processing engine of the server 106 will perform steps S108-S112: after reading the coasting condition from the database, it is determined whether the collision angle reaches the coasting condition. And under the condition that the collision angle is determined to reach the sliding condition, determining that the moving mode of the target virtual object is to automatically attach to the barrier and slide and move along the offset direction. The movement pattern is then notified to the terminal device 102 via the network 104.
In step S114, the terminal device 102 displays a process that the control target virtual object automatically fits the obstacle and slides in the offset direction in the display interface according to the received movement manner.
The interface and the flow steps shown in fig. 1 are examples, and steps S108 to S110 may be executed in a terminal device with high processing capability. That is, each step shown in fig. 1 can be independently completed by the terminal device without participation of the server, so as to save the communication cost and shorten the processing waiting time, which is not limited in the embodiment of the present application.
It should be noted that, in this embodiment, when a target virtual object moving in a virtual scene collides with an obstacle in the virtual scene, a collision angle between the target virtual object and the obstacle is determined, and when the collision angle reaches a sliding condition, the target virtual object is controlled to automatically adhere to the obstacle and to slide and move along an offset direction, and a user does not need to manually adjust a moving direction of the target virtual object, so that the target virtual object is prevented from being stuck at the obstacle and cannot move, an effect of simplifying a control operation when the target virtual object collides with the obstacle is achieved, and a problem of high complexity of an object control operation in related technologies is solved.
Optionally, in this embodiment, the terminal device may be a terminal device configured with a target client, and may include, but is not limited to, at least one of the following: mobile phones (such as Android phones, iOS phones, etc.), notebook computers, tablet computers, palm computers, MID (Mobile Internet Devices), PAD, desktop computers, smart televisions, etc. The target client may be an application client for performing a confrontational game-like task. Such networks may include, but are not limited to: a wired network, a wireless network, wherein the wired network comprises: a local area network, a metropolitan area network, and a wide area network, the wireless network comprising: bluetooth, WIFI, and other networks that enable wireless communication. The server may be a single server, a server cluster composed of a plurality of servers, or a cloud server. The above is merely an example, and this is not limited in this embodiment.
Optionally, in this embodiment, the object control method may be, but not limited to, applied to a game terminal Application (APP) that completes a predetermined confrontational game task in a virtual scene, such as a shooting game Application in a Multiplayer Online Battle game (MOBA) Application, where the confrontational game task may be, but not limited to, a game task in which a current player controls a virtual character in the virtual scene through man-machine interaction operation and a virtual character controlled by another player through confrontational interaction, and the confrontational game task may be, but not limited to, running in an Application (e.g., a game APP running non-independently) in the form of a plug-in or a applet, or running in an Application (e.g., a game APP running independently) in a game engine. The types of gaming applications described above may include, but are not limited to, at least one of: two-dimensional (2D) game applications, Three-dimensional (3D) game applications, Virtual Reality (VR) game applications, Augmented Reality (AR) game applications, Mixed Reality (MR) game applications. The above is merely an example, and the present embodiment is not limited to this.
Optionally, as an optional implementation manner, as shown in fig. 2, the object control method includes:
s202, displaying a target virtual object in a moving state in a virtual scene;
optionally, in this embodiment, the target virtual object may be, but is not limited to, a virtual character controlled by a client in a virtual scene. For example, taking a Shooting-confrontation Game as an example, a picture of a virtual scene presented in a First Person Shooting Game (FPS) may be, but is not limited to, a picture observed from the viewpoint of the above-described currently controlled virtual character. Here, in the event that the virtual character collides with an obstacle, the view of the virtual character is blocked by the obstacle, and the moving process of the virtual character is also hindered.
It should be noted that, in this embodiment, the target virtual object needs to continuously move in the virtual scene to perform an interactive operation with an enemy object of different battles (for example, mutually shooting a prop to kill an opponent to obtain a victory of a game task, or obtaining a victory of a game task through a battle action, etc.).
S204, determining a collision angle between the target virtual object and an obstacle under the condition that the moving target virtual object collides with the obstacle in the virtual scene;
optionally, in this embodiment, the obstacle may be, but is not limited to, a dynamic virtual object or a static virtual object set in a virtual scene, where the dynamic virtual object may include, but is not limited to: a virtual carrier object, a Non-player Character object (NPC for short), and the like. The static virtual objects may include, but are not limited to: building objects (such as house walls, bridge guardrails and the like) configured in the virtual scene, prop objects (such as prop boxes and the like) randomly appearing in the virtual scene, and landscape objects (such as stones and the like) in the virtual scene. That is, when the moving target virtual object collides with the obstacle, a collision angle generated when the moving target virtual object collides with the obstacle is acquired.
It should be noted that, since the target virtual object is mounted with a physical collision box (i.e., collision body) provided by a game engine (e.g., Unity engine), a rectangular collision body is also mounted on the obstacle in order to detect a collision event. When two colliders come into contact in the related art, the collider of the moving target virtual object is decelerated or immediately stopped. In practice, in the battle game task, if the target virtual object is decelerated after colliding with the obstacle and stops at the position of the obstacle, the probability of being killed by the enemy object is likely to be increased. Therefore, in order to avoid the above situation, the player needs to manually adjust the moving direction of the target virtual object so as to leave the obstacle having collided as soon as possible in the related art.
In this embodiment, the adjustment operation by the player is omitted, and the player automatically slides in the direction of the deviation along the obstacle. The above-described movement control manner, which eliminates the adjustment operation, will also help to avoid task failures caused by inexperienced operations of novice players. Therefore, the aim of simplifying the control operation when the target virtual object collides with the obstacle is fulfilled. The control method here is a scene in which a collision body of the target virtual object and an obstacle have a collision body.
And S206, controlling the target virtual object to automatically attach to the barrier and to slide and move along the offset direction under the condition that the collision angle reaches the sliding condition, wherein the offset direction is determined according to the current moving direction of the target virtual object.
It should be noted that, after collision, two colliders in the virtual scene decelerate or stop moving, which are self-attributes configured in the game engine (e.g. unity). Thus, in the present embodiment, whether or not the control target virtual object is slidingly moved in conformity with the obstacle is determined using the preset slide condition and the determination result of the collision angle. That is, in the case where the coasting condition is not reached, the above-described target virtual object will continue to decelerate or stop moving in the manner provided in the related art, thereby retaining the attribute function previously configured in the game engine.
In this embodiment, if it is detected that the target virtual object is still in a moving state (i.e. the player still operates the moving key) after the target virtual object collides with the obstacle, the offset direction of the target virtual object sliding along the obstacle is calculated according to the current moving direction, and the target virtual object is controlled to rapidly slide over the current obstacle along the offset direction.
Optionally, in this embodiment, the materials of the different types of obstacles in the virtual scene are different, and the target virtual object may, but is not limited to, perform sliding movement at different sliding speeds after colliding with the different obstacles. For example, when the target virtual object collides with some smooth obstacles such as stones, tiles and the like, the sliding speed of the target virtual object is relatively fast; when the target virtual object collides with some rough obstacles such as wood, the sliding speed of the target virtual object is relatively slow. Therefore, different sliding movement effects are simulated in a virtual scene aiming at different obstacles, and the simulation degree of the sliding movement process is improved.
The description is made with reference to the example shown in fig. 3: assume that the target virtual object is a client-controlled virtual character (virtual character as shown in the figure) and the obstacle is a wall.
As shown in fig. 3 (a), the virtual character is in a moving state (e.g., running forward) in the virtual scene. When the virtual character is detected to collide with the wall at the position P1, the collision angle α between the target virtual object and the obstacle is determined. Further, whether the collision angle alpha reaches a sliding condition preset by the game task is judged. In a case where it is determined that the collision angle α has reached the slide condition, the virtual character is controlled to slide along the wall in the offset direction corresponding to the moving direction, as shown in fig. 3 (b), in the direction of the position P2 (the direction indicated by the broken-line arrow).
According to the embodiment provided by the application, under the condition that a target virtual object moving in a virtual scene collides with an obstacle in the virtual scene, the collision angle between the target virtual object and the obstacle is determined, and under the condition that the collision angle reaches a sliding condition, the target virtual object is controlled to automatically attach to the obstacle and slide and move along the offset direction, and a user does not need to manually adjust the moving direction of the target virtual object, so that the situation that the target virtual object is clamped at the position of the obstacle and cannot move can be avoided, the effect of simplifying the control operation when the target virtual object collides with the obstacle is achieved, and the problem that the complexity of object control operation is high in the related technology is solved.
As an alternative, determining the collision angle between the target virtual object and the obstacle includes:
s1, determining the collision position when the target virtual object collides with the obstacle;
s2, determining the collision surface of the obstacle based on the collision position;
and S3, determining an included angle between the current moving direction of the target virtual object and the vertical direction of the collision surface of the obstacle as a collision angle.
It should be noted that, since the surface of each obstacle in the virtual scene is not necessarily a plane, it is likely to be an uneven surface. Thus, in the present embodiment, it is possible, but not limited to, determining the collision surface based on the collision position and then determining the collision angle based on the normal vector of the collision surface. Thereby achieving the purpose of improving the accuracy of the determined collision angle.
For example, as shown in fig. 4, the above-mentioned assumed scenario is still used as an example for explanation: such as a virtual character moving in a virtual scene (e.g., running forward). When the virtual character is detected to collide with the wall at the position P1, the collision surface of the barrier wall (as the collision surface with the thick line in FIG. 4) is determined to be the surface where the position P1 is located.
Then, the moving direction of the virtual character at the time of the collision and the vertical direction of the collision surface where the above-mentioned P1 position is located are obtained as two straight lines constituted by dotted lines shown in fig. 4. According to the relation of the trigonometric function, the included angle alpha between the straight line of the moving direction and the straight line of the vertical direction can be calculated, and the included angle alpha is determined as the collision angle alpha.
Through the embodiment provided by the application, after the collision surface of the obstacle corresponding to the collision position is determined, the included angle between the moving direction of the target virtual object when the target virtual object collides and the vertical direction of the collision surface is obtained, so that the accuracy of the collision angle for judging whether the sliding condition is met in the determined current collision event is ensured, and the accuracy of the sliding movement control is improved.
As an optional scheme, after determining the collision angle between the target virtual object and the obstacle, the method further includes:
1) under the condition that the collision angle is smaller than the target angle threshold value, determining the collision angle and not reaching the sliding condition, and controlling the target virtual object to reduce the moving speed or stop moving;
it should be noted that, since two colliders in the virtual scene decelerate or stop moving after collision, these are self-attributes configured in the game engine (e.g. unity). In the present embodiment, whether the control target virtual object automatically follows the obstacle to slide and move or whether the control target virtual object is controlled to decelerate or stop moving in accordance with the attribute of the game engine itself is determined using the determination results of the slide condition and the collision angle set in advance.
Optionally, in this embodiment, when the collision angle is smaller than the target angle threshold, it is determined that the coasting condition is not reached, that is, the currently occurring collision cannot trigger the coasting movement. The control target virtual object decelerates or stops moving according to its own attribute.
For example, as shown in fig. 5, assume that OA is the collision surface of the obstacle and OB is the vertical direction perpendicular to OA. Assuming that the moving direction of the target virtual object during the currently occurring collision can be represented by OC, the included angle α between OC and OB is determined as the collision angle. And further controlling the target virtual object to decelerate or stop moving when the collision angle alpha is determined to be smaller than the target angle threshold value.
2) In the event that the collision angle is greater than or equal to the target angle threshold, it is determined that the collision angle has reached a coasting condition.
Alternatively, in this embodiment, when the collision angle is greater than or equal to the target angle threshold, it is determined that the coasting condition has been reached, that is, the currently occurring collision may trigger the coasting movement. The control target virtual object automatically fits the obstacle and glides in the offset direction.
For example, as shown in fig. 5, assume that OA is the collision surface of the obstacle and OB is the vertical direction perpendicular to OA. Assuming that the moving direction of the target virtual object during the current collision can be represented by OD, the included angle β between OD and OB is determined as the collision angle. And further controlling the target virtual object to automatically attach to the barrier and to slide and move along the offset direction when the collision angle beta is determined to be larger than the target angle threshold value.
The gliding movement effect can be explained in connection with fig. 3. Assuming that the moving direction indicates that the target virtual object is colliding with the obstacle obliquely from the left, the offset direction is determined to be a direction to the left of the wall-facing surface (a direction indicated by a dotted arrow shown in fig. 3 (b)). Then, the control target virtual object slides and moves along the offset direction against the obstacle, and the stop position after the sliding movement is the corner formed by the two obstacle walls, as shown in fig. 3 (b).
Alternatively, in the present embodiment, the sliding speed of the target virtual object sliding and moving along the offset direction while fitting the obstacle may be determined according to, but not limited to, the collision angle. As shown in fig. 5, when the collision angle is greater than β, the target virtual object will slide quickly, and when the collision angle is greater than α and less than β, the target virtual object will slide slowly. That is, in an angle section larger than the target angle threshold value, the larger the collision angle is, the faster the coasting speed thereof is, and the smaller the collision angle is, the slower the coasting speed thereof is.
Through the embodiment provided by the application, different moving modes are distinguished by using the comparison result between the collision angle and the sliding condition, the purpose of keeping the original function of the game engine is achieved, the collision angle can be adjusted by a player through control operation, and the effect of flexibly realizing sliding movement is achieved. That is, the effect of achieving multi-mode compatibility that the control target virtual object moves according to different moving modes is achieved.
As an alternative, controlling the target virtual object to slidingly move in the offset direction at the target sliding speed includes:
s1, determining a target sliding speed matched with the material of the obstacle;
and S2, controlling the target virtual object to slide and move along the offset direction according to the target sliding speed.
Alternatively, in the present embodiment, it may be, but is not limited to, determining whether the target virtual object collides with the obstacle through ray detection. Assuming that the detection result of the ray detection indicates that an obstacle is detected, all attribute information on the obstacle is acquired. The attribute information may include, but is not limited to, information such as a collision position and a material of an obstacle. The material may indicate the type of composition of the obstacle, such as stone, wood, glass, etc. In the present embodiment, obstacles made of different materials may be matched with different sliding speeds, but not limited to.
For example, as described with reference to fig. 6, it is assumed that the target virtual object is determined to slidingly move in the offset direction (the direction in which the position P3 is located). If the obstacle indicates a tile wall, as shown in fig. 6 (a), the sliding speed of the sliding movement from the collision position P1 to P3 is v 1; if the obstacle indicates a wood wall, as shown in fig. 6 (b), the sliding speed of the sliding movement starting from the collision position P1 toward P3 is v 2. Since the friction of wood is greater than that of tiles, the above-mentioned sliding speed v2 will also be less than the sliding speed v 1.
Through the embodiment provided by the application, the target virtual object is controlled to slide and move according to the target sliding speed matched with the material of the barrier, the simulation degree of the target virtual object which is attached to the barrier and slides and moves after collision in the virtual scene is improved, and the user experience is improved.
As an alternative, controlling the target virtual object to slidingly move in the offset direction at the target sliding speed includes: when the target virtual object leaves the obstacle, the control target virtual object is returned to the moving speed before the collision occurs.
It should be noted that, during the sliding movement of the target virtual object against the obstacle, the sliding speed may be, but is not limited to, a speed component of the moving speed in the offset direction before the collision. And under the condition that the target virtual object leaves the obstacle after sliding for a certain distance, the control target virtual object is restored to the moving speed before the collision occurs.
For example, assume that the above-described assumed scenario is still exemplified as follows: if the virtual character is in a moving state (e.g., running forward) in the virtual scene, the moving speed is v 0. As shown in fig. 7 (a), the target virtual object collides with the obstacle at a collision position P1.
Then, in a case where the collision angle determined based on the collision position P1 reaches the coasting condition, it is determined that the control target virtual object is coasting-moved in the offset direction determined based on the moving direction against the obstacle. After determining the velocity component in the offset direction (i.e., the sliding velocity v1) based on the above-described moving velocity v0, the target virtual object is controlled to slide and move at the sliding velocity v1 from the P1 position, as shown in fig. 7 (b). After moving to the obstacle boundary position P4, if it is determined that the target virtual object leaves the obstacle, the target virtual object is restored to the moving speed v0 and continues to move to the position P5.
Through the embodiment provided by the application, under the condition that the target virtual object after the sliding movement is detected to leave the obstacle, the target virtual object is controlled to return to the moving speed before collision, so that the target virtual object is returned to the moving state before collision, and the motion information of the target virtual object in the virtual scene is maintained.
As an alternative, the controlling the target virtual object to automatically fit the obstacle and to slidingly move in the offset direction includes:
s1, determining the initial sliding movement speed matched with the collision angle;
s2, the control target virtual object starts the sliding movement in the offset direction at the initial sliding movement speed.
It should be noted that when the target virtual object collides with the obstacle, different collision angles will have different effects on the sliding speed.
Optionally, in this embodiment, determining the initial speed of the sliding movement matched with the collision angle includes:
s11, determining the moving speed of the target virtual object when colliding with the obstacle;
s12, calculating the velocity component of the moving velocity in the offset direction according to the collision angle;
and S13, determining the speed component as the initial speed of the sliding movement.
In this embodiment, after the target virtual object collides with the obstacle, the direction vector of the offset direction may be determined based on, but not limited to, the component of the movement direction vector of the target virtual object before the collision on the collision surface of the obstacle based on the trigonometric function relationship. That is, it is determined in which direction of the collision surface the offset direction of the target virtual object is along, according to the moving direction of the target virtual object within the virtual space.
Further, based on the trigonometric function relationship, the velocity vector of the moving velocity of the target virtual object before the collision may be decomposed to obtain the sliding velocity at which the target virtual object slides in the offset direction in accordance with the obstacle.
For example, when the target virtual object collides with the obstacle, a collision surface determined based on the collision position and a vertical direction of the collision surface are as shown in fig. 8. Further, assuming that the OA vector is used to indicate the moving direction of the target virtual object, it is determined according to the trigonometric function that the OB vector indicates the offset direction in which the target virtual object slides against the obstacle.
The moving speed when the target virtual object collides with the obstacle is vMoving deviceIn the case of (2), the velocity vector of the moving velocity is decomposed to obtain a velocity component v in the offset directionSliding deviceThe velocity component v can then be divided intoSliding deviceAnd determining the initial speed of the target virtual object sliding and moving along the offset direction by attaching to the obstacle.
According to the embodiment provided by the application, the initial sliding movement speed of the target virtual object during sliding movement is determined according to the collision speed of the target virtual object when colliding with the obstacle. Therefore, the player can obtain different collision angles through different control operations, and the effect of flexibly adjusting the initial speed of sliding movement of the attached barrier is achieved.
As an optional scheme, after the control target virtual object starts the sliding movement in the offset direction according to the initial sliding movement speed, the method further includes:
s1, determining the friction force matched with the material of the barrier;
s2, determining the resistance acceleration of the target virtual object when sliding along the offset direction according to the friction force;
s3, determining the current sliding speed according to the initial sliding movement speed and the resistance acceleration;
and S4, controlling the target virtual object to slide and move according to the current sliding speed.
Alternatively, in the present embodiment, it may be, but is not limited to, determining whether the target virtual object collides with the obstacle through ray detection. Assuming that the detection result of the ray detection indicates that an obstacle is detected, all attribute information on the obstacle is acquired. The attribute information may include, but is not limited to, information such as a collision position and a material of an obstacle. The material may indicate the type of composition of the obstacle, such as stone, wood, glass, etc. In the present embodiment, obstacles made of different materials may be matched with different sliding speeds, but not limited to.
Due to the fact that friction coefficients of obstacles made of different materials are different, friction force born by the target virtual object in the sliding movement process is correspondingly different. That is, in the process of the sliding movement at the initial sliding movement speed, the resistance acceleration received by the target virtual object is different for different material obstacles.
It should be noted that, the target virtual object is influenced by friction during the sliding movement, and the sliding speed of the target virtual object gradually decreases. Therefore, in this embodiment, it is possible, but not limited to, to calculate a sliding speed of the target virtual object in real time during the sliding movement in combination with the resistance acceleration on the basis of the initial speed of the sliding movement, and control the target virtual object to slide and move according to the sliding speed.
Optionally, in this embodiment, if the target virtual object leaves the obstacle after sliding for a certain distance, and does not continue to slide and move, and is affected by the friction force, the moving speed of the target virtual object will be reduced to some extent, and then the target virtual object may continue to move at the speed when the target virtual object leaves the obstacle.
For example, assume that the above-described assumed scenario is still exemplified as follows: if the virtual character is in a moving state (e.g., running forward) in the virtual scene, the moving speed is v 0. As shown in fig. 9 (a), the target virtual object collides with the obstacle at a collision position P1.
Then, in a case where the collision angle determined based on the collision position P1 reaches the coasting condition, it is determined that the control target virtual object is coasting-moved in the offset direction determined based on the moving direction against the obstacle. After determining the velocity component in the offset direction (i.e., the initial sliding movement velocity v1) based on the movement velocity v0, the target virtual object is controlled to start the sliding movement from the P1 position at the initial sliding movement velocity v1, as shown in fig. 9 (b). During the sliding movement, the sliding speed of the target virtual object is continuously reduced under the influence of friction. Assuming that the target virtual object is determined to leave the obstacle after moving to the obstacle boundary position P4, and it is determined that the current sliding speed has decreased to v1 ', the target virtual object is controlled to resume moving to the position P5 according to the moving speed v 1'.
According to the embodiment provided by the application, the current sliding speed of the target virtual object in the sliding movement process is calculated in real time by combining the friction force matched with the material of the barrier, and the target virtual object is controlled to slide and move according to the current sliding speed, so that the sliding movement process of the target virtual object attached to the barrier in the virtual scene is closer to the real scene, and the simulation degree of the sliding movement is improved.
As an alternative, controlling the target virtual object to slidingly move at the current sliding speed includes: and controlling the target virtual object to stop moving under the condition that the target virtual object still fits the obstacle but the current sliding speed reaches the target threshold value.
Specifically, the description is made with reference to fig. 10, assuming that the above-mentioned assumed scenario is still used as an example: if the virtual character is in a moving state (e.g., running forward) in the virtual scene, the moving speed is v 0. As shown in fig. 10 (a), the target virtual object collides with the obstacle at a collision position P1.
Then, in a case where it is determined that the collision angle at the time of its collision reaches the slide condition, the control target virtual object is slidingly moved in the offset direction (the direction indicated by the broken-line arrow shown in the figure) in conformity with the obstacle as shown in fig. 10 (b). If the target virtual object continues to be reduced in sliding speed due to the influence of friction during the sliding movement, the target virtual object is controlled to stop moving and stay at the current position when the sliding speed of the target virtual object reaches 0 when the target virtual object slides to the position P6 where the target virtual object has not left the obstacle.
Through the embodiment provided by the application, the target virtual object is controlled to stop moving under the condition that the target virtual object still fits the obstacle but the current sliding speed reaches the target threshold value. Therefore, high-simulation sliding control is realized on the target virtual object.
The embodiment provided by the present application is fully described by the process shown in fig. 11 in particular: assume for example a shooting confrontation game mission in which a player will use a shooting prop to kill an enemy character belonging to a different battle through a client-controlled virtual character. The virtual role controlled by the client may be the target virtual object. In the shooting confrontation game mission, many obstacles are provided in order to enhance the confrontation difficulty and interactivity.
After starting a game task, the player controls the currently controlled virtual character to move forward as by step S1102. When an obstacle is encountered, step S1104 is performed to determine whether the virtual character collides with the obstacle. If it is determined that the vehicle does not collide with the obstacle, the process returns to the step S1102. If it is determined that the virtual character collides with the obstacle, step S1106 is executed to calculate a collision angle (i.e., an angle between a moving direction and a vertical direction of a collision surface of the obstacle) when the virtual character collides with the obstacle. Then, it is determined whether the collision angle exceeds the coasting angle (i.e., whether the coasting condition is reached) in step S1108.
If the collision angle is smaller than the slidable angle, in step S1110-1, the virtual character is controlled to stop moving. And adjusts the moving direction thereof according to the manual operation of the player and continues the forward movement according to the new adjusted moving direction, e.g., returning to step S1102.
If the collision angle is greater than or equal to the slidable angle, in step S1110-2, the sliding speed of the virtual character when sliding along the obstacle is calculated. Step S1112 is executed again to determine whether the vehicle leaves the obstacle after the vehicle slides for a certain distance. If the vehicle does not leave the obstacle, the method returns to the step before the step S1110-2. If the virtual character leaves the obstacle, step S1114 is executed to stop the sliding compensation and control the virtual character to return to the normal speed.
The process shown in fig. 11 is an example, the flow steps and the execution sequence thereof are examples, and this embodiment is not limited in any way.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
According to another aspect of the embodiment of the present invention, there is also provided an object control apparatus for implementing the above object control method. As shown in fig. 12, the apparatus includes:
a display unit 1202 for displaying a target virtual object in a moving state in a virtual scene;
a first determining unit 1204, configured to determine a collision angle between a target virtual object and an obstacle in a virtual scene when the moving target virtual object collides with the obstacle;
and the control unit 1206 is used for controlling the target virtual object to automatically attach to the obstacle and to slide and move along the offset direction when the collision angle reaches the sliding condition, wherein the offset direction is determined according to the current moving direction of the target virtual object.
Optionally, in this embodiment, the object control apparatus may further include various functional unit modules for implementing the object control method, which are obtained by referring to the method embodiment and are not described herein again.
As an alternative, the first determining unit 1204 includes:
the first determination module is used for determining a collision position when the target virtual object collides with the barrier;
the second determining module is used for determining a collision surface of the barrier based on the collision position;
and the third determining module is used for determining an included angle between the current moving direction of the target virtual object and the vertical direction of the collision surface of the obstacle as a collision angle.
Optionally, in this embodiment, the object control apparatus may further include various functional unit modules for implementing the object control method, which are obtained by referring to the method embodiment and are not described herein again.
As an optional scheme, the method further comprises the following steps:
a second determination unit for determining a collision angle between the target virtual object and the obstacle and controlling the target virtual object to reduce the moving speed or stop moving if the collision angle is smaller than a target angle threshold value; in the event that the collision angle is greater than or equal to the target angle threshold, it is determined that the collision angle has reached a coasting condition.
Optionally, in this embodiment, the object control apparatus may further include various functional unit modules for implementing the object control method, which are obtained by referring to the method embodiment and are not described herein again.
As an alternative, the control unit 1206 includes:
the fourth determination module is used for determining the target sliding speed matched with the material of the barrier;
and the first control module is used for controlling the target virtual object to slide and move along the offset direction according to the target sliding speed.
Optionally, in this embodiment, the object control apparatus may further include various functional unit modules for implementing the object control method, which are obtained by referring to the method embodiment and are not described herein again.
As an alternative, the first control module includes:
and the first control sub-module is used for controlling the target virtual object to return to the moving speed before collision when the target virtual object leaves the obstacle.
Optionally, in this embodiment, the object control apparatus may further include various functional unit modules for implementing the object control method, which are obtained by referring to the method embodiment and are not described herein again.
As an alternative, the control unit 1206 includes:
the fifth determining module is used for determining the initial sliding movement speed matched with the collision angle;
and the second control module is used for controlling the target virtual object to start sliding movement along the offset direction according to the initial sliding movement speed.
Optionally, in this embodiment, the object control apparatus may further include various functional unit modules for implementing the object control method, which are obtained by referring to the method embodiment and are not described herein again.
As an optional solution, the fifth determining module includes:
the first determining submodule is used for determining the moving speed of the target virtual object when the target virtual object collides with the obstacle;
the calculation submodule is used for calculating the speed component of the moving speed in the offset direction according to the collision angle;
and a second determination submodule for determining the velocity component as the initial velocity of the coasting movement.
Optionally, in this embodiment, the object control apparatus may further include various functional unit modules for implementing the object control method, which are obtained by referring to the method embodiment and are not described herein again.
As an optional scheme, the method further comprises the following steps:
the sixth determining module is used for determining the friction force matched with the material of the barrier after the control target virtual object starts to slide and move along the offset direction according to the initial sliding movement speed;
the seventh determining module is used for determining the resistance acceleration of the target virtual object when the target virtual object slides and moves along the offset direction according to the friction force;
the eighth determining module is used for determining the current sliding speed according to the initial sliding movement speed and the resistance acceleration;
and the third control module is used for controlling the target virtual object to slide and move according to the current sliding speed.
Optionally, in this embodiment, the object control apparatus may further include various functional unit modules for implementing the object control method, which are obtained by referring to the method embodiment and are not described herein again.
As an alternative, the third control module includes:
and the third control sub-module is used for controlling the target virtual object to stop moving under the condition that the target virtual object still fits the obstacle but the current sliding speed reaches the target threshold value.
Optionally, in this embodiment, the object control apparatus may further include various functional unit modules for implementing the object control method, which are obtained by referring to the method embodiment and are not described herein again.
According to another aspect of the embodiment of the present invention, there is also provided an electronic device for implementing the object control method, where the electronic device may be a terminal device or a server shown in fig. 1. The present embodiment takes the electronic device as a terminal device as an example for explanation. As shown in fig. 13, the electronic device comprises a memory 1302 and a processor 1304, wherein the memory 1302 stores a computer program, and the processor 1304 is configured to perform the steps of any of the above method embodiments by the computer program.
Optionally, in this embodiment, the electronic device may be located in at least one network device of a plurality of network devices of a computer network.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, displaying the target virtual object in the moving state in the virtual scene;
s2, determining the collision angle between the target virtual object and the obstacle when the moving target virtual object collides with the obstacle in the virtual scene;
and S3, controlling the target virtual object to automatically attach to the obstacle and to slide and move along the offset direction when the collision angle reaches the sliding condition, wherein the offset direction is determined according to the current moving direction of the target virtual object.
Alternatively, it can be understood by those skilled in the art that the structure shown in fig. 13 is only an illustration, and the electronic device may also be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palmtop computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 13 is a diagram illustrating a structure of the electronic device. For example, the electronics may also include more or fewer components (e.g., network interfaces, etc.) than shown in FIG. 13, or have a different configuration than shown in FIG. 13.
The memory 1302 may be used to store software programs and modules, such as program instructions/modules corresponding to the object control method and apparatus in the embodiments of the present invention, and the processor 1304 executes various functional applications and data processing by running the software programs and modules stored in the memory 1302, that is, implementing the object control method. The memory 1302 may include high speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 1302 may further include memory located remotely from the processor 1304, which may be connected to the terminal over a network. Examples of the network include, but are not limited to, the internet, an intranet, object attribute information of a target virtual object of a local area network, and attribute information of an obstacle. As an example, as shown in fig. 13, the memory 1302 may include, but is not limited to, a display unit 1202, a first determination unit 1204, and a control unit 1206 of the object control device. In addition, other module units in the object control apparatus may also be included, but are not limited to, and are not described in detail in this example.
Optionally, the transmitting device 1306 is used for receiving or sending data via a network. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 1306 includes a Network adapter (NIC) that can be connected to a router via a Network cable and other Network devices to communicate with the internet or a local area Network. In one example, the transmitting device 1306 is a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
In addition, the electronic device further includes: a display 1308 for displaying a virtual scene, a target virtual object in a moving state, and a sliding movement process of the target virtual object and the obstacle attached to the target virtual object along an offset direction; and a connection bus 1310 for connecting the respective module parts in the above-described electronic apparatus.
In other embodiments, the terminal device or the server may be a node in a distributed system, where the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting a plurality of nodes through a network communication. Nodes can form a Peer-To-Peer (P2P, Peer To Peer) network, and any type of computing device, such as a server, a terminal, and other electronic devices, can become a node in the blockchain system by joining the Peer-To-Peer network.
According to an aspect of the application, a computer program product or computer program is provided, comprising computer instructions, the computer instructions being stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the object control method. Wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
Alternatively, in the present embodiment, the above-mentioned computer-readable storage medium may be configured to store a computer program for executing the steps of:
s1, displaying the target virtual object in the moving state in the virtual scene;
s2, determining the collision angle between the target virtual object and the obstacle when the moving target virtual object collides with the obstacle in the virtual scene;
and S3, controlling the target virtual object to automatically attach to the obstacle and to slide and move along the offset direction when the collision angle reaches the sliding condition, wherein the offset direction is determined according to the current moving direction of the target virtual object.
Alternatively, in this embodiment, a person skilled in the art may understand that all or part of the steps in the methods of the foregoing embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, network devices, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (12)

1. An object control method, comprising:
displaying a target virtual object in a moving state in a virtual scene;
determining a collision angle between the target virtual object and an obstacle in the virtual scene when the target virtual object in motion collides with the obstacle;
and under the condition that the collision angle reaches a sliding condition, controlling the target virtual object to automatically attach to the barrier and to slide and move along an offset direction, wherein the offset direction is determined according to the current moving direction of the target virtual object.
2. The method of claim 1, wherein determining the angle of collision between the target virtual object and the obstacle comprises:
determining a collision position when the target virtual object collides with the obstacle;
determining a collision surface of the obstacle based on the collision position;
and determining an included angle between the current moving direction of the target virtual object and the vertical direction of the collision surface of the obstacle as the collision angle.
3. The method of claim 2, after determining the angle of collision between the target virtual object and the obstacle, further comprising:
under the condition that the collision angle is smaller than a target angle threshold value, determining that the collision angle does not reach the sliding condition, and controlling the target virtual object to reduce the moving speed or stop moving;
determining that the collision angle reaches the coasting condition if the collision angle is greater than or equal to the target angle threshold.
4. The method of claim 1, wherein controlling the target virtual object to automatically conform to the obstacle and slidingly move in an offset direction comprises:
determining a target sliding speed matched with the material of the barrier;
and controlling the target virtual object to slide and move along the offset direction according to the target sliding speed.
5. The method of claim 4, wherein controlling the target virtual object to slidingly move in the offset direction at the target sliding speed comprises:
and controlling the target virtual object to return to the moving speed before the collision when the target virtual object leaves the obstacle.
6. The method of claim 1, wherein controlling the target virtual object to automatically conform to the obstacle and slidingly move in an offset direction comprises:
determining the initial sliding movement speed matched with the collision angle;
and controlling the target virtual object to start sliding movement along the offset direction according to the initial sliding movement speed.
7. The method of claim 6, wherein determining an initial speed of taxi movement that matches the angle of collision comprises:
determining a moving speed of the target virtual object when colliding with the obstacle;
calculating a velocity component of the moving velocity in the offset direction according to the collision angle;
determining the speed component as the initial speed of the coasting movement.
8. The method of claim 6, further comprising, after controlling the target virtual object to start the sliding movement in the offset direction at the initial sliding movement speed:
determining the friction force matched with the material of the barrier;
determining resistance acceleration of the target virtual object in sliding movement along the offset direction according to the friction force;
determining the current sliding speed according to the initial sliding movement speed and the resistance acceleration;
and controlling the target virtual object to slide and move according to the current sliding speed.
9. The method of claim 8, wherein controlling the target virtual object to coast at the current coast speed comprises:
and controlling the target virtual object to stop moving under the condition that the target virtual object still fits the obstacle but the current sliding speed reaches a target threshold value.
10. An object control apparatus, characterized by comprising:
a display unit for displaying a target virtual object in a moving state in a virtual scene;
a first determination unit, configured to determine a collision angle between the target virtual object and an obstacle in the virtual scene when the moving target virtual object collides with the obstacle;
and the control unit is used for controlling the target virtual object to automatically attach to the barrier and to slide and move along an offset direction under the condition that the collision angle reaches a sliding condition, wherein the offset direction is determined according to the current moving direction of the target virtual object.
11. A computer-readable storage medium, comprising a stored program, wherein the program when executed performs the method of any of claims 1 to 9.
12. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 9 by means of the computer program.
CN202110874353.4A 2021-07-30 2021-07-30 Object control method and device, storage medium and electronic equipment Active CN113559515B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110874353.4A CN113559515B (en) 2021-07-30 2021-07-30 Object control method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110874353.4A CN113559515B (en) 2021-07-30 2021-07-30 Object control method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN113559515A true CN113559515A (en) 2021-10-29
CN113559515B CN113559515B (en) 2023-11-14

Family

ID=78169616

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110874353.4A Active CN113559515B (en) 2021-07-30 2021-07-30 Object control method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN113559515B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106383016A (en) * 2016-08-19 2017-02-08 锦州锦恒汽车安全系统有限公司 Vehicle side impact simulation test structure and test method thereof
CN110180182A (en) * 2019-04-28 2019-08-30 腾讯科技(深圳)有限公司 Collision checking method, device, storage medium and electronic device
US20190388729A1 (en) * 2018-06-21 2019-12-26 Bridgestone Sports Co.,Ltd. Golf ball evaluation method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106383016A (en) * 2016-08-19 2017-02-08 锦州锦恒汽车安全系统有限公司 Vehicle side impact simulation test structure and test method thereof
US20190388729A1 (en) * 2018-06-21 2019-12-26 Bridgestone Sports Co.,Ltd. Golf ball evaluation method
CN110180182A (en) * 2019-04-28 2019-08-30 腾讯科技(深圳)有限公司 Collision checking method, device, storage medium and electronic device

Also Published As

Publication number Publication date
CN113559515B (en) 2023-11-14

Similar Documents

Publication Publication Date Title
CN109847361B (en) Method and device for synchronizing motion states, storage medium and electronic device
US11173400B2 (en) Data exchange method and apparatus, storage medium and electronic device
CN108597530B (en) Sound reproducing method and apparatus, storage medium and electronic apparatus
US20220168647A1 (en) Virtual prop control method and apparatus, storage medium and electronic device
CN111228802B (en) Information prompting method and device, storage medium and electronic device
CN107998654B (en) Acceleration adjusting method and device, storage medium and electronic device
US20230054065A1 (en) Delivery of virtual effect
CN112107861B (en) Control method and device of virtual prop, storage medium and electronic equipment
CN111298430A (en) Virtual item control method and device, storage medium and electronic device
US20220274021A1 (en) Display method and apparatus for virtual scene, storage medium, and electronic device
US20220143507A1 (en) Method and apparatus for displaying virtual prop, storage medium, and electronic device
CN113209618B (en) Virtual character control method, device, equipment and medium
KR20220163452A (en) Interaction processing method of virtual props, device, electronic device and readable storage medium
CN110975283A (en) Processing method and device of virtual shooting prop, storage medium and electronic device
CN111111217A (en) Control method and device of virtual prop, storage medium and electronic device
WO2021143318A1 (en) Control method and device for virtual operating object, storage medium, and electronic device
CN111921195B (en) Three-dimensional scene generation method and device, storage medium and electronic device
US20230347248A1 (en) Controlling method and apparatus of virtual actor, storage medium and electronic device
CN110772784B (en) Carrier control method and device, storage medium and electronic device
US20220161144A1 (en) Image display method and apparatus, storage medium, and electronic device
CN113893542A (en) Object control method and apparatus, storage medium, computer program, and electronic device
CN112121428B (en) Control method and device for virtual character object and storage medium
CN113559515B (en) Object control method and device, storage medium and electronic equipment
CN111729312A (en) Position synchronization method, device and equipment
CN111111165A (en) Control method and device of virtual prop, storage medium and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40053528

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant