Virtual object control method and device, electronic equipment, storage medium and product
By responding to the biased operation of virtual objects in the game, determining and orthogonizing vectors, and controlling the posture of virtual objects based on the biased vector, the problem of limited resources in game development is solved, and the automatic modification of poses is realized to generate corresponding The animation effect improves the authenticity of the game.
Patent Information
- Application Number
- CN202411359091.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-02-07
AI Technical Summary
In game development, due to limited resources, it is impossible to design an independent animation clip for each action, making it difficult to modify the posture of the virtual object to generate corresponding animation based on the designed animation sequence frame.
By responding to the bias operation of the virtual object, the first vector from the aiming point to the biasing point is determined, and the forward vector and the first vector of the target entity where the aiming point are located are Schmidt orthogonalized to obtain the biasing vector. Based on the bias vector, the posture of the virtual object is controlled to bend toward the bias point side.
It realizes that the posture of the virtual object is automatically modified based on the basic combat animation frames and renders the corresponding combat animation frames, without the need to design an independent animation clip for the actions of each virtual object, saving development resources and improving the authenticity of the game effect.
Smart Images

Figure CN119386460A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of game technology, and in particular to a virtual object control method, device, electronic device, storage medium and product. Background Art
[0002] In video games, there are often scenes where players control characters to jump over obstacles to attack enemies, or dodge attacks and fight back against enemies. For example, in shooting games, players control characters to jump over wall cover to shoot enemies; or in fighting games, players control characters to dodge enemy punches and then stab enemies with knives.
[0003] To ensure the authenticity of the game, different scenes require different animations. For example, during the game, when facing different bunkers, the character may need to cross the bunker to the left or to the right to shoot. Bunkers of different sizes and styles may require different crossing distances.
[0004] However, due to limited resources, it is impossible to design an animation clip for each action during game development. Therefore, how to modify the posture of the virtual object in the animation frame based on the designed animation sequence frame to generate the corresponding animation is an urgent problem to be solved. Summary of the invention
[0005] The present invention provides a virtual object control method, device, electronic device, storage medium and product, which are used to solve the defect in the prior art that, during game development, due to limited resources, it is impossible to design an animation clip for each action, and to modify the posture of the virtual object in the animation frame on the basis of the designed animation sequence frame to generate the corresponding animation.
[0006] The present invention provides a virtual object control method, wherein the virtual object includes a plurality of interconnected virtual entities, and the method includes: In response to a deflection operation on the virtual object, determining a first vector from an aiming point to a deflection point indicated by the deflection operation; Performing Schmidt orthogonalization on the forward vector of the target entity where the aiming point is located and the first vector to obtain a deflection vector; Based on the deflection vector, the posture of the virtual object is controlled to bend toward the deflection point.
[0007] According to a virtual object control method provided by the present invention, the forward vector of the target entity where the aiming point is located and the first vector are Schmidt-orthogonalized to obtain a deflection vector, including: Taking the forward vector of the target entity where the aiming point is located as a reference vector, calculating the projection vector of the first vector on the reference vector; The first vector is subtracted from the projection vector to obtain a deflection vector orthogonal to a forward vector of the target entity where the aiming point is located.
[0008] According to a virtual object control method provided by the present invention, the posture of the virtual object is controlled to bend toward the deflection point based on the deflection vector, comprising: Determine a second vector from a first entity to a last entity in a target entity chain in the virtual object, and determine a first vector angle based on the deflection vector and the second vector; Based on the first vector angle, an entity in the target entity chain is interpolated toward the deflection vector to control the posture of the virtual object to bend toward the deflection point.
[0009] According to a virtual object control method provided by the present invention, interpolating the entity in the target entity chain toward the deflection vector based on the first vector angle includes: For each entity in the target entity chain, determining the magnitude of the deviation of each entity toward the deviation vector according to a limit value of the angle of each entity relative to the first vector; Based on the magnitude of the deviation of each entity toward the deviation vector, interpolation is performed on each entity toward the deviation vector.
[0010] According to a virtual object control method provided by the present invention, before responding to a deflection operation on a virtual object and determining a first vector from an aiming point to a deflection point indicated by the deflection operation, the method further comprises: In response to the aiming operation for the attack point, determining a third vector from the last entity in the target entity chain in the virtual object to the attack point, and a forward vector of the first entity in the target entity chain; Determining a second vector angle based on the third vector and the forward vector of the first entity; Based on the second vector angle, the entities in the target entity chain are interpolated toward the third vector to control the last entity in the target entity chain to face the attack point.
[0011] According to a virtual object control method provided by the present invention, the method further includes: Interpolation is performed on the target entity where the aiming point is located toward the third vector to control the target entity where the aiming point is located toward the attack point.
[0012] The present invention also provides a virtual object control device, comprising: A first vector determination module, configured to determine, in response to a deflection operation on a virtual object, a first vector from a target point to a deflection point indicated by the deflection operation; An orthogonalization module, used for performing Schmidt orthogonalization on the forward vector of the target entity where the aiming point is located and the first vector to obtain a deflection vector; The bending control module is used to control the posture of the virtual object to bend toward the deflection point based on the deflection vector.
[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, any of the virtual object control methods described above is implemented.
[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the virtual object control method as described in any one of the above is implemented.
[0015] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the virtual object control methods described above.
[0016] The virtual object control method, device, electronic device, storage medium and product provided by the present invention determine the first vector from the aiming point to the deflection point indicated by the deflection operation by responding to the deflection operation on the virtual object; Schmidt orthogonalize the forward vector and the first vector of the target entity where the aiming point is located to obtain the deflection vector; based on the deflection vector, control the posture of the virtual object to bend toward the side of the deflection point, so that the posture of the virtual object can be automatically modified on the basis of the basic combat animation frame, and the corresponding combat animation frame can be rendered, without having to design an animation clip for each action of the virtual object, which can save development resources and improve the authenticity of the game effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 It is a flowchart of a virtual object control method provided by an embodiment of the present invention.
[0019] Figure 2 It is a structural schematic diagram of a virtual object control device provided by an embodiment of the present invention.
[0020] Figure 3 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0022] Figure 1 is a flow chart of a virtual object control method provided by an embodiment of the present invention. Figure 1 The embodiment of the present invention provides a virtual object control method, wherein the virtual object includes a plurality of interconnected virtual entities, and the method may specifically include the following steps: Step 101: In response to a deflection operation on a virtual object, determine a first vector from a target point to a deflection point indicated by the deflection operation.
[0023] It should be noted that the execution subject of the virtual object control method provided in the embodiment of the present invention may be a game engine, an electronic device running a game engine, a component in an electronic device, an integrated circuit or a chip. The electronic device may be a mobile electronic device or a non-mobile electronic device. For example, the mobile electronic device may be a mobile phone, a tablet computer, a laptop computer, a PDA, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), etc., and the non-mobile electronic device may be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present invention. The following embodiment of the present invention is described with the game engine as the execution subject.
[0024] The embodiment of the present invention can be applied to the generation of three-dimensional animation. When an associated event is triggered, the actions involved in the virtual object control method provided by the embodiment of the present invention can be executed in each animation frame. By controlling and modifying the posture of the virtual object, the corresponding animation effect can be rendered on the display.
[0025] The embodiments of the present invention can be applied to various game scenarios. For example, in a game attack scenario, the virtual object control method provided by the embodiments of the present invention can be used to control the combat posture of the virtual object during the game, so as to render and generate animation effects in the combat state on the display, such as combat animations that require sideways movement, such as crossing cover design, avoiding counterattacks, etc.
[0026] A virtual object may include multiple interconnected virtual entities. These entities are the basic framework for controlling the actions of the virtual object. Through the transformations of these entities such as rotation and translation, the actions and postures of the virtual object can be controlled, so that the virtual object can perform various actions such as walking, running, jumping, fighting, etc.
[0027] The virtual object may be a skeleton module in a game character model, and the virtual entity may be a specific skeleton or a weapon held by the game character.
[0028] The aiming point can be the point used for attacking. When designing an animation, you can specify an aiming point, such as the firing port of a weapon, the face of a fist, etc.
[0029] The deflection point of the deflection operation indication may refer to the indicated position input by the player in the virtual space during the game to control the virtual object to make a deflection action. For example, the player can control the virtual object to move to the left by pressing the q button, and control the virtual object to move to the right by pressing the e button. The position of the deflection point may change with the duration of pressing the button.
[0030] When designing animations, game designers can set the way players input deflection points, such as inputting through the qe button, and the numerical range of the deflection points. During the game, the player can input a specific numerical value within the numerical range of the deflection point, thereby indicating the deflection of the virtual object in the virtual space; the duration of the player pressing the qe button can also be converted into a specific numerical value within the numerical range of the deflection point, thereby indicating the deflection of the virtual object.
[0031] Specifically, during the game, if a player's deflection operation on a virtual object is detected, the deflection operation can be responded to, the coordinates of the deflection point indicated by the deflection operation and the coordinates of the aiming point can be obtained, and the first vector from the aiming point to the deflection point can be determined based on the coordinates of the deflection point and the coordinates of the aiming point.
[0032] Step 102, performing Schmidt orthogonalization on the forward vector of the target entity where the aiming point is located and the first vector to obtain a deflection vector.
[0033] The entity where the aiming point is located is the target entity. The target entity can be a virtual entity in the virtual object (such as the fist of the game character) or a virtual entity outside the virtual object (such as the handheld weapon of the game character), which can be specifically defined by the game designer during editing. For example, when designing an animation, if the designed aiming point is the weapon launch port, the target entity where the aiming point is located can be the handheld weapon of the game character; if the designed aiming point is the fist surface, the target entity where the aiming point is located can be the fist of the game character.
[0034] Any virtual entity can have a predefined orientation, and a vector consistent with the orientation can be the forward vector of the entity. Any entity can have a predefined origin, which can be located at the center of the entity or a fixed point of the entity, and the origin can be used to define the position, rotation and scale of the virtual entity.
[0035] During the game, the position of the deflection point may be in front of or behind the aiming point. The embodiment of the present invention obtains the deflection vector by Schmidt orthogonalizing the forward vector of the target entity where the aiming point is located and the first vector from the aiming point to the deflection point, so that no matter whether the player inputs an orthogonal deflection point, it can remain orthogonal to the forward vector of the aiming point, that is, the deflection vector can always be orthogonal to the direction of the target entity where the aiming point is located, so that the calculated entity chain controls the posture of the virtual object to bend toward the deflection point while keeping the forward vector of the aiming point unchanged.
[0036] Step 103: Based on the deflection vector, control the posture of the virtual object to bend toward the deflection point.
[0037] In the embodiment of the present invention, the relevant virtual entity in the virtual object may be deflected toward the deflection point based on the deflection vector, thereby controlling the posture of the virtual object to bend toward the deflection point.
[0038] The embodiment of the present invention determines a first vector from an aiming point to a deflection point indicated by a deflection operation in response to a deflection operation on a virtual object; performs Schmidt orthogonalization on a forward vector and the first vector of a target entity where the aiming point is located to obtain a deflection vector; based on the deflection vector, controls the posture of the virtual object to bend toward the deflection point, thereby automatically modifying the posture of the virtual object on the basis of a basic combat animation frame, and rendering a corresponding combat animation frame, without having to design an animation clip for each action of the virtual object, thereby saving development resources and improving the authenticity of the game effect.
[0039] Based on any of the above embodiments, performing Schmidt orthogonalization on the forward vector of the target entity where the aiming point is located and the first vector to obtain the deflection vector may specifically include: Step S11, taking the forward vector of the target entity where the aiming point is located as a reference vector, calculating the projection vector of the first vector on the reference vector; Step S12, subtracting the first vector from the projection vector to obtain a deflection vector orthogonal to the forward vector of the target entity where the aiming point is located.
[0040] Specifically, the forward vector A of the target entity where the aiming point is located can be defined as the reference vector u1. The projection vector of the first vector B from the aiming point to the deflection point on the reference vector u1 can be calculated:
[0041] The first vector can be subtracted from the projection vector to remove the projection of the first vector on the reference vector, and a deflection vector orthogonal to the forward vector of the target entity where the aiming point is located can be obtained:
[0042] The embodiment of the present invention uses the forward vector of the target entity where the aiming point is located as the reference vector, calculates the projection vector of the first vector from the aiming point to the deviation point on the reference vector, and removes the projection of the first vector on the reference vector, so as to obtain a deviation vector that is orthogonal to the forward vector of the target entity where the aiming point is located, so that no matter whether the player input is an orthogonal deviation point, it can remain orthogonal to the forward vector of the aiming point, that is, the deviation vector can always be orthogonal to the orientation of the target entity where the aiming point is located, so that the calculated entity chain controls the posture of the virtual object to bend toward the deviation point while keeping the forward vector based on the aiming point unchanged.
[0043] Based on any of the above embodiments, controlling the posture of the virtual object to bend toward the deflection point based on the deflection vector may specifically include: Step S21, determining a second vector from a first entity to a last entity in a target entity chain in the virtual object, and determining a first vector angle based on the deflection vector and the second vector; Step S22: interpolating the entities in the target entity chain toward the deflection vector based on the first vector angle, so as to control the posture of the virtual object to bend toward the deflection point.
[0044] An entity chain may refer to a group of virtual entities connected in sequence. Any two adjacent entities on the entity chain have an active angle in one or more directions.
[0045] The target entity chain in the virtual object can refer to the bone chain specified by the game animation designer, for example, it can be the bone chain between the waist bone and the head bone. Each bone in the bone chain can have a predefined orientation, which can be regarded as the forward vector of this bone, such as the facial orientation of the head bone and the orientation of the sternum. These parameters can be preset by the game animation designer.
[0046] The first entity in the target entity chain may refer to a waist bone, and the last entity in the target entity chain may refer to a head bone. The waist bone and the head bone may be connected in sequence by multiple bones.
[0047] Specifically, the second vector from the first entity to the last entity in the target entity chain in the virtual object can be determined, and a vector angle can be determined based on the deviation vector and the second vector. Based on the first vector angle, linear interpolation of the deviation vector is performed on the entities in the target entity chain, so that the target entity chain in the virtual object bends toward the deviation point, thereby controlling the posture of the virtual object to bend toward the deviation point.
[0048] It should be noted that, when designing game animations, for game attack scenes, the position of the first entity (i.e., the waist bone) usually remains unchanged. In the embodiment of the present invention, when controlling the posture of the virtual object to bend toward the deflection point, the first entity in the target entity chain may not bend toward the deflection point.
[0049] It should be noted that, when designing game animation, the embodiment of the present invention specifies the target entity chain as the bone chain from the waist bone to the head bone, so that the attack action can be achieved by changing the upper body posture of the virtual object in game attack scenarios such as shooting scenes and fighting scenes.
[0050] In an embodiment of the present invention, when designing an animation, the designer only needs to pay attention to the input of the deflection point. Then, during the game, the target entity chain in the virtual object can be controlled to deflect toward the deflection point according to the deflection point input by the player, so that the posture of the virtual object bends toward the deflection point, thereby displaying the animation effect of the virtual object turning sideways on the display through rendering.
[0051] Based on any of the above embodiments, interpolating the entities in the target entity chain toward the bias vector based on the first vector angle may specifically include: Step S221, for each entity in the target entity chain, determining the magnitude of the deviation of each entity toward the deviation vector according to the limit value of the angle of each entity relative to the first vector; Step S222: interpolating the deviation vector of each entity based on the magnitude of the deviation of each entity toward the deviation vector.
[0052] The limit value may range from 0 to 1, the limit value corresponding to the first entity on the target entity chain may be 0, the limit value corresponding to the last entity on the target entity chain may be 1, and the limit values corresponding to the entities on the target entity chain may increase in sequence according to the order in which the entities are connected.
[0053] Specifically, when designing a game animation, the first distance from an entity in the target entity chain to the first entity and the second distance from the first entity to the last entity can be obtained, the ratio of the first distance to the second distance can be calculated, and the ratio can be set as the limit value corresponding to the entity; during the game, the deflection amplitude (i.e., arc length) of the entity can be calculated based on the limit value corresponding to the entity and the angle between the first vector, so that the entity deviates to one side of the deflection point according to the deflection amplitude.
[0054] Interpolation may include linear interpolation and spherical interpolation. In an embodiment of the present invention, when entities on the target entity chain are deflected according to the deflection amplitude, linear interpolation of the deflection vector may be performed on the entities on the target entity chain. Compared with spherical interpolation, this can reduce performance consumption and provide a smooth transition, which is conducive to further improving the naturalness and authenticity of the game effect.
[0055] Based on any of the above embodiments, before responding to a deflection operation on a virtual object and determining a first vector from a target point to a deflection point indicated by the deflection operation, the method further includes: Step S31, in response to the aiming operation for the attack point, determining a third vector from the last entity in the target entity chain in the virtual object to the attack point, and a forward vector of the first entity in the target entity chain; Step S32, determining the second vector angle based on the third vector and the forward vector of the first entity; Step S33: interpolating the entities in the target entity chain toward the third vector based on the second vector angle, so as to control the last entity in the target entity chain to face the attack point.
[0056] The attack point may refer to a target point indicated by a player during a game, such as a target selected by a player during a game, or an attack position point indicated by an operation indicator.
[0057] During the game, if the player's aiming operation at the attack point is detected, the aiming operation can be responded to, the coordinates of the origin of the last entity in the target entity chain and the coordinates of the attack point can be obtained, and the third vector from the origin of the last entity to the attack point can be determined based on the coordinates of the origin of the last entity and the coordinates of the attack point.
[0058] The first entity in the target entity chain may have a predefined orientation, and the vector consistent with the predefined orientation may be the forward vector of the first entity. A vector angle may be determined based on the third vector and the forward vector of the first entity, and then based on the second vector angle, the entities in the target entity chain are linearly interpolated toward the third vector, so that the orientation of the entities on the target entity chain in the virtual object is consistent with the orientation of the third vector, thereby controlling the head bone of the virtual object to be oriented toward the attack point (and the posture of the virtual object is also oriented toward the attack point).
[0059] It should be noted that for game attack scenarios, before the orientation of the virtual object changes, the forward vectors of the first entity and the last entity in the target entity chain can be consistent; in the process of controlling the last entity in the target entity chain toward the attack point, the forward vector of the last entity can change, while the forward vector of the first entity (i.e., the waist bone) usually remains unchanged. The forward vector of the first entity can be used to determine the angle of the second vector to avoid deviation in the orientation of the virtual object.
[0060] In an embodiment of the present invention, when designing an animation, the designer only needs to set the head bone of the virtual object (i.e., the game character) as the last entity in the entity chain. Then, during the running of the game, by controlling the last entity in the target entity chain to face the attack point, the face of the character model is automatically directed toward the target object. There is no need to design an animation clip for each action of the virtual object, thereby increasing the realism of the game.
[0061] Based on any of the above embodiments, the method may further include: interpolating the target entity where the aiming point is located toward the third vector to control the target entity where the aiming point is located toward the attack point.
[0062] After interpolating the entities in the target entity chain toward the third vector to control the last entity in the target entity chain to be oriented toward the attack point, the target entity where the aiming point is located can be interpolated according to the third vector so that the orientation of the target entity is consistent with the orientation of the last entity in the target entity chain, that is, consistent with the orientation of the third vector, thereby controlling the target entity where the aiming point is located to be oriented toward the attack point.
[0063] In an embodiment of the present invention, when designing an animation, the designer only needs to set the aiming point. Then, during the running of the game, the target entity where the aiming point is located can be controlled to automatically move toward the attack point indicated by the player, and the corresponding picture can be displayed by rendering. There is no need to design an animation clip for each action of the virtual object, thereby increasing the authenticity of the game.
[0064] The virtual object control device provided by the present invention is described below. The virtual object control device described below and the virtual object control method described above can be referenced to each other.
[0065] Figure 2 Schematic diagram of the structure of a virtual object control device provided by an embodiment of the present invention. Figure 2 The embodiment of the present invention provides a virtual object control device, which may specifically include the following modules: A first vector determination module 201 is used to determine a first vector from a target point to a deflection point indicated by the deflection operation in response to a deflection operation on a virtual object; An orthogonalization module 202 is used to perform Schmidt orthogonalization on the forward vector of the target entity where the aiming point is located and the first vector to obtain a deflection vector; The bending control module 203 is used to control the posture of the virtual object to bend toward the deflection point based on the deflection vector.
[0066] Based on any of the above embodiments, the orthogonalization module 202 includes: A calculation submodule, configured to calculate a projection vector of the first vector on the reference vector by taking a forward vector of a target entity where the aiming point is located as a reference vector; The subtraction submodule is used to subtract the first vector from the projection vector to obtain a deflection vector orthogonal to the forward vector of the target entity where the aiming point is located.
[0067] Based on any of the above embodiments, the bending control module 203 includes: A first angle determination submodule, configured to determine a second vector from a first entity to a last entity in a target entity chain in the virtual object, and determine a first vector angle based on the deflection vector and the second vector; The first interpolation submodule is used to interpolate the entity in the target entity chain toward the deflection vector based on the first vector angle, so as to control the posture of the virtual object to bend toward the deflection point.
[0068] Based on any of the above embodiments, the first interpolation submodule includes: an amplitude determination unit, configured to determine, for each entity in the target entity chain, an amplitude of the deviation of each entity from the deviation vector according to a limit value of an angle of each entity relative to the first vector; The first interpolation unit is used to interpolate the deviation of each entity toward the deviation vector based on the magnitude of the deviation of each entity toward the deviation vector.
[0069] Based on any of the above embodiments, before responding to a deflection operation on a virtual object and determining a first vector from a target point to a deflection point indicated by the deflection operation, the method further includes: A third vector determination module, configured to determine, in response to a targeting operation on an attack point, a third vector from a last entity in a target entity chain in the virtual object to the attack point, and a forward vector of a first entity in the target entity chain; A second angle determination module, used to determine a second vector angle based on the third vector and the forward vector of the first entity; A direction control module is used to interpolate the entities in the target entity chain toward the third vector based on the second vector angle, so as to control the last entity in the target entity chain to face the attack point.
[0070] Based on any of the above embodiments, the method further includes: The second interpolation module is used to interpolate the target entity where the aiming point is located toward the third vector to control the target entity where the aiming point is located to move toward the attack point.
[0071] The embodiment of the present invention determines a first vector from an aiming point to a deflection point indicated by a deflection operation in response to a deflection operation on a virtual object; performs Schmidt orthogonalization on a forward vector and the first vector of a target entity where the aiming point is located to obtain a deflection vector; based on the deflection vector, controls the posture of the virtual object to bend toward the deflection point, thereby automatically modifying the posture of the virtual object on the basis of a basic combat animation frame, and rendering a corresponding combat animation frame, without having to design an animation clip for each action of the virtual object, thereby saving development resources and improving the authenticity of the game effect.
[0072] Figure 3 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 3 As shown, the electronic device may include: a processor 310, a communication interface 320, a memory 330 and a communication bus 340, wherein the processor 310, the communication interface 320 and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic instructions in the memory 330 to execute the virtual object control method, which includes: responding to the deflection operation on the virtual object, determining a first vector from the aiming point to the deflection point indicated by the deflection operation; performing Schmidt orthogonalization on the forward vector of the target entity where the aiming point is located and the first vector to obtain a deflection vector; and based on the deflection vector, controlling the posture of the virtual object to bend toward the side of the deflection point.
[0073] In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0074] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the virtual object control method provided by the above-mentioned methods, which includes: responding to a deflection operation on a virtual object, determining a first vector from an aiming point to a deflection point indicated by the deflection operation; Schmidt orthogonalizing a forward vector of a target entity where the aiming point is located and the first vector to obtain a deflection vector; and based on the deflection vector, controlling the posture of the virtual object to bend toward the side of the deflection point.
[0075] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the virtual object control method provided by the above-mentioned methods, the method comprising: responding to a deflection operation on a virtual object, determining a first vector from an aiming point to a deflection point indicated by the deflection operation; Schmidt orthogonalizing a forward vector of a target entity where the aiming point is located and the first vector to obtain a deflection vector; and based on the deflection vector, controlling the posture of the virtual object to bend toward the side of the deflection point.
[0076] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0077] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0078] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A virtual object control method, characterized in that: The virtual object includes a plurality of interconnected virtual entities, and the method includes: In response to a deflection operation on the virtual object, determining a first vector from an aiming point to a deflection point indicated by the deflection operation; Performing Schmidt orthogonalization on the forward vector of the target entity where the aiming point is located and the first vector to obtain a deflection vector; Based on the deflection vector, the posture of the virtual object is controlled to bend toward the deflection point.
2. The virtual object control method according to claim 1, characterized in that: The step of performing Schmidt orthogonalization on the forward vector of the target entity where the aiming point is located and the first vector to obtain the deflection vector includes: Taking the forward vector of the target entity where the aiming point is located as a reference vector, calculating the projection vector of the first vector on the reference vector; The first vector is subtracted from the projection vector to obtain a deflection vector orthogonal to a forward vector of the target entity where the aiming point is located.
3. The virtual object control method according to claim 1, characterized in that: The step of controlling the posture of the virtual object to bend toward the deflection point based on the deflection vector comprises: Determine a second vector from a first entity to a last entity in a target entity chain in the virtual object, and determine a first vector angle based on the deflection vector and the second vector; Based on the first vector angle, an entity in the target entity chain is interpolated toward the deflection vector to control the posture of the virtual object to bend toward the deflection point.
4. The virtual object control method according to claim 3, characterized in that: The interpolating the entities in the target entity chain toward the bias vector based on the first vector angle includes: For each entity in the target entity chain, determining the magnitude of the deviation of each entity toward the deviation vector according to a limit value of the angle of each entity relative to the first vector; Based on the magnitude of the deviation of each entity toward the deviation vector, interpolation is performed on each entity toward the deviation vector.
5. The virtual object control method according to claim 1, characterized in that: Before determining a first vector from a target point to a deflection point indicated by the deflection operation in response to the deflection operation on the virtual object, the method further includes: In response to the aiming operation for the attack point, determining a third vector from the last entity in the target entity chain in the virtual object to the attack point, and a forward vector of the first entity in the target entity chain; Determining a second vector angle based on the third vector and the forward vector of the first entity; Based on the second vector angle, the entities in the target entity chain are interpolated toward the third vector to control the last entity in the target entity chain to face the attack point.
6. The virtual object control method according to claim 5, characterized in that: The method further comprises: Interpolation is performed on the target entity where the aiming point is located toward the third vector to control the target entity where the aiming point is located toward the attack point.
7. A virtual object control device, characterized in that: include: A first vector determination module, configured to determine, in response to a deflection operation on a virtual object, a first vector from a target point to a deflection point indicated by the deflection operation; An orthogonalization module, used for performing Schmidt orthogonalization on the forward vector of the target entity where the aiming point is located and the first vector to obtain a deflection vector; The bending control module is used to control the posture of the virtual object to bend toward the deflection point based on the deflection vector.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the virtual object control method according to any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the virtual object control method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the virtual object control method according to any one of claims 1 to 6 is implemented.