Method and system for automatic generation of virtual character turn action

CN122888079APending Publication Date: 2026-10-09FUJIAN TQ ONLINE INTERACTIVE INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611020463.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-09
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

[0006]综上所述,现有技术存在的核心缺点:虚拟人物转身动作生成技术缺乏对人体转身运动学规律的深度建模,无法在动作生成阶段融合足部支撑、重心平衡、关节角度限制等多种物理约束进行联合求解,且不考虑场景环境约束进行自适应策略选择,导致生成的转身动作僵硬不自然、存在滑步和关节超限等物理异常、在障碍物密集场景中产生穿模,需要大量预制动作资源和人工后处理修正,动作生成效率低且质量不可控

Benefits of technology

[0010]本发明的有益效果在于:通过解析转身指令中的转身角度和虚拟人物当前位置的转身空间半径共同确定最优转身策略,实现转身方案自适应选择,提升转身动作生成的环境适应性;基于最优转身策略在虚拟人物当前骨骼姿态与转身指令对应的目标骨骼姿态之间生成多个关键姿态,并计算质心转移路径,基于质心转移路径对每个关键姿态进行逆运动学求解,得到第一关节角度序列集合,使关节姿态与质心运动协调一致,避免姿态失真;基于预设物理约束对第一关节角度序列集合进行迭代优化,得到第二关节角度序列集合,能够融合足部支撑、重心平衡、关节角度限制等多约束联合求解,避免关节角度超限等物理异常,保障转身动作生成的物理合理性;基于第二关节角度序列集合生成动作序列并进行碰撞检测,将检测通过的动作序列输出,确保转身动作与场景环境无穿模,无需大量预制动作资源和人工后处理修正,提高虚拟人物转身动作的生成效率与质量。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122888079A_ABST
    Figure CN122888079A_ABST
Patent Text Reader

Abstract

The application provides a method and system for automatically generating a virtual character turning action, receives a turning instruction, analyzes a turning angle and a target skeleton posture, obtains a current position, a skeleton posture and a turning space radius of the virtual character, determines an optimal turning strategy based on the turning angle and the turning space radius, generates a plurality of key postures between the current skeleton posture and the target skeleton posture based on the optimal turning strategy and plans a mass center transfer path, solves inverse kinematics of each key posture based on the mass center transfer path to obtain a first joint angle sequence set, applies a preset physical constraint to the first joint angle sequence set for iterative optimization to obtain a second joint angle sequence set, generates an action sequence based on the second joint angle sequence set, and outputs a turning action of the virtual character after collision detection, so that the environment adaptability and physical rationality of the virtual character turning action generation are realized, and the generation efficiency and quality of the virtual character turning action are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of virtual character motion generation technology, and in particular to a method and system for automatically generating virtual character turning motions. Background Technology

[0002] With the rapid development of virtual reality, gaming, and digital humans, virtual character motion generation technology faces core challenges, including insufficient naturalness in turning movements, lack of physical realism, and inadequate environmental adaptability. Existing technologies primarily rely on the following solutions: 1. Keyframe Interpolation-Based Turning Animation Generation Solution: Existing technologies require animators to manually set the start and end keyframe poses of the turn, and the system then uses linear or spline interpolation on the intermediate frames to generate the turning animation. This method lacks in-depth modeling of the kinematic laws of human turning (such as the upper body rotating first and the trajectory of the center of gravity transfer), resulting in a mechanical and stiff visual effect in the generated turning animation. Furthermore, it cannot support continuous turns at arbitrary angles and requires the creation of keyframe data separately for different angles.

[0003] 2. Turning motion selection scheme based on pre-made motion library: Existing technology involves pre-recording or creating a set of fixed-angle turning motions (such as 90° left turn, 180° right turn, etc.). During runtime, the closest pre-made motion is selected for playback or mixing based on the target angle. This method requires maintaining a large number of pre-made motion resources. For angles not covered by the pre-made library, only simple mixing can produce approximate effects. The motion library maintenance cost is high, and the mixed motions are prone to unnatural transitions.

[0004] 3. Lack of physical constraints in turning motion generation schemes: Existing technologies typically employ simple post-processing corrections (such as single IK correction of foot position) when applying physical constraints, failing to integrate multiple physical constraints (foot support, center of gravity balance, joint angle limitations) for joint solution during the generation stage. This results in unreasonable postures such as foot suspension, sliding, and joint angles exceeding physiological limits during the turning process, making it difficult to guarantee the physical realism of the motion.

[0005] 4. Turning motion generation schemes that do not consider environmental constraints: Existing technologies usually do not consider scene environmental constraints. In scenarios with dense obstacles and limited space, the generated turning motions are prone to clipping or unreasonable movement trajectories. They cannot adaptively adjust the turning strategy and stride according to the available space, resulting in poor environmental adaptability.

