CN113559515B - 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
CN113559515B
CN113559515B CN202110874353.4A CN202110874353A CN113559515B CN 113559515 B CN113559515 B CN 113559515B CN 202110874353 A CN202110874353 A CN 202110874353A CN 113559515 B CN113559515 B CN 113559515B
Authority
CN
China
Prior art keywords
virtual object
target virtual
obstacle
target
collision
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.)
Active
Application number
CN202110874353.4A
Other languages
Chinese (zh)
Other versions
CN113559515A (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

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 the target virtual object and an obstacle in the virtual scene under the condition that the moving target virtual object collides with the obstacle; and under the condition that the collision angle reaches the sliding condition, the target virtual object is controlled to automatically attach to the obstacle 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.

Description

Object control method and device, storage medium and electronic equipment
Technical Field
The present invention relates to the field of computers, and in particular, to an object control method and apparatus, a storage medium, and an electronic device.
Background
In a combat interaction scenario provided by a shooting-type game application, a player is often required to obtain the winning of the current shooting game mission by controlling a virtual object to hit a target object in the game scenario using a virtual shooting prop. In the shooting game task, a player often needs to control a virtual object to move in real time in a game scene so as to hit and kill target objects appearing at different positions. In which moving virtual objects often encounter obstacles placed in the game scene.
In the existing scheme, the moving virtual object can be decelerated until the movement is stopped after the virtual object encounters an obstacle, and the virtual object can bypass the current obstacle and continue to move only after the player performs direction adjustment operation on the direction keys to control the virtual object to move in the direction without the obstacle.
However, in general, the real-time requirement of the fight interaction process is very high, and if the fight interaction process encounters an obstacle set in the virtual scene, the movement direction of the virtual object needs to be adjusted first, so that the virtual object can be moved continuously. If the operation level of the player is not high, the virtual object is easy to be blocked at the position of the current obstacle, and finally is killed by the enemy. That is, the control operation provided by the related art when the virtual object encounters an obstacle has a problem of high operation complexity.
In view of the above problems, no effective solution has been proposed at present.
Disclosure of Invention
The embodiment of the invention provides an object control method and device, a storage medium and electronic equipment, which at least solve the technical problem that the control operation of a virtual object when encountering an obstacle has higher operation complexity.
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 the 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 slide 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 embodiment 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 in a case where the target virtual object in motion collides with the obstacle; and a control unit configured to control the target virtual object to automatically attach to the obstacle and to slide in an offset direction when the collision angle reaches a sliding condition, wherein the offset direction is a direction determined according to a current movement 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-described object control method when run.
According to still another aspect of the embodiments of the present invention, there is also provided an electronic apparatus including a memory in which a computer program is stored, and a processor configured to execute the above-described object control method by the computer program.
In the embodiment of the application, under the condition that the target virtual object moving in the virtual scene collides with the 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 the sliding condition, the target virtual object is controlled to automatically attach to the obstacle and slide and move along the offset direction, and the moving direction of the target virtual object is not required to be manually adjusted by a user, so that the situation that the target virtual object is blocked at the position of the obstacle and cannot move is avoided, 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 overcome.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
FIG. 1 is a schematic diagram of a hardware environment of an alternative object control method according to an embodiment of the application;
FIG. 2 is a flow chart of an alternative object control method according to an embodiment of the application;
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 present invention;
FIG. 7 is a schematic diagram of yet another alternative object control method according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of yet another alternative object control method according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of yet another alternative object control method according to an embodiment of the present invention;
FIG. 10 is a schematic diagram of yet another alternative object control method according to an embodiment of the present invention;
FIG. 11 is a flow chart of another alternative object control method according to an embodiment of the invention;
fig. 12 is a schematic structural view of an alternative object control apparatus according to an embodiment of the present invention;
fig. 13 is a schematic structural view of an alternative electronic device according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise 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 embodiment of the present invention, there is provided an object control method, optionally, as an alternative implementation, the object control method may be applied, but not limited to, in the environment as shown in fig. 1. The above object control method may be applied, but not limited to, to an object control system in a hardware environment as shown in fig. 1, where the object control system may include, but is not limited to, a terminal device 102, a network 104, a server 106, and a database 108. The terminal device 102 runs a target client (a game client is taken as an example, and a virtual scene is presented in a display interface of the target client) logged in by using a target user account as shown in fig. 1. The terminal device 102 includes a man-machine interaction screen, a processor and a memory. The man-machine interaction screen is used for displaying a virtual scene (such as a virtual game scene) in the display interface, and the virtual game scene is displayed with a target virtual object 100-1 in a moving state and a pre-configured barrier 100-2; and is further configured to provide a man-machine interaction interface to receive a man-machine interaction operation for controlling the target virtual object to perform a predetermined action, such as a shooting action, a moving action, etc. performed in the virtual scene. The processor is used for responding to the man-machine 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 a target virtual object and the like) of the target virtual object displayed in the virtual scene and attribute information (such as position information and material information and the like of the obstacle in the virtual scene).
Further, a processing engine is included in the server 106 for performing a storing or reading operation on the database 108, such as storing the angle of collision received from the terminal device 102 into the database, or storing object attribute information of virtual objects controlled by the respective clients into the database. Such as the coasting conditions for comparison determination described above, are read from the database. That is, the server 106 may determine whether the collision angle reaches the sliding condition after receiving the collision angle from the terminal device 102 and reading the sliding condition from the database, and determine that the movement manner of the target virtual object presented in the terminal device is to fit the obstacle and to slidingly move in the offset direction if it is determined that the sliding condition is reached.
The specific process comprises the following steps: in step S102, a target virtual object 100-1 in a moving state is displayed in a virtual scene displayed on a display interface of a target client operated by the terminal device 102. Then, as shown in steps S104-S106, in the case where the terminal device 102 determines that the moving target virtual object 100-1 collides with the obstacle 100-2 in the virtual scene, a 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. Here, the calculation of 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 transmitted to the server 106 in real time, the server determines whether the target virtual object and the obstacle collide, and if the target virtual object and the obstacle collide, the collision angle between the target virtual object and the obstacle is calculated.
The processing engine of the server 106 will perform steps S108-S112: after the coasting conditions are read from the database, it is determined whether the collision angle reaches the coasting conditions. 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 obstacle and slide along the offset direction. The mobile mode is then notified to the terminal device 102 via the network 104.
In step S114, the terminal device 102 displays the process of automatically attaching the control target virtual object to the obstacle and sliding the control target virtual object in the offset direction on the display interface according to the received movement manner.
The interface and flow steps shown in fig. 1 are examples, and the steps S108 to S110 may be executed in a terminal device with a relatively high processing capability. That is, the steps shown in fig. 1 may be independently performed by the terminal device without participation of a server, so that communication cost is saved and processing waiting time is shortened, which is not limited by the embodiment of the present application.
It should be noted that, in this embodiment, when the target virtual object moving in the virtual scene collides with the obstacle in the virtual scene, the collision angle between the target virtual object and the obstacle is determined, and when the collision angle reaches the sliding condition, the target virtual object is controlled to automatically attach to the obstacle and slide and move along the offset direction, and the user does not need to manually adjust the moving direction of the target virtual object again, so that the target virtual object is prevented from being blocked at the position of the obstacle and cannot move, thereby achieving the effect of simplifying the control operation when the target virtual object collides with the obstacle, and further overcoming the problem of higher complexity of the object control operation in the related art.
Alternatively, in the present embodiment, the above-mentioned 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: a mobile phone (e.g., an Android mobile phone, iOS mobile phone, etc.), a notebook computer, a tablet computer, a palm computer, a MID (Mobile Internet Devices, mobile internet device), a PAD, a desktop computer, a smart television, etc. The target client may be an application client for performing an opponent type game task. The network may include, but is not limited to: a wired network, a wireless network, wherein the wired network comprises: local area networks, metropolitan area networks, and wide area networks, the wireless network comprising: bluetooth, WIFI, and other networks that enable wireless communications. 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 is not limited in any way in the present embodiment.
Alternatively, in this embodiment, the above object control method may be applied, but not limited to, a game terminal Application (APP) for completing a predetermined challenge game task in a virtual scene, such as a shooting game Application in a multiplayer online tactical game (Multiplayer Online Battle Arena abbreviated as MOBA) Application, where the challenge game task may be, but not limited to, a game task that a current player controls a virtual character in the virtual scene to complete with a virtual character controlled by another player through a man-machine interaction operation, where the challenge game task may be, but not limited to, running in a plug-in, applet form in an Application (such as a game APP running in a non-independent manner), or running in a game engine in an Application (such as a game APP running in an independent manner). 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 (Augmented Reality AR) game applications, mixed Reality (MR) game applications. The above is merely an example, and the present embodiment is not limited in any way.
Optionally, as an optional embodiment, as shown in fig. 2, the object control method includes:
s202, displaying a target virtual object in a moving state in a virtual scene;
alternatively, in the present 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 shooter game as an example, the screen of the virtual scene presented in the first-person shooter game (First Person Shooting Game, abbreviated as FPS) may be, but is not limited to, the screen observed by the view angle of the virtual character currently controlled as described above. Here, in the case where the virtual character collides with an obstacle, the view of the virtual character will be blocked by the obstacle, and the movement process of the virtual character will be blocked.
It should be noted that, in this embodiment, the target virtual object needs to move continuously in the virtual scene to perform interactive operations with enemy objects of different campaigns (e.g. capturing victory of a game task by shooting a prop against each other or capturing victory of a game task by a fight action, etc.).
S204, determining a collision angle between the target virtual object and the obstacle in the case that the moving target virtual object collides with the obstacle in the virtual scene;
Alternatively, in the present 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: virtual carrier objects, non-player Character objects (NPCs) 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 Dan Toudeng) in the virtual scene. That is, in the case where the moving target virtual object collides with the obstacle, the collision angle generated at the time of collision between the two is acquired.
It should be noted that, since the physical crash box (i.e., the crash body) provided by the game engine (e.g., the Unity engine) is mounted on the target virtual object, a rectangular parallelepiped crash body is mounted on the obstacle in order to detect the crash event. In the related art, when two collision bodies are in contact, the collision body of the moving target virtual object is decelerated or stopped immediately. But in practice in the opponent game task, if the target virtual object decelerates and stops at the position of the obstacle after colliding with the obstacle, there is a high possibility that the probability of being hit by the enemy object will be increased. In order to avoid the occurrence of the above situation, therefore, in the related art, it is necessary for the player to manually adjust the moving direction of the target virtual object so as to leave the colliding obstacle as soon as possible.
In this embodiment, the adjustment operation of the player is omitted, so that the player automatically slides against the obstacle along the offset direction. The above-described movement control manner omitting the adjustment operation will also help to avoid task failure caused by inexperienced operation of the novice player. Thereby achieving the purpose of simplifying the control operation when the target virtual object collides with the obstacle. The control method here is a scene in which a collision body occurs with an obstacle with respect to a collision body of a target virtual object.
S206, when the collision angle reaches the sliding condition, the target virtual object is controlled to automatically attach to the obstacle 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.
It should be noted that, after two collision bodies in the virtual scene collide, the movement is decelerated or stopped, and these are self-attributes configured in the game engine (such as units). Thus, in the present embodiment, whether or not the control target virtual object is fitted to the obstacle for sliding movement is determined using the determination result of the preset sliding condition and the collision angle. That is, in the event that the glide condition is not reached, the above-described target virtual object will continue to slow down or stop moving in the manner provided by the related art, thereby preserving the attribute function previously configured by 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 movement button) after the target virtual object collides with the obstacle, an offset direction in which the target virtual object is attached to the obstacle for sliding movement is calculated according to the current moving direction, and the target virtual object is controlled to quickly slide over the current obstacle along the offset direction.
Optionally, in this embodiment, the different types of obstacles in the virtual scene are different in material, and the target virtual object may perform sliding movement according to, but not limited to, different sliding speeds after colliding with the different obstacles. For example, the target virtual object slides relatively fast when colliding with relatively smooth obstacles such as stones, tiles, etc.; while the target virtual object slides relatively slowly when hitting some rough obstacles, such as wood, etc. 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.
Specifically described in connection with the example shown in fig. 3: assuming that the target virtual object is a client-controlled virtual character (virtual character as shown in the figure), 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 collision of the virtual character with the wall at the P1 position is detected, a collision angle alpha between the target virtual object and the obstacle is determined. Further, it is determined whether the collision angle α reaches a coasting condition configured in advance for the game task. When it is determined that the collision angle α has reached the sliding condition, the virtual character is controlled to slide against the wall in the direction of the displacement corresponding to the moving direction, and the virtual character is controlled to slide in the direction in which the P2 position is located (the direction indicated by the dotted arrow) as shown in fig. 3 b.
According to the embodiment provided by the application, under the condition that the target virtual object moving in the virtual scene collides with the 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 the sliding condition, the target virtual object is controlled to automatically attach to the obstacle and slide and move along the offset direction, and the moving direction of the target virtual object is not required to be manually adjusted by a user, so that the situation that the target virtual object is blocked at the position of the obstacle and cannot move is avoided, 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 art is further overcome.
As an alternative, determining the collision angle between the target virtual object and the obstacle includes:
s1, determining a collision position when a target virtual object collides with an obstacle;
s2, determining a 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.
Since the surface of each obstacle in the virtual scene is not necessarily a plane, it is highly likely to be an uneven surface. Thus, in the present embodiment, the above-described collision angle may be determined, but is not limited to, using a determination of a collision surface based on a collision position, and then based on a 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 description will be given taking the above assumed scenario as an example: such as the avatar being 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 P1 position, the surface where the P1 position is located is determined to be the collision surface of the obstacle wall (such as the surface where the bold line is located in fig. 4).
Then, the moving direction of the virtual character at the time of collision and the vertical direction of the collision surface of the obstacle wall on which the above-described P1 position is located are obtained as two straight lines constituted by dotted lines as shown in fig. 4. According to the relation of the trigonometric function, the included angle alpha between the straight line in which the moving direction is located and the straight line in which the straight line is located relative to the vertical direction can be calculated, and the included angle alpha is determined as the collision angle alpha.
According to the embodiment of 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 sliding movement control is improved.
As an alternative, 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 that the collision angle does not reach the sliding condition, and controlling the target virtual object to reduce the moving speed or stop moving;
it should be noted that, since two collision bodies in the virtual scene decelerate or stop moving after collision, these are self-attributes configured in the game engine (such as units). In the present embodiment, the determination result of the preset sliding condition and the collision angle is used to determine whether the control target virtual object automatically slides against the obstacle or controls the deceleration or stop movement thereof according to the attribute of the game engine itself.
Optionally, in this embodiment, when the collision angle is smaller than the target angle threshold, it is determined that the sliding condition is not reached, that is, the currently occurring collision cannot trigger the sliding movement. The control target virtual object decelerates or stops moving according to its own properties.
For example, as shown in fig. 5, let OA be the collision surface of an obstacle and OB be the vertical direction perpendicular to OA. Assuming that the moving direction of the target virtual object in the current collision process can be represented by OC, determining the included angle α between OC and OB as the collision angle. Further, when the collision angle alpha is determined to be smaller than the target angle threshold value, the target virtual object is controlled to decelerate or stop moving.
2) And determining that the collision angle reaches the sliding condition under the condition that the collision angle is greater than or equal to the target angle threshold value.
Alternatively, in the present embodiment, in the case where the above collision angle is greater than or equal to the target angle threshold value, 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 engages the obstacle and slides in the offset direction.
For example, as shown in fig. 5, let OA be the collision surface of an obstacle and OB be the vertical direction perpendicular to OA. Assuming that the moving direction of the target virtual object in the collision process can be represented by an OD, determining an included angle β between the OD and the OB as a collision angle. And further, when the collision angle beta is determined to be larger than the target angle threshold value, the target virtual object is controlled to automatically attach to the obstacle and slide and move along the offset direction.
The effect of the glide movement can be explained in connection with what is shown in fig. 3. Assuming that the moving direction indicates that the target virtual object collides with an obstacle obliquely from the left, it is determined that the offset direction is the direction of the wall-attaching surface to the left (as indicated by the broken-line arrow shown in (b) of fig. 3). Then, the control target virtual object slides against the obstacle in the above-described offset direction, and the stop position after the sliding movement is a corner formed by two obstacle walls as shown in fig. 3 (b).
Alternatively, in the present embodiment, the sliding speed at which the target virtual object fits the obstacle and slides in the offset direction may be, but is not limited to, determined according to the above-described collision angle. As shown in fig. 5, in the case where the collision angle is greater than β, the target virtual object will slide rapidly, and in the case where 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, the larger the collision angle, the faster the coasting speed thereof, and the smaller the collision angle, the slower the coasting speed thereof.
According to the embodiment provided by the application, different movement modes are distinguished by utilizing the comparison result between the collision angle and the sliding condition, so that the purpose of retaining 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 further achieved. The method and the device realize the effect of achieving multi-mode compatibility of moving the control target virtual object according to different moving modes.
As an alternative, controlling the target virtual object to slide in the offset direction according to the target sliding speed includes:
s1, determining a target sliding speed matched with the material of an obstacle;
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 determined whether the target virtual object collides with the obstacle by, but not limited to, radiation detection. When the detection result of the radiation 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 of collision position, obstacle material, and the like. The material herein may indicate the type of constituent of the barrier, such as stone, wood, glass, etc. In this embodiment, different sliding speeds may be matched for different material obstacles, but not limited to.
For example, in the description 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 P3 position is located) against the obstacle. If the obstacle is indicated as a tile wall, as shown in fig. 6 (a), the sliding speed of the sliding movement from the collision position P1 to P3 is v1; if the obstacle is indicated as a wood wall, as shown in fig. 6 (b), the sliding speed of the sliding movement from the collision position P1 to the sliding movement P3 is v2. Since the friction of wood is greater than that of tile, the sliding speed v2 will also be less than the sliding speed v1.
According to 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 obstacle, so that the simulation degree of sliding and moving of the target virtual object attached to the obstacle after collision in the virtual scene is improved, and the user experience is improved.
As an alternative, controlling the target virtual object to slide in the offset direction according to the target sliding speed includes: when the target virtual object leaves the obstacle, the target virtual object is controlled to resume the movement speed before the collision.
In the process of the target virtual object attaching obstacle sliding movement, the sliding speed may be, but is not limited to, a speed component of the pre-collision movement speed in the offset direction. When the target virtual object slides a certain distance and leaves the obstacle, the target virtual object is controlled to resume to the moving speed before collision.
For example, assume that the above assumption scenario is still explained as an example: if the avatar is in a moving state (e.g., running forward) in the virtual scene, its moving speed is v0. As shown in fig. 7 (a), the target virtual object collides with an obstacle at a collision position P1.
Then, in the 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 in the offset direction determined based on the moving direction. After determining the velocity component in the offset direction (i.e., the coasting velocity v 1) based on the moving velocity v0, as shown in fig. 7 b, the target virtual object-attached obstacle is controlled to coast at the coasting velocity v1 from the P1 position. 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.
According to the embodiment of the application, when the target virtual object after sliding movement is detected to leave the obstacle, the target virtual object is controlled to restore to the moving speed before collision, so that the target virtual object is restored to the moving state before collision, and the moving 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 virtual object of the control target starts sliding movement along the offset direction according to 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 the present embodiment, determining the initial velocity of the sliding movement that matches the collision angle includes:
s11, determining the moving speed of the target virtual object when the target virtual object collides with the obstacle;
s12, calculating a speed component of the moving speed in the offset direction according to the collision angle;
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 trigonometric function relationship, based on the component of the movement direction vector before the target virtual object collides on the collision surface of the obstacle. That is, depending on the moving direction of the target virtual object in the virtual space, it is determined which direction the offset direction thereof is along the collision surface.
Further, based on the above-described trigonometric function relationship, the velocity vector of the movement velocity before the collision of the target virtual object may be decomposed to obtain the sliding velocity at which the adhesion obstacle slides in the offset direction.
For example, it is assumed that when the target virtual object collides with an obstacle, the collision surface and the vertical direction of the collision surface determined based on the collision position are as shown in fig. 8. Further, assuming that the OA vector is used to indicate the moving direction of the target virtual object, determining the OB vector according to the trigonometric function indicates the offset direction of the target virtual object sliding against the obstacle.
The moving speed when the target virtual object collides with the obstacle is v Moving In the case of (2), the velocity vector of the moving velocity is decomposed to obtain a velocity component v in the direction of displacement Sliding device The velocity component v can be used Sliding device And determining the initial speed of sliding movement of the target virtual object attaching obstacle along the offset direction.
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 the target virtual object collides 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 the sliding movement of the attaching obstacle is further achieved.
As an alternative, 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 friction force matched with the material of an obstacle;
s2, 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;
s3, determining the current sliding speed according to the initial sliding movement speed and the resistance acceleration;
s4, controlling the target virtual object to slide and move according to the current sliding speed.
Alternatively, in the present embodiment, it may be determined whether the target virtual object collides with the obstacle by, but not limited to, radiation detection. When the detection result of the radiation 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 of collision position, obstacle material, and the like. The material herein may indicate the type of constituent of the barrier, such as stone, wood, glass, etc. In this embodiment, different sliding speeds may be matched for different material obstacles, but not limited to.
The friction coefficients of the obstacles made of different materials are different, so that the friction force born by the target virtual object in the sliding and moving process is correspondingly different. That is, in the course of the sliding movement at the initial sliding movement speed, the resistance acceleration applied to the target virtual object is different for the obstacle of different materials.
It should be noted that, the target virtual object is affected by friction during the sliding movement, and the sliding speed will gradually decrease. Thus, in this embodiment, the sliding speed of the target virtual object in real time during the sliding movement may be calculated by combining the resistance acceleration based on the initial sliding movement speed, and the target virtual object may be controlled to move in sliding according to the sliding speed.
Alternatively, in this embodiment, if the target virtual object leaves the obstacle after sliding movement for a certain distance, and does not continue sliding movement, the moving speed of the target virtual object will be reduced to a certain extent under the influence of friction, and then the target virtual object may continue to move according to the speed when the target virtual object leaves the obstacle.
For example, assume that the above assumption scenario is still explained as an example: if the avatar is in a moving state (e.g., running forward) in the virtual scene, its moving speed is v0. As shown in fig. 9 (a), the target virtual object collides with an obstacle at a collision position P1.
Then, in the 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 in the offset direction determined based on the moving direction. After determining the velocity component in the offset direction (i.e., the initial sliding velocity v 1) based on the movement velocity v0, as shown in fig. 9 b, the target virtual object-attached obstacle is controlled to start sliding movement from the P1 position at the initial sliding velocity v 1. During the sliding movement, the sliding speed of the target virtual object is continuously reduced under the influence of the friction force. Assuming that the target virtual object is determined to leave the obstacle after moving to the obstacle boundary position P4, and that the current coasting speed has been reduced to v1', the target virtual object is controlled to resume moving to the position P5 in accordance with 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 obstacle, and the target virtual object is controlled to slide according to the current sliding speed, so that the sliding movement process of the target virtual object attached to the obstacle 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 slide according to 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 will be given with reference to fig. 10 assuming that the above assumed scenario is still described as an example: if the avatar is in a moving state (e.g., running forward) in the virtual scene, its moving speed is v0. As shown in fig. 10 (a), the target virtual object collides with an obstacle at a collision position P1.
Then, in the case where it is determined that the collision angle at the time of collision thereof reaches the coasting condition, the control target virtual object is coasted and moved in the offset direction (the direction pointed by the broken line arrow as shown in the figure) as shown in fig. 10 (b). If the sliding speed of the target virtual object reaches 0 when the target virtual object slides to the position P6 where the obstacle has not been moved away, the target virtual object is controlled to stop moving and stay at the current position, assuming that the sliding speed is affected by the friction force during the sliding movement.
According to the embodiment provided by the application, when the target virtual object still fits an obstacle, but the current sliding speed reaches the target threshold value, the target virtual object is controlled to stop moving. Thereby realizing high-simulation sliding control on the target virtual object.
Detailed description of the applicationthe process shown in fig. 11 fully describes the embodiments provided by the present application: assume for example a shooter game mission in which a player would control a virtual character through a client to use shooting props to hit enemy characters belonging to different campaigns. The virtual role controlled by the client may be the target virtual object. In this shooting game task, many obstacles are provided in order to enhance the difficulty of the shooting and interactivity.
After starting a game mission, the player controls the currently controlled virtual character to move forward as by step S1102. Then, 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 obstacle has not been hit, the routine returns to step S1102. If it is determined that an obstacle has been hit, step S1106 is performed, in which the collision angle (i.e., the angle between the moving direction and the vertical direction of the collision surface of the obstacle) at the time of the collision of the virtual character with the obstacle is calculated. It is then determined whether the collision angle exceeds the slidable angle (i.e., whether the sliding condition is reached) as by 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 according to the manual operation of the player, and continues to move forward according to the adjusted new moving direction, as the step S1102 is returned.
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 the virtual character slides against the obstacle is calculated. Step S1112 is executed to determine whether the vehicle has moved a distance away from the obstacle. If the obstacle is not left, the process returns to step S1110-2. If the obstacle is not present, step S1114 is executed to stop the coasting compensation and control the virtual character to return to the normal speed.
The process shown in fig. 11 is an example, and the flow steps and the execution sequence thereof are examples, which are not limited in this embodiment.
It should be noted that, for simplicity of description, the foregoing method embodiments are all described as a series of acts, but it should be understood by those skilled in the art that the present invention is not limited by the order of acts described, as some steps may be performed in other orders or concurrently in accordance with the present invention. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required for the present 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 for determining, in the event of a collision of a moving target virtual object with an obstacle in a virtual scene, a collision angle between the target virtual object and the obstacle;
and a control unit 1206 for controlling the target virtual object to automatically attach to the obstacle and slide in an offset direction, wherein the offset direction is determined according to the current moving direction of the target virtual object, when the collision angle reaches the sliding condition.
Optionally, in this embodiment, the object control device may further include respective functional unit modules for implementing an object control method, which is obtained by referring to the above method embodiment, and will not be described herein.
As an alternative, the first determining unit 1204 includes:
the first determining module is used for determining the collision position when the target virtual object collides with the obstacle;
A second determining module for determining a collision surface of the obstacle based on the collision position;
and the third determining module is used for determining the 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.
Optionally, in this embodiment, the object control device may further include respective functional unit modules for implementing an object control method, which is obtained by referring to the above method embodiment, and will not be described herein.
As an alternative, the method further comprises:
a second determination unit configured to determine that the collision angle does not reach the coasting condition and control the target virtual object to reduce the moving speed or stop the movement, in a case where the collision angle is smaller than the target angle threshold value after determining the collision angle between the target virtual object and the obstacle; and determining that the collision angle reaches the sliding condition under the condition that the collision angle is greater than or equal to the target angle threshold value.
Optionally, in this embodiment, the object control device may further include respective functional unit modules for implementing an object control method, which is obtained by referring to the above method embodiment, and will not be described herein.
As an alternative, the control unit 1206 includes:
a fourth determining module, configured to determine a target sliding speed that matches a material of the obstacle;
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 device may further include respective functional unit modules for implementing an object control method, which is obtained by referring to the above method embodiment, and will not be described herein.
As an alternative, the first control module includes:
and the first control sub-module is used for controlling the target virtual object to restore to the moving speed before collision under the condition that the target virtual object leaves the obstacle.
Optionally, in this embodiment, the object control device may further include respective functional unit modules for implementing an object control method, which is obtained by referring to the above method embodiment, and will not be described herein.
As an alternative, the control unit 1206 includes:
a fifth determining module, configured to determine a sliding movement initial velocity that matches 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 device may further include respective functional unit modules for implementing an object control method, which is obtained by referring to the above method embodiment, and will not be described herein.
As an alternative, the fifth determining module includes:
the first determining submodule is used for determining the moving speed when the target virtual object collides with the obstacle;
a calculating sub-module for calculating a velocity component of the moving velocity in the offset direction according to the collision angle;
a second determination sub-module for determining the velocity component as a coasting movement initial velocity.
Optionally, in this embodiment, the object control device may further include respective functional unit modules for implementing an object control method, which is obtained by referring to the above method embodiment, and will not be described herein.
As an alternative, the method further comprises:
the sixth determining module is used for determining friction force matched with the material of the obstacle after the control target virtual object starts sliding movement along the offset direction according to the initial sliding movement speed;
a seventh determining module, configured to determine a resistance acceleration when the target virtual object slides 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 device may further include respective functional unit modules for implementing an object control method, which is obtained by referring to the above method embodiment, and will not be described herein.
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 device may further include respective functional unit modules for implementing an object control method, which is obtained by referring to the above method embodiment, and will not be described herein.
According to still another aspect of the embodiment of the present invention, there is also provided an electronic device for implementing the above object control method, where the electronic device may be a terminal device or a server as shown in fig. 1. The present embodiment is described taking the electronic device as a terminal device as an example. As shown in fig. 13, the electronic device comprises a memory 1302 and a processor 1304, the memory 1302 having stored therein a computer program, the processor 1304 being arranged to perform the steps of any of the method embodiments described above by means of the computer program.
Alternatively, in this embodiment, the electronic device may be located in at least one network device of a plurality of network devices of the computer network.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s1, displaying a target virtual object in a moving state in a virtual scene;
s2, determining a collision angle between the target virtual object and the obstacle under the condition that the moving target virtual object collides with the obstacle in the virtual scene;
and S3, under the condition that the collision angle reaches the sliding condition, the target virtual object is controlled to automatically attach to the obstacle 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.
Alternatively, it will be understood by those skilled in the art that the structure shown in fig. 13 is only schematic, 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 palm computer, and a mobile internet device (Mobile Internet Devices, MID), a PAD, etc. Fig. 13 is not limited to the structure of the electronic device and the electronic apparatus described above. For example, the electronics can 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 methods and apparatuses in the embodiments of the present invention, and the processor 1304 executes the software programs and modules stored in the memory 1302 to perform various functional applications and data processing, that is, implement the object control methods described above. 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, memory 1302 may further include memory located remotely from processor 1304, which may be connected to the terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, object attribute information of local area network target virtual objects, and attribute information of obstacles. As an example, as shown in fig. 13, the memory 1302 may include, but is not limited to, the display unit 1202, the first determining unit 1204, and the control unit 1206 in the object control device. In addition, other module units in the object control device may be included, but are not limited to, and are not described in detail in this example.
Optionally, the transmission device 1306 is configured to receive or transmit data via a network. Specific examples of the network described above may include wired networks and wireless networks. In one example, the transmission means 1306 comprises a network adapter (Network Interface Controller, NIC) which can be connected to other network devices and routers via network lines so as to communicate with the internet or a local area network. In one example, the transmission device 1306 is a Radio Frequency (RF) module for communicating wirelessly with the internet.
In addition, the electronic device further includes: a display 1308 for displaying a virtual scene and a process of sliding movement of a target virtual object and a bonding barrier thereof in a moving state along an offset direction; and a connection bus 1310 for connecting the respective module components in the above-described electronic device.
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 the plurality of nodes through a network communication. Among them, the nodes may form a Peer-To-Peer (P2P) network, and any type of computing device, such as a server, a terminal, etc., may become a node in the blockchain system by joining the Peer-To-Peer network.
According to one aspect of the present application, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions so that the computer device performs the above-described object control method. Wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
Alternatively, in the present embodiment, the above-described computer-readable storage medium may be configured to store a computer program for executing the steps of:
s1, displaying a target virtual object in a moving state in a virtual scene;
s2, determining a collision angle between the target virtual object and the obstacle under the condition that the moving target virtual object collides with the obstacle in the virtual scene;
and S3, under the condition that the collision angle reaches the sliding condition, the target virtual object is controlled to automatically attach to the obstacle 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.
Alternatively, in this embodiment, it will be understood by those skilled in the art that all or part of the steps in the methods of the above embodiments may be performed by a program for instructing a terminal device to execute the steps, where the program may be stored in a computer readable storage medium, and the storage medium may include: flash disk, read-Only Memory (ROM), random-access Memory (Random Access Memory, RAM), magnetic or optical disk, and the like.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
The integrated units in the above embodiments may be stored in the above-described computer-readable storage medium if implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the technical solution of the present invention may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, comprising several instructions for causing one or more computer devices (which may be personal computers, servers or network devices, etc.) to perform all or part of the steps of the method described in the embodiments of the present invention.
In the foregoing embodiments of the present application, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In several embodiments provided by 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 exemplary, and the division of the units, such as the division of the units, is merely a logical function division, and may be implemented in another manner, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate units may or may not be physically separate, and units shown 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 may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The foregoing is merely a preferred embodiment of the present invention and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present invention, which are intended to be comprehended within the scope of the present invention.

