WO2022021686A1 - Method and apparatus for controlling virtual object, and storage medium and electronic apparatus - Google Patents

Method and apparatus for controlling virtual object, and storage medium and electronic apparatus Download PDF

Info

Publication number
WO2022021686A1
WO2022021686A1 PCT/CN2020/130413 CN2020130413W WO2022021686A1 WO 2022021686 A1 WO2022021686 A1 WO 2022021686A1 CN 2020130413 W CN2020130413 W CN 2020130413W WO 2022021686 A1 WO2022021686 A1 WO 2022021686A1
Authority
WO
WIPO (PCT)
Prior art keywords
rigid body
animation
data
skeleton
animation frame
Prior art date
Application number
PCT/CN2020/130413
Other languages
French (fr)
Chinese (zh)
Inventor
刘洋
何文峰
Original Assignee
完美世界(北京)软件科技发展有限公司
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 完美世界(北京)软件科技发展有限公司 filed Critical 完美世界(北京)软件科技发展有限公司
Publication of WO2022021686A1 publication Critical patent/WO2022021686A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras

Definitions

  • the present invention relates to the field of computers, and in particular, to a method and device for controlling virtual objects, a storage medium, and an electronic device.
  • FIG. 1 is an effect diagram of simulating the knock-to-fly operation according to the animation system in the related art.
  • Figure 2 is based on the physics in related technologies. The effect diagram of the system simulating the knock-to-fly operation.
  • the physical system in the related art also introduces some new problems: the art loses direct control over the action performance, and the results of the physical simulation are unpredictable and difficult to adjust.
  • art can directly control and adjust the position and orientation of bones according to the chronological visual effects, which is very intuitive, while the concepts of mass, force, and speed of the physical system are relatively abstract and need to be run to get the effect.
  • a certain data at a certain time is actually difficult to understand for the overall performance; and there are many physical parameters, which are related to each other and affect the whole body. It is difficult to express the artistic effect as a whole.
  • FIG. 3 is a comparison diagram between the skeletal animation provided according to the related art and the pure physics effect.
  • Embodiments of the present invention provide a virtual object control method and device, a storage medium, and an electronic device, so as to at least solve the problem in the related art that the virtual object cannot be directly controlled due to art production, and it is difficult to predict the physical simulation result of the virtual object, and It is difficult to express technical problems such as the artistic effect of virtual objects.
  • a method for controlling a virtual object wherein a skeleton model of the virtual object is provided with an animation system, and the skeleton model of the virtual object is provided with a physics system, the physics system comprising: a skeletal rigid body and Corresponding joint information; it is characterized in that, the control method includes: when the skeleton rigid body triggers a collision during the animation of the skeletal model, acquiring the animation frame data of the skeleton corresponding to the skeleton rigid body in the current state in the animation system; according to the animation The frame data calculates the state data and corresponding joint data of the current state of the skeleton rigid body; calculates and sets the state data and corresponding joint data of the skeleton rigid body in the target state of the next animation frame; adopts the physical system of the skeleton model, The approach of the skeletal rigid body from the current state to the target state of the next animation frame is simulated at a time interval according to the driving parameters generated during the collision, until the loading of the
  • a control device for a virtual object wherein an animation system is set on the skeleton model of the virtual object, and a physics system is set on the skeleton model of the virtual object, and the physics system includes: a skeleton The rigid body and the corresponding joint information;
  • the control device includes: an acquisition module for acquiring the animation frame data of the bone corresponding to the bone rigid body in the current state in the animation system when the bone rigid body triggers a collision during the animation process of the skeletal model;
  • a calculation module used for calculating the state data and corresponding joint data of the current state of the skeleton rigid body according to the animation frame data; a second calculation module, used for calculating and setting the target state of the skeleton rigid body in the next animation frame.
  • a simulation module used for using the physical system of the skeleton model, simulates the trend of the skeleton rigid body from the current state to the target state of the next animation frame at a time interval according to the driving parameters generated during the collision until the next animation frame data is loaded.
  • a computer program which includes computer-readable codes, which, when the computer-readable codes are executed on a server, cause the server to execute the above-mentioned method for controlling virtual objects.
  • a computer-readable medium in which a computer program of the above-mentioned method for controlling a virtual object is stored.
  • the beneficial effects of the present invention are: through the present invention, when the skeletal rigid body triggers collision during the animation of the skeletal model, the animation frame data of the skeleton corresponding to the skeleton in the current state in the animation system is obtained, and then the state of the skeletal rigid body in the current state is calculated.
  • the data and the corresponding joint data, as well as the state data of the skeleton rigid body in the target state of the next animation frame and the corresponding joint data use the physical system of the skeleton model to simulate the skeleton rigid body from the current state to the target state of the next animation frame at a time interval.
  • Fig. 1 is according to the effect drawing of the animation system in the related art simulating the knock-to-fly operation
  • Fig. 2 is according to the effect diagram of physical system simulation hit-to-fly operation in the related art
  • Fig. 3 is the contrast diagram between skeletal animation and pure physical effect provided according to the related art
  • FIG. 4 is a block diagram of a hardware structure in which a method for controlling a virtual object provided by an embodiment of the present invention is applied to a mobile terminal;
  • FIG. 5 is a flowchart of a method for controlling a virtual object according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of a ragdoll physics provided according to an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of a rigid body provided according to an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of several different types of joints provided according to an embodiment of the present invention.
  • Fig. 9 is a kind of orthogonal axis system based on six degrees of freedom provided according to an embodiment of the present invention.
  • FIG. 10 is a schematic diagram of an animation frame of a current state of a virtual object provided according to an embodiment of the present invention.
  • FIG. 11 is a schematic diagram of an animation frame in which a virtual object is driven by an external force according to an embodiment of the present invention
  • FIG. 13 is a flowchart of each frame in a physical animation scene provided according to an embodiment of the present invention.
  • Fig. 14 is a structural block diagram of an apparatus for controlling a virtual object according to an embodiment of the present invention.
  • Fig. 15 shows a block diagram of a server provided by an embodiment of the present invention for executing the method according to the present invention
  • FIG. 16 shows a storage unit provided by an embodiment of the present invention for holding or carrying program codes for implementing the method according to the present invention.
  • FIG. 4 is a block diagram of a hardware structure in which a method for controlling a virtual object provided by an embodiment of the present invention is applied to a mobile terminal.
  • the terminal may include one or more (only one is shown in FIG.
  • processor 402 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and
  • the memory 404 for storing data, optionally, the above-mentioned terminal may further include a transmission device 406 and an input and output device 408 for communication functions.
  • the structure shown in FIG. 4 is only for illustration, and does not limit the structure of the above-mentioned terminal.
  • the mobile terminal may further include more or fewer components than those shown in FIG. 4 , or have a different configuration than that shown in FIG. 4 .
  • the memory 404 can be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to a method for controlling a virtual object in an embodiment of the present invention.
  • the processor 402 runs the computer program stored in the memory 404 by running the computer program. , so as to perform various functional applications and data processing, that is, to implement the above method.
  • Memory 404 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 instances, the memory 404 may further include memory located remotely from the processor 402, and these remote memories may be connected to the mobile terminal through a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
  • Transmission means 406 is used to receive or transmit data via a network.
  • the specific example of the above-mentioned network may include a wireless network provided by a communication provider of the mobile terminal.
  • the transmission device 406 includes a network adapter (Network Interface Controller, NIC for short), which can be connected to other network devices through a base station so as to communicate with the Internet.
  • the transmission device 406 may be a radio frequency (Radio Frequency, RF for short) module, which is used to communicate with the Internet in a wireless manner.
  • RF Radio Frequency
  • a method for controlling a virtual object is provided.
  • the skeleton model of the virtual object is provided with an animation system, the animation system includes bones and skins, and the game engine is an animation engine; and the virtual object skeleton model is provided with Physics system, the game engine is a physics engine, the physics system includes: skeleton rigid body and corresponding joint information.
  • FIG. 5 is a flowchart of a method for controlling a virtual object according to an embodiment of the present invention. As shown in FIG. 5 , the flowchart includes:
  • Step S502 when the skeleton rigid body triggers a collision during the skeletal model animation process, obtain the animation frame data of the skeleton corresponding to the skeleton rigid body in the current state in the animation system;
  • the above-mentioned virtual object is a character in the game (such as NPC (Non-Player-Controlled Character, non-player-controlled character), PCC (player-controlled character, Player-Controlled Character)), and a drawing tool is used to make a character
  • the character model installs bones for the character at appropriate positions, and controls the movement of these skeleton rigid bodies through the skeleton control template in the game engine, and the surface of the character changes accordingly with the movement of the skeleton rigid bodies.
  • Ragdoll the skeleton of Ragdoll is composed of rigid bodies and joints. The rigid bodies are connected by joints to form the structure of the system (usually humanoid), and the joints lock the displacement and configure the appropriate constraint angle, as shown in Figure 6.
  • FIG. 6 is a schematic diagram of ragdoll physics provided according to an embodiment of the present invention, wherein the left side shows the torso of ragdoll physics, the middle shows the joints and rigid bodies in the torso, the rigid bodies are connected by joints, and the right side shows the joints driving the rigid body Limits the trajectory range during motion.
  • Rigid Body refers to a rigid object that cannot be deformed during motion.
  • Rigid bodies have several physical properties such as mass, velocity, position, and orientation.
  • Rigid bodies are usually composed of [0,n] basic shapes (Shape (shape), Collider (collider)).
  • Basic shapes include cubes, spheres, capsules, and convex hulls.
  • a rigid body may not contain any primitives, representing the concept of a mass point.
  • a rigid body can also contain several primitives, which are used to model complex irregular objects.
  • FIG. 7 FIG. 7 is a schematic diagram of a rigid body provided according to an embodiment of the present invention.
  • a joint is an object that connects two rigid bodies together to form a whole. Joints can limit the range of motion of connected rigid bodies. There are many types of joints depending on the range of limitations.
  • FIG. 8 FIG. 8 is a schematic diagram of several different types of joints provided according to an embodiment of the present invention.
  • Step S504 calculating the state data and corresponding joint data when the current state of the skeleton rigid body is calculated according to the animation frame data;
  • the state data of the skeletal rigid body includes at least data such as the position, orientation, angular velocity, and linear velocity of the skeletal rigid body, but is not limited thereto;
  • the joint data includes the orientation and position of the joint, and the parameters of the joint itself.
  • Step S506 calculating and setting the state data of the skeleton rigid body in the target state of the next animation frame and the corresponding joint data;
  • Step S508 the physical system of the skeleton model is used to simulate the approach of the skeleton rigid body from the current state to the target state of the next animation frame at a time interval according to the driving parameters generated during the collision until the next animation frame data is loaded.
  • control method of this embodiment further includes: judging whether the collision process is completed in the physical system; if the collision process is not completed, updating the next animation frame data loaded in the current cycle to the next cycle in the next cycle.
  • the animation frame data at the start state.
  • the operations of S502 to S508 are continued until the collision process is completed, and the system uses the animation system to drive the skeleton model of the virtual object.
  • the animation frame data of the skeleton corresponding to the skeleton rigid body in the current state in the animation system is obtained, and then the state data and the corresponding joint of the skeletal rigid body in the current state are calculated.
  • the physical system of the skeleton model is used to simulate the approach of the skeletal rigid body from the current state to the target state of the next animation frame at a time interval, so as to achieve
  • the physical system and the animation system are used to act together on the virtual object to present the animation special effects of the virtual object in the process of collision, which solves the problem that the virtual object cannot be directly controlled due to the art production in the related art, and the physical simulation result of the virtual object is difficult to predict.
  • it is difficult to express technical problems such as the artistic effect of virtual objects, realizes the physical collision effect of the skeleton model in the real world, and improves the fidelity of the virtual object's action performance.
  • obtaining the animation frame data of the skeleton corresponding to the skeleton rigid body in the current state in the animation system includes: obtaining the animation frame loaded by the animation system at the current time, wherein the objects in the animation frame include virtual objects; parsing the virtual objects in the animation frame
  • the skeleton rigid body corresponds to the pose information of the skeleton in the world coordinate system.
  • the posture information includes information such as the position and orientation of the skeleton at each moment.
  • the state data and corresponding joint data when the current state of the skeletal rigid body is calculated according to the animation frame data includes: in the animation engine, the following state data when the current state of the skeletal rigid body is calculated according to the animation frame data are at least One: the position of the skeleton rigid body, the orientation of the skeleton rigid body, the linear velocity of the skeleton rigid body, and the angular velocity of the skeleton rigid body; determine the joint associated with the skeleton rigid body in the animation engine, and obtain the joint data of the joint in the current state.
  • calculating the state data of the current state of the skeletal rigid body in the animation engine according to the animation frame data includes: in the animation engine, according to the first animation frame data, parsing the first animation frame data of the virtual object in the world coordinate system Attitude information; first state data when the current state of the skeletal rigid body is determined based on the first attitude information, wherein the first state data includes: the position of the skeletal rigid body and the orientation of the skeletal rigid body; analyzed in the animation engine according to the second animation frame data The second pose information of the virtual object in the world coordinate system, wherein the animation frame data includes first animation frame data and second animation frame data, and the loading time of the second animation frame data is earlier than the loading time of the first animation frame data; based on The moving distance of the virtual object is calculated from the second attitude information and the first attitude information, and the linear velocity of the bone rigid body and the angular velocity of the bone rigid body are calculated according to the moving distance.
  • both the animation system and the physics system are calculated in real time.
  • the animation system reads the animation frame data of the skeleton corresponding to the skeleton rigid body from the animation file, and calculates the current frame (that is, the above current state) according to the animation frame data.
  • the skeleton rigid body of the virtual object corresponds to the state data of the skeleton in the animation system (including the orientation and position), and then output to the physical system.
  • the animation engine is used to control the animation process of the virtual character, and the loading, management and query of animation frame data are the main functions implemented by the animation system.
  • the animation engine obtains the animation frame data (that is, the time frame) during the movement of the virtual object. For example, 1 second includes 30 frames, which is equivalent to 30 animation pictures, and can then be displayed continuously within 1 second to form the animation of the virtual object.
  • the animation engine can calculate the position and orientation of each bone at each moment (each moment corresponds to a time frame), so through the animation engine, the user can obtain the current posture information of any bone at any moment (ie the above position and orientation) .
  • A3DMatrix4 pose pBone->GetAbsTM();//Get the pose information (position, orientation) in the current world coordinate system of this bone, and the above pose information is stored in a 4x4 matrix.
  • the bone pose information may be stored as a 3-dimensional vector and a quaternion; it may also be stored as a 3-dimensional vector and a 3x3 matrix.
  • the state data and the corresponding joint data of the skeletal rigid body in this embodiment are calculated by the animation engine, and output to the physics engine, and then participate in the application in the physics system, wherein the state data of the skeletal rigid body at least include: the position of the skeletal rigid body, The orientation of the skeletal rigid body, the linear velocity of the skeletal rigid body, and the angular velocity of the skeletal rigid body.
  • the orientation and position of the rigid body can be calculated directly from the animation frame data; the linear velocity and angular velocity of the rigid body cannot be calculated directly from the current frame data, but also need to be calculated indirectly by referring to the previous animation frame data.
  • the animation engine collects key frames (including the position and orientation) of the target bone at multiple moments, and calculates the linear velocity and the angular velocity of the bone according to several frames. For example, if the target bone is at position S1 at time t0 and at position S2 at time t1, then the linear velocity is (S2-S1)/(t1-t0).
  • the physical system of the skeleton model is used to simulate the approach of the skeletal rigid body from the current state to the target state of the next animation frame at a time interval according to the driving parameters generated during the collision, until the next animation frame.
  • the loading of animation frame data includes: constructing a three-axis orthogonal coordinate system based on a preset reference rigid body in the physical system of the skeleton model, wherein the skeleton rigid body and the six-degree-of-freedom joints of the joints correspond to the three coordinates of the three-axis orthogonal coordinate system respectively The axial displacement direction and rotation direction of the axis; in the physical system, the skeleton rigid body is simulated at a time interval according to the driving parameters generated at the time of collision through the physical drive in the three-axis orthogonal coordinate system along the axial displacement direction and/or rotation direction from the current The state approaches the target state of the next animation frame until the next animation frame data is loaded, wherein the physical drive includes one of the following: LinearDrive, Ang
  • Joint Drive there are many different types of Joint Drive, including at least 6 types, linear drive, angle drive and spherical linear interpolation drive, and each drive type includes: position drive (positiondrive) and velocity Drive (VelocityDrive); according to different types, set different joint parameters, for 6-DOF joints, the summary of the influence of specific parameters is the axial displacement (ie x-axis, y-axis, Z-axis) and respectively Rotation displacement around the xyz axis, a total of 6 joint parameters.
  • position drive position drive
  • VelocityDrive velocity Drive
  • the skeletal rigid body of the virtual object can be connected by a six-degree-of-freedom joint (D6 Joint, Configurable Joint (configurable joint)), and the six-degree-of-freedom joint is a general high-level joint.
  • D6 Joint can be flexibly configured to implement arbitrary constraints.
  • D6 Joint also has a powerful Drive feature. This is the underlying basis for implementing physical animation. As shown in FIG. 9 , FIG.
  • FIG. 9 is a six-degree-of-freedom-based orthogonal axis system provided according to an embodiment of the present invention, including an axial direction along the XYZ axis, and a rotation direction around the axial direction, including an axis with the X axis.
  • the corresponding rotation direction along its own axis, the swing direction along the local normal corresponding to the Y axis, and the swing direction perpendicular to the X axis and the Y axis corresponding to the Z axis.
  • Actor1 At the beginning of each animation frame of the virtual object, Actor1 is in the current state, and it is necessary to set the target state of Actor1 and set the parameters related to the Joint of Actor1; and then obtain the new state of Actor1 through physical simulation, where the new state is Actor1 from The result of the current state "best effort" towards the target state.
  • the state data and the corresponding joint data when calculating the current state of the skeleton rigid body according to the animation frame data include:
  • the skeleton model of the virtual object at least includes a first rigid body, a second rigid body, and a skeleton connected between the first rigid body and the second rigid body a first joint connected to the first rigid body, and a second joint connected to the second rigid body;
  • determining the current state of the virtual object at least includes: the current orientation of the target rigid body Actor1, the current position, the current linear velocity, and the current angle.
  • the target state of a virtual object includes at least different data such as position, orientation, linear velocity, and angular velocity.
  • the physics system calculates the driving parameters of the skeletal rigid body according to the mathematical model, and the time interval for outputting the physical animation toward the target state. For example, if there are 30 frames per second, the time interval from the current frame to the next frame is Input the calculated driving parameters as the driving target into the physics engine, and act on the skeleton rigid body. By simulating and calculating the process of the skeletal rigid body moving from the current animation frame to the next animation frame, until the next animation frame data loading ends.
  • the time interval between each two frames is seconds or seconds (that is, the above time interval), store the skeletal pose data in this frame, and finally render the animation of this frame through the rendering engine; and in the physical animation provided by this scheme, select 60 frames per second ( or more than 60 frames, such as 120 frames), to achieve a finer granularity per second, then the time interval between every two frames Second, the simulation state of the skeleton rigid body at a smaller time interval is controlled by the physics engine, making the physical animation smoother.
  • the driving parameter includes at least the resultant moment received by the rigid body, but is not limited thereto.
  • the physical bottom layer ie, the above-mentioned physics engine
  • Actor1 will be calculated.
  • the resulting moment is applied to Actor1 (that is, the above-mentioned bone rigid body), where the moment calculation formula is as follows:
  • Torque spring*(tarOri-curOri)+damping*(tarAVel-curAVel):
  • tarOri Target orientation of Actor1 relative to Actor0
  • curOri Current orientation of Actor1 relative to Actor0
  • tarAVel Target angular velocity of Actor1 relative to Actor0
  • curAVel Current angular velocity of Actor1 relative to Actor0
  • spring This driving torque coefficient.
  • the larger the spring the more toward the target, representing the weight of the orientation
  • damping the applied driving torque coefficient.
  • the larger the damping the more toward the target, which represents the weight of the angular velocity.
  • the physics engine controls the movement of the skeletal rigid body and the corresponding joints through the combined moment of the skeletal rigid body, at least including rotation, translation, scaling and other operations, so that the skeletal rigid body "try its best” to tend to the target state, and form a physical animation for the bones to assume various poses .
  • the physical system of the skeleton model is used to simulate the approach of the skeleton rigid body from the current state to the target state of the next animation frame at a time interval according to the driving parameters generated during the collision, until the loading of the next animation frame data, including: extracting the skeleton rigid body In the state data of the target state of the next animation frame and the joint parameters and driving parameters in the corresponding joint data, the joint parameters and driving parameters are related to each other; abstract and encapsulate the joint parameters and driving parameters to obtain the engine parameters; use the engine parameters as the driving parameters
  • the target is input into the physics engine of the physics system, which drives the physics engine to simulate the approach of the skeleton rigid body from the current state to the target state of the next animation frame at a time interval, until the loading of the next animation frame data.
  • inputting the engine parameters as the driving target into the physics engine of the physics system includes: calculating the first moment of the engine parameter with respect to the skeleton rigid body, and calculating the limit torque of the skeletal rigid body; according to the first torque and The limit torque calculates the resultant moment received by the skeletal rigid body, and inputs the resultant moment as the driving target into the physics engine of the physics system.
  • Rigid body Actor1 may encounter collision blocking during motion; external users may also apply force; Actor1 is also limited by Jointlimit (joint limit), Joint (joint) maximum force (torque) limit; Joint various flags (signs) The effect of the flag is used to control the different working modes of the joint drive (ie the above-mentioned drive types); as well as the iterative effect of the Joint connection chain, etc., the physics engine will comprehensively calculate the final result of Actor1 (ie the resultant torque).
  • the system further includes a controller
  • the solution further includes: in a predetermined number of animation frame time periods, the following operations are performed by a controller according to the character behavior of the virtual object: driving parameter smoothing, driving State management, driving application strategy management; wherein, driving parameter smoothing is used to smoothly display animation effects of virtual objects; driving state management includes managing the state changes of skeletal rigid bodies; driving application strategy management is used to indicate the controller used to control The skeletal rigid body produces the corresponding animation effect.
  • the physics engine performs the simulation of the dt time slice (ie, the above-mentioned time interval) from the current state to obtain the physics simulation result.
  • This scheme also includes the operation of controllers and compositors, where the controllers (controllers manage behaviors that tend to be relatively long-term, usually on the order of seconds or more, each animation controller is usually responsible for one type of character behavior, the harmony It is mainly responsible for parameter smoothing (to make the animation effect of the character more fluent), the management of Drive state (the state change management of rigid body), and the application strategy of Drive (the application strategy indicates which controller is used for control). What kind of animation effect of the rigid body, such as using the rotation controller to control the rotation of the joint, and then using the position controller to control the position of the virtual object), so as to achieve different effects with various controllers.
  • the system further includes a synthesizer, and the synthesizer is responsible for processing the result of the physical animation and the smooth processing between the animation and pure physics.
  • the synthesizer performs the result of the physical animation and the smoothing of the animation
  • the solution also includes: when the skeletal rigid body triggers a collision during the animation of the skeletal model, a synthesizer is used to compare the approach result calculated by the physics system with the state data of the current animation frame Fusion processing is performed with the corresponding joint data.
  • the compositor When the compositor performs the smoothing of the result of the physical animation and the pure physics, it also includes: when a new trigger event on the skeletal model is detected, the motion of the skeletal model is switched to the motion calculated by the pure physics system; wherein when switching , using a synthesizer to fuse the approximation result calculated by the physical system with the state data and the corresponding joint data calculated by the pure physical system to be switched to at the current moment.
  • this effect has been achieved in the game project: after the original protagonist collided with other NPCs or players while walking, he went straight through without any reaction.
  • the process after adding physical animation is like this: when there is no collision, the protagonist is in an animation-driven state. When the system determines the collision, switch to the physical animation state, and apply a force opposite to the collision direction to the rigid body of the protagonist's torso. The animation-driven state is restored after a certain period of time. In this process, the bending degree of the physical animation body calculated by the physics engine after applying the force is often relatively large. Therefore, we used a compositor to fuse the result calculated by the physics engine with the original animation to form the final result.
  • the upper logic layer determines to switch from a loose physical animation effect to a tight physical animation effect at a certain frame, and the spring parameter needs to be adjusted, for example, the spring parameter needs to be adjusted from 200 to 800, However, if you switch suddenly (that is, directly adjust the spring parameter from 200 to 800), it will often cause the screen to jump, which will make people feel stiff and lead to poor visual effects.
  • the spring parameter will be adjusted gradually, for example, in 0.3 seconds
  • the spring parameter needs to be adjusted from 200 to 800 within the time, and more than 20 frames have been run within 0.3 seconds, the controller is responsible for increasing the spring parameter value for each frame to reach the final target value, thus realizing the operation of parameter smoothing. .
  • the character before the knock-up, the character is alive and is controlled by pure animation, and the physics is controlled by animation in the form of kinematic (kinematic) rigid bodies.
  • Switch to physical animation at the moment of knock-up and the body gradually relaxes during the whole process of vacating; when the character lands, it is considered to be in a state of death and maintains a looser effect; after landing for a period of time (that is, after a period of death), the body forms a relatively looser effect.
  • a tense and stiff state thought to be a zombie.
  • the driving state and application strategy of the physical animation are different, which requires the controller to control and manage the implementation. Or assign physical properties to the target joint.
  • the underlying physics engine is responsible for collision penetration.
  • Various physical parameters are set in advance through the physics engine. After the physics engine gets the animation data, it is converted into data in the physics system, and the settings are different. parameters, execute a dt (time slice), get the final simulation result, and then get the physical animation, which realizes the control of the target rigid body or the target joint to rotate, translate, and even zoom, etc.
  • Physical animation The following is a further description of this scheme with the overall process of pure physics and physical animation:
  • FIG. 12 is a flowchart of each frame in a purely physical scene provided according to an embodiment of the present invention.
  • the arm of the game character such as the above-mentioned skeleton rigid body
  • the physical The system physics engine sets the rigid body to hit the wall and is subject to physical parameters, such as gravity, the arm sags and is constrained by the acceleration of gravity, and then simulates the rigid body to do free fall motion.
  • the final result obtained does not conform to the state of the arm hitting the wall in the real scene. .
  • FIG. 13 is a flowchart of each frame in the physical animation scene provided according to the embodiment of the present invention.
  • the wall was previously controlled by the animation system.
  • the animation system calculates the state data and joint data of the bones in the animation system according to the animation frame data (the pose data of the bones) in the animation file, and calculates the parameters of the corresponding skeleton rigid bodies and joints in the physics system.
  • the physics engine sets the corresponding joint data of the skeleton rigid body of the next frame according to the drive type of the joint (ie, sets the target state); after the arm hits the wall, it switches from the animation state to the physical animation
  • the state is controlled by the physics engine.
  • Each animation controller in the physics engine is usually responsible for one type of character behavior, and different parameters are set for the specified controller, such as physical parameters such as spring and damping.
  • Smoothing processing to perform parameter smoothing processing on the current frame trending to the next frame drive; the data model in the physics engine calculates the output time interval according to the animation frame data, and simulates the rigid body from the current frame trending down with this time interval (such as 1/60th of a second).
  • This solution provides the state data of all the bones of the virtual object in each frame, and outputs it to the physics system.
  • the time interval simulates the approaching process of the virtual object from the current state to the target state, and finally renders the art animation of the virtual object through the rendering engine, thus realizing the art effect of the final game character jointly determined by physics and animation.
  • a virtual object control device is also provided, which is used to implement the above-mentioned embodiments and preferred implementations, and the descriptions that have been described will not be repeated.
  • the term "module” may be a combination of software and/or hardware that implements a predetermined function.
  • the apparatus described in the following embodiments is preferably implemented in software, implementations in hardware, or a combination of software and hardware, are also possible and contemplated.
  • This embodiment provides a control device for a virtual object, wherein the skeleton model of the virtual object is provided with an animation system, and the skeleton model of the virtual object is provided with a physics system, and the physics system includes: a skeleton rigid body and corresponding joint information; 14 is a structural block diagram of a control device for a virtual object according to an embodiment of the present invention, the device includes: an acquisition module 1402 for acquiring the current state in the animation system when the rigid body of the skeleton triggers a collision during the animation of the skeletal model The animation frame data of the skeleton corresponding to the skeleton rigid body;
  • the first calculation module 1404 is connected to the above-mentioned acquisition module 1402, and is used for calculating the state data and corresponding joint data of the current state of the skeleton rigid body according to the animation frame data;
  • the simulation module 1408, connected to the above-mentioned second calculation module 1406, is used for using the physical system of the skeleton model to simulate the skeleton rigid body from the current state to the target state of the next animation frame at a time interval according to the driving parameters generated during the collision approach until the next animation frame data is loaded.
  • the obtaining module includes: an obtaining unit for obtaining an animation frame loaded by the animation system at the current time, wherein the object in the animation frame includes the virtual object; a parsing unit for obtaining the animation frame in the animation In the frame, the skeleton rigid body of the virtual object is parsed to correspond to the posture information of the skeleton in the world coordinate system.
  • the first calculation module includes: a calculation unit for calculating at least one of the following state data when the current state of the skeleton rigid body is calculated according to the animation frame data in the animation engine: the position of the skeleton rigid body, the skeleton The orientation of the rigid body, the linear velocity of the skeletal rigid body, and the angular velocity of the skeletal rigid body; the processing unit is used to determine the joint associated with the skeletal rigid body in the animation engine, and obtain the joint data of the joint in the current state .
  • the first calculation module includes: a first acquisition unit, configured to obtain the pose data in the animation world coordinate system of the bone corresponding to the first rigid body, wherein the skeleton model of the virtual object includes at least the first a rigid body, a second rigid body, and a first joint connected to the first rigid body between the first rigid body and the second rigid body, and a second joint connected to the second rigid body; a first calculation unit for The posture of a rigid body relative to the bones calculates the posture data in the physical world coordinate system of the first rigid body; the second calculation unit is used to calculate the posture data of the first joint according to the posture of the first joint relative to the first rigid body; the second The acquisition unit is used to obtain the posture data in the animation world coordinate system of the bone corresponding to the second rigid body; the third calculation unit is used to calculate the posture in the world coordinate system of the second rigid body according to the posture of the second rigid body relative to the bone data; a fourth calculation unit for calculating the attitude data of the second joint according to the attitude of the second joint relative to the second rigid
  • the computing unit includes: a first parsing subunit for parsing the first pose information of the virtual object in the world coordinate system according to the first animation frame data in the animation engine; a determination subunit for The first posture information determines the first state data of the current state of the skeleton rigid body, wherein the first state data includes: the position of the skeleton rigid body, the orientation of the skeleton rigid body; the second parsing subunit is used for The animation engine parses the second pose information of the virtual object in the world coordinate system according to the second animation frame data, wherein the animation frame data includes the first animation frame data and the second animation frame data, and the animation frame data includes the first animation frame data and the second animation frame data.
  • the loading time of the second animation frame data is earlier than the loading time of the first animation frame data; the calculation subunit is configured to calculate the moving distance of the virtual object based on the second posture information and the first posture information, and calculate the linear velocity of the skeleton rigid body and the angular velocity of the skeleton rigid body according to the moving distance.
  • the simulation module includes: a construction unit for constructing a three-axis orthogonal coordinate system based on a preset reference rigid body in the physical system of the skeleton model, wherein the skeleton rigid body and the six-degree-of-freedom joint of the joint Corresponding to the axial displacement direction and the rotation direction of the three coordinate axes of the three-axis orthogonal coordinate system respectively; the simulation unit is used to simulate the physical driving in the physical system at a time interval according to the driving parameters generated during the collision.
  • the skeletal rigid body approaches from the current state to the target state of the next animation frame along the axial displacement direction and/or the rotation direction in the three-axis orthogonal coordinate system, until the loading of the next animation frame data, wherein the physical drive It includes one of the following: linear drive, angular drive, spherical interpolation drive, and the drive parameters include displacement along the axial direction and rotational displacement around the axis.
  • the simulation module includes: an extraction unit, configured to extract the state data of the skeleton rigid body in the target state of the next animation frame and the joint parameters and driving parameters in the corresponding joint data, wherein the joint parameters and all The drive parameters are related to each other; the encapsulation unit is used to abstract and encapsulate the joint parameters and the drive parameters to obtain engine parameters; the drive unit is used to input the engine parameters into the physics engine of the physical system as a drive target, The physics engine is driven to simulate the approach of the skeletal rigid body from the current state to the target state of the next animation frame at a time interval until the loading of the next animation frame data.
  • the driving unit includes: a calculation subunit for calculating a first moment of the engine parameter with respect to the skeleton rigid body, and calculating a limit torque of the skeleton rigid body; an input subunit for calculating the first moment of the skeleton rigid body according to the first The moment and the limit moment calculate the resultant moment received by the skeletal rigid body, and input the resultant moment as a drive target into the physics engine of the physics system.
  • the device further includes: a control module, configured to perform the following operations according to the character behavior of the virtual object through a controller in a predetermined number of animation frame time periods: smoothing processing of driving parameters, management of driving states, Driving application strategy management; wherein, the driving parameter smoothing process is used to smoothly display the animation effect of the virtual object; the driving state management includes managing the state changes of the skeletal rigid body; the driving application strategy management is used to indicate the The controller used to control the skeletal rigid body to produce corresponding animation effects.
  • a control module configured to perform the following operations according to the character behavior of the virtual object through a controller in a predetermined number of animation frame time periods: smoothing processing of driving parameters, management of driving states, Driving application strategy management; wherein, the driving parameter smoothing process is used to smoothly display the animation effect of the virtual object; the driving state management includes managing the state changes of the skeletal rigid body; the driving application strategy management is used to indicate the The controller used to control the skeletal rigid body to produce corresponding animation effects.
  • the device further includes: a synthesis module, used for using a synthesizer when the skeletal rigid body triggers a collision during the animation process of the skeletal model to compare the approach result calculated by the physics system with the result of the current animation frame.
  • the state data and the corresponding joint data are fused.
  • the device further includes: when a new trigger event on the skeleton model is detected, switching the motion of the skeleton model to the motion calculated by the pure physical system; wherein when performing the switching, a A synthesizer, which fuses the approaching result calculated by the physical system with the state data and the corresponding joint data calculated by the pure physical system to be switched to at the current moment.
  • the device further includes: a judgment module, configured to use the physical system of the skeleton model in the simulation module, and simulate the skeleton rigid body from the current state downward at a time interval according to the driving parameters generated during the collision.
  • a judgment module configured to use the physical system of the skeleton model in the simulation module, and simulate the skeleton rigid body from the current state downward at a time interval according to the driving parameters generated during the collision.
  • the above modules can be implemented by software or hardware, and the latter can be implemented in the following ways, but not limited to this: the above modules are all located in the same processor; or, the above modules can be combined in any combination The forms are located in different processors.
  • Various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof.
  • a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all functions of some or all components of the virtual object control device according to the embodiment of the present invention.
  • DSP digital signal processor
  • the present invention can also be implemented as apparatus or apparatus programs (eg, computer programs and computer program products) for performing part or all of the methods described herein.
  • Such a program implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such signals may be downloaded from Internet sites, or provided on carrier signals, or in any other form.
  • FIG. 15 shows a server, such as an application server, that can implement the control method of a virtual object according to the present invention.
  • the server traditionally includes a processor 410 and a computer program product or computer readable medium in the form of memory 420 .
  • the memory 420 may be electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM.
  • the memory 420 has storage space 430 for program code 431 for performing any of the method steps in the above-described methods.
  • storage space 430 for program code may include various program codes 431 for implementing various steps in the above methods, respectively. These program codes can be read from or written to one or more computer program products.
  • These computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks. Such computer program products are typically portable or fixed storage units as described with reference to FIG. 16 .
  • the storage unit may have storage segments, storage spaces, etc. arranged similarly to the storage 420 in the server of FIG. 4 .
  • the program code may, for example, be compressed in a suitable form.
  • the storage unit includes computer readable code 431', i.e. code readable by a processor such as 410 for example, which when executed by a server, causes the server to perform the various steps in the methods described above.
  • the units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a computer-readable storage medium.
  • the technical solutions of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, and the computer software products are stored in a storage medium , including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes .

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Processing Or Creating Images (AREA)

Abstract

A method and apparatus for controlling a virtual object, and a storage medium and an electronic apparatus. The method comprises: during an animation process of a skeleton model, when a skeleton rigid body of the skeleton model triggers a collision, acquiring animation frame data of a skeleton, corresponding to the skeleton rigid body in the current state, from an animation system (S502); according to the animation frame data, calculating state data and corresponding joint data of the skeleton rigid body in the current state (S504); calculating and setting state data and corresponding joint data of the skeleton rigid body at the next animation frame target state (S506); and by using a physical system of the skeleton model, and according to a driving parameter generated upon collision, simulating the approach of the skeleton rigid body from the current state to the next animation frame target state at a time interval until the next piece of animation frame data is loaded (S508). By means of the method, the technical problems in the related art of it being difficult to expect a physical simulation result of a virtual object, and it being difficult to show an artistic effect of the virtual object, etc. since artistic production cannot directly control the virtual object are solved.

Description

虚拟对象的控制方法及装置、存储介质、电子装置Control method and device for virtual object, storage medium, and electronic device
本发明要求与2020年7月28日提交中国专利局、申请号为202010736955.9、申请名称为“虚拟对象的控制方法及装置、存储介质、电子装置”的中国专利申请的优先权,其全部内容通过引用结合在申请中。The present invention claims the priority of the Chinese patent application filed on July 28, 2020 with the application number of 202010736955.9 and the application title is "control method and device for virtual object, storage medium and electronic device", the entire contents of which are approved by Reference is incorporated in the application.
技术领域technical field
本发明涉及计算机领域,具体而言,涉及一种虚拟对象的控制方法及装置、存储介质、电子装置。The present invention relates to the field of computers, and in particular, to a method and device for controlling virtual objects, a storage medium, and an electronic device.
背景技术Background technique
在相关技术的游戏渲染系统中,使用骨骼动画系统,能够取得良好的表现效果。但是在使用过程中,逐渐出现了一些问题:一方面动画效果表现单一,以受击动画为例,无论击打什么部位,受击效果都是同样的,若想表现出不同的受击效果,需要通过美术制作出相应的动作,使得整体表现严重依赖美术的工作量;另一方面,预制作的动画难以与实际的周围环境互动。以击飞动画为例,在实际应用中,击飞过程有可能穿透了场景物体,图1是根据相关技术中动画系统模拟击飞操作的效果图。因此,面对复杂的应用环境,自然的会想到引入物理系统。物理系统确实能够解决复杂环境下的碰撞穿透问题,也能够解决表现效果单一的问题,在不显著增加美术工作量的情况下,打击不同部位会产生不同效果,图2是根据相关技术中物理系统模拟击飞操作的效果图。In the game rendering system of the related art, a skeletal animation system can be used to achieve good performance effects. However, in the process of use, some problems gradually emerged: on the one hand, the animation effect is single. Take the hit animation as an example, no matter what part is hit, the hit effect is the same. If you want to show different hit effects, Corresponding actions need to be produced through art, so that the overall performance is heavily dependent on the workload of art; on the other hand, it is difficult for pre-made animations to interact with the actual surrounding environment. Taking the knock-to-fly animation as an example, in practical applications, the knock-to-fly process may penetrate the scene objects. Figure 1 is an effect diagram of simulating the knock-to-fly operation according to the animation system in the related art. Therefore, in the face of complex application environments, it is natural to think of introducing physical systems. The physical system can indeed solve the problem of collision penetration in a complex environment, and it can also solve the problem of a single performance effect. Without significantly increasing the workload of art, hitting different parts will produce different effects. Figure 2 is based on the physics in related technologies. The effect diagram of the system simulating the knock-to-fly operation.
然后,相关技术中的物理系统也引入了一些新的问题:美术对动作表现失去了直接的控制,物理模拟的结果难以预期,也不好调较。原本美术可以按照时间顺序的视觉效果直接控制调教骨骼位置和朝向,是很直观的,而物理系统的质量、力、速度等概念是比较抽象的,需要运行起来才能得到效果的。某一时刻的某一数据,对于整体表现其实是不好理解的;而且物理参数众多,互相关联牵一发而动全身。整体上难以表现美术效果。在美术制作的动作中常常会有艺术夸张的效果,这些效果不一定符合物理规律,在物理系统中无法展现或者很难展现。因此,纯物理表现很可能达不到美术的预期。在上面的击飞示例中,在击飞后的空中姿态表现上,骨骼 动画与纯物理有明显的不同,图3是根据相关技术提供的骨骼动画与纯物理效果之间的对照图。Then, the physical system in the related art also introduces some new problems: the art loses direct control over the action performance, and the results of the physical simulation are unpredictable and difficult to adjust. Originally, art can directly control and adjust the position and orientation of bones according to the chronological visual effects, which is very intuitive, while the concepts of mass, force, and speed of the physical system are relatively abstract and need to be run to get the effect. A certain data at a certain time is actually difficult to understand for the overall performance; and there are many physical parameters, which are related to each other and affect the whole body. It is difficult to express the artistic effect as a whole. There are often artistic exaggerated effects in the actions of art production. These effects do not necessarily conform to the laws of physics, and cannot be displayed or difficult to display in the physical system. Therefore, pure physical representation is likely to fall short of artistic expectations. In the above knock-to-fly example, the skeletal animation is obviously different from pure physics in the performance of the aerial posture after the knock-to-fly. Figure 3 is a comparison diagram between the skeletal animation provided according to the related art and the pure physics effect.
针对相关技术中存在的上述问题,目前尚未发现有效的解决方案。For the above problems existing in the related art, no effective solution has been found so far.
发明内容SUMMARY OF THE INVENTION
本发明实施例提供了一种虚拟对象的控制方法及装置、存储介质、电子装置,以至少解决相关技术中因美术制作无法对虚拟对象进行直接的控制,难以预期虚拟对象的物理模拟结果,且难以表现虚拟对象的美术效果等技术问题。Embodiments of the present invention provide a virtual object control method and device, a storage medium, and an electronic device, so as to at least solve the problem in the related art that the virtual object cannot be directly controlled due to art production, and it is difficult to predict the physical simulation result of the virtual object, and It is difficult to express technical problems such as the artistic effect of virtual objects.
根据本发明的一个实施例,提供了一种虚拟对象的控制方法,其中,虚拟对象的骨骼模型设置有动画系统,并且所述虚拟对象骨骼模型设置有物理系统,该物理系统包括:骨骼刚体和对应的关节信息;其特征在于,所述控制方法包括:骨骼模型动画过程中在其骨骼刚体触发碰撞时,获取动画系统中当前状态时所述骨骼刚体对应骨骼的动画帧数据;依据所述动画帧数据计算所述骨骼刚体的当前状态时的状态数据和对应的关节数据;计算设置所述骨骼刚体在下一动画帧目标状态的状态数据和对应的关节数据;采用所述骨骼模型的物理系统,依据碰撞时产生的驱动参数以一时间间隔模拟所述骨骼刚体从当前状态向下一动画帧目标状态的趋近,一直到下一动画帧数据的加载。According to an embodiment of the present invention, a method for controlling a virtual object is provided, wherein a skeleton model of the virtual object is provided with an animation system, and the skeleton model of the virtual object is provided with a physics system, the physics system comprising: a skeletal rigid body and Corresponding joint information; it is characterized in that, the control method includes: when the skeleton rigid body triggers a collision during the animation of the skeletal model, acquiring the animation frame data of the skeleton corresponding to the skeleton rigid body in the current state in the animation system; according to the animation The frame data calculates the state data and corresponding joint data of the current state of the skeleton rigid body; calculates and sets the state data and corresponding joint data of the skeleton rigid body in the target state of the next animation frame; adopts the physical system of the skeleton model, The approach of the skeletal rigid body from the current state to the target state of the next animation frame is simulated at a time interval according to the driving parameters generated during the collision, until the loading of the next animation frame data.
根据本发明的又一个实施例,还提供了一种虚拟对象的控制装置,其中,虚拟对象的骨骼模型设置有动画系统,并且所述虚拟对象骨骼模型设置有物理系统,该物理系统包括:骨骼刚体和对应的关节信息;所述控制装置包括:获取模块,用于骨骼模型动画过程中在其骨骼刚体触发碰撞时,获取动画系统中当前状态时所述骨骼刚体对应骨骼的动画帧数据;第一计算模块,用于依据所述动画帧数据计算所述骨骼刚体的当前状态时的状态数据和对应的关节数据;第二计算模块,用于计算设置所述骨骼刚体在下一动画帧目标状态的状态数据和对应的关节数据;模拟模块,用于采用所述骨骼模型的物理系统,依据碰撞时产生的驱动参数以一时间间隔模拟所述骨骼刚体从当前状态向下一动画帧目标状态的趋近,一直到下一动画帧数据的加载。According to yet another embodiment of the present invention, a control device for a virtual object is also provided, wherein an animation system is set on the skeleton model of the virtual object, and a physics system is set on the skeleton model of the virtual object, and the physics system includes: a skeleton The rigid body and the corresponding joint information; the control device includes: an acquisition module for acquiring the animation frame data of the bone corresponding to the bone rigid body in the current state in the animation system when the bone rigid body triggers a collision during the animation process of the skeletal model; A calculation module, used for calculating the state data and corresponding joint data of the current state of the skeleton rigid body according to the animation frame data; a second calculation module, used for calculating and setting the target state of the skeleton rigid body in the next animation frame. state data and corresponding joint data; a simulation module, used for using the physical system of the skeleton model, simulates the trend of the skeleton rigid body from the current state to the target state of the next animation frame at a time interval according to the driving parameters generated during the collision until the next animation frame data is loaded.
根据本发明的又一个实施例,还提供了一种计算机程序,其包括计算机可读代码,当所述计算机可读代码在服务器上运行时,导致所述服务器执行上述的虚拟对象的控制方法。According to yet another embodiment of the present invention, there is also provided a computer program, which includes computer-readable codes, which, when the computer-readable codes are executed on a server, cause the server to execute the above-mentioned method for controlling virtual objects.
根据本发明的又一个实施例,还提供了一种计算机可读介质,其中存储了上述的虚拟对象的控制方法的计算机程序。According to yet another embodiment of the present invention, a computer-readable medium is also provided, in which a computer program of the above-mentioned method for controlling a virtual object is stored.
本发明的有益效果为:通过本发明,骨骼模型动画过程中在其骨骼刚体触发碰撞时,获取动画系统中当前状态时骨骼刚体对应骨骼的动画帧数据,然后计算骨骼刚体的当前状态时的状态数据和对应的关节数据,以及骨骼刚体在下一动画帧目标状态的状态数据和对应的关节数据,采用骨骼模型的物理系统,以一时间间隔模拟骨骼刚体从当前状态向下一动画帧目标状态的趋近,从而实现了采用物理系统和动画系统共同作用于虚拟对象,以呈现虚拟对象在碰撞过程中的动画特效,解决了相关技术中因美术制作无法对虚拟对象进行直接的控制,难以预期虚拟对象的物理模拟结果,且难以表现虚拟对象的美术效果等技术问题,实现了骨骼模型在真实世界中的物理碰撞效果,提高了虚拟对象动作表现的逼真度的技术效果。The beneficial effects of the present invention are: through the present invention, when the skeletal rigid body triggers collision during the animation of the skeletal model, the animation frame data of the skeleton corresponding to the skeleton in the current state in the animation system is obtained, and then the state of the skeletal rigid body in the current state is calculated. The data and the corresponding joint data, as well as the state data of the skeleton rigid body in the target state of the next animation frame and the corresponding joint data, use the physical system of the skeleton model to simulate the skeleton rigid body from the current state to the target state of the next animation frame at a time interval. Approaching, thus realizing the use of the physical system and the animation system to act together on the virtual object to present the animation special effects of the virtual object during the collision process, solving the problem that the virtual object cannot be directly controlled due to the art production in the related technology, and it is difficult to predict the virtual object. The physical simulation result of the object, and technical problems such as the difficulty of expressing the artistic effect of the virtual object, realize the physical collision effect of the skeleton model in the real world, and improve the technical effect of the fidelity of the virtual object's action performance.
附图说明Description of drawings
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The accompanying drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the attached image:
图1是根据相关技术中动画系统模拟击飞操作的效果图;Fig. 1 is according to the effect drawing of the animation system in the related art simulating the knock-to-fly operation;
图2是根据相关技术中物理系统模拟击飞操作的效果图;Fig. 2 is according to the effect diagram of physical system simulation hit-to-fly operation in the related art;
图3是根据相关技术提供的骨骼动画与纯物理效果之间的对照图;Fig. 3 is the contrast diagram between skeletal animation and pure physical effect provided according to the related art;
图4是本发明实施例提供的一种虚拟对象的控制方法应用于移动终端的硬件结构框图;4 is a block diagram of a hardware structure in which a method for controlling a virtual object provided by an embodiment of the present invention is applied to a mobile terminal;
图5是根据本发明实施例的一种虚拟对象的控制方法的流程图;5 is a flowchart of a method for controlling a virtual object according to an embodiment of the present invention;
图6是根据本发明实施例提供的布娃娃物理的示意图;FIG. 6 is a schematic diagram of a ragdoll physics provided according to an embodiment of the present invention;
图7是根据本发明实施例提供的刚体的示意图;7 is a schematic diagram of a rigid body provided according to an embodiment of the present invention;
图8是根据本发明实施例提供的几种不同类型的关节的示意图;8 is a schematic diagram of several different types of joints provided according to an embodiment of the present invention;
图9是根据本发明实施例提供的一种基于六自由度的正交轴系;Fig. 9 is a kind of orthogonal axis system based on six degrees of freedom provided according to an embodiment of the present invention;
图10是根据本发明实施例提供的虚拟对象的当前状态的动画帧示意图;10 is a schematic diagram of an animation frame of a current state of a virtual object provided according to an embodiment of the present invention;
图11根据本发明实施例提供的虚拟对象收到外力驱动的动画帧示意图;11 is a schematic diagram of an animation frame in which a virtual object is driven by an external force according to an embodiment of the present invention;
图12是根据本发明实施例提供的纯物理场景下每帧的流程图;12 is a flowchart of each frame in a purely physical scene provided according to an embodiment of the present invention;
图13是根据本发明实施例提供的物理动画场景下每帧的流程图;13 is a flowchart of each frame in a physical animation scene provided according to an embodiment of the present invention;
图14是根据本发明实施例的一种虚拟对象的控制装置的结构框图。Fig. 14 is a structural block diagram of an apparatus for controlling a virtual object according to an embodiment of the present invention.
图15示出了本发明实施例提供的用于执行根据本发明的方法的服务器的框图;Fig. 15 shows a block diagram of a server provided by an embodiment of the present invention for executing the method according to the present invention;
图16示出了本发明实施例提供的用于保持或者携带实现根据本发明的方法的程序代码的存储单元。FIG. 16 shows a storage unit provided by an embodiment of the present invention for holding or carrying program codes for implementing the method according to the present invention.
具体实施方式detailed description
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分的实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。In order to make those skilled in the art better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only The embodiments are part of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the scope of protection of the present application. It should be noted that the embodiments in the present application and the features of the embodiments may be combined with each other in the case of no conflict.
需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地 列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "first", "second", etc. in the description and claims of the present application and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific sequence or sequence. It is to be understood that data so used may be interchanged under appropriate circumstances so that the embodiments of the application described herein can be practiced in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having" and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those expressly listed Rather, those steps or units may include other steps or units not expressly listed or inherent to these processes, methods, products or devices.
实施例1Example 1
本发明实施例一所提供的方法实施例可以在计算机、终端或者类似的运算装置中执行。以运行在终端上为例,图4是本发明实施例提供的一种虚拟对象的控制方法应用于移动终端的硬件结构框图。如图4所示,终端可以包括一个或多个(图4中仅示出一个)处理器402(处理器402可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)和用于存储数据的存储器404,可选地,上述终端还可以包括用于通信功能的传输设备406以及输入输出设备408。本领域普通技术人员可以理解,图4所示的结构仅为示意,其并不对上述终端的结构造成限定。例如,移动终端还可包括比图4中所示更多或者更少的组件,或者具有与图4所示不同的配置。The method embodiment provided in Embodiment 1 of the present invention may be executed in a computer, a terminal, or a similar computing device. Taking running on a terminal as an example, FIG. 4 is a block diagram of a hardware structure in which a method for controlling a virtual object provided by an embodiment of the present invention is applied to a mobile terminal. As shown in FIG. 4 , the terminal may include one or more (only one is shown in FIG. 4 ) processor 402 (the processor 402 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and The memory 404 for storing data, optionally, the above-mentioned terminal may further include a transmission device 406 and an input and output device 408 for communication functions. Those skilled in the art can understand that the structure shown in FIG. 4 is only for illustration, and does not limit the structure of the above-mentioned terminal. For example, the mobile terminal may further include more or fewer components than those shown in FIG. 4 , or have a different configuration than that shown in FIG. 4 .
存储器404可用于存储计算机程序,例如,应用软件的软件程序以及模块,如本发明实施例中的一种虚拟对象的控制方法对应的计算机程序,处理器402通过运行存储在存储器404内的计算机程序,从而执行各种功能应用以及数据处理,即实现上述的方法。存储器404可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器404可进一步包括相对于处理器402远程设置的存储器,这些远程存储器可以通过网络连接至移动终端。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 404 can be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to a method for controlling a virtual object in an embodiment of the present invention. The processor 402 runs the computer program stored in the memory 404 by running the computer program. , so as to perform various functional applications and data processing, that is, to implement the above method. Memory 404 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 instances, the memory 404 may further include memory located remotely from the processor 402, and these remote memories may be connected to the mobile terminal through a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
传输装置406用于经由一个网络接收或者发送数据。上述的网络具体实例可包括移动终端的通信供应商提供的无线网络。在一个实例中,传输装置406包括一个网络适配器(Network Interface Controller,简称为NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输装置406可以为射频(Radio Frequency,简称为RF)模块,其用于通过无线方式与互联网进行通讯。Transmission means 406 is used to receive or transmit data via a network. The specific example of the above-mentioned network may include a wireless network provided by a communication provider of the mobile terminal. In an example, the transmission device 406 includes a network adapter (Network Interface Controller, NIC for short), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 406 may be a radio frequency (Radio Frequency, RF for short) module, which is used to communicate with the Internet in a wireless manner.
在本实施例中提供了一种虚拟对象的控制方法,游戏制作环节,虚拟对象的骨骼模型设置有动画系统,动画系统包括骨骼、蒙皮,游戏引擎为 动画引擎;并且虚拟对象骨骼模型设置有物理系统,游戏引擎为物理引擎,该物理系统包括:骨骼刚体和对应的关节信息。图5是根据本发明实施例的一种虚拟对象的控制方法的流程图,如图5所示,该流程包括:In this embodiment, a method for controlling a virtual object is provided. In the game production process, the skeleton model of the virtual object is provided with an animation system, the animation system includes bones and skins, and the game engine is an animation engine; and the virtual object skeleton model is provided with Physics system, the game engine is a physics engine, the physics system includes: skeleton rigid body and corresponding joint information. FIG. 5 is a flowchart of a method for controlling a virtual object according to an embodiment of the present invention. As shown in FIG. 5 , the flowchart includes:
步骤S502,骨骼模型动画过程中在其骨骼刚体触发碰撞时,获取动画系统中当前状态时骨骼刚体对应骨骼的动画帧数据;Step S502, when the skeleton rigid body triggers a collision during the skeletal model animation process, obtain the animation frame data of the skeleton corresponding to the skeleton rigid body in the current state in the animation system;
本实施例中,在上述虚拟对象为游戏中的一个角色(如NPC(Non-Player-Controlled Character,非玩家控制角色),PCC(玩家控制角色,Player-Controlled Character)),通过绘图工具制作一个角色模型,在合适的位置给角色安装骨骼,通过游戏引擎中的骨骼控制模板,控制这些骨骼刚体的移动,而角色的表层随着骨骼刚体的移动而发生相应的变化。比如布娃娃物理(Ragdoll),布娃娃物理的骨骼由刚体和关节组成,刚体之间采用关节连接并形成体系的结构(通常是人形),关节锁定位移并配置适当的约束角度,参见图6所示,图6是根据本发明实施例提供的布娃娃物理的示意图,其中,左边示意了布娃娃物理的躯干,中间示意了躯干中的关节和刚体,刚体通过关节连接,右边示意了关节带动刚体限制运动时的轨迹范围。In this embodiment, the above-mentioned virtual object is a character in the game (such as NPC (Non-Player-Controlled Character, non-player-controlled character), PCC (player-controlled character, Player-Controlled Character)), and a drawing tool is used to make a character The character model installs bones for the character at appropriate positions, and controls the movement of these skeleton rigid bodies through the skeleton control template in the game engine, and the surface of the character changes accordingly with the movement of the skeleton rigid bodies. For example, Ragdoll, the skeleton of Ragdoll is composed of rigid bodies and joints. The rigid bodies are connected by joints to form the structure of the system (usually humanoid), and the joints lock the displacement and configure the appropriate constraint angle, as shown in Figure 6. 6 is a schematic diagram of ragdoll physics provided according to an embodiment of the present invention, wherein the left side shows the torso of ragdoll physics, the middle shows the joints and rigid bodies in the torso, the rigid bodies are connected by joints, and the right side shows the joints driving the rigid body Limits the trajectory range during motion.
其中,刚体(Rigid Body),是指在运动过程中不可形变的刚性物体。刚体具有质量、速度、位置、朝向等若干物理属性。刚体通常由[0,n]个基本形体(Shape(外形)、Collider(碰撞体))组成。基本形体包括立方体、球形体、胶囊体、凸包等类型。一个刚体可以不包含任何基本形体,表示质点的概念。一个刚体也可以包含若干基本形体,用以模塑复杂的不规则物体。如图7所示,图7是根据本发明实施例提供的刚体的示意图。关节(Joint),是指将两个刚体连接在一起形成整体的物体。关节可以限制连接刚体的运动范围。根据限制范围不同,关节可以分为很多类型。如图8所示,图8是根据本发明实施例提供的几种不同类型的关节的示意图。Among them, Rigid Body refers to a rigid object that cannot be deformed during motion. Rigid bodies have several physical properties such as mass, velocity, position, and orientation. Rigid bodies are usually composed of [0,n] basic shapes (Shape (shape), Collider (collider)). Basic shapes include cubes, spheres, capsules, and convex hulls. A rigid body may not contain any primitives, representing the concept of a mass point. A rigid body can also contain several primitives, which are used to model complex irregular objects. As shown in FIG. 7 , FIG. 7 is a schematic diagram of a rigid body provided according to an embodiment of the present invention. A joint is an object that connects two rigid bodies together to form a whole. Joints can limit the range of motion of connected rigid bodies. There are many types of joints depending on the range of limitations. As shown in FIG. 8 , FIG. 8 is a schematic diagram of several different types of joints provided according to an embodiment of the present invention.
步骤S504,依据动画帧数据计算骨骼刚体的当前状态时的状态数据和对应的关节数据;Step S504, calculating the state data and corresponding joint data when the current state of the skeleton rigid body is calculated according to the animation frame data;
本实施例中骨骼刚体的状态数据至少包括骨骼刚体的位置、朝向、角速度及线速度等数据,但不限于此;关节数据包括关节的朝向和位置,以 及关节自身参数。In this embodiment, the state data of the skeletal rigid body includes at least data such as the position, orientation, angular velocity, and linear velocity of the skeletal rigid body, but is not limited thereto; the joint data includes the orientation and position of the joint, and the parameters of the joint itself.
步骤S506,计算设置骨骼刚体在下一动画帧目标状态的状态数据和对应的关节数据;Step S506, calculating and setting the state data of the skeleton rigid body in the target state of the next animation frame and the corresponding joint data;
步骤S508,采用骨骼模型的物理系统,依据碰撞时产生的驱动参数以一时间间隔模拟骨骼刚体从当前状态向下一动画帧目标状态的趋近,一直到下一动画帧数据的加载。Step S508 , the physical system of the skeleton model is used to simulate the approach of the skeleton rigid body from the current state to the target state of the next animation frame at a time interval according to the driving parameters generated during the collision until the next animation frame data is loaded.
可选的,在步骤S508之后,本实施例的控制方法还包括:在物理系统中判断碰撞过程是否完成;若碰撞过程未完成,将当前周期加载的下一动画帧数据更新为下一周期在起始状态时的动画帧数据。在下一周期,继续执行S502~S508的操作,直到完成碰撞过程,系统采用动画系统驱动虚拟对象的骨骼模型。Optionally, after step S508, the control method of this embodiment further includes: judging whether the collision process is completed in the physical system; if the collision process is not completed, updating the next animation frame data loaded in the current cycle to the next cycle in the next cycle. The animation frame data at the start state. In the next cycle, the operations of S502 to S508 are continued until the collision process is completed, and the system uses the animation system to drive the skeleton model of the virtual object.
通过本发明实施例,骨骼模型动画过程中在其骨骼刚体触发碰撞时,获取动画系统中当前状态时骨骼刚体对应骨骼的动画帧数据,然后计算骨骼刚体的当前状态时的状态数据和对应的关节数据,以及骨骼刚体在下一动画帧目标状态的状态数据和对应的关节数据,采用骨骼模型的物理系统,以一时间间隔模拟骨骼刚体从当前状态向下一动画帧目标状态的趋近,从而实现了采用物理系统和动画系统共同作用于虚拟对象,以呈现虚拟对象在碰撞过程中的动画特效,解决了相关技术中因美术制作无法对虚拟对象进行直接的控制,难以预期虚拟对象的物理模拟结果,且难以表现虚拟对象的美术效果等技术问题,实现了骨骼模型在真实世界中的物理碰撞效果,提高了虚拟对象动作表现的逼真度。According to the embodiment of the present invention, when the skeletal rigid body triggers a collision during the animation process of the skeletal model, the animation frame data of the skeleton corresponding to the skeleton rigid body in the current state in the animation system is obtained, and then the state data and the corresponding joint of the skeletal rigid body in the current state are calculated. data, as well as the state data and corresponding joint data of the skeletal rigid body in the target state of the next animation frame, the physical system of the skeleton model is used to simulate the approach of the skeletal rigid body from the current state to the target state of the next animation frame at a time interval, so as to achieve The physical system and the animation system are used to act together on the virtual object to present the animation special effects of the virtual object in the process of collision, which solves the problem that the virtual object cannot be directly controlled due to the art production in the related art, and the physical simulation result of the virtual object is difficult to predict. , and it is difficult to express technical problems such as the artistic effect of virtual objects, realizes the physical collision effect of the skeleton model in the real world, and improves the fidelity of the virtual object's action performance.
可选的,获取动画系统中当前状态时骨骼刚体对应骨骼的动画帧数据包括:获取动画系统在当前时间加载的动画帧,其中,动画帧中的对象包括虚拟对象;在动画帧中解析虚拟对象的骨骼刚体对应骨骼在世界坐标系下的姿态信息。在本实施例中,姿态信息骨骼在每个时刻的位置、朝向等信息。在本实施例的另一方面,依据动画帧数据计算骨骼刚体的当前状态时的状态数据和对应的关节数据包括:在动画引擎中依据动画帧数据计算骨骼刚体的当前状态时的以下状态数据至少之一:骨骼刚体的位置、骨骼刚体的朝向、骨骼刚体的线速度、骨骼刚体的角速度;在动画引擎中确定 与骨骼刚体关联的关节,并获取关节在当前状态时的关节数据。Optionally, obtaining the animation frame data of the skeleton corresponding to the skeleton rigid body in the current state in the animation system includes: obtaining the animation frame loaded by the animation system at the current time, wherein the objects in the animation frame include virtual objects; parsing the virtual objects in the animation frame The skeleton rigid body corresponds to the pose information of the skeleton in the world coordinate system. In this embodiment, the posture information includes information such as the position and orientation of the skeleton at each moment. In another aspect of this embodiment, the state data and corresponding joint data when the current state of the skeletal rigid body is calculated according to the animation frame data includes: in the animation engine, the following state data when the current state of the skeletal rigid body is calculated according to the animation frame data are at least One: the position of the skeleton rigid body, the orientation of the skeleton rigid body, the linear velocity of the skeleton rigid body, and the angular velocity of the skeleton rigid body; determine the joint associated with the skeleton rigid body in the animation engine, and obtain the joint data of the joint in the current state.
在本实施例的一个实施方式中,在动画引擎中依据动画帧数据计算骨骼刚体的当前状态时的状态数据包括:在动画引擎中依据第一动画帧数据解析虚拟对象在世界坐标系中第一姿态信息;基于第一姿态信息确定骨骼刚体的当前状态时的第一状态数据,其中,第一状态数据包括:骨骼刚体的位置、骨骼刚体的朝向;在动画引擎中依据第二动画帧数据解析虚拟对象在世界坐标系中第二姿态信息,其中,动画帧数据包括第一动画帧数据和第二动画帧数据,第二动画帧数据的加载时间早于第一动画帧数据的加载时间;基于第二姿态信息与第一姿态信息计算虚拟对象的移动距离,并根据移动距离计算骨骼刚体的线速度和骨骼刚体的角速度。In an implementation of this embodiment, calculating the state data of the current state of the skeletal rigid body in the animation engine according to the animation frame data includes: in the animation engine, according to the first animation frame data, parsing the first animation frame data of the virtual object in the world coordinate system Attitude information; first state data when the current state of the skeletal rigid body is determined based on the first attitude information, wherein the first state data includes: the position of the skeletal rigid body and the orientation of the skeletal rigid body; analyzed in the animation engine according to the second animation frame data The second pose information of the virtual object in the world coordinate system, wherein the animation frame data includes first animation frame data and second animation frame data, and the loading time of the second animation frame data is earlier than the loading time of the first animation frame data; based on The moving distance of the virtual object is calculated from the second attitude information and the first attitude information, and the linear velocity of the bone rigid body and the angular velocity of the bone rigid body are calculated according to the moving distance.
在本实施例中,动画系统和物理系统都是实时进行计算。动画系统从动画文件中读取骨骼刚体对应骨骼的动画帧数据,根据动画帧数据计算当前帧(即上述当前状态)时虚拟对象的骨骼刚体对应动画系统中骨骼的状态数据(包括骨骼的朝向和位置),然后输出给物理系统。In this embodiment, both the animation system and the physics system are calculated in real time. The animation system reads the animation frame data of the skeleton corresponding to the skeleton rigid body from the animation file, and calculates the current frame (that is, the above current state) according to the animation frame data. The skeleton rigid body of the virtual object corresponds to the state data of the skeleton in the animation system (including the orientation and position), and then output to the physical system.
可选地,动画引擎用来控制虚拟角色的动画过程,动画帧数据的加载、管理、查询是动画系统实现的主要功能。动画引擎获取虚拟对象移动过程中的动画帧数据(即时间帧),比如1秒钟包括30帧,相当于30张动画图片,进而能够在1秒内连续展示以形成虚拟对象的动画。动画引擎可以计算每个骨骼在每个时刻(每个时刻对应一个时间帧)的位置、朝向,因此通过动画引擎,用户可以在任何时刻获得任一骨骼的当前姿态信息(即上述位置、朝向)。Optionally, the animation engine is used to control the animation process of the virtual character, and the loading, management and query of animation frame data are the main functions implemented by the animation system. The animation engine obtains the animation frame data (that is, the time frame) during the movement of the virtual object. For example, 1 second includes 30 frames, which is equivalent to 30 animation pictures, and can then be displayed continuously within 1 second to form the animation of the virtual object. The animation engine can calculate the position and orientation of each bone at each moment (each moment corresponds to a time frame), so through the animation engine, the user can obtain the current posture information of any bone at any moment (ie the above position and orientation) .
在一个示例中,动画引擎实现任一骨骼代码如下:A3DBone*pBone=pSkeleton->GetBone(index);//从骨架中根据骨骼索引获得某个骨骼In an example, the animation engine implements any bone code as follows: A3DBone*pBone=pSkeleton->GetBone(index); //Get a certain bone from the skeleton according to the bone index
A3DMatrix4 pose=pBone->GetAbsTM();//获得这个骨骼的当前世界坐标系下的姿态信息(位置,朝向),且上述姿态信息是保存在一个4x4的矩阵中。A3DMatrix4 pose=pBone->GetAbsTM();//Get the pose information (position, orientation) in the current world coordinate system of this bone, and the above pose information is stored in a 4x4 matrix.
在另一个示例中,在其它的引擎中,骨骼姿态信息可能是以一个3维向量和一个四元数保存的;也可能是以一个3维向量和一个3x3矩阵保存的。在游戏角色制作的实例中,需要实现根据动画系统中骨骼的动画帧数 据事先编辑(采用骨骼编辑器)好物理系统中骨骼刚体的大小和对应的关节信息。本实施例中的骨骼刚体的状态数据和对应的关节数据由动画引擎计算得到,并输出给物理引擎,然后参与物理系统中应用的,其中,骨骼刚体的状态数据至少包括:骨骼刚体的位置,骨骼刚体的朝向,骨骼刚体的线速度,骨骼刚体的角速度。In another example, in other engines, the bone pose information may be stored as a 3-dimensional vector and a quaternion; it may also be stored as a 3-dimensional vector and a 3x3 matrix. In the example of making a game character, it is necessary to edit the size of the rigid body of the bones and the corresponding joint information in the physics system in advance according to the animation frame data of the bones in the animation system (using a bone editor). The state data and the corresponding joint data of the skeletal rigid body in this embodiment are calculated by the animation engine, and output to the physics engine, and then participate in the application in the physics system, wherein the state data of the skeletal rigid body at least include: the position of the skeletal rigid body, The orientation of the skeletal rigid body, the linear velocity of the skeletal rigid body, and the angular velocity of the skeletal rigid body.
可选地,刚体的朝向、位置可以直接由动画帧数据计算得出;刚体的线速度、角速度等不能由当前帧数据直接计算得出,还需要参考上一动画帧数据间接计算出。在一个可选地示例中,动画引擎采集目标骨骼在多个时刻的关键帧(包括位置和朝向),根据若干个帧计算骨骼的线速度和角速度。例如,目标骨骼在t0时刻是位置S1,在t1时刻是位置S2,那么线速度就为(S2-S1)/(t1-t0)。Optionally, the orientation and position of the rigid body can be calculated directly from the animation frame data; the linear velocity and angular velocity of the rigid body cannot be calculated directly from the current frame data, but also need to be calculated indirectly by referring to the previous animation frame data. In an optional example, the animation engine collects key frames (including the position and orientation) of the target bone at multiple moments, and calculates the linear velocity and the angular velocity of the bone according to several frames. For example, if the target bone is at position S1 at time t0 and at position S2 at time t1, then the linear velocity is (S2-S1)/(t1-t0).
在本案的一个可选的实施例中,采用骨骼模型的物理系统,依据碰撞时产生的驱动参数以一时间间隔模拟骨骼刚体从当前状态向下一动画帧目标状态的趋近,一直到下一动画帧数据的加载,包括:在骨骼模型的物理系统中基于预设参照刚体构建三轴正交坐标系统,其中,骨骼刚体和关节的六自由度关节分别对应三轴正交坐标系统三个坐标轴的轴向位移方向和旋转方向;在物理系统中通过物理驱动依据碰撞时产生的驱动参数以一时间间隔模拟骨骼刚体在三轴正交坐标系统沿轴向位移方向和/或旋转方向从当前状态向下一动画帧目标状态的趋近,一直到下一动画帧数据的加载,其中,物理驱动包括以下之一:线性驱动(LinearDrive)、角度驱动(AngularDrive)、球面插值驱动(SlerpDrive),驱动参数包括沿轴向位移和绕轴旋转位移。In an optional embodiment of this case, the physical system of the skeleton model is used to simulate the approach of the skeletal rigid body from the current state to the target state of the next animation frame at a time interval according to the driving parameters generated during the collision, until the next animation frame. The loading of animation frame data includes: constructing a three-axis orthogonal coordinate system based on a preset reference rigid body in the physical system of the skeleton model, wherein the skeleton rigid body and the six-degree-of-freedom joints of the joints correspond to the three coordinates of the three-axis orthogonal coordinate system respectively The axial displacement direction and rotation direction of the axis; in the physical system, the skeleton rigid body is simulated at a time interval according to the driving parameters generated at the time of collision through the physical drive in the three-axis orthogonal coordinate system along the axial displacement direction and/or rotation direction from the current The state approaches the target state of the next animation frame until the next animation frame data is loaded, wherein the physical drive includes one of the following: LinearDrive, AngularDrive, SlerpDrive, Drive parameters include axial displacement and rotational displacement around an axis.
在本实施例中,Joint Drive(关节驱动)有多种不同的类型,至少包括6种,线性驱动,角度驱动和球面线性插值驱动,且每一种驱动类型包括:位置驱动(positiondrive)和速度驱动(VelocityDrive);根据不同的类型,设置具体不同的关节参数,针对6自由度关节,具体的不同参数所影响的归纳总结起来就是轴向位移(即x轴,y轴,Z轴)和分别绕xyz轴旋转位移,共6种关节参数。In this embodiment, there are many different types of Joint Drive, including at least 6 types, linear drive, angle drive and spherical linear interpolation drive, and each drive type includes: position drive (positiondrive) and velocity Drive (VelocityDrive); according to different types, set different joint parameters, for 6-DOF joints, the summary of the influence of specific parameters is the axial displacement (ie x-axis, y-axis, Z-axis) and respectively Rotation displacement around the xyz axis, a total of 6 joint parameters.
本实施例中,虚拟对象的骨骼刚体可以通过六自由度关节(D6 Joint、 Configurable Joint(可配置关节))连接的,六自由度关节是一种通用的高级关节。六自由度是指在三个任意指向的正交轴系中,沿轴向的3种位移运动和围绕轴向的3种旋转运动。D6 Joint可以灵活配置,实现任意约束。D6 Joint还有强大的Drive(驱动)特性。这是实现物理动画的底层基础。如图9所示,图9是根据本发明实施例提供的一种基于六自由度的正交轴系,分别包括沿着XYZ轴的轴向,以及围绕轴向的旋转方向,包括与X轴对应的沿自身轴的旋转方向,与Y轴对应的沿局部法线的摆动方向,与Z轴对应的沿X轴与Y轴垂直的摆动方向。In this embodiment, the skeletal rigid body of the virtual object can be connected by a six-degree-of-freedom joint (D6 Joint, Configurable Joint (configurable joint)), and the six-degree-of-freedom joint is a general high-level joint. Six degrees of freedom refers to three kinds of displacement motions along the axial direction and three kinds of rotational motions around the axial direction in three orthogonal axis systems with arbitrary orientations. D6 Joint can be flexibly configured to implement arbitrary constraints. D6 Joint also has a powerful Drive feature. This is the underlying basis for implementing physical animation. As shown in FIG. 9 , FIG. 9 is a six-degree-of-freedom-based orthogonal axis system provided according to an embodiment of the present invention, including an axial direction along the XYZ axis, and a rotation direction around the axial direction, including an axis with the X axis. The corresponding rotation direction along its own axis, the swing direction along the local normal corresponding to the Y axis, and the swing direction perpendicular to the X axis and the Y axis corresponding to the Z axis.
根据上述实施例,在一个实施例中,以SLERP Drive(球面线性插值驱动)为例,假设虚拟对象上的两个刚体Actor0(角色0)(即上述上一骨骼刚体)和刚体Actor1(角色1)(即上述骨骼刚体),其中,数据均为Actor0坐标系下,实线Actor1表示Actor1的当前状态,虚线Actor1表示Actor1的目标状态,如图10所示,图10是根据本发明实施例提供的骨骼刚体当前状态的动画帧示意图。虚拟对象的每一动画帧开始时,Actor1处于当前状态,需要设定Actor1的目标状态以及设定与Actor1的Joint相关参数;再经过物理模拟,获得Actor1的新状态,其中,新状态是Actor1从当前状态“尽力”趋向目标状态的结果。According to the above embodiment, in one embodiment, taking SLERP Drive (spherical linear interpolation drive) as an example, it is assumed that two rigid bodies Actor0 (character 0) (that is, the above-mentioned last bone rigid body) and rigid body Actor1 (character 1) on the virtual object ) (that is, the above-mentioned skeleton rigid body), where the data are all in the Actor0 coordinate system, the solid line Actor1 represents the current state of Actor1, and the dotted line Actor1 represents the target state of Actor1, as shown in FIG. 10 , which is provided according to an embodiment of the present invention. The animation frame diagram of the current state of the skeletal rigid body. At the beginning of each animation frame of the virtual object, Actor1 is in the current state, and it is necessary to set the target state of Actor1 and set the parameters related to the Joint of Actor1; and then obtain the new state of Actor1 through physical simulation, where the new state is Actor1 from The result of the current state "best effort" towards the target state.
在一个示例中,按照一个关节连接的两个刚体为例。依据动画帧数据计算骨骼刚体的当前状态时的状态数据和对应的关节数据包括:In one example, take two rigid bodies connected by a joint. The state data and the corresponding joint data when calculating the current state of the skeleton rigid body according to the animation frame data include:
S11,获得第一刚体所对应的骨骼的动画世界坐标系下的姿态数据,其中,虚拟对象的骨骼模型至少包括第一刚体、第二刚体,以及连接在第一刚体和第二刚体之间的连接第一刚体的第一关节,以及与第二刚体连接的第二关节;S11, obtaining pose data in the animation world coordinate system of the bone corresponding to the first rigid body, wherein the skeleton model of the virtual object at least includes a first rigid body, a second rigid body, and a skeleton connected between the first rigid body and the second rigid body a first joint connected to the first rigid body, and a second joint connected to the second rigid body;
S12,根据第一刚体相对骨骼的姿态计算第一刚体的物理世界坐标系下的姿态数据;S12, calculating the posture data in the physical world coordinate system of the first rigid body according to the posture of the first rigid body relative to the bones;
S13,根据第一关节相对第一刚体的姿态计算出第一关节的姿态数据;S13, calculate the attitude data of the first joint according to the attitude of the first joint relative to the first rigid body;
S14,获得第二刚体所对应的骨骼的动画世界坐标系下的姿态数据;S14, obtaining the pose data in the animation world coordinate system of the bone corresponding to the second rigid body;
S15,根据第二刚体相对骨骼的姿态计算出第二刚体的世界坐标系下的姿态数据;S15, calculating the posture data in the world coordinate system of the second rigid body according to the posture of the second rigid body relative to the bones;
S16,根据第二关节相对第二刚体的姿态计算出第二关节的姿态数据;S16, calculate the attitude data of the second joint according to the attitude of the second joint relative to the second rigid body;
S17,计算第二关节的相对第一关节的姿态数据。S17: Calculate the posture data of the second joint relative to the first joint.
根据上述实施例,确定虚拟对象的当前状态至少包括:目标刚体Actor1的当前朝向,当前位置,当前线速度,当前角度。Joint Drive(关节驱动)有多种不同的类型,根据不同的类型,虚拟对象的目标状态至少包括:位置、朝向、线速度、角速度等不同数据。According to the above embodiment, determining the current state of the virtual object at least includes: the current orientation of the target rigid body Actor1, the current position, the current linear velocity, and the current angle. There are many different types of Joint Drive. According to different types, the target state of a virtual object includes at least different data such as position, orientation, linear velocity, and angular velocity.
在本实施例中,物理系统根据数学模型计算骨骼刚体的驱动参数,以及趋向目标状态输出物理动画的时间间隔,例如,一秒30帧,则当前帧到下一帧的时间间隔为
Figure PCTCN2020130413-appb-000001
将计算出的驱动参数作为驱动目标输入物理引擎,并作用在骨骼刚体上,通过模拟并计算骨骼刚体从当前动画帧趋向下一动画帧的过程,直到下一动画帧数据加载结束。
In this embodiment, the physics system calculates the driving parameters of the skeletal rigid body according to the mathematical model, and the time interval for outputting the physical animation toward the target state. For example, if there are 30 frames per second, the time interval from the current frame to the next frame is
Figure PCTCN2020130413-appb-000001
Input the calculated driving parameters as the driving target into the physics engine, and act on the skeleton rigid body. By simulating and calculating the process of the skeletal rigid body moving from the current animation frame to the next animation frame, until the next animation frame data loading ends.
正常情况下,比如原始动画的1秒有24帧或30帧,则每两帧之间的时间间隔为
Figure PCTCN2020130413-appb-000002
秒或
Figure PCTCN2020130413-appb-000003
秒(即上述时间间隔),将骨骼姿态数据存储在这一帧中,最后通过渲染引擎将这一帧的动画渲染出来即可;而在本方案提供得物理动画中,选择1秒60帧(或60帧以上,比如120帧),达到每秒的粒度更细,则每两帧之间时间间隔
Figure PCTCN2020130413-appb-000004
秒,实现了通过物理引擎控制时间间隔更小的时刻的骨骼刚体的模拟状态,使得物理动画更加流畅。
Under normal circumstances, for example, there are 24 or 30 frames in 1 second of the original animation, then the time interval between each two frames is
Figure PCTCN2020130413-appb-000002
seconds or
Figure PCTCN2020130413-appb-000003
seconds (that is, the above time interval), store the skeletal pose data in this frame, and finally render the animation of this frame through the rendering engine; and in the physical animation provided by this scheme, select 60 frames per second ( or more than 60 frames, such as 120 frames), to achieve a finer granularity per second, then the time interval between every two frames
Figure PCTCN2020130413-appb-000004
Second, the simulation state of the skeleton rigid body at a smaller time interval is controlled by the physics engine, making the physical animation smoother.
在本案的一个实施例中,驱动参数至少包括刚体受到的合力矩,但不限于此。以力矩为例,物理底层(即上述物理引擎)会根据根据输入的动画帧数据,计算下一帧动画输出时间间隔,以及根据下面的公式(即物理引擎中的数学模型)计算出Actor1所受的合力矩并应用在Actor1(即上述骨骼刚体),其中,力矩计算公式如下:In an embodiment of the present application, the driving parameter includes at least the resultant moment received by the rigid body, but is not limited thereto. Taking torque as an example, the physical bottom layer (ie, the above-mentioned physics engine) will calculate the output time interval of the next frame of animation according to the input animation frame data, and according to the following formula (ie, the mathematical model in the physics engine), Actor1 will be calculated. The resulting moment is applied to Actor1 (that is, the above-mentioned bone rigid body), where the moment calculation formula is as follows:
Torque=spring*(tarOri-curOri)+damping*(tarAVel-curAVel):Torque=spring*(tarOri-curOri)+damping*(tarAVel-curAVel):
其中,tarOri:相对Actor0的Actor1的目标朝向;curOri:相对Actor0的Actor1的当前朝向;tarAVel:相对Actor0的Actor1的目标角速度;curAVel:相对Actor0的Actor1的当前角速度;spring:本次驱动力矩系数。其中,spring越大越趋向目标,代表了朝向权重;damping:已经应用的驱动力矩系数。其中,damping越大越趋向目标,代表了角速度权重。Among them, tarOri: Target orientation of Actor1 relative to Actor0; curOri: Current orientation of Actor1 relative to Actor0; tarAVel: Target angular velocity of Actor1 relative to Actor0; curAVel: Current angular velocity of Actor1 relative to Actor0; spring: This driving torque coefficient. Among them, the larger the spring, the more toward the target, representing the weight of the orientation; damping: the applied driving torque coefficient. Among them, the larger the damping, the more toward the target, which represents the weight of the angular velocity.
物理引擎通过骨骼刚体的合力矩控制骨骼刚体和对应关节的移动,至 少包括旋转、平移、缩放等操作,让骨骼刚体“尽力”趋向目标状态,并形成了让骨骼摆出各种姿势的物理动画。The physics engine controls the movement of the skeletal rigid body and the corresponding joints through the combined moment of the skeletal rigid body, at least including rotation, translation, scaling and other operations, so that the skeletal rigid body "try its best" to tend to the target state, and form a physical animation for the bones to assume various poses .
采用骨骼模型的物理系统,依据碰撞时产生的驱动参数以一时间间隔模拟骨骼刚体从当前状态向下一动画帧目标状态的趋近,一直到下一动画帧数据的加载,包括:提取骨骼刚体在下一动画帧目标状态的状态数据和对应的关节数据中的关节参数和驱动参数,其中,关节参数和驱动参数相互关联;抽象并封装关节参数和驱动参数,得到引擎参数;将引擎参数作为驱动目标输入到物理系统的物理引擎中,驱动物理引擎以一时间间隔模拟骨骼刚体从当前状态向下一动画帧目标状态的趋近,一直到下一动画帧数据的加载。通过对Joint(关节)参数、Drive参数等数据进行抽象和封装,以提供良好的对外接口,既方便用户使用,又能提供调教灵活性。The physical system of the skeleton model is used to simulate the approach of the skeleton rigid body from the current state to the target state of the next animation frame at a time interval according to the driving parameters generated during the collision, until the loading of the next animation frame data, including: extracting the skeleton rigid body In the state data of the target state of the next animation frame and the joint parameters and driving parameters in the corresponding joint data, the joint parameters and driving parameters are related to each other; abstract and encapsulate the joint parameters and driving parameters to obtain the engine parameters; use the engine parameters as the driving parameters The target is input into the physics engine of the physics system, which drives the physics engine to simulate the approach of the skeleton rigid body from the current state to the target state of the next animation frame at a time interval, until the loading of the next animation frame data. By abstracting and encapsulating data such as Joint (joint) parameters and Drive parameters to provide a good external interface, it is not only convenient for users to use, but also provides flexibility in tuning.
在一个示例中,时间间隔为1/60秒,动画系统的动画帧时间间隔为1/30秒。在本实施例的一些实施场景中,将引擎参数作为驱动目标输入到物理系统的物理引擎中包括:计算引擎参数针对骨骼刚体的第一力矩,以及计算骨骼刚体的限制力矩;根据第一力矩和限制力矩计算骨骼刚体受到的合力矩,并将合力矩作为驱动目标输入到物理系统的物理引擎中。刚体Actor1在运动过程中可能会发生碰撞阻挡;还可能外部用户施加了力;Actor1还受到Jointlimit(关节限制)的限制,Joint(关节)最大力(力矩)的限制;Joint各种flag(标志)的影响,flag用于控制joint驱动的不同工作方式(即上述驱动类型);以及Joint连接链的迭代影响等等,物理引擎会综合计算出Actor1的最终结果(即合力矩)。In one example, the interval is 1/60 of a second, and the animation frame interval of the animation system is 1/30 of a second. In some implementation scenarios of this embodiment, inputting the engine parameters as the driving target into the physics engine of the physics system includes: calculating the first moment of the engine parameter with respect to the skeleton rigid body, and calculating the limit torque of the skeletal rigid body; according to the first torque and The limit torque calculates the resultant moment received by the skeletal rigid body, and inputs the resultant moment as the driving target into the physics engine of the physics system. Rigid body Actor1 may encounter collision blocking during motion; external users may also apply force; Actor1 is also limited by Jointlimit (joint limit), Joint (joint) maximum force (torque) limit; Joint various flags (signs) The effect of the flag is used to control the different working modes of the joint drive (ie the above-mentioned drive types); as well as the iterative effect of the Joint connection chain, etc., the physics engine will comprehensively calculate the final result of Actor1 (ie the resultant torque).
在本实施例的一个实施方式中,系统还包括控制器,方案还包括:在预定数量的动画帧时间段中,通过一控制器根据虚拟对象的角色行为执行以下操作:驱动参数平滑处理、驱动状态管理、驱动应用策略管理;其中,驱动参数平滑处理用于流畅显示虚拟对象的动画效果;驱动状态管理包括管理骨骼刚体的状态变化;驱动应用策略管理用于指示所使用的控制器,以控制骨骼刚体产生对应的动画效果。In an implementation of this embodiment, the system further includes a controller, and the solution further includes: in a predetermined number of animation frame time periods, the following operations are performed by a controller according to the character behavior of the virtual object: driving parameter smoothing, driving State management, driving application strategy management; wherein, driving parameter smoothing is used to smoothly display animation effects of virtual objects; driving state management includes managing the state changes of skeletal rigid bodies; driving application strategy management is used to indicate the controller used to control The skeletal rigid body produces the corresponding animation effect.
在本实施例中,物理引擎从当前状态进行dt时间片(即上述时间间隔)的模拟得到物理模拟结果。本方案还包括控制器和合成器的操作,其中, 控制器(控制器管理趋向相对长时间的行为,通常是数秒或以上的级别,每个动画控制器通常负责一个类型的角色行为,即和谐地安排角色各方面动画相关行为)主要负责参数平滑处理(以使角色的动画效果更加流畅)、Drive状态的管理(刚体的状态变化管理)、Drive应用策略(应用策略表示采用何种控制器控制刚体的何种动画效果,比如使用旋转控制器控制关节转动,再例如使用位置控制器控制虚拟对象的位置),从而实现多种控制器分别达到不同效果。In this embodiment, the physics engine performs the simulation of the dt time slice (ie, the above-mentioned time interval) from the current state to obtain the physics simulation result. This scheme also includes the operation of controllers and compositors, where the controllers (controllers manage behaviors that tend to be relatively long-term, usually on the order of seconds or more, each animation controller is usually responsible for one type of character behavior, the harmony It is mainly responsible for parameter smoothing (to make the animation effect of the character more fluent), the management of Drive state (the state change management of rigid body), and the application strategy of Drive (the application strategy indicates which controller is used for control). What kind of animation effect of the rigid body, such as using the rotation controller to control the rotation of the joint, and then using the position controller to control the position of the virtual object), so as to achieve different effects with various controllers.
在本实施例的一个实施方式中,系统还包括合成器,合成器负责处理物理动画的结果与动画、纯物理之间的平滑处理。合成器在执行物理动画的结果与动画的平滑处理时,方案还包括:骨骼模型动画过程中骨骼刚体触发碰撞时,使用一合成器,将物理系统计算的趋近结果与当前动画帧的状态数据和对应的关节数据进行融合处理。In one implementation of this embodiment, the system further includes a synthesizer, and the synthesizer is responsible for processing the result of the physical animation and the smooth processing between the animation and pure physics. When the synthesizer performs the result of the physical animation and the smoothing of the animation, the solution also includes: when the skeletal rigid body triggers a collision during the animation of the skeletal model, a synthesizer is used to compare the approach result calculated by the physics system with the state data of the current animation frame Fusion processing is performed with the corresponding joint data.
合成器在执行物理动画的结果与纯物理的平滑处理时,还包括:在检测到骨骼模型上新的触发事件时,将骨骼模型的运动切换到纯物理系统计算的运动;其中在进行切换时,使用一合成器,将物理系统计算的趋近结果与要切换到的纯物理系统在当前时刻计算的状态数据和对应的关节数据进行融合处理。When the compositor performs the smoothing of the result of the physical animation and the pure physics, it also includes: when a new trigger event on the skeletal model is detected, the motion of the skeletal model is switched to the motion calculated by the pure physics system; wherein when switching , using a synthesizer to fuse the approximation result calculated by the physical system with the state data and the corresponding joint data calculated by the pure physical system to be switched to at the current moment.
在一个实例中,在游戏项目中实现过这样的效果:原先主角在行走中与其它NPC或者玩家相撞后,就直接穿过去没有任何反应。加入物理动画后的流程是这样:在没有相撞时,主角是动画驱动状态。在系统判定相撞时,切换为物理动画状态,并对主角躯干刚体施加一个与相撞方向相反的力。一定时间后恢复动画驱动状态。在这个过程中,施加力之后物理引擎计算出的物理动画身体弯曲程度往往比较大。因此,我们使用合成器将物理引擎计算出的结果与原始动画再进行了融合形成最终结果。In one instance, this effect has been achieved in the game project: after the original protagonist collided with other NPCs or players while walking, he went straight through without any reaction. The process after adding physical animation is like this: when there is no collision, the protagonist is in an animation-driven state. When the system determines the collision, switch to the physical animation state, and apply a force opposite to the collision direction to the rigid body of the protagonist's torso. The animation-driven state is restored after a certain period of time. In this process, the bending degree of the physical animation body calculated by the physics engine after applying the force is often relatively large. Therefore, we used a compositor to fuse the result calculated by the physics engine with the original animation to form the final result.
在本实施例的一个示例中,假设上面的逻辑层在某一帧确定由松散的物理动画效果切换到紧绷的物理动画效果,需要调整spring参数,比如需要将spring参数从200调到800,但是如果突然切换(即直接将spring参数从200调整成800)往往会造成画面跳变,使人感觉生硬,导致视觉效果不好,通过本示例,将spring参数进行逐步调整,比如,在0.3秒时间内spring 参数需要从200调到800,这0.3秒内跑了20多帧,则控制器负责将每帧增大一些spring参数值,来达到最终的目标值,从而实现了参数平滑处理的操作。In an example of this embodiment, it is assumed that the upper logic layer determines to switch from a loose physical animation effect to a tight physical animation effect at a certain frame, and the spring parameter needs to be adjusted, for example, the spring parameter needs to be adjusted from 200 to 800, However, if you switch suddenly (that is, directly adjust the spring parameter from 200 to 800), it will often cause the screen to jump, which will make people feel stiff and lead to poor visual effects. Through this example, the spring parameter will be adjusted gradually, for example, in 0.3 seconds The spring parameter needs to be adjusted from 200 to 800 within the time, and more than 20 frames have been run within 0.3 seconds, the controller is responsible for increasing the spring parameter value for each frame to reach the final target value, thus realizing the operation of parameter smoothing. .
在另一个示例中,以上文的击飞效果为例,在击飞前,人物是活着状态是纯动画控制,物理以kinematic(运动学上的)刚体的形式受动画控制。在击飞时刻切换为物理动画,在整个腾空的过程中身体是逐渐放松的;人物落地时认为是死亡状态,保持较松散的效果;落地一段时间后(也就是死亡一段时间后)身体形成较紧绷僵硬的状态,认为是僵尸。在击飞的过程中,物理动画的驱动状态和应用策略是不同的,需要控制器控制管理实施,控制器根据击飞时刻的受力参数,确定虚拟对象的驱动参数,进而为目标刚体和/或目标关节赋予物理属性。In another example, taking the above knock-up effect as an example, before the knock-up, the character is alive and is controlled by pure animation, and the physics is controlled by animation in the form of kinematic (kinematic) rigid bodies. Switch to physical animation at the moment of knock-up, and the body gradually relaxes during the whole process of vacating; when the character lands, it is considered to be in a state of death and maintains a looser effect; after landing for a period of time (that is, after a period of death), the body forms a relatively looser effect. A tense and stiff state, thought to be a zombie. During the knock-up process, the driving state and application strategy of the physical animation are different, which requires the controller to control and manage the implementation. Or assign physical properties to the target joint.
在一个示例中,在复杂环境下,碰撞穿透是由底层物理引擎负责的,通过物理引擎事先设置好各种物理参数,物理引擎拿到动画数据后,转换为物理系统中的数据,设置不同的参数,执行一个dt(时间切片),得到最终一个模拟结果,从而得到物理动画,实现了控制目标刚体或目标关节进行旋转、平移,甚至缩放等操作,形成了让骨骼摆出各种姿势的物理动画。下面以纯物理与物理动画总体流程对本方案做进一步地说明:In one example, in a complex environment, the underlying physics engine is responsible for collision penetration. Various physical parameters are set in advance through the physics engine. After the physics engine gets the animation data, it is converted into data in the physics system, and the settings are different. parameters, execute a dt (time slice), get the final simulation result, and then get the physical animation, which realizes the control of the target rigid body or the target joint to rotate, translate, and even zoom, etc. Physical animation. The following is a further description of this scheme with the overall process of pure physics and physical animation:
图12是根据本发明实施例提供的纯物理场景下每帧的流程图,如图12所示,以布娃娃系统的骨骼模型为例,若游戏角色的手臂(例如上述骨骼刚体)撞墙,物理系统(物理引擎)设定刚体撞墙后受到物理参数,比如重力,手臂出现下垂,受到重力加速度的约束,然后模拟刚体做自由落体运动,获得的最终结果,不符合现实场景中手臂撞墙呈现的状态。FIG. 12 is a flowchart of each frame in a purely physical scene provided according to an embodiment of the present invention. As shown in FIG. 12 , taking the skeleton model of the ragdoll system as an example, if the arm of the game character (such as the above-mentioned skeleton rigid body) hits the wall, the physical The system (physics engine) sets the rigid body to hit the wall and is subject to physical parameters, such as gravity, the arm sags and is constrained by the acceleration of gravity, and then simulates the rigid body to do free fall motion. The final result obtained does not conform to the state of the arm hitting the wall in the real scene. .
为了达到动作表现效果多样化且不显著增加美术工作量、动作表现能够受周围环境影响以及动作表现能够展现整体的美术效果,本实施例提供一种使用动画驱动物理的方案(简称物理动画),即以动画为框架,用物理手段去实现,参见图13,图13是根据本发明实施例提供的物理动画场景下每帧的流程图,仍以游戏角色的手臂撞墙为例,在手臂撞到墙之前是由动画系统控制的,动画系统根据动画文件中的动画帧数据(骨骼的姿态数据);计算动画系统中骨骼的状态数据和关节数据,计算物理系统中对应 的骨骼刚体以及关节的参数,以及下一帧的骨骼刚体的状态数据,物理引擎根据关节的驱动类型设置下一帧的骨骼刚体对应关节数据(即设定目标状态);在手臂碰撞墙后,从动画状态切换成物理动画的状态,并由物理引擎控制,物理课引擎中的每个动画控制器通常负责一个类型的角色行为,针对指定的控制器设置不同的参数,比如spring和damping等物理参数,以对物理参数进行平滑处理,对当前帧趋向下一帧驱动进行参数平滑处理;物理引擎中的数据模型根据动画帧数据计算输出时间间隔,以该时间间隔(比如60分之1秒)模拟刚体从当前帧趋向下一帧的物理动画,并输出;在骨骼刚体从动画系统进入物理动画系统,或者从物理动画系统进行动画系统,由合成器进行状态平滑处理,使得当前帧“尽力”趋向下一目标帧,得到最终结果。本方案中,物理动画充分结合了动画的可控性和物理的可交互性,具有相比纯物理场景或纯动画场景有更好的动作表现效果;而如果配合IK、动画融合等技术的话,可进一步提升游戏的动作表现力和真实感。因此,在一些注重动作表现的游戏中可考虑使用此方案。从而解决了相关技术中存在的美术制作无法控制虚拟对象动作,进而影响美术效果的技术问题。In order to achieve a variety of action performance effects without significantly increasing the art workload, the action performance can be affected by the surrounding environment, and the action performance can show the overall artistic effect, this embodiment provides a solution using animation to drive physics (referred to as physical animation), That is, the animation is used as the frame and is realized by physical means. Referring to FIG. 13, FIG. 13 is a flowchart of each frame in the physical animation scene provided according to the embodiment of the present invention. The wall was previously controlled by the animation system. The animation system calculates the state data and joint data of the bones in the animation system according to the animation frame data (the pose data of the bones) in the animation file, and calculates the parameters of the corresponding skeleton rigid bodies and joints in the physics system. , and the state data of the skeleton rigid body of the next frame. The physics engine sets the corresponding joint data of the skeleton rigid body of the next frame according to the drive type of the joint (ie, sets the target state); after the arm hits the wall, it switches from the animation state to the physical animation The state is controlled by the physics engine. Each animation controller in the physics engine is usually responsible for one type of character behavior, and different parameters are set for the specified controller, such as physical parameters such as spring and damping. Smoothing processing, to perform parameter smoothing processing on the current frame trending to the next frame drive; the data model in the physics engine calculates the output time interval according to the animation frame data, and simulates the rigid body from the current frame trending down with this time interval (such as 1/60th of a second). One frame of physical animation, and output; when the skeleton rigid body enters the physical animation system from the animation system, or from the physical animation system to the animation system, the compositor performs state smoothing processing, so that the current frame "try its best" to the next target frame, get Final result. In this solution, physical animation fully combines the controllability of animation and the interactivity of physics, and has better action performance than pure physical scenes or pure animation scenes; and if combined with IK, animation fusion and other technologies, It can further enhance the action expression and realism of the game. Therefore, this scheme can be considered in some games that focus on action performance. Thus, the technical problem in the related art that art production cannot control the action of the virtual object and thus affects the art effect is solved.
本方案提供每一帧中的虚拟对象的所有骨骼的状态数据,并输出给物理系统,物理系统中的物理引擎根据骨骼的状态数据计算驱动参数(比如合力矩),物理系统根据驱动参数以一时间间隔模拟虚拟对象从当前状态向目标状态的趋近过程,最后通过渲染引擎渲染虚拟对象的美术动画,从而实现了物理和动画共同决定最终游戏角色的美术效果。This solution provides the state data of all the bones of the virtual object in each frame, and outputs it to the physics system. The time interval simulates the approaching process of the virtual object from the current state to the target state, and finally renders the art animation of the virtual object through the rendering engine, thus realizing the art effect of the final game character jointly determined by physics and animation.
实施例2Example 2
在本实施例中还提供了一种虚拟对象的控制装置,用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。In this embodiment, a virtual object control device is also provided, which is used to implement the above-mentioned embodiments and preferred implementations, and the descriptions that have been described will not be repeated. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, implementations in hardware, or a combination of software and hardware, are also possible and contemplated.
本实施例提供了一种虚拟对象的控制装置,其中,虚拟对象的骨骼模型设置有动画系统,并且所述虚拟对象骨骼模型设置有物理系统,该物理 系统包括:骨骼刚体和对应的关节信息;图14是根据本发明实施例的一种虚拟对象的控制装置的结构框图,该装置包括:获取模块1402,用于骨骼模型动画过程中在其骨骼刚体触发碰撞时,获取动画系统中当前状态时所述骨骼刚体对应骨骼的动画帧数据;This embodiment provides a control device for a virtual object, wherein the skeleton model of the virtual object is provided with an animation system, and the skeleton model of the virtual object is provided with a physics system, and the physics system includes: a skeleton rigid body and corresponding joint information; 14 is a structural block diagram of a control device for a virtual object according to an embodiment of the present invention, the device includes: an acquisition module 1402 for acquiring the current state in the animation system when the rigid body of the skeleton triggers a collision during the animation of the skeletal model The animation frame data of the skeleton corresponding to the skeleton rigid body;
第一计算模块1404,连接至上述获取模块1402,用于依据所述动画帧数据计算所述骨骼刚体的当前状态时的状态数据和对应的关节数据;The first calculation module 1404 is connected to the above-mentioned acquisition module 1402, and is used for calculating the state data and corresponding joint data of the current state of the skeleton rigid body according to the animation frame data;
第二计算模块1406,连接至上述第一计算模块1404,用于计算设置所述骨骼刚体在下一动画帧目标状态的状态数据和对应的关节数据;The second calculation module 1406, connected to the above-mentioned first calculation module 1404, is used to calculate and set the state data and corresponding joint data of the skeleton rigid body in the target state of the next animation frame;
模拟模块1408,连接至上述第二计算模块1406,用于采用所述骨骼模型的物理系统,依据碰撞时产生的驱动参数以一时间间隔模拟所述骨骼刚体从当前状态向下一动画帧目标状态的趋近,一直到下一动画帧数据的加载。The simulation module 1408, connected to the above-mentioned second calculation module 1406, is used for using the physical system of the skeleton model to simulate the skeleton rigid body from the current state to the target state of the next animation frame at a time interval according to the driving parameters generated during the collision approach until the next animation frame data is loaded.
可选的,所述获取模块包括:获取单元,用于获取动画系统在当前时间加载的动画帧,其中,所述动画帧中的对象包括所述虚拟对象;解析单元,用于在所述动画帧中解析所述虚拟对象的骨骼刚体对应骨骼在世界坐标系下的姿态信息。Optionally, the obtaining module includes: an obtaining unit for obtaining an animation frame loaded by the animation system at the current time, wherein the object in the animation frame includes the virtual object; a parsing unit for obtaining the animation frame in the animation In the frame, the skeleton rigid body of the virtual object is parsed to correspond to the posture information of the skeleton in the world coordinate system.
可选的,所述第一计算模块包括:计算单元,用于在动画引擎中依据所述动画帧数据计算所述骨骼刚体的当前状态时的以下状态数据至少之一:骨骼刚体的位置、骨骼刚体的朝向、骨骼刚体的线速度、骨骼刚体的角速度;处理单元,用于在所述动画引擎中确定与所述骨骼刚体关联的关节,并获取所述关节在所述当前状态时的关节数据。Optionally, the first calculation module includes: a calculation unit for calculating at least one of the following state data when the current state of the skeleton rigid body is calculated according to the animation frame data in the animation engine: the position of the skeleton rigid body, the skeleton The orientation of the rigid body, the linear velocity of the skeletal rigid body, and the angular velocity of the skeletal rigid body; the processing unit is used to determine the joint associated with the skeletal rigid body in the animation engine, and obtain the joint data of the joint in the current state .
可选的,所述第一计算模块包括:第一获取单元,用于获得第一刚体所对应的骨骼的动画世界坐标系下的姿态数据,其中,所述虚拟对象的骨骼模型至少包括第一刚体、第二刚体,以及连接在第一刚体和第二刚体之间的连接第一刚体的第一关节,以及与第二刚体连接的第二关节;第一计算单元,用于根据所述第一刚体相对骨骼的姿态计算第一刚体的物理世界坐标系下的姿态数据;第二计算单元,用于根据第一关节相对所述第一刚体的姿态计算出第一关节的姿态数据;第二获取单元,用于获得第二刚体所对应的骨骼的动画世界坐标系下的姿态数据;第三计算单元,用于根据 第二刚体相对骨骼的姿态计算出第二刚体的世界坐标系下的姿态数据;第四计算单元,用于根据第二关节相对第二刚体的姿态计算出第二关节的姿态数据;第五计算单元,用于计算第二关节的相对第一关节的姿态数据。Optionally, the first calculation module includes: a first acquisition unit, configured to obtain the pose data in the animation world coordinate system of the bone corresponding to the first rigid body, wherein the skeleton model of the virtual object includes at least the first a rigid body, a second rigid body, and a first joint connected to the first rigid body between the first rigid body and the second rigid body, and a second joint connected to the second rigid body; a first calculation unit for The posture of a rigid body relative to the bones calculates the posture data in the physical world coordinate system of the first rigid body; the second calculation unit is used to calculate the posture data of the first joint according to the posture of the first joint relative to the first rigid body; the second The acquisition unit is used to obtain the posture data in the animation world coordinate system of the bone corresponding to the second rigid body; the third calculation unit is used to calculate the posture in the world coordinate system of the second rigid body according to the posture of the second rigid body relative to the bone data; a fourth calculation unit for calculating the attitude data of the second joint according to the attitude of the second joint relative to the second rigid body; and a fifth calculation unit for calculating the attitude data of the second joint relative to the first joint.
可选的,所述计算单元包括:第一解析子单元,用于在动画引擎中依据第一动画帧数据解析所述虚拟对象在世界坐标系中第一姿态信息;确定子单元,用于基于所述第一姿态信息确定所述骨骼刚体的当前状态时的第一状态数据,其中,所述第一状态数据包括:骨骼刚体的位置、骨骼刚体的朝向;第二解析子单元,用于在动画引擎中依据第二动画帧数据解析所述虚拟对象在世界坐标系中第二姿态信息,其中,所述动画帧数据包括所述第一动画帧数据和所述第二动画帧数据,所述第二动画帧数据的加载时间早于所述第一动画帧数据的加载时间;计算子单元,用于基于所述第二姿态信息与所述第一姿态信息计算所述虚拟对象的移动距离,并根据所述移动距离计算所述骨骼刚体的线速度和所述骨骼刚体的角速度。Optionally, the computing unit includes: a first parsing subunit for parsing the first pose information of the virtual object in the world coordinate system according to the first animation frame data in the animation engine; a determination subunit for The first posture information determines the first state data of the current state of the skeleton rigid body, wherein the first state data includes: the position of the skeleton rigid body, the orientation of the skeleton rigid body; the second parsing subunit is used for The animation engine parses the second pose information of the virtual object in the world coordinate system according to the second animation frame data, wherein the animation frame data includes the first animation frame data and the second animation frame data, and the animation frame data includes the first animation frame data and the second animation frame data. The loading time of the second animation frame data is earlier than the loading time of the first animation frame data; the calculation subunit is configured to calculate the moving distance of the virtual object based on the second posture information and the first posture information, and calculate the linear velocity of the skeleton rigid body and the angular velocity of the skeleton rigid body according to the moving distance.
可选的,所述模拟模块包括:构建单元,用于在所述骨骼模型的物理系统中基于预设参照刚体构建三轴正交坐标系统,其中,所述骨骼刚体和关节的六自由度关节分别对应所述三轴正交坐标系统三个坐标轴的轴向位移方向和旋转方向;模拟单元,用于在所述物理系统中通过物理驱动依据碰撞时产生的驱动参数以一时间间隔模拟所述骨骼刚体在所述三轴正交坐标系统沿轴向位移方向和/或旋转方向从当前状态向下一动画帧目标状态的趋近,一直到下一动画帧数据的加载,其中,物理驱动包括以下之一:线性驱动、角度驱动、球面插值驱动,所述驱动参数包括沿轴向位移和绕轴旋转位移。Optionally, the simulation module includes: a construction unit for constructing a three-axis orthogonal coordinate system based on a preset reference rigid body in the physical system of the skeleton model, wherein the skeleton rigid body and the six-degree-of-freedom joint of the joint Corresponding to the axial displacement direction and the rotation direction of the three coordinate axes of the three-axis orthogonal coordinate system respectively; the simulation unit is used to simulate the physical driving in the physical system at a time interval according to the driving parameters generated during the collision. The skeletal rigid body approaches from the current state to the target state of the next animation frame along the axial displacement direction and/or the rotation direction in the three-axis orthogonal coordinate system, until the loading of the next animation frame data, wherein the physical drive It includes one of the following: linear drive, angular drive, spherical interpolation drive, and the drive parameters include displacement along the axial direction and rotational displacement around the axis.
可选的,所述模拟模块包括:提取单元,用于提取所述骨骼刚体在下一动画帧目标状态的状态数据和对应的关节数据中的关节参数和驱动参数,其中,所述关节参数和所述驱动参数相互关联;封装单元,用于抽象并封装所述关节参数和驱动参数,得到引擎参数;驱动单元,用于将所述引擎参数作为驱动目标输入到所述物理系统的物理引擎中,驱动所述物理引擎以一时间间隔模拟所述骨骼刚体从当前状态向下一动画帧目标状态的趋近,一直到下一动画帧数据的加载。Optionally, the simulation module includes: an extraction unit, configured to extract the state data of the skeleton rigid body in the target state of the next animation frame and the joint parameters and driving parameters in the corresponding joint data, wherein the joint parameters and all The drive parameters are related to each other; the encapsulation unit is used to abstract and encapsulate the joint parameters and the drive parameters to obtain engine parameters; the drive unit is used to input the engine parameters into the physics engine of the physical system as a drive target, The physics engine is driven to simulate the approach of the skeletal rigid body from the current state to the target state of the next animation frame at a time interval until the loading of the next animation frame data.
可选的,所述驱动单元包括:计算子单元,用于计算所述引擎参数针对骨骼刚体的第一力矩,以及计算所述骨骼刚体的限制力矩;输入子单元,用于根据所述第一力矩和所述限制力矩计算所述骨骼刚体受到的合力矩,并将所述合力矩作为驱动目标输入到所述物理系统的物理引擎中。Optionally, the driving unit includes: a calculation subunit for calculating a first moment of the engine parameter with respect to the skeleton rigid body, and calculating a limit torque of the skeleton rigid body; an input subunit for calculating the first moment of the skeleton rigid body according to the first The moment and the limit moment calculate the resultant moment received by the skeletal rigid body, and input the resultant moment as a drive target into the physics engine of the physics system.
可选的,所述时间间隔为1/60秒,所述动画系统的动画帧时间间隔为1/30秒。可选的,所述装置还包括:控制模块,用于在预定数量的动画帧时间段中,通过一控制器根据所述虚拟对象的角色行为执行以下操作:驱动参数平滑处理、驱动状态管理、驱动应用策略管理;其中,所述驱动参数平滑处理用于流畅显示所述虚拟对象的动画效果;所述驱动状态管理包括管理所述骨骼刚体的状态变化;所述驱动应用策略管理用于指示所使用的控制器,以控制骨骼刚体产生对应的动画效果。Optionally, the time interval is 1/60 second, and the animation frame time interval of the animation system is 1/30 second. Optionally, the device further includes: a control module, configured to perform the following operations according to the character behavior of the virtual object through a controller in a predetermined number of animation frame time periods: smoothing processing of driving parameters, management of driving states, Driving application strategy management; wherein, the driving parameter smoothing process is used to smoothly display the animation effect of the virtual object; the driving state management includes managing the state changes of the skeletal rigid body; the driving application strategy management is used to indicate the The controller used to control the skeletal rigid body to produce corresponding animation effects.
可选的,所述装置还包括:合成模块,用于所述骨骼模型动画过程中所述骨骼刚体触发碰撞时,使用一合成器,将所述物理系统计算的趋近结果与当前动画帧的状态数据和对应的关节数据进行融合处理。Optionally, the device further includes: a synthesis module, used for using a synthesizer when the skeletal rigid body triggers a collision during the animation process of the skeletal model to compare the approach result calculated by the physics system with the result of the current animation frame. The state data and the corresponding joint data are fused.
可选的,所述装置还包括:在检测到所述骨骼模型上新的触发事件时,将所述骨骼模型的运动切换到纯物理系统计算的运动;其中在进行所述切换时,使用一合成器,将所述物理系统计算的所述趋近结果与要切换到的纯物理系统在当前时刻计算的状态数据和对应的关节数据进行融合处理。Optionally, the device further includes: when a new trigger event on the skeleton model is detected, switching the motion of the skeleton model to the motion calculated by the pure physical system; wherein when performing the switching, a A synthesizer, which fuses the approaching result calculated by the physical system with the state data and the corresponding joint data calculated by the pure physical system to be switched to at the current moment.
可选的,所述装置还包括:判断模块,用于在所述模拟模块采用所述骨骼模型的物理系统,依据碰撞时产生的驱动参数以一时间间隔模拟所述骨骼刚体从当前状态向下一动画帧目标状态的趋近,一直到下一动画帧数据的加载之后,在所述物理系统中判断碰撞过程是否完成;更新模块,用于若所述碰撞过程未完成,将当前周期加载的下一动画帧数据更新为下一周期在起始状态时的动画帧数据。Optionally, the device further includes: a judgment module, configured to use the physical system of the skeleton model in the simulation module, and simulate the skeleton rigid body from the current state downward at a time interval according to the driving parameters generated during the collision. When the target state of an animation frame approaches, until the loading of the next animation frame data, it is judged in the physics system whether the collision process is completed; the update module is used to update the current cycle if the collision process is not completed. The next animation frame data is updated to the animation frame data when the next cycle is in the initial state.
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。It should be noted that the above modules can be implemented by software or hardware, and the latter can be implemented in the following ways, but not limited to this: the above modules are all located in the same processor; or, the above modules can be combined in any combination The forms are located in different processors.
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的 技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的虚拟对象的控制设备中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。Various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all functions of some or all components of the virtual object control device according to the embodiment of the present invention. The present invention can also be implemented as apparatus or apparatus programs (eg, computer programs and computer program products) for performing part or all of the methods described herein. Such a program implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such signals may be downloaded from Internet sites, or provided on carrier signals, or in any other form.
例如,图15示出了可以实现根据本发明的虚拟对象的控制方法的服务器,例如应用服务器。该服务器传统上包括处理器410和以存储器420形式的计算机程序产品或者计算机可读介质。存储器420可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。存储器420具有用于执行上述方法中的任何方法步骤的程序代码431的存储空间430。例如,用于程序代码的存储空间430可以包括分别用于实现上面的方法中的各种步骤的各个程序代码431。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。这些计算机程序产品包括诸如硬盘,紧致盘(CD)、存储卡或者软盘之类的程序代码载体。这样的计算机程序产品通常为如参考图16所述的便携式或者固定存储单元。该存储单元可以具有与图4的服务器中的存储器420类似布置的存储段、存储空间等。程序代码可以例如以适当形式进行压缩。通常,存储单元包括计算机可读代码431’,即可以由例如诸如410之类的处理器读取的代码,这些代码当由服务器运行时,导致该服务器执行上面所描述的方法中的各个步骤。For example, FIG. 15 shows a server, such as an application server, that can implement the control method of a virtual object according to the present invention. The server traditionally includes a processor 410 and a computer program product or computer readable medium in the form of memory 420 . The memory 420 may be electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM. The memory 420 has storage space 430 for program code 431 for performing any of the method steps in the above-described methods. For example, storage space 430 for program code may include various program codes 431 for implementing various steps in the above methods, respectively. These program codes can be read from or written to one or more computer program products. These computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks. Such computer program products are typically portable or fixed storage units as described with reference to FIG. 16 . The storage unit may have storage segments, storage spaces, etc. arranged similarly to the storage 420 in the server of FIG. 4 . The program code may, for example, be compressed in a suitable form. Typically, the storage unit includes computer readable code 431', i.e. code readable by a processor such as 410 for example, which when executed by a server, causes the server to perform the various steps in the methods described above.
在本申请的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
在本申请所提供的几个实施例中,应该理解到,所揭露的技术内容,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统, 或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The apparatus embodiments described above are only illustrative, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components may be combined or Integration into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of units or modules, and may be in electrical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, and the computer software products are stored in a storage medium , including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes .
以上所述仅是本申请的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本申请的保护范围。The above are only the preferred embodiments of the present application. It should be pointed out that for those skilled in the art, without departing from the principles of the present application, several improvements and modifications can also be made. It should be regarded as the protection scope of this application.

Claims (15)

  1. 一种虚拟对象的控制方法,其中,虚拟对象的骨骼模型设置有动画系统,并且所述虚拟对象骨骼模型设置有物理系统,该物理系统包括:骨骼刚体和对应的关节信息;所述控制方法包括:A control method of a virtual object, wherein an animation system is set on a skeleton model of the virtual object, and a physics system is set on the skeleton model of the virtual object, the physics system includes: a skeleton rigid body and corresponding joint information; the control method includes: :
    骨骼模型动画过程中在其骨骼刚体触发碰撞时,获取动画系统中当前状态时所述骨骼刚体对应骨骼的动画帧数据;During the animation process of the skeletal model, when the skeleton rigid body triggers a collision, obtain the animation frame data of the skeleton corresponding to the skeleton rigid body in the current state of the animation system;
    依据所述动画帧数据计算所述骨骼刚体的当前状态时的状态数据和对应的关节数据;Calculate the state data and corresponding joint data of the current state of the skeleton rigid body according to the animation frame data;
    计算设置所述骨骼刚体在下一动画帧目标状态的状态数据和对应的关节数据;Calculate and set the state data and corresponding joint data of the skeleton rigid body in the target state of the next animation frame;
    采用所述骨骼模型的物理系统,依据碰撞时产生的驱动参数以一时间间隔模拟所述骨骼刚体从当前状态向下一动画帧目标状态的趋近,一直到下一动画帧数据的加载。The physical system using the skeleton model simulates the approach of the skeletal rigid body from the current state to the target state of the next animation frame at a time interval according to the driving parameters generated during collision, until the loading of the next animation frame data.
  2. 根据权利要求1所述的方法,获取动画系统中当前状态时所述骨骼刚体对应骨骼的动画帧数据包括:The method according to claim 1, obtaining the animation frame data of the skeleton corresponding to the skeleton rigid body when the current state in the animation system comprises:
    获取动画系统在当前时间加载的动画帧,其中,所述动画帧中的对象包括所述虚拟对象;Obtain the animation frame loaded by the animation system at the current time, wherein the object in the animation frame includes the virtual object;
    在所述动画帧中解析所述虚拟对象的骨骼刚体对应骨骼在世界坐标系下的姿态信息。In the animation frame, the pose information of the skeleton corresponding to the skeleton of the virtual object in the world coordinate system is parsed.
  3. 根据权利要求1所述的方法,依据所述动画帧数据计算所述骨骼刚体的当前状态时的状态数据和对应的关节数据包括:The method according to claim 1, the state data and the corresponding joint data when calculating the current state of the skeletal rigid body according to the animation frame data comprises:
    在动画引擎中依据所述动画帧数据计算所述骨骼刚体的当前状态时的以下状态数据至少之一:骨骼刚体的位置、骨骼刚体的朝向、骨骼刚体的线速度、骨骼刚体的角速度;At least one of the following state data when the current state of the skeletal rigid body is calculated in the animation engine according to the animation frame data: the position of the skeletal rigid body, the orientation of the skeletal rigid body, the linear velocity of the skeletal rigid body, and the angular velocity of the skeletal rigid body;
    在所述动画引擎中确定与所述骨骼刚体关联的关节,并获取所述关节在所述当前状态时的关节数据。A joint associated with the skeleton rigid body is determined in the animation engine, and joint data of the joint in the current state is obtained.
  4. 根据权利要求1所述的方法,依据所述动画帧数据计算所述骨骼刚体的当前状态时的状态数据和对应的关节数据包括:The method according to claim 1, the state data and the corresponding joint data when calculating the current state of the skeletal rigid body according to the animation frame data comprises:
    获得第一刚体所对应的骨骼的动画世界坐标系下的姿态数据,其中,所述虚拟对象的骨骼模型至少包括第一刚体、第二刚体,以及连接在第一刚体和第二刚体之间的连接第一刚体的第一关节,以及与第二刚体连接的第二关节;Obtain the pose data in the animation world coordinate system of the bone corresponding to the first rigid body, wherein the skeleton model of the virtual object includes at least a first rigid body, a second rigid body, and a connection between the first rigid body and the second rigid body. a first joint connected to the first rigid body, and a second joint connected to the second rigid body;
    根据所述第一刚体相对骨骼的姿态计算第一刚体的物理世界坐标系下的姿态数据;Calculate the posture data in the physical world coordinate system of the first rigid body according to the posture of the first rigid body relative to the bones;
    根据第一关节相对所述第一刚体的姿态计算出第一关节的姿态数据;Calculate the posture data of the first joint according to the posture of the first joint relative to the first rigid body;
    获得第二刚体所对应的骨骼的动画世界坐标系下的姿态数据;Obtain the pose data in the animation world coordinate system of the bone corresponding to the second rigid body;
    根据第二刚体相对骨骼的姿态计算出第二刚体的世界坐标系下的姿态数据;Calculate the posture data in the world coordinate system of the second rigid body according to the posture of the second rigid body relative to the bone;
    根据第二关节相对第二刚体的姿态计算出第二关节的姿态数据;Calculate the attitude data of the second joint according to the attitude of the second joint relative to the second rigid body;
    计算第二关节的相对第一关节的姿态数据。Calculate the pose data of the second joint relative to the first joint.
  5. 根据权利要求3所述的方法,在动画引擎中依据所述动画帧数据计算所述骨骼刚体的当前状态时的状态数据包括:The method according to claim 3, the state data when calculating the current state of the skeletal rigid body according to the animation frame data in the animation engine comprises:
    在动画引擎中依据第一动画帧数据解析所述虚拟对象在世界坐标系中第一姿态信息;Analyzing the first pose information of the virtual object in the world coordinate system according to the first animation frame data in the animation engine;
    基于所述第一姿态信息确定所述骨骼刚体的当前状态时的第一状态数据,其中,所述第一状态数据包括:骨骼刚体的位置、骨骼刚体的朝向;The first state data when the current state of the skeleton rigid body is determined based on the first posture information, wherein the first state data includes: the position of the skeleton rigid body and the orientation of the skeleton rigid body;
    在动画引擎中依据第二动画帧数据解析所述虚拟对象在世界坐标系中第二姿态信息,其中,所述动画帧数据包括所述第一动画帧数据和所述第二动画帧数据,所述第二动画帧数据的加载时间早于所述第一动画帧数据的加载时间;The animation engine parses the second pose information of the virtual object in the world coordinate system according to the second animation frame data, wherein the animation frame data includes the first animation frame data and the second animation frame data, so The loading time of the second animation frame data is earlier than the loading time of the first animation frame data;
    基于所述第二姿态信息与所述第一姿态信息计算所述虚拟对象的移动距离,并根据所述移动距离计算所述骨骼刚体的线速度和所述骨骼刚体的角速度。The movement distance of the virtual object is calculated based on the second posture information and the first posture information, and the linear velocity of the skeleton rigid body and the angular velocity of the skeleton rigid body are calculated according to the movement distance.
  6. 根据权利要求1所述的方法,采用所述骨骼模型的物理系统,依据碰撞时产生的驱动参数以一时间间隔模拟所述骨骼刚体从当前状态向下一动画帧目标状态的趋近,一直到下一动画帧数据的加载,包括:The method according to claim 1, using the physical system of the skeletal model to simulate the approach of the skeletal rigid body from the current state to the target state of the next animation frame at a time interval according to the driving parameters generated during the collision, until The loading of the next animation frame data, including:
    在所述骨骼模型的物理系统中基于预设参照刚体构建三轴正交坐标系统,其中,所述骨骼刚体和关节的六自由度关节分别对应所述三轴正交坐标系统三个坐标轴的轴向位移方向和旋转方向;In the physical system of the skeleton model, a three-axis orthogonal coordinate system is constructed based on a preset reference rigid body, wherein the skeleton rigid body and the six-degree-of-freedom joints of the joints respectively correspond to the three coordinate axes of the three-axis orthogonal coordinate system. Axial displacement direction and rotation direction;
    在所述物理系统中通过物理驱动依据碰撞时产生的驱动参数以一时间间隔模拟所述骨骼刚体在所述三轴正交坐标系统沿轴向位移方向和/或旋转方向从当前状态向下一动画帧目标状态的趋近,一直到下一动画帧数据的加载,其中,物理驱动包括以下之一:线性驱动、角度驱动、球面插值驱动,所述驱动参数包括沿轴向位移和绕轴旋转位移。In the physical system, the skeletal rigid body is simulated at a time interval through physical driving according to the driving parameters generated during collision in the three-axis orthogonal coordinate system along the axial displacement direction and/or rotation direction from the current state to the next state Approaching the target state of the animation frame until the loading of the next animation frame data, wherein the physical drive includes one of the following: linear drive, angle drive, spherical interpolation drive, and the drive parameters include displacement along the axis and rotation around the axis displacement.
  7. 根据权利要求1所述的方法,采用所述骨骼模型的物理系统,依据碰撞时产生的驱动参数以一时间间隔模拟所述骨骼刚体从当前状态向下一动画帧目标状态的趋近,一直到下一动画帧数据的加载,包括:The method according to claim 1, using the physical system of the skeletal model to simulate the approach of the skeletal rigid body from the current state to the target state of the next animation frame at a time interval according to the driving parameters generated during the collision, until The loading of the next animation frame data, including:
    提取所述骨骼刚体在下一动画帧目标状态的状态数据和对应的关节数据中的关节参数和驱动参数,其中,所述关节参数和所述驱动参数相互关联;extracting the joint parameters and driving parameters in the state data of the skeleton rigid body in the target state of the next animation frame and the corresponding joint data, wherein the joint parameters and the driving parameters are related to each other;
    抽象并封装所述关节参数和驱动参数,得到引擎参数;Abstract and encapsulate the joint parameters and drive parameters to obtain engine parameters;
    将所述引擎参数作为驱动目标输入到所述物理系统的物理引擎中,驱动所述物理引擎以一时间间隔模拟所述骨骼刚体从当前状态向下一动画帧目标状态的趋近,一直到下一动画帧数据的加载。The engine parameters are input into the physics engine of the physics system as the driving target, and the physics engine is driven to simulate the approach of the skeletal rigid body from the current state to the target state of the next animation frame at a time interval, until the next A loading of animation frame data.
  8. 根据权利要求7所述的方法,将所述引擎参数作为驱动目标输入到所述物理系统的物理引擎中包括:The method according to claim 7, inputting the engine parameter as a driving target into a physics engine of the physics system comprises:
    计算所述引擎参数针对骨骼刚体的第一力矩,以及计算所述骨骼刚体的限制力矩;calculating the first moment of the engine parameter with respect to the skeletal rigid body, and calculating the limiting moment of the skeletal rigid body;
    根据所述第一力矩和所述限制力矩计算所述骨骼刚体受到的合力矩,并将所述合力矩作为驱动目标输入到所述物理系统的物理引擎中。The resultant moment received by the skeleton rigid body is calculated according to the first moment and the limit moment, and the resultant moment is input into the physics engine of the physics system as a driving target.
  9. 根据权利要求1所述的方法,所述方法还包括:The method of claim 1, further comprising:
    在预定数量的动画帧时间段中,通过一控制器根据所述虚拟对象的角色行为执行以下操作:驱动参数平滑处理、驱动状态管理、驱动应用策略管理;In a predetermined number of animation frame time periods, the following operations are performed by a controller according to the character behavior of the virtual object: smoothing processing of driving parameters, management of driving states, and management of driving application policies;
    其中,所述驱动参数平滑处理用于流畅显示所述虚拟对象的动画效果;所述驱动状态管理包括管理所述骨骼刚体的状态变化;所述驱动应用策略管理用于指示所使用的控制器,以控制骨骼刚体产生对应的动画效果。Wherein, the driving parameter smoothing process is used to smoothly display the animation effect of the virtual object; the driving state management includes managing the state changes of the skeletal rigid body; the driving application policy management is used to indicate the controller used, To control the skeleton rigid body to produce the corresponding animation effect.
  10. 根据权利要求1所述的方法,所述方法还包括:所述骨骼模型动画过程中所述骨骼刚体触发碰撞时,使用一合成器,将所述物理系统计算的趋近结果与当前动画帧的状态数据和对应的关节数据进行融合处理。The method according to claim 1, further comprising: when the skeletal rigid body triggers a collision during the animation of the skeletal model, using a synthesizer to compare the approach result calculated by the physics system with the current animation frame The state data and the corresponding joint data are fused.
  11. 根据权利要求10所述的方法,所述方法还包括:The method of claim 10, further comprising:
    在检测到所述骨骼模型上新的触发事件时,将所述骨骼模型的运动切换到纯物理系统计算的运动;When a new trigger event on the skeletal model is detected, the motion of the skeletal model is switched to the motion calculated by the pure physics system;
    其中在进行所述切换时,使用一合成器,将所述物理系统计算的所述趋近结果与要切换到的纯物理系统在当前时刻计算的状态数据和对应的关节数据进行融合处理。When performing the switching, a synthesizer is used to fuse the approaching result calculated by the physical system with the state data and the corresponding joint data calculated at the current moment by the pure physical system to be switched to.
  12. 根据权利要求1所述的方法,在采用所述骨骼模型的物理系统,依据碰撞时产生的驱动参数以一时间间隔模拟所述骨骼刚体从当前状态向下一动画帧目标状态的趋近,一直到下一动画帧数据的加载之后,所述方法还包括:The method according to claim 1, in which the physical system using the skeleton model simulates the approach of the skeletal rigid body from the current state to the target state of the next animation frame at a time interval according to the driving parameters generated during the collision. After the loading of the next animation frame data, the method further includes:
    在所述物理系统中判断碰撞过程是否完成;Determine whether the collision process is completed in the physical system;
    若所述碰撞过程未完成,将当前周期加载的下一动画帧数据更新为下一周期在起始状态时的动画帧数据。If the collision process is not completed, the next animation frame data loaded in the current cycle is updated to the animation frame data when the next cycle is in the initial state.
  13. 一种虚拟对象的控制装置,其中,虚拟对象的骨骼模型设置有动画系统,并且所述虚拟对象骨骼模型设置有物理系统,该物理系统包括:骨骼刚体和对应的关节信息;所述控制装置包括:A control device for a virtual object, wherein a skeleton model of the virtual object is provided with an animation system, and the virtual object skeleton model is provided with a physics system, the physics system includes: a skeleton rigid body and corresponding joint information; the control device includes :
    获取模块,用于骨骼模型动画过程中在其骨骼刚体触发碰撞时,获取动画系统中当前状态时所述骨骼刚体对应骨骼的动画帧数据;The acquiring module is used to acquire the animation frame data of the skeleton corresponding to the skeletal rigid body in the current state of the animation system when the skeletal rigid body triggers a collision during the animation of the skeletal model;
    第一计算模块,用于依据所述动画帧数据计算所述骨骼刚体的当前状态时的状态数据和对应的关节数据;a first calculation module, configured to calculate the state data and corresponding joint data of the current state of the skeleton rigid body according to the animation frame data;
    第二计算模块,用于计算设置所述骨骼刚体在下一动画帧目标状态的状态数据和对应的关节数据;The second calculation module is used to calculate and set the state data of the skeleton rigid body in the target state of the next animation frame and the corresponding joint data;
    模拟模块,用于采用所述骨骼模型的物理系统,依据碰撞时产生的驱动参数以一时间间隔模拟所述骨骼刚体从当前状态向下一动画帧目标状态的趋近,一直到下一动画帧数据的加载。The simulation module is used to use the physical system of the skeleton model to simulate the approach of the skeleton rigid body from the current state to the target state of the next animation frame at a time interval according to the driving parameters generated during the collision, until the next animation frame data loading.
  14. 一种计算机程序,包括计算机可读代码,当所述计算机可读代码在服务器上运行时,导致所述服务器执行根据权利要求1-12中的任一项所述的方法。A computer program comprising computer readable code which, when run on a server, causes the server to perform the method of any of claims 1-12.
  15. 一种计算机可读介质,其中存储了如权利要求14所述的计算机程序。A computer-readable medium in which the computer program of claim 14 is stored.
PCT/CN2020/130413 2020-07-28 2020-11-20 Method and apparatus for controlling virtual object, and storage medium and electronic apparatus WO2022021686A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010736955.9 2020-07-28
CN202010736955.9A CN112001989B (en) 2020-07-28 2020-07-28 Virtual object control method and device, storage medium and electronic device

Publications (1)

Publication Number Publication Date
WO2022021686A1 true WO2022021686A1 (en) 2022-02-03

Family

ID=73466612

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/130413 WO2022021686A1 (en) 2020-07-28 2020-11-20 Method and apparatus for controlling virtual object, and storage medium and electronic apparatus

Country Status (2)

Country Link
CN (1) CN112001989B (en)
WO (1) WO2022021686A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114911406A (en) * 2022-06-01 2022-08-16 北京字节跳动网络技术有限公司 Dynamic effect generation method, device, medium and equipment
CN115035218A (en) * 2022-08-11 2022-09-09 湖南湘生网络信息有限公司 Interactive animation production method and device, computer equipment and storage medium
CN115641375A (en) * 2022-12-07 2023-01-24 腾讯科技(深圳)有限公司 Method, device, equipment, medium and program product for processing hair of virtual object
CN115937373A (en) * 2022-12-23 2023-04-07 北京百度网讯科技有限公司 Avatar driving method, apparatus, device, and storage medium
WO2023155775A1 (en) * 2022-02-17 2023-08-24 北京字跳网络技术有限公司 Motion picture generation method and apparatus, computer device, and storage medium

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115222854A (en) * 2021-04-15 2022-10-21 北京字跳网络技术有限公司 Virtual image collision processing method and device, electronic equipment and storage medium
CN113318439B (en) * 2021-06-17 2024-05-28 网易(杭州)网络有限公司 Method and device for processing starting animation, processor and electronic device
CN113546415B (en) * 2021-08-11 2024-03-29 北京字跳网络技术有限公司 Scenario animation playing method, scenario animation generating method, terminal, device and equipment
CN113680063A (en) * 2021-08-17 2021-11-23 网易(杭州)网络有限公司 Action processing method and device for virtual object
CN113610949B (en) * 2021-08-25 2023-06-16 腾讯科技(深圳)有限公司 Method, device, equipment and storage medium for covering virtual arm skeleton
CN114882153A (en) * 2022-04-01 2022-08-09 网易(杭州)网络有限公司 Animation generation method and device
CN117011498A (en) * 2022-04-27 2023-11-07 腾讯科技(上海)有限公司 Animation data restoration method, device, apparatus, storage medium, and program product
CN116228942B (en) * 2023-03-17 2024-02-06 北京优酷科技有限公司 Character action extraction method, device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110267358A1 (en) * 2010-04-29 2011-11-03 Rennuit Antoine Felix Robert Animating a virtual object within a virtual world
CN107578461A (en) * 2017-09-06 2018-01-12 合肥工业大学 A kind of three-dimensional virtual human body physical motion generation method based on subspace screening
CN109758765A (en) * 2018-12-21 2019-05-17 网易(杭州)网络有限公司 Mobile terminal virtual object control method and equipment
CN110930483A (en) * 2019-11-20 2020-03-27 腾讯科技(深圳)有限公司 Role control method, model training method and related device
CN111292403A (en) * 2020-03-10 2020-06-16 黄海波 Method for creating movable cloth doll

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111028317B (en) * 2019-11-14 2021-01-01 腾讯科技(深圳)有限公司 Animation generation method, device and equipment for virtual object and storage medium
CN111161427A (en) * 2019-12-04 2020-05-15 北京代码乾坤科技有限公司 Self-adaptive adjustment method and device of virtual skeleton model and electronic device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110267358A1 (en) * 2010-04-29 2011-11-03 Rennuit Antoine Felix Robert Animating a virtual object within a virtual world
CN107578461A (en) * 2017-09-06 2018-01-12 合肥工业大学 A kind of three-dimensional virtual human body physical motion generation method based on subspace screening
CN109758765A (en) * 2018-12-21 2019-05-17 网易(杭州)网络有限公司 Mobile terminal virtual object control method and equipment
CN110930483A (en) * 2019-11-20 2020-03-27 腾讯科技(深圳)有限公司 Role control method, model training method and related device
CN111292403A (en) * 2020-03-10 2020-06-16 黄海波 Method for creating movable cloth doll

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023155775A1 (en) * 2022-02-17 2023-08-24 北京字跳网络技术有限公司 Motion picture generation method and apparatus, computer device, and storage medium
CN114911406A (en) * 2022-06-01 2022-08-16 北京字节跳动网络技术有限公司 Dynamic effect generation method, device, medium and equipment
CN114911406B (en) * 2022-06-01 2023-10-17 北京字节跳动网络技术有限公司 Dynamic effect generation method, dynamic effect generation device, dynamic effect generation medium and dynamic effect generation equipment
CN115035218A (en) * 2022-08-11 2022-09-09 湖南湘生网络信息有限公司 Interactive animation production method and device, computer equipment and storage medium
CN115641375A (en) * 2022-12-07 2023-01-24 腾讯科技(深圳)有限公司 Method, device, equipment, medium and program product for processing hair of virtual object
CN115641375B (en) * 2022-12-07 2023-04-11 腾讯科技(深圳)有限公司 Method, device, equipment and storage medium for processing hair of virtual object
CN115937373A (en) * 2022-12-23 2023-04-07 北京百度网讯科技有限公司 Avatar driving method, apparatus, device, and storage medium
CN115937373B (en) * 2022-12-23 2023-10-03 北京百度网讯科技有限公司 Avatar driving method, apparatus, device and storage medium

Also Published As

Publication number Publication date
CN112001989B (en) 2022-08-05
CN112001989A (en) 2020-11-27

Similar Documents

Publication Publication Date Title
WO2022021686A1 (en) Method and apparatus for controlling virtual object, and storage medium and electronic apparatus
JP5639646B2 (en) Real-time retargeting of skeleton data to game avatars
WO2022001652A1 (en) Virtual character control method and apparatus, computer device, and storage medium
JP5576932B2 (en) System and method for adding animation or motion to a character
CN111714880B (en) Picture display method and device, storage medium and electronic device
US7999812B2 (en) Locality based morphing between less and more deformed models in a computer graphics system
Tsai et al. Unity game engine: Interactive software design using digital glove for virtual reality baseball pitch training
US11783523B2 (en) Animation control method and apparatus, storage medium, and electronic device
CN111968204B (en) Motion display method and device for bone model
CN111773686A (en) Animation generation method and device, storage medium and electronic device
EP3914367B1 (en) A toy system for augmented reality
WO2023088041A1 (en) Method and apparatus for generating walking animation of virtual character, and device and storage medium
US11816772B2 (en) System for customizing in-game character animations by players
CN111899319B (en) Expression generation method and device of animation object, storage medium and electronic equipment
WO2008116426A1 (en) Controlling method of role animation and system thereof
US20180144531A1 (en) Animating a virtual object in a virtual world
Lee et al. A development of virtual reality game utilizing kinect, oculus rift and smartphone
US10099135B2 (en) Relative inverse kinematics graphical user interface tool
CN116196611A (en) Somatosensory game method based on waving action
CN113426110B (en) Virtual character interaction method, device, computer equipment and storage medium
CN112181139B (en) Cooperative control interaction method for virtual reality and mixed reality
CN107050848B (en) Somatosensory game implementation method and device based on body area network
CN113041616A (en) Method and device for controlling jumping display in game, electronic equipment and storage medium
JP4229316B2 (en) Image generation system, program, and information storage medium
Lan Simulation of Animation Character High Precision Design Model Based on 3D Image

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20947233

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20947233

Country of ref document: EP

Kind code of ref document: A1