[0006] In summary, the core drawbacks of existing technologies are: virtual character turning motion generation technology lacks in-depth modeling of the kinematic laws of human turning, cannot integrate multiple physical constraints such as foot support, center of gravity balance, and joint angle limitations for joint solution during the motion generation stage, and does not consider scene environment constraints for adaptive strategy selection, resulting in stiff and unnatural turning motions, physical anomalies such as sliding and joint over-limit, clipping in obstacle-dense scenes, requiring a large amount of pre-made motion resources and manual post-processing correction, resulting in low motion generation efficiency and uncontrollable quality. Summary of the Invention

[0007] The technical problem to be solved by the present invention is to provide a method and system for automatically generating virtual character turning actions, which can achieve environmental adaptability and physical rationality in the generation of virtual character turning actions, and ensure the efficiency and quality of virtual character turning action generation.

[0008] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: A method for automatically generating virtual character turning motions includes: Receive a turning command, parse the turning angle and target skeleton posture from the turning command, obtain the current position and current skeleton posture of the virtual character, obtain the turning space radius corresponding to the current position, and determine the optimal turning strategy based on the turning angle and the turning space radius; Based on the optimal turning strategy, multiple key poses are generated between the current skeleton pose and the target skeleton pose, and the centroid transfer path from the current skeleton pose to the target skeleton pose is calculated based on the multiple key poses. Based on the centroid transfer path, inverse kinematics is solved for each key posture to obtain the first joint angle sequence set. Obtain preset physical constraints, and iteratively optimize the first joint angle sequence set based on the preset physical constraints to obtain the second joint angle sequence set; An action sequence is generated based on the second joint angle sequence set. Collision detection is performed on the action sequence, and the action sequence that passes the collision detection is output as the turning action of the virtual character.

[0009] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows: A system for automatically generating virtual character turning actions includes a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the computer program to implement the various steps of the method for automatically generating virtual character turning actions described above.

[0010] The beneficial effects of this invention are as follows: By analyzing the turning angle in the turning command and the turning space radius of the virtual character's current position, the optimal turning strategy is determined, enabling adaptive selection of the turning scheme and improving the environmental adaptability of the turning action generation; based on the optimal turning strategy, multiple key postures are generated between the virtual character's current skeletal posture and the target skeletal posture corresponding to the turning command, and the center of mass transfer path is calculated. Based on the center of mass transfer path, inverse kinematics is performed on each key posture to obtain a first set of joint angle sequences, ensuring that the joint postures and center of mass movements are coordinated and consistent, avoiding posture distortion; based on preset physical constraints, the first set of joint angle sequences is iteratively optimized to obtain a second set of joint angle sequences, which can integrate multiple constraints such as foot support, center of gravity balance, and joint angle limitations for joint solution, avoiding physical anomalies such as joint angle exceeding limits, and ensuring the physical rationality of the turning action generation; based on the second set of joint angle sequences, an action sequence is generated and collision detection is performed, and the action sequence that passes the detection is output, ensuring that the turning action does not clip through the scene environment, eliminating the need for a large number of pre-made action resources and manual post-processing corrections, and improving the generation efficiency and quality of virtual character turning actions. Attached Figure Description

[0011] Figure 1 This is a flowchart illustrating a method for automatically generating virtual character turning motions according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating the process of obtaining the optimal turning strategy in an embodiment of the present invention. Figure 3 This is a schematic diagram of a system for automatically generating virtual character turning actions according to an embodiment of the present invention. Detailed Implementation

[0012] Definitions:

[0013] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.

[0014] Existing methods for generating virtual character turning motions mainly include: keyframe interpolation-based methods, where animators manually set the start and end postures and perform linear or spline interpolation on intermediate frames. However, these methods lack in-depth modeling of the kinematic laws of human turning (such as weight transfer and upper body movement), resulting in stiff and mechanical movements. Methods based on pre-made motion libraries involve pre-recording turning segments at fixed angles and matching them during runtime. This requires maintaining a large amount of resources, and uncovered angles can only be roughly mixed, resulting in unnatural transitions. Furthermore, existing solutions generally ignore multiple physical constraints such as foot support, center of gravity balance, and joint limitations during the generation stage, and do not consider environmental constraints such as dense obstacles or narrow spaces. This leads to distortions during turning, such as sliding, foot suspension, joint over-limitation, and clipping, resulting in insufficient naturalness and environmental adaptability of the movements.

[0015] To at least address the aforementioned issues, this method receives a turning command, extracts the turning angle and target skeleton posture, and simultaneously obtains the virtual character's current position, skeleton posture, and the available turning radius corresponding to the current position. Based on the turning angle and turning radius, an optimal turning strategy is determined. This optimal strategy generates a series of key postures between the current and target postures, and a continuous movement path of the center of mass during the turning process is planned accordingly. For each key posture, combined with the corresponding center of mass position, a first joint angle sequence set is obtained through inverse kinematics. This first joint angle sequence set is then iteratively optimized using preset physical constraints to obtain a second joint angle sequence set. An action sequence is generated based on the second joint angle sequence set, and collision detection is performed on the action sequence. The action sequence that passes the collision detection is output as the virtual character's turning action. This approach achieves environmental adaptability and physical plausibility in the generation of virtual character turning actions, ensuring the efficiency and quality of virtual character turning action generation.