Claims (11)

1. An object control method, characterized by 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 in the case that the moving target virtual object collides with the obstacle;
controlling the target virtual object to automatically attach to the obstacle and slide along an offset direction under the condition that the collision angle is larger than a target angle threshold, wherein the offset direction is a direction determined according to the current moving direction of the target virtual object, and the larger the collision angle is, the faster the target virtual object automatically attaches to the obstacle and slides along the offset direction;
And in the case that the collision angle is smaller than the target angle threshold value, controlling the target virtual object to reduce the moving speed or stop moving.
2. The method of claim 1, wherein determining a collision angle 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 1, wherein controlling the target virtual object to automatically engage the obstacle and to slide in an offset direction comprises:
determining a target sliding speed matched with the material of the obstacle;
and controlling the target virtual object to slide and move along the offset direction according to the target sliding speed.
4. A method according to claim 3, wherein controlling the target virtual object to coast in the offset direction at the target coast speed comprises:
And controlling the target virtual object to restore to the moving speed before collision under the condition that the target virtual object leaves the obstacle.
5. The method of claim 1, wherein controlling the target virtual object to automatically engage the obstacle and to slide in an offset direction comprises:
determining a preliminary speed of the sliding movement 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.
6. The method of claim 5, wherein determining a preliminary glide movement speed that matches the angle of impact comprises:
determining a moving speed when the target virtual object collides with the obstacle;
calculating a velocity component of the moving velocity in the offset direction according to the collision angle;
the velocity component is determined as the coasting movement initial velocity.
7. The method of claim 5, further comprising, after controlling the target virtual object to begin the taxi movement in the offset direction at the initial taxi movement speed:
determining a friction force matched with the material of the obstacle;
Determining resistance acceleration of the target virtual object when the target virtual object slides and moves along the offset direction according to the friction force;
determining a 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.
8. The method of claim 7, 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.
9. An object control apparatus, 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 in a case where the target virtual object in motion collides with the obstacle;
the control unit is used for controlling the target virtual object to automatically attach to the obstacle and slide along the offset direction under the condition that the collision angle is larger than a target angle threshold value, wherein the offset direction is determined according to the current moving direction of the target virtual object, and the larger the collision angle is, the faster the target virtual object automatically attaches to the obstacle and slides along the offset direction; and in the case that the collision angle is smaller than the target angle threshold value, controlling the target virtual object to reduce the moving speed or stop moving.
10. A computer readable storage medium, characterized in that the computer readable storage medium comprises a stored program, wherein the program when run performs the method of any one of claims 1 to 8.
11. 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 according to any of the claims 1 to 8 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 CN113559515A (en) 2021-10-29
CN113559515B true 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 (2)