[0016] The following describes in detail a method for automatically generating virtual character turning actions according to the present invention. Please refer to [link / reference]. Figure 1 The method 100 includes steps 101 to 105: Step 101: Receive a turning command, parse the turning angle and target skeleton posture from the turning command, obtain the current position and current skeleton posture of the virtual character, obtain the turning space radius corresponding to the current position, and determine the optimal turning strategy based on the turning angle and the turning space radius.

[0017] Specifically, after receiving an external turning command, the system parses the target orientation or turning angle parameters and the target skeletal posture from the command, and normalizes the turning angle to the range of [-180°, 180°] to eliminate the problem of inconsistent angle formats passed by different callers. Simultaneously, it acquires the current virtual character state, including position, orientation, and skeletal posture, loads the skeletal model definition, extracts the initial transformation information (position, rotation, scaling) of each joint, and constructs a complete skeletal state snapshot to provide basic data for subsequent kinematics solutions. The system performs completeness and validity checks on the above parameters, including whether the target orientation is valid, whether the skeletal model can be loaded, and whether the environmental context is available. If the checks fail, a clear error message is returned for invalid parameters to prevent invalid data from entering the subsequent processing flow. Otherwise, the system acquires the turning space radius of the virtual character's current position, i.e., the available turning space radius around the virtual character. Based on the turning angle and the turning space radius, the optimal turning strategy is determined. By analyzing the environmental constraints around the virtual character, the system adaptively selects the turning scheme, improving the environmental adaptability of the turning motion generation.

[0018] Step 102: Based on the optimal turning strategy, generate multiple key poses between the current skeleton pose and the target skeleton pose, and calculate the centroid transfer path from the current skeleton pose to the target skeleton pose based on the multiple key poses.

[0019] Specifically, based on the optimal turning strategy and turning angle, multiple key poses are generated between the current skeletal pose and the target skeletal pose. For example, the stationary turning strategy—both feet remain supported, key poses are evenly distributed only on the rotation axis, the supporting foot does not switch, and the step count is 0; the single-step turning strategy—includes at least one stepping key pose, i.e., the intermediate pose where one foot leaves the ground and steps out, the supporting foot switches from double support to single support and then back to double support, and the step count is 1; the multi-step turning strategy—includes multiple progressive turning and center of gravity switching key poses, each center of gravity switching corresponds to one foot stepping out, the step count is greater than 1, and the rotation amount is evenly distributed according to the turning angle. Based on the human body center of mass dynamics model, the center of mass position of the virtual character under each key pose is calculated separately, and the center of mass positions of all key poses are connected in chronological order to obtain the center of mass transfer path. In this way, while conforming to the laws of human kinematics, the accurate center of mass position corresponding to each key pose can be provided for subsequent inverse kinematics solution, while ensuring the dynamic balance of the turning action and avoiding unnatural postures caused by center of gravity imbalance.

[0020] Step 103: Perform inverse kinematics solution for each key posture based on the centroid transfer path to obtain the first joint angle sequence set.

[0021] Specifically, an inverse kinematics solver (IK solver) is used to solve the inverse kinematics for each key pose based on the centroid transfer path, obtaining the joint angle vector for each key pose. Based on these joint angle vectors, a first joint angle sequence for each preset joint is constructed. Cubic spline interpolation is then performed on each first joint angle sequence, and all interpolated first joint angle sequences are combined into a set of first joint angle sequences. In this way, a smooth and continuous initial motion trajectory for each joint can be obtained while satisfying the centroid balance constraint, providing a basic sequence for subsequent physical constraint optimization.

[0022] Step 104: Obtain preset physical constraints, and iteratively optimize the first joint angle sequence set based on the preset physical constraints to obtain the second joint angle sequence set.

[0023] Specifically, the preset physical constraints are divided into hard constraints and soft constraints according to priority. Hard constraints include joint angle limitation constraints (each joint angle does not exceed the physiological range of the human body) and foot support constraints (the foot position in the support phase is locked to the ground contact point). Soft constraints include center of gravity balance constraints (the centroid projection falls within the support polygon) and path deviation minimization (the deviation between the optimized posture and the original planned path is minimized). For each first joint angle sequence in the first joint angle sequence set, a projection-based hierarchical constraint iterative solution framework is used for iterative optimization. That is, iterative optimization is performed by first applying hard constraints and then applying soft constraints to obtain the second joint angle sequence set. In this way, the generated second joint angle sequence set can satisfy basic physical safety and be as close as possible to the original kinematic planning path, avoiding unreasonable phenomena such as joint twisting, foot suspension, or excessive center of gravity shift.

[0024] Step 105: Generate an action sequence based on the second joint angle sequence set, perform collision detection on the action sequence, and output the action sequence that passes the collision detection as the turning action of the virtual character.

[0025] Specifically, motion sequences are generated based on a set of second joint angle sequences using forward kinematics. Within the current scene, collision detection is performed frame-by-frame on these motion sequences. When a collision occurs, the cause is analyzed, and corresponding adjustment suggestions are generated. These suggestions are then used to regenerate the set of first joint angle sequences, forming a closed loop of generation, verification, and adjustment. If no collision occurs, the motion sequence is output as the virtual character's turning motion. This approach ensures that the final output motion is conflict-free with the environment, improving the quality of the virtual character's turning motion generation and its environmental adaptability.

[0026] In one embodiment of the present invention, step 101 includes steps 1011 and 1012: Step 1011: Identify all obstacles within a preset range of the current position using ray detection, obtain the distance between each obstacle and the current position based on the ray detection results, and determine the turning radius based on each distance.

[0027] Specifically, please refer to Figure 2 Centered on the character's current position, rays are emitted outward along a preset direction, and the reachable distances to obstacles in each direction are calculated. Then, combined with the safety margin required for the character's collision, the minimum effective value that can be used for turning is taken from these distances as the turning space radius, providing spatial constraint data for selecting the optimal turning strategy.

[0028] Step 1012: Obtain the corresponding preset turning strategy from the preset strategy library based on the turning angle; obtain the collision volume parameters of the virtual character's collider, and perform a spatial compatibility test on the preset turning strategy based on the collision volume parameters and the turning space radius; if the test passes, the preset turning strategy is taken as the optimal turning strategy; otherwise, adjust the turning radius and stride in the preset turning strategy based on the collision volume parameters and the turning space radius, and re-perform a spatial compatibility test on the adjusted preset turning strategy.

[0029] Specifically, please refer to Figure 2 Based on the turning angle, the system retrieves the corresponding preset turning strategy from the preset strategy library: small angles (<30°) select the stationary turning strategy, medium angles (30°-120°) select the single-step turning strategy, and large angles (>120°) select the multi-step turning strategy. The system then obtains the corresponding turning radius, stride, and number of steps based on the selected preset turning strategy. Finally, it obtains the collision volume parameters (including radius and height) of the virtual character's collider (capsule or bounding box). These parameters implicitly reflect the character's size; larger characters have larger collision volumes and require more safe turning space, thus increasing the space threshold judgment condition during strategy selection. Spatial compatibility testing is performed based on turning radius and collision volume parameters: First, the minimum safe envelope space required by the current strategy is calculated based on parameters such as the radius and height of the collider. Then, this space requirement is compared with the currently available turning radius. Only when the available space is not less than the required safe envelope is the spatial compatibility test considered passed, and the currently selected preset turning strategy is taken as the optimal turning strategy. Otherwise, the turning radius or stride in the preset turning strategy is adjusted based on the collision volume parameters and turning radius, i.e., downgraded (multi-step turning > single-step turning strategy > in-place turning strategy) or the stride is reduced. The adjusted preset turning strategy is then re-tested for spatial compatibility until it passes. In this way, when the preferred strategy is incompatible with the available space, it can automatically downgrade to a strategy with smaller space requirements (such as downgrading from a single-step turning to an in-place turning), ensuring that turning can still be completed in a confined space.

[0030] In one embodiment of the present invention, step 103 includes steps 1031 and 1032: Step 1031: For each key pose, obtain the corresponding centroid position from the centroid transfer path. Based on the centroid position and the key pose, solve the joint angle vector of the key pose using an inverse kinematics solver. The joint angle vector is used to describe the angle values ​​of each preset joint of the virtual character under the key pose.

[0031] Specifically, for each key pose, the corresponding centroid position is obtained from the centroid transfer path. Using the key pose and centroid position as input to the inverse kinematics solver, a coordinated upper and lower body rotation control strategy is adopted: first, the upper body (spine, neck, shoulders) is rotated, then the lower body (hips, legs) is rotated. The inverse kinematics solver then calculates the angle values ​​of each preset joint of the virtual character in this key pose, obtaining the joint angle vector. This method simulates the natural sequence of rotation of the upper body followed by the lower body when a real human turns, ensuring that the joint angles in each key pose satisfy centroid balance while conforming to human biomechanical characteristics. This provides kinematically feasible and posture-coordinated basic data for the subsequent construction of joint angle sequences.

[0032] Step 1032: Construct the first joint angle sequence of each preset joint based on all joint angle vectors, and perform cubic spline interpolation on each first joint angle sequence to obtain the set of first joint angle sequences.

[0033] Specifically, based on all joint angle vectors, the angle values ​​of each joint under all key poses are extracted by joint dimension and arranged in chronological order to form the first joint angle sequence for each preset joint, such as the hip, knee, and ankle joint rotation sequence and the spine and neck coordinated rotation sequence. Then, cubic spline interpolation is performed on each first joint angle sequence, and all the interpolated first joint angle sequences form the first joint angle sequence set. This method ensures that the motion trajectory of each joint is smooth and continuous, eliminates abrupt angle changes between keyframes, and ensures the fluidity of turning movements.

[0034] In one embodiment of the present invention, step 104 includes step 1041: Step 1041: For each first joint angle sequence in the first joint angle sequence set, perform a hard constraint projection operation on the joint angle sequence based on the hard constraints, and construct a weighted objective function based on the soft constraints. Use gradient descent to adjust the joint angles after the hard constraint projection operation. Repeat the hard constraint projection and soft constraint optimization until all hard constraints are satisfied and the weighted objective function converges or reaches the maximum number of iterations to obtain the second joint angle sequence; generate a second joint angle sequence set based on all second joint angle sequences.