* 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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7088754B2 (en) * 2018-06-21 2022-06-21 ブリヂストンスポーツ株式会社 Evaluation method

Patent Citations (2)

* 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

Also Published As

Publication number Publication date
CN113559515A (en) 2021-10-29

Similar Documents

Publication Publication Date Title
CN109847361B (en) Method and device for synchronizing motion states, storage medium and electronic device
KR102325311B1 (en) Method and apparatus for synchronously displaying game content, and storage medium
US20220168647A1 (en) Virtual prop control method and apparatus, storage medium and electronic device
US20200261802A1 (en) Data exchange method and apparatus, storage medium and electronic device
CN111265858B (en) Operation control method, operation control device, storage medium, and electronic device
CN107998654B (en) Acceleration adjusting method and device, storage medium and electronic device
CN111659118B (en) Prop control method and device, storage medium and electronic equipment
KR20220083803A (en) Method, apparatus, medium and program product for state switching of virtual scene
CN111111217A (en) Control method and device of virtual prop, storage medium and electronic device
CN111298430A (en) Virtual item control method and device, storage medium and electronic device
EP2990086A2 (en) Program, game system, and control method
US20220143507A1 (en) Method and apparatus for displaying virtual prop, storage medium, and electronic device
CN113209618B (en) Virtual character control method, device, equipment and medium
CN110975283A (en) Processing method and device of virtual shooting prop, storage medium and electronic device
US20230347248A1 (en) Controlling method and apparatus of virtual actor, storage medium and electronic device
CN112107858A (en) Prop control method and device, storage medium and electronic equipment
CN111228807B (en) Control method and device of virtual operation object, storage medium and electronic device
CN111265850B (en) Control method and device of virtual operation object, storage medium and electronic device
CN110772784B (en) Carrier control method and device, storage medium and electronic device
CN113893542A (en) Object control method and apparatus, storage medium, computer program, and electronic device
CN113559515B (en) Object control method and device, storage medium and electronic equipment
CN112121428B (en) Control method and device for virtual character object and storage medium
CN111228805B (en) Virtual operation object control method and device, storage medium and electronic device
CN111111165A (en) Control method and device of virtual prop, storage medium and electronic device
CN113633987B (en) Object control method and device, storage medium and electronic equipment

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