[0035] Specifically, in each iteration, a hard constraint projection operation is first performed: the current joint angle values ​​are cropped to the physiologically permissible range (such as 0-160° for the knee joint, external rotation range for the ankle joint, etc.) to prevent abnormal postures that violate physiology, such as reverse bending or excessive rotation. The foot position is locked to the target contact point using the IK solver to ensure that the foot position is locked in the support phase and that the foot moves along a reasonable trajectory in the swing phase, eliminating the slippage phenomenon during the turning process. Then, the soft constraints are solved using the weighted gradient descent method—a weighted objective function is constructed that includes a center of gravity deviation term (the center of gravity projection position is calculated in real time, and the center of gravity is always constrained to fall within the support polygon. When the center of gravity approaches the support boundary, a center of gravity callback mechanism is automatically triggered to ensure dynamic balance during the turning process) and a path deviation term. The joint angles are adjusted along the gradient direction to decrease the objective function value, where the weight of the center of gravity constraint is higher than that of the path deviation constraint. When all hard constraints are satisfied and the change in the soft constraint objective function value is less than a set threshold, convergence is determined. If the number of iterations reaches the upper limit and convergence is not complete, the information of the unsatisfied soft constraints is recorded and the subsequent process continues with the current optimal solution. In this way, we can achieve optimization within the feasible region that satisfies hard constraints, avoid violating hard constraints during the optimization process, and balance solution efficiency with constraint satisfaction.

[0036] Further, in one embodiment of the present invention, the first joint angle sequence set is iteratively optimized based on the preset physical constraints to obtain a second joint angle sequence set, and then the process includes: for each second joint angle sequence in the second joint angle sequence set, calculating the coordinate position of each skeletal node in the virtual character based on the second joint angle sequence, assigning a mass weight coefficient to each skeletal node, and calculating the centroid position of the virtual character based on the coordinate position of each skeletal node and the mass weight coefficient; obtaining the supporting polygon corresponding to the second joint angle sequence, projecting the centroid position onto a horizontal plane, and determining the stability of the virtual character's center of gravity based on the positional relationship between the projection point and the supporting polygon.

[0037] Specifically, for each second joint angle sequence, the coordinate position P of each skeletal node in the virtual character is calculated based on the second joint angle sequence. i Based on anthropometric data, a mass weight coefficient w is assigned to each skeletal node in the skeletal hierarchy. iThe weight value corresponds to the mass percentage of the body segment represented by that node. For example, the torso (vertebral root node) accounts for approximately 43% of the total body mass, the thigh segment on one side accounts for approximately 10%, the lower leg segment on one side accounts for approximately 4.5%, the foot on one side accounts for approximately 1.5%, the head accounts for approximately 8%, and the upper limbs are allocated according to the corresponding proportions. The centroid position of the virtual character is calculated based on the coordinate position and mass weight coefficient of each skeletal node: CoM = Σ(w i ×P i ) / Σ(w i The calculated centroid position is projected onto a horizontal plane, and it is determined whether it falls within the support polygon formed by the current support foot contact point, thereby assessing the dynamic balance during the turning process.

[0038] In one embodiment of the present invention, step 105 includes steps 1051 to 1053: Step 1051: Calculate the skeletal local transformation matrix of each second joint angle sequence in the second joint angle sequence set; calculate the global transformation matrix step by step according to the skeletal hierarchy chain of the virtual character based on all skeletal local transformation matrices; generate a skeletal pose transformation array based on the global transformation matrix; and generate an action sequence based on the skeletal pose transformation array.

[0039] Specifically, the local transformation matrix of each second joint angle sequence is calculated, and then the global transformation matrix is ​​calculated level by level along the skeleton hierarchy of the virtual character using forward kinematics. A skeleton pose transformation array is generated based on the global transformation matrix. The displacement and rotation changes of the root bone are extracted from the skeleton pose transformation array as root motion data, ensuring that turning actions correctly drive the virtual character's displacement and orientation changes in the scene. The discrete joint angle data is converted into continuous animation curves at a set frame rate (e.g., 30 or 60 FPS), and finally packaged into a standard animation resource format to generate a motion sequence that can be directly applied to the virtual character. In this way, the optimized joint angle sequence can be transformed into skeletal animation frames with complete spatial position and orientation information, ensuring that the virtual character's displacement and orientation in the scene are correctly driven by the root motion, facilitating seamless integration and use across different development engines.

[0040] Step 1052: Traverse the action sequence, perform collision detection between the virtual character collider corresponding to the current skeletal pose and the scene collider at the current position. If a collision occurs, record the collision point position and penetration depth of the collision frame and store them in a preset collision buffer.

[0041] Specifically, the algorithm iterates through the skeletal pose of each frame in the action sequence, calculates the spatial position of the virtual character's collider (bounding box or capsule) in the current frame under that pose, performs collision detection with scene colliders, and if a collision occurs, records the collision point position and penetration depth of the collision frame and stores them in a preset collision buffer. In this way, it can accurately identify whether each frame in the action sequence interferes with scene obstacles, and completely record the specific location, penetration depth, and relevant body parts of the collision. This provides accurate and fine-grained data support for subsequent collision cause analysis and strategy adjustment, avoiding missed collision frames or loss of key collision information.

[0042] Step 1053: After the traversal is completed, if the preset collision buffer is empty, the collision detection is determined to be successful; otherwise, the collision type is determined according to the collision point position and the penetration depth, the optimal turning strategy is adjusted according to the collision type, and the first joint angle sequence set is regenerated.

[0043] Specifically, if the preset collision buffer is empty, it means there are no collisions in any frame, and the current action sequence is output as the final turning action. If the buffer is not empty, the collision point position and penetration depth are read from the buffer. The collision cause (such as excessive turning radius, excessive stride, path overlap with obstacle, etc.) and collision type (such as rotational arc collision, stepping collision, lateral collision) are analyzed in conjunction with the body part and orientation where the collision occurred. Based on the collision type, the corresponding feedback variables are adjusted to regenerate the first joint angle sequence set. For example, for the turning radius, when the collision cause analysis determines that the arm or torso collides with an obstacle on a rotational arc, the turning radius is reduced by an adjustment step size ΔR (e.g., ΔR). =Collision penetration depth + safety margin), reducing the space swept by the limbs when the virtual character rotates; stride, when the collision occurs during the stepping phase and the collision point is located on the foot or leg movement trajectory, the stride is reduced proportionally (e.g., reduced to 80% of the original stride) to reduce the space occupied by the leg swing; path offset, when the collision area is on one side of the virtual character, a lateral path offset is applied perpendicular to the turning direction, causing the entire turning path to translate away from the obstacle, the offset being the collision penetration depth plus the safety margin; strategy degradation flag, when the regenerated action after the above parameter adjustments still fails the collision detection, or the parameter adjustment amount has exceeded the allowable range, the strategy degradation flag is set to true, triggering strategy degradation (e.g., downgrading from a single-step turn to a stationary turn), and the first joint angle sequence set is regenerated with the downgraded strategy. In this way, the turning parameters can be precisely adjusted for different collision causes, automatically avoiding environmental obstacles while ensuring the feasibility of the action, significantly improving the turning success rate and action quality of the virtual character in complex scenes.

[0044] Furthermore, in one embodiment of the present invention, integrity verification, formatting and encapsulation of action sequences are supported, along with recording generation parameters and log information, and support for action caching and reuse. Specifically, the system checks whether the number of frames in the action sequence is complete, whether the joint data is complete, and whether the timestamps are continuous to ensure the reliability of the output data. The verified action sequence is formatted into a standard output data structure, and generation parameters (turning angle, strategy type, number of iterations, etc.) and metadata information are recorded for subsequent traceability and analysis. The action sequence is also written to a cache, so that when a turning request with the same or similar parameters arrives again, the action data in the cache can be directly reused, reducing the overhead of repeated calculations.

[0045] In one embodiment of the present invention, the following specific application scenarios are also provided: 1. Open-world game character turning scene Scene description: In open-world games, player characters need to frequently perform turning operations in various complex environments (such as city streets, indoor corridors, jungle paths, etc.), facing different obstacle distributions and spatial constraints.

[0046] Triggering condition: The player inputs a turning command via controller or keyboard, and the game system detects an angular difference between the current orientation and the target orientation.

[0047] Input data: player character's current position and orientation, target orientation, character skeleton posture data, and surrounding scene collision information (building walls, props, etc.).

[0048] Application method: After receiving a turning request, the environmental perception module analyzes the available space around the character through ray detection. In a narrow corridor, it automatically selects the in-place turning strategy, and in an open area, it selects the single-step turning strategy. The turning path planning module calculates the joint rotation sequence and center of gravity transfer trajectory based on inverse kinematics. The physics constraint solving module ensures that the feet do not slip and that the joint angles are within the physiological range. The collision detection module verifies that the turning action will not clip through the surrounding walls or props.

[0049] Expected results: Player characters will perform natural and fluid turning movements in different environments, eliminating the need to pre-create turning animations for each scene, significantly reducing the amount of animation resources required, while enhancing the realism and environmental adaptability of character movements. This approach reduces the repetitive work for animators in creating turning animations for different angles and scenes, shortens the game development cycle, and improves the quality of game character movements.

[0050] 2. Virtual Digital Human Interaction Scenarios Scenario description: In digital human applications such as virtual live streaming and virtual customer service, virtual digital humans need to adjust their orientation in real time according to the changes in the position of the dialogue object or the interaction command, and perform natural turning actions.

[0051] Triggering condition: The virtual digital human receives an orientation change instruction (such as the dialogue object moving from the left to the right), and the system calculates that a turning operation needs to be performed.

[0052] Input data: the digital human's current orientation and skeletal posture, the target orientation angle, and collision information of furniture and decorations in the virtual scene.

[0053] Application method: After receiving a turn request, the system automatically selects an appropriate turn strategy based on the turn angle; the path planning module generates a coordinated turn path in which the upper body rotates first and the lower body follows; the physical constraint solving module ensures that the center of gravity is balanced and natural during the turn; the action sequence generation module outputs a standard animation frame sequence to drive the digital human skeleton model to perform the turn action in real time.

[0054] Expected results: The virtual digital human will exhibit natural and fluid turning movements during interaction, enhancing the realism and user experience of the interaction, eliminating the need to record animations for each turning angle individually. This approach reduces the production and maintenance costs of digital human motion resources, supports more diverse interaction scenarios, and improves the competitiveness of virtual digital human products.

[0055] 3. VR Virtual Reality Social Scenarios Scenario Description: In VR social applications, users' virtual avatars need to interact with other users in a virtual space, frequently turning around in different directions, and there are obstacles such as furniture and walls in the virtual space.

[0056] Triggering conditions: The user inputs an orientation change command through the VR controller, or the system detects a change in the user's gaze direction that requires adjustment of the virtual avatar's orientation.

[0057] Input data: the current position and orientation of the virtual avatar, the target orientation, information on collision objects in the VR virtual space (sofas, tables, chairs, walls, etc.), and the avatar's skeletal model data.

[0058] Application method: After the system receives a turning request, the environment perception module detects the available space around the virtual avatar and automatically downgrades to the in-place turning strategy in the narrow space between the sofa and coffee table; the physics constraint solving module ensures the balance of the center of gravity and the rationality of the joints in the turning action; the collision detection module verifies that the turning process will not penetrate the surrounding virtual furniture, and if a collision is detected, it will provide feedback to adjust the path parameters and regenerate them.

[0059] Expected Results: The user's virtual avatar will perform physically accurate turning movements in various VR social scenarios, effectively avoiding clipping and unnatural postures, thus enhancing the immersion and experience quality of VR social interactions. This approach improves the motion performance quality of VR social products, reduces the workload for development teams in customizing turning animations for different scenarios, and accelerates the iteration speed of VR social applications.

[0060] In summary, this invention provides a method for automatically generating virtual character turning actions. By analyzing the turning angle in the turning command and the turning radius of the virtual character's current position, the optimal turning strategy is determined, enabling adaptive selection of the turning scheme and improving the environmental adaptability of the generated turning action. Based on the optimal turning strategy, multiple key postures are generated between the virtual character's current skeletal posture and the target skeletal posture corresponding to the turning command, and the center of mass transfer path is calculated. Inverse kinematics is then performed on each key posture based on the center of mass transfer path to obtain a first set of joint angle sequences, ensuring coordination between joint postures and center of mass movement and avoiding posture distortion. The first set of joint angle sequences is iteratively optimized based on preset physical constraints to obtain a second set of joint angle sequences. This second set integrates multiple constraints such as foot support, center of gravity balance, and joint angle limitations, avoiding physical anomalies such as joint angle exceeding limits and ensuring the physical rationality of the generated turning action. An action sequence is generated based on the second set of joint angle sequences and collision detection is performed. The action sequence that passes the detection is output, ensuring that the turning action does not clip through the scene environment. This eliminates the need for a large amount of pre-made action resources and manual post-processing correction, improving the generation efficiency and quality of virtual character turning actions.

[0061] Please refer to Figure 3 The present invention also provides a system 200 for automatically generating virtual character turning actions, including a memory 201, a processor 202, and a computer program stored in the memory and executable on the processor. The computer program includes a turning request receiving module, an environment perception and strategy selection module, a turning path planning module, a physical constraint solving module, an action sequence generation module, a collision detection and adjustment module, and a turning action output module. The turning request receiving module receives turning commands, parses the turning angle and target skeleton posture, obtains the current state of the virtual character, and performs parameter verification and normalization. The environment perception and strategy selection module obtains the turning space radius and determines the optimal turning strategy based on the turning angle and spatial constraints. The turning path planning module generates multiple key... The process involves several steps: a posture and a planned center-of-gravity transfer path are defined, and inverse kinematics is performed on each key posture to obtain a first set of joint angle sequences. A physical constraint solving module is used to obtain preset physical constraints and iteratively optimize the first set of joint angle sequences to obtain a second set of joint angle sequences. An action sequence generation module is used to generate action sequences based on the second set of joint angle sequences. A collision detection and adjustment module is used to perform collision detection on the action sequences and generate adjustment suggestions when a collision occurs, which are then fed back to the turning path planning module to regenerate the action. A turning action output module is used to verify the integrity of the action sequences that have passed the collision detection, format and encapsulate them, record metadata, and output them. When the processor executes the computer program, it implements each step of the method for automatically generating turning actions of a virtual character as described above.

[0062] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method for automatically generating virtual character turning actions, characterized in that, include: Receive a turning command, parse the turning angle and target skeleton posture from the turning command, obtain the current position and current skeleton posture of the virtual character, obtain the turning space radius corresponding to the current position, and determine the optimal turning strategy based on the turning angle and the turning space radius; Based on the optimal turning strategy, multiple key poses are generated between the current skeleton pose and the target skeleton pose, and the centroid transfer path from the current skeleton pose to the target skeleton pose is calculated based on the multiple key poses. Based on the centroid transfer path, inverse kinematics is solved for each key posture to obtain the first joint angle sequence set. Obtain preset physical constraints, and iteratively optimize the first joint angle sequence set based on the preset physical constraints to obtain the second joint angle sequence set; An action sequence is generated based on the second joint angle sequence set. Collision detection is performed on the action sequence, and the action sequence that passes the collision detection is output as the turning action of the virtual character.

2. The method for automatically generating virtual character turning actions according to claim 1, characterized in that, Obtaining the turning radius corresponding to the current position includes: All obstacles within a preset range of the current position are identified by ray detection. The distance between each obstacle and the current position is obtained based on the ray detection results, and the turning radius is determined based on each distance.

3. The method for automatically generating virtual character turning actions according to claim 1, characterized in that, Determining the optimal turning strategy based on the turning angle and the turning radius includes: Based on the turning angle, obtain the corresponding preset turning strategy from the preset strategy library; Obtain the collision volume parameters of the virtual character's collider, and perform spatial compatibility testing on the preset turning strategy based on the collision volume parameters and the turning space radius; If the detection passes, the preset turning strategy is taken as the optimal turning strategy; otherwise, the turning radius and stride in the preset turning strategy are adjusted based on the collision volume parameters and the turning space radius, and the spatial compatibility detection is re-performed on the adjusted preset turning strategy.

4. The method for automatically generating virtual character turning actions according to claim 1, characterized in that, Based on the centroid transfer path, inverse kinematics is solved for each key posture to obtain a set of first joint angle sequences, including: For each key pose, the corresponding centroid position is obtained from the centroid transfer path. Based on the centroid position and the key pose, the joint angle vector of the key pose is solved by the inverse kinematics solver. The joint angle vector is used to describe the angle values ​​of each preset joint of the virtual character under the key pose. Based on all joint angle vectors, a first joint angle sequence for each preset joint is constructed. Cubic spline interpolation is then performed on each first joint angle sequence to obtain a set of first joint angle sequences.

5. The method for automatically generating virtual character turning actions according to claim 1, characterized in that, Based on the preset physical constraints, the first joint angle sequence set is iteratively optimized to obtain the second joint angle sequence set, including: The preset physical constraints include hard constraints and soft constraints; For each first joint angle sequence in the first joint angle sequence set, a hard constraint projection operation is performed on the joint angle sequence based on the hard constraints, and a weighted objective function is constructed based on the soft constraints. The joint angles after the hard constraint projection operation are adjusted by the gradient descent method. The hard constraint projection and soft constraint optimization are repeated until all hard constraints are satisfied and the weighted objective function converges or reaches the maximum number of iterations, thus obtaining the second joint angle sequence. Generate a set of second joint angle sequences based on all second joint angle sequences.

6. The method for automatically generating a virtual character turning motion according to claim 5, characterized in that, Based on the preset physical constraints, the first joint angle sequence set is iteratively optimized to obtain the second joint angle sequence set, which then includes: For each second joint angle sequence in the second joint angle sequence set, the coordinate position of each skeletal node in the virtual character is calculated based on the second joint angle sequence, a mass weight coefficient is assigned to each skeletal node, and the centroid position of the virtual character is calculated by weighting the coordinate position of each skeletal node and the mass weight coefficient. Obtain the supporting polygon corresponding to the second joint angle sequence, project the centroid position onto the horizontal plane, and determine the stability of the virtual character's center of gravity based on the positional relationship between the projection point and the supporting polygon.

7. The method for automatically generating virtual character turning actions according to claim 1, characterized in that, An action sequence is generated based on the second set of joint angle sequences, including: Calculate the skeletal local transformation matrix of each second joint angle sequence in the second joint angle sequence set. Based on all skeletal local transformation matrices, calculate the global transformation matrix step by step according to the skeletal hierarchy chain of the virtual character. Generate a skeletal pose transformation array based on the global transformation matrix. Generate an action sequence based on the skeletal pose transformation array.

8. The method for automatically generating virtual character turning actions according to claim 3, characterized in that, Collision detection is performed on the action sequence, including: Traverse the action sequence, perform collision detection between the virtual character collider corresponding to the current skeletal pose and the scene collider at the current position. If a collision occurs, record the collision point position and penetration depth of the collision frame and store them in a preset collision buffer.

9. The method for automatically generating a virtual character turning motion according to claim 8, characterized in that, Collision detection of the action sequence further includes: After the traversal is completed, if the preset collision buffer is empty, the collision detection is considered to have passed; otherwise, the collision type is determined according to the collision point position and the penetration depth, the optimal turning strategy is adjusted according to the collision type, and the first joint angle sequence set is regenerated.

10. A system for automatically generating virtual character turning actions, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements each step of the method for automatically generating a virtual character turning action as described in any one of claims 1 to 9.