Method and apparatus for location updating

By obtaining the target bone position information of the virtual character, determining the mapping position and calculating the offset, and adjusting the positional relationship between the virtual character and the contact surface, the problem of unrealistic rendering effects of the virtual character in complex ground scenes is solved, achieving more natural movements and higher rendering realism.

CN114130030BActive Publication Date: 2025-10-17ZHUHAI KINGSOFT ONLINE GAME TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111481964.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-06
Publication Date
2025-10-17
Estimated Expiration
2041-12-06

AI Technical Summary

Technical Problem

In the existing technology, the rendering effect of virtual characters in complex ground scenes is low in realism, which affects the user's gaming experience. In particular, when there is a slope or complex structure on the contact surface, the virtual character's skeleton adjustment causes movement deformation.

Method used

By obtaining the target bone position information of the virtual character, determining the mapping position information and calculating the offset, the position of the virtual character relative to the contact surface is adjusted to ensure that the positional relationship between the virtual character and the contact surface is more realistic and avoid excessive bone adjustment.

Benefits of technology

It improves the positional realism between the virtual character and the contact surface, reduces the adjustment of bone position, ensures natural movements, and improves the rendering effect of the game.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114130030B_ABST
    Figure CN114130030B_ABST
Patent Text Reader

Abstract

The application provides a position updating method and device, wherein the position updating method comprises the following steps: acquiring position information corresponding to a target bone of a virtual character; determining mapping position information of the target bone mapped on a contact surface according to the position information; calculating an offset between the target bone and the contact surface based on the mapping position information; and updating the position of the virtual character relative to the contact surface according to the offset.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to a position updating method. The present application also relates to a position updating device, a computing device and a computer readable storage medium. BACKGROUND

[0002] With the development of Internet technology, users have higher and higher requirements for the reality of games. In order to provide users with better game experience, major game manufacturers will continuously update games in the game development, testing and publishing stages. In the prior art, foot IK technology is a widely used method, which aims to make game characters more realistic in actual game environment. The principle of foot IK technology is to complete detection by performing ray casting from the foot slot of the character to the ground. However, in the case that the ground scene contacted by the game character is complex, the reality of the rendered result is greatly reduced, which greatly affects the user's game experience. Therefore, an effective solution is needed to solve the above problems. SUMMARY

[0003] Therefore, the embodiments of the present application provide a position updating method to solve the technical defects in the prior art. The embodiments of the present application also provide a position updating device, a computing device and a computer readable storage medium.

[0004] According to a first aspect of the embodiments of the present application, a position updating method is provided, comprising:

[0005] obtaining position information corresponding to a target bone of a virtual character;

[0006] determining mapping position information of the target bone mapped on a contact surface according to the position information;

[0007] calculating an offset between the target bone and the contact surface based on the mapping position information;

[0008] updating the position of the virtual character relative to the contact surface according to the offset.

[0009] Optionally, the obtaining of the position information corresponding to the target bone of the virtual character comprises:

[0010] selecting a target character bone closest to the contact surface from character bones corresponding to the virtual character as the target bone;

[0011] determining a world coordinate system to which the virtual character belongs, and determining the position information corresponding to the target bone based on the world coordinate system.

[0012] Optionally, before the step of acquiring the position information corresponding to the target bone of the virtual role is performed, the method further comprises:

[0013] In the case that there is an inclination angle between the virtual role and the contact surface, the virtual role is rotated according to the inclination angle; wherein the virtual role after rotation is perpendicular to the contact surface.

[0014] Optionally, the step of determining the mapping position information of the target bone on the contact surface according to the position information comprises:

[0015] determining a bone position of the target bone according to the position information, and creating an auxiliary line between the bone position and the contact surface;

[0016] determining a contact point based on the intersection of the contact surface and the auxiliary line, and taking the position information of the contact point as the mapping position information.

[0017] Optionally, the step of calculating the offset between the target bone and the contact surface based on the mapping position information comprises:

[0018] determining a collision detection body associated with the virtual role;

[0019] calculating the height difference between the target position corresponding to the mapping position information and the collision detection body;

[0020] determining the height difference as the offset between the target bone and the contact surface.

[0021] Optionally, the step of updating the position of the virtual role relative to the contact surface according to the offset comprises:

[0022] determining a main bone of the virtual role;

[0023] adjusting the positions of the main bone and the target bone according to the offset, and taking the adjustment result as the position update result of the virtual role relative to the contact surface.

[0024] Optionally, the method further comprises:

[0025] In the case that the number of target bones is greater than or equal to a preset number threshold, calculating the offset between each target bone and the contact surface;

[0026] sorting the offsets in ascending order, and selecting a target offset from the offsets between each target bone and the contact surface according to the sorting result;

[0027] Correspondingly, the step of updating the position of the virtual role relative to the contact surface according to the offset comprises:

[0028] updating a position of the virtual character relative to the contact surface according to the offset.

[0029] Optionally, the step of updating a position of the virtual character relative to the contact surface according to the offset is executed, and further comprising:

[0030] rendering a visual area containing the virtual character and the contact surface according to the position updating result and displaying.

[0031] According to a second aspect of the embodiments of the present application, a position updating apparatus is provided, comprising:

[0032] an obtaining module configured to obtain position information corresponding to a target bone of a virtual character;

[0033] a determining module configured to determine mapping position information of the target bone mapped on a contact surface according to the position information;

[0034] a calculating module configured to calculate an offset between the target bone and the contact surface based on the mapping position information;

[0035] an updating module configured to update a position of the virtual character relative to the contact surface according to the offset.

[0036] According to a third aspect of the embodiments of the present application, a computing device is provided, comprising:

[0037] a memory and a processor;

[0038] the memory is configured to store computer executable instructions, and the processor is configured to execute the computer executable instructions to implement the steps of the position updating method.

[0039] According to a fourth aspect of the embodiments of the present application, a computer readable storage medium is provided, which stores computer executable instructions, and the instructions are executed by a processor to implement the steps of the position updating method.

[0040] According to a fifth aspect of the embodiments of the present application, a chip is provided, which stores a computer program, and the computer program is executed by the chip to implement the steps of the position updating method.

[0041] The position updating method provided in the application can improve the position relationship between the virtual character and the contact surface to be closer to the real situation. After the position information corresponding to the target bone of the virtual character is acquired, the mapping position information of the target bone on the contact surface is determined according to the position information. Then, the offset between the target bone and the contact surface is calculated based on the mapping position information, and the position of the virtual character relative to the contact surface is updated based on this, so that the position relationship between the virtual character and the contact surface is more real, and the complexity of the contact surface does not have a great influence on the position of the virtual character, thereby ensuring that a more real virtual scene can be displayed subsequently. BRIEF DESCRIPTION OF DRAWINGS

[0042] Figure 1 is a flowchart of a position updating method provided in an embodiment of the application;

[0043] Figure 2 is a schematic diagram of a game screen in a position updating method provided in an embodiment of the application;

[0044] Figure 3 is a schematic diagram of a game screen in another position updating method provided in an embodiment of the application;

[0045] Figure 4 is a processing flowchart of a position updating method applied to a game scene provided in an embodiment of the application;

[0046] Figure 5 is a structural schematic diagram of a position updating device provided in an embodiment of the application;

[0047] Figure 6 is a structural block diagram of a computing device provided in an embodiment of the application. DETAILED DESCRIPTION

[0048] In the following description, numerous specific details are set forth in order to provide a thorough understanding of the application. However, the application can be practiced without the specific details. In other instances, well-known methods, procedures, components, and circuits have not been described in detail so as not to unnecessarily obscure aspects of the application.

[0049] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of one or more embodiments of the present application. As used in this disclosure and the appended claims, the singular forms "a," "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

[0050] It should be understood that, although the terms first, second, etc. can be employed in describing various information in one or more embodiments, the information should not be limited to these terms. These terms are only used to distinguish one category of information from another. For example, without departing from the scope of one or more embodiments, first can be termed second, and, similarly, second can be termed first.

[0051] In the present application, a position updating method is provided. The present application also relates to a position updating device, a computing device, and a computer readable storage medium, which are described in detail in the following embodiments.

[0052] In practical applications, the foot IK technology is an important technical means for adjusting the position of a virtual character. The principle of the foot IK technology is to perform a raycast from the foot slot of the virtual character to the actual ground in the virtual scene, and to detect the height difference between the actual ground and the bottom of the capsule corresponding to the virtual character. The height difference is the distance that needs to be compensated for the virtual character. When the virtual character is located on a terrain with a large height difference, such as a slope, a road covered with stones, or a virtual building, the distance between the two feet of the virtual character is too large. In this case, the bones of the virtual character are adjusted to fit the contact surface due to the slope. However, this adjustment may cause the motion of the virtual character to deform due to the large adjustment range of the bones. Therefore, there is an urgent need for an effective solution to solve the above problems.

[0053] The position updating method provided by the present application can minimize the adjustment of the bone position of the virtual character while ensuring that the position relationship between the virtual character and the contact surface is closer to the actual situation, and can be closer to the original animation. After obtaining the position information corresponding to the target bone of the virtual character, the mapping position information of the target bone on the contact surface is determined according to the position information. Then, the offset between the target bone and the contact surface is calculated based on the mapping position information, and the position of the virtual character relative to the contact surface is updated based on this, so as to ensure that the position relationship between the virtual character and the contact surface is more realistic, and the complexity of the contact surface does not have a large impact on the bone position and motion of the virtual character, thereby ensuring that a more realistic virtual scene can be displayed subsequently.

[0054] Figure 1 A flowchart of a position updating method according to an embodiment of the present application is shown, which specifically includes the following steps:

[0055] In step S102, the position information corresponding to the target bone of the virtual character is obtained.

[0056] Specifically, the virtual character specifically refers to a character that needs to be displayed through a terminal device, including but not limited to a game character in a game scene, an interactive character in a VR scene, a simulated character in a human-computer interaction scene, and the like. Correspondingly, the target bone specifically refers to a bone in the character bone of the virtual character that needs to be in contact with the contact surface, including but not limited to a foot bone, a hand bone, a pelvic bone, and the like; when the virtual character stands on the contact surface, the target bone can be a foot bone; when the virtual character stands on the contact surface, the target bone can be a hand bone; when the virtual character sits on the contact surface, the target bone can be a pelvic bone. Correspondingly, the position information specifically refers to the position information of the target bone in the world coordinate system to which the virtual character belongs.

[0057] This embodiment takes the virtual character as a game character in a game scene as an example to describe the position updating method. The description in other application scenarios can refer to the same or corresponding description in this embodiment, which will not be described in detail here.

[0058] Based on this, in order to ensure that the virtual character can exhibit a real contact effect when contacting with a complex contact surface, the target bone of the virtual character that needs to be in contact with the contact surface can be determined first, and the subsequent position adjustment is performed based on the position information of the target bone, so that the contact surface can meet the real contact effect when contacting with the target bone, thereby providing a more real game experience for the player.

[0059] Further, considering that the virtual character contains multiple character bones when being established, in order to ensure that the bone in contact with the contact surface has a more real contact effect with the contact surface when the virtual character contacts with the contact surface, the target bone can be selected from the multiple character bones, and the corresponding position information thereof is determined. In this embodiment, the specific implementation manner is as follows:

[0060] selecting a target character bone closest to the contact surface from the character bones corresponding to the virtual character as the target bone;

[0061] determining a world coordinate system to which the virtual character belongs, and determining the position information corresponding to the target bone based on the world coordinate system.

[0062] Specifically, the role skeleton specifically refers to all the skeletons corresponding to the virtual role, including but not limited to the foot skeleton, the hand skeleton, the pelvic skeleton, the head skeleton, and the like of the virtual role. Correspondingly, the target role skeleton specifically refers to the role skeleton closest to the contact surface, wherein the distance between the role skeleton and the contact surface is the straight-line distance therebetween. Correspondingly, the contact surface specifically refers to the ground surface, the building surface, the water surface, and the like in the game scene that bears the virtual role, i.e., the surface on which the virtual role can stand. Correspondingly, the world coordinate system specifically refers to a coordinate system covering the entire game scene, and any virtual object in the game scene has corresponding coordinate information in the coordinate system.

[0063] Based on this, in order to ensure that subsequent adjustment of the position of the virtual role does not cause the virtual role to deform, the target role skeleton closest to the contact surface can be selected from the role skeletons of the virtual role as the target skeleton, and then the world coordinate system to which the virtual role belongs is determined, and the position information corresponding to the target skeleton in the coordinate system is determined, so as to facilitate subsequent position adjustment of the virtual role in combination with the position information, and ensure the contact authenticity of the virtual role and the contact surface.

[0064] In summary, by adopting the distance calculation manner to screen the target skeleton and determining the position information of the target skeleton in the world coordinate system, it can be ensured that the virtual role can be updated as a whole in the subsequent position adjustment, thereby avoiding deformation of the virtual role.

[0065] In addition, considering that the contact surface contacted by the virtual role has a slope, if the standing angle of the virtual role is not adjusted when the virtual role stands on the contact surface with the slope, the final display effect will appear that the virtual role deforms excessively in order to fit the contact surface; therefore, when the contact surface has a slope, the standing angle of the virtual role also needs to be adjusted, and in the embodiment, the specific implementation manner is as follows:

[0066] In the case that there is an inclination angle between the virtual role and the contact surface, the virtual role is rotated according to the inclination angle; wherein the virtual role after rotation is perpendicular to the contact surface.

[0067] Specifically, the inclination angle specifically refers to the included angle presented by the virtual role standing on the contact surface at the current moment. Based on this, when there is an inclination angle between the virtual role and the contact surface, and the inclination angle is not equal to 90 degrees, the angle difference between the inclination angle and 90 degrees can be calculated at this time, and then the virtual role is rotated according to the angle difference, so as to ensure that the virtual role after rotation is perpendicular to the contact surface, facilitating subsequent adjustment of the height of the virtual role relative to the contact surface.

[0068] It should be noted that when the deflection angle of the virtual character relative to the contact surface is adjusted, the corresponding default view angle will also be adjusted, so that the screen viewed by the user conforms to the adjusted visual effect.

[0069] For example, when the game character needs to stand on a certain hill in the game scene, the game character mesh can be rotated according to the angle difference between the slope of the hill and the game character, so that the game character can be perpendicular to the slope of the hill. Further, it is determined that the game character stands on the hill, and it is determined that the foot skeleton of the game character is closest to the slope, and the position information corresponding to the foot skeleton in the world coordinate system to which the game character belongs is determined, so as to facilitate subsequent adjustment of the height between the game character and the slope.

[0070] In summary, considering that the contact surface with the inclination angle affects the standing effect of the virtual character, the virtual character can be rotated in combination with the inclination angle of the contact surface, so as to ensure that the virtual character is perpendicular to the contact surface at any frame, thereby improving the contact authenticity between the two.

[0071] In step S104, the mapping position information of the target skeleton on the contact surface is determined according to the position information.

[0072] Specifically, after obtaining the position information of the target skeleton, further, in order to ensure that the virtual character is more in line with the contact surface when the virtual character contacts the contact surface, and to prevent the virtual character from being deformed, the mapping position information of the target skeleton on the contact surface can be determined in combination with the position information of the target skeleton, so as to facilitate subsequent adjustment of the height of the virtual character relative to the contact surface in combination with the mapping position information. The mapping position information specifically refers to the position information corresponding to the mapping point after the position of the target skeleton is mapped to the contact surface. The distance that the virtual character needs to move relative to the contact surface at the current frame can be calculated through the mapping position information.

[0073] Further, in the process of determining the mapping position information based on the position information of the target skeleton, considering that there can be positive / negative distance between the position of the target skeleton and the contact surface, it is necessary to determine the mapping position information by creating an auxiliary line. In this embodiment, the specific implementation is as follows:

[0074] The skeleton position of the target skeleton is determined according to the position information, and an auxiliary line is created between the skeleton position and the contact surface;

[0075] The contact point is determined based on the intersection of the contact surface and the auxiliary line, and the position information of the contact point is taken as the mapping position information.

[0076] Specifically, the auxiliary line specifically refers to a ray made from the bone position to the contact surface; correspondingly, the contact point specifically refers to the only point where the auxiliary line contacts the contact surface, representing the situation that the virtual role is in contact with the contact surface, and the bone position of the target bone of the virtual role coincides.

[0077] Based on this, in order to ensure the accuracy of determining the mapping position information, the bone position of the target bone can be determined according to the target bone position information, and a ray is made from the bone position to the contact surface direction, and the mapping position information is determined according to the contact point between the ray and the contact surface, so as to facilitate subsequent adjustment of the distance of the virtual role relative to the contact surface in combination with the mapping position information.

[0078] It should be noted that since the target bone of the virtual role may be located above or below the contact surface due to game setting problems; therefore, when establishing the auxiliary line, a ray is made from the target bone to the contact surface, so as to accurately determine the mapping position information.

[0079] In the above example, when it is determined that the game role needs to stand on the slope surface of the hill, a ray is made from the foot socket position of the game role to the slope surface, wherein the foot socket position specifically refers to the position corresponding to the foot bone of the game role, and when the ray is made from the foot socket position to the slope surface, the foot socket position is actually taken as the starting point, as shown in the schematic diagram of (a) in Figure 2 , a ray is made in the direction perpendicular to the slope surface to achieve intersection with the slope surface. Then, the mapping position of the foot bone on the slope surface is determined according to the contact point between the ray and the slope surface, and the mapping position is taken as the target position of the foot IK, so as to facilitate subsequent adjustment of the position of the game role. Wherein, the foot IK refers to a ray made from the foot socket of the role to the actual ground in the game scene, and the height difference between the bottom of the capsule corresponding to the virtual role is the distance that needs to be compensated by the foot.

[0080] In summary, by adopting the method of making an auxiliary line to determine the mapping position information, the accuracy of the mapping position information can be ensured, so as to facilitate subsequent adjustment of the virtual role in combination with the mapping position information, and to ensure that the adjusted virtual role is more in line with the contact surface.

[0081] Step S106, calculating the offset between the target bone and the contact surface based on the mapping position information.

[0082] Specifically, after determining the mapped position information of the target skeleton relative to the contact surface, further, in order to ensure that the virtual character and the contact surface are more closely aligned and to avoid deformation of the virtual character, an offset between the target skeleton and the contact surface can be calculated based on the mapped position information. This facilitates subsequent adjustment of the distance between the virtual character and the contact surface based on the offset, so that the distance can approach 0, thereby ensuring that the contact surface and the virtual character are more closely aligned. The offset specifically refers to the relative distance between the target skeleton and the contact surface, and this distance can be used to determine the height difference between the virtual character and the contact surface.

[0083] Furthermore, when calculating the offset between the target bone and the contact surface, in order to ensure the calculation accuracy, it can be completed based on the collision detection body associated with the virtual character. In this embodiment, the specific implementation method is as follows:

[0084] Determining a collision detection body associated with the virtual character;

[0085] Calculating a height difference between a target position corresponding to the mapped position information and the collision detection object;

[0086] The height difference is determined as the offset between the target bone and the contact surface.

[0087] Specifically, the collision detection volume refers to the capsule corresponding to the avatar. It can be understood that the collision detection volume encloses the avatar, and the position of the collision detection volume is the position of the avatar. Correspondingly, the height difference refers to the distance between the bottom of the collision detection volume and the contact surface.

[0088] Based on this, after determining the mapping position information, the collision detection body associated with the virtual character can be determined. Then, the height difference between the target position corresponding to the mapping position information and the collision detection body can be calculated to determine the distance difference between the target bone and the contact surface. Figure 2 The schematic diagram shown in (b) is the vertical distance between the target bone and the contact surface. This distance can be used as the offset between the target bone and the contact surface, which facilitates the subsequent position update of the virtual character in combination with the offset.

[0089] Following the above example, see Figure 3 (a) and Figure 3When the foot skeleton of the game character is below the slope surface, a ray is cast upward to determine the target position of the foot IK, and then a capsule corresponding to the game character is determined. At this time, the height difference between the target position of the foot IK and the bottom position of the capsule is calculated, and the offset amount S1 of the foot skeleton is determined. Subsequently, the position of the game character is adjusted according to the offset amount S1, so that the game character can be attached to the slope surface.

[0090] In summary, by combining the collision detection body of the virtual character to calculate the offset amount between the target skeleton and the contact surface, the accuracy of the offset amount calculation can be ensured, and subsequent position adjustment of the virtual character combined with the offset amount can further ensure that the contact surface and the virtual character are more attached.

[0091] Step S108, updating the position of the virtual character relative to the contact surface according to the offset amount.

[0092] Specifically, after calculating the offset amount between the target skeleton and the contact surface according to the mapping position information, further, since the target skeleton belongs to the virtual character and is closest to the contact surface, the position of the virtual character relative to the contact surface can be adjusted according to the offset amount between the target skeleton and the contact surface, and in the adjustment process, the virtual character is regarded as a whole, which can avoid deformation of the virtual character, and at the same time can ensure that the contact surface and the virtual character are more attached.

[0093] Further, when adjusting the position of the virtual character relative to the contact surface according to the offset amount, in order to ensure that the virtual character can change position without deformation, the main skeleton of the virtual character can be adjusted to control the virtual character to change position. In this embodiment, the specific implementation is as follows:

[0094] Determining the main skeleton of the virtual character.

[0095] Adjusting the positions of the main skeleton and the target skeleton according to the offset amount, and taking the adjustment result as the position update result of the virtual character relative to the contact surface.

[0096] Specifically, the main skeleton specifically refers to the middle skeleton connecting the upper body skeleton and the lower body skeleton of the virtual character, and by adjusting the position of the main skeleton, the virtual character as a whole can be controlled.

[0097] Based on this, when the offset is determined, in order to be able to control the position update of the virtual character as a whole according to the offset, the main bone of the virtual character can be determined first, and then the position of the main bone and the target bone of the virtual character is adjusted according to the offset, the adjustment distance is the same as the offset, and the direction is to move to the contact surface, so as to realize the position adjustment of the virtual character relative to the contact surface according to the adjustment result.

[0098] Further, when the position adjustment of the virtual character is completed, the visual area containing the virtual character can be rendered to show the user a higher-realistic picture. In the embodiment, the specific implementation is as follows:

[0099] According to the position update result, the visual area containing the virtual character and the contact surface is rendered and displayed. The visual area containing the virtual character and the contact surface specifically refers to the picture that needs to be displayed to the user. By rendering the area, the picture of the virtual character standing on the contact surface can be displayed, and the virtual character and the contact surface are more consistent.

[0100] In the above example, when the offset S1 or S2 of the foot bone relative to the slope surface is determined, the pelvic bone of the game character can be determined at this time, and then the pelvic bone and the foot bone are adjusted according to the offset S1 or S2, so that the game character can stand on the slope surface after adjustment, and the foot and the slope surface are more consistent; After the position adjustment of the game character, the game scene containing the game character and the slope surface can be rendered to show the user the game picture as shown in (c) of FIG. Figure 3

[0101] In summary, by using the offset to adjust the position of the main bone of the game character, it can be ensured that the virtual character after adjustment is more consistent with the contact surface, and at the same time, the deformation of the virtual character due to position adjustment can be avoided, thereby improving the realism of the rendered picture.

[0102] In addition, considering that there can be multiple target bones of the virtual character, for example, there are two target bones when the target bone is the foot bone, and the offset corresponding to each foot bone is determined by the above offset calculation; At this time, if the position of the virtual character is updated according to the offset, there can be a problem of not being able to choose, and choosing which offset can ensure that the position update is reasonable, which is the basis for improving the user's viewing experience. Therefore, when the number of target bones is greater than a set number, the offset needs to be selected, and the specific implementation in the embodiment is as follows:

[0103] In the case where the number of target bones is greater than or equal to a preset number threshold, the offset between each target bone and the contact surface is calculated.

[0104] ​sort the offset amounts in ascending order and select a target offset amount from the offset amounts between each target bone and the contact surface according to the sorting result;

[0105] update the position of the virtual character relative to the contact surface according to the target offset amount.

[0106] Specifically, the preset number threshold can be set to 1 or other values, and in this embodiment, the selection of the target offset amount from the plurality of offset amounts can be to select the minimum offset amount as the target offset amount to avoid the virtual character from being out of the model, and then update the position of the virtual character.

[0107] Based on this, in the case that the number of target bones is greater than or equal to the preset number threshold, the offset amount between each target bone and the contact surface can be calculated respectively, and then the offset amounts are sorted in ascending order, and the smallest offset amount is selected as the target offset amount according to the sorting result, and then the position of the virtual character relative to the contact surface is updated according to the target offset amount. The process of updating the position according to the offset amount can be referred to the corresponding description in the above embodiments, and this embodiment will not be described in more detail.

[0108] In the above example, the offset amount between the first foot bone of the game character and the slope surface is S3, and the offset amount between the second foot bone and the slope surface is S4, and then the offset amount S3 and the offset amount S4 are compared, and according to the comparison result, it is determined that S3 < S4, and then the offset amount S3 between the first foot bone and the slope surface can be selected to adjust the distance of the game character relative to the slope surface, and the pelvis bone of the game character can be adjusted to complete the adjustment, so that the game character can stand on the slope surface of the uphill, and the display effect is as shown in (c) of FIG. 8. Figure 3

[0109] In summary, by selecting the smallest offset amount as the target offset amount to update the position of the virtual character relative to the contact surface, the virtual character can be prevented from being out of the model, and a more realistic display effect can be displayed.

[0110] ​The position updating method provided in the application can ensure that the position relationship between the virtual character and the contact surface is closer to the real situation, and can minimize the adjustment of the bone position of the virtual character, and is closer to the original animation. After the position information corresponding to the target bone of the virtual character is obtained, the mapping position information of the target bone on the contact surface is determined according to the position information. Then, the offset between the target bone and the contact surface is calculated based on the mapping position information, and the position of the virtual character relative to the contact surface is updated based on this, so that the position relationship between the virtual character and the contact surface is more real, and the complexity of the contact surface will not have a great impact on the bone position and action of the virtual character, so that a more real virtual scene can be displayed subsequently.

[0111] The following describes the position updating method provided in the application in combination with the accompanying drawings. Figure 4 The position updating method provided in the application is taken as an example in the application of the game scene, and the position updating method is further described. Wherein, Figure 4 A processing flowchart of a position updating method applied in a game scene is shown, which specifically includes the following steps:

[0112] Step S402, determining the foot bone closest to the slope surface in the role bone corresponding to the game character.

[0113] Step S404, determining the world coordinate system to which the game character belongs, and determining the position information corresponding to the foot bone based on the world coordinate system.

[0114] Step S406, in the case that there is an inclination angle between the game character and the slope surface, rotating the game character according to the inclination angle.

[0115] Step S408, determining the bone position of the foot bone according to the position information, and creating an auxiliary line between the bone position and the slope surface.

[0116] Step S410, determining the contact point based on the intersection of the slope surface and the auxiliary line, and taking the position information of the contact point as the mapping position information.

[0117] Step S412, determining the collision detection body associated with the game character.

[0118] Step S414, calculating the height difference between the target position corresponding to the mapping position information and the collision detection body.

[0119] Step S416, determining the height difference as the offset between the foot bone and the slope surface.

[0120] Step S418, determining the pelvic bone of the virtual character.

[0121] Step S420, the position of the pelvic bone skeleton and the foot skeleton is adjusted according to the offset, and a visual area containing the game character and the inclined surface is rendered according to the position adjustment result and displayed.

[0122] The position updating method provided in the application can ensure that the position relationship between the virtual character and the contact surface is closer to the real situation, and can adjust the skeleton position of the virtual character as little as possible, and is closer to the original animation. After the position information corresponding to the target skeleton of the virtual character is obtained, the mapping position information of the target skeleton on the contact surface is determined according to the position information. Then, the offset between the target skeleton and the contact surface is calculated based on the mapping position information, and the position of the virtual character relative to the contact surface is updated based on this, so that the position relationship between the virtual character and the contact surface is more real, and the complexity of the contact surface does not have a great influence on the skeleton position and action of the virtual character, so that a more real virtual scene can be displayed subsequently.

[0123] Corresponding to the method embodiments, the application also provides position updating device embodiments, Figure 5 A structure diagram of a position updating device provided by an embodiment of the application is shown. As shown in the figure, Figure 5 The device comprises:

[0124] The obtaining module 502 is configured to obtain position information corresponding to a target skeleton of a virtual character.

[0125] The determining module 504 is configured to determine mapping position information of the target skeleton on a contact surface according to the position information.

[0126] The calculating module 506 is configured to calculate an offset between the target skeleton and the contact surface based on the mapping position information.

[0127] The updating module 508 is configured to update the position of the virtual character relative to the contact surface according to the offset.

[0128] In an optional embodiment, the obtaining module 502 is further configured to:

[0129] select a target character skeleton closest to the contact surface from character skeletons corresponding to the virtual character as the target skeleton, determine a world coordinate system to which the virtual character belongs, and determine the position information corresponding to the target skeleton based on the world coordinate system.

[0130] In an optional embodiment, the position updating device further comprises:

[0131] The rotating module is configured to rotate the virtual role according to the inclination angle when the inclination angle exists between the virtual role and the contact surface, and the rotated virtual role is perpendicular to the contact surface.

[0132] In an optional embodiment, the determining module 504 is further configured to:

[0133] determine a bone position of the target bone according to the position information, create an auxiliary line between the bone position and the contact surface, determine a contact point based on an intersection of the contact surface and the auxiliary line, and take position information of the contact point as the mapping position information.

[0134] In an optional embodiment, the calculating module 506 is further configured to:

[0135] determine a collision detection body associated with the virtual role, calculate a height difference between a target position corresponding to the mapping position information and the collision detection body, and determine the height difference as the offset between the target bone and the contact surface.

[0136] In an optional embodiment, the updating module 508 is further configured to:

[0137] determine a main bone of the virtual role, adjust positions of the main bone and the target bone according to the offset, and take an adjustment result as a position updating result of the virtual role relative to the contact surface.

[0138] In an optional embodiment, the position updating apparatus further includes:

[0139] The sorting module is configured to, when the number of target bones is greater than or equal to a preset number threshold, calculate offsets between each target bone and the contact surface, sort the offsets in ascending order, and select a target offset from the offsets between each target bone and the contact surface according to a sorting result.

[0140] Correspondingly, the updating module 508 is further configured to:

[0141] update a position of the virtual role relative to the contact surface according to the target offset.

[0142] In an optional embodiment, the position updating apparatus further includes:

[0143] The display module is configured to render a visual area containing the virtual role and the contact surface according to the position updating result and display the visual area.

[0144] The position updating device provided in the application can ensure that the position relationship between the virtual character and the contact surface is closer to the real situation, and can adjust the bone position of the virtual character as little as possible, and is closer to the original animation. After the position information corresponding to the target bone of the virtual character is acquired, the mapping position information of the target bone on the contact surface is determined according to the position information. Then, the offset between the target bone and the contact surface is calculated based on the mapping position information, and the position of the virtual character relative to the contact surface is updated based on this, so that the position relationship between the virtual character and the contact surface is more real, and the complexity of the contact surface will not have a great influence on the bone position and action of the virtual character, so that a more real virtual scene can be displayed subsequently.

[0145] The above is a schematic scheme of the position updating device of the embodiment. It should be noted that the technical scheme of the position updating device belongs to the same concept as the technical scheme of the position updating method described above. The details of the technical scheme of the position updating device that are not described in detail can be referred to the description of the technical scheme of the position updating method. In addition, each component in the device embodiment should be understood as a functional module that must be established to realize each step of the program flow or each step of the method. Each functional module is not limited by actual functional division or separation. The device claim defined by such a group of functional modules should be understood as a functional module architecture for realizing the solution of the computer program mainly by the description of the specification, and should not be understood as an entity device for realizing the solution mainly by hardware.

[0146] Figure 6 A structural block diagram of a computing device 600 according to an embodiment of the application is shown. The components of the computing device 600 include, but are not limited to, a memory 610 and a processor 620. The processor 620 is connected to the memory 610 through a bus 630, and a database 650 is used to save data.

[0147] The computing device 600 also includes an access device 640, which enables the computing device 600 to communicate via one or more networks 660. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 640 can include one or more of any type of network interface (e.g., network interface card (NIC)) such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a worldwide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like, wired or wireless.

[0148] In one embodiment of the present application, the above components of the computing device 600 and Figure 6 Other components not shown in the figure may also be connected to each other, for example, via a bus. Figure 6 The computing device structure block diagram shown is for illustrative purposes only and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.

[0149] The computing device 600 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook computer, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smartwatch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 600 may also be a mobile or stationary server.

[0150] The processor 620 is configured to execute the following computer-executable instructions:

[0151] Get the position information corresponding to the target skeleton of the virtual character;

[0152] Determine mapping position information of the target bone mapping on the contact surface according to the position information;

[0153] Calculating an offset between the target bone and the contact surface based on the mapped position information;

[0154] The position of the virtual character relative to the contact surface is updated according to the offset.

[0155] The above is a schematic solution of a computing device of this embodiment. It should be noted that the technical solution of the computing device and the technical solution of the above-mentioned location update method are of the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the above-mentioned location update method.

[0156] An embodiment of the present application further provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, are used to:

[0157] Get the position information corresponding to the target skeleton of the virtual character;

[0158] Determine mapping position information of the target bone mapping on the contact surface according to the position information;

[0159] Calculating an offset between the target bone and the contact surface based on the mapped position information;

[0160] The position of the virtual character relative to the contact surface is updated according to the offset.

[0161] The above is a schematic solution of a computer-readable storage medium of this embodiment. It should be noted that the technical solution of the storage medium and the technical solution of the above-mentioned location update method are of the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the above-mentioned location update method.

[0162] An embodiment of the present application further provides a chip storing a computer program, which implements the steps of the location updating method when executed by the chip.

[0163] The foregoing description describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0164] The computer instructions include computer program code, which may be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0165] It should be noted that for the aforementioned method embodiments, for ease of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.

[0166] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0167] The preferred embodiments of the present application disclosed above are intended only to help illustrate the present application. The optional embodiments do not describe all details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made based on the content of this application. This application selects and describes these embodiments in detail to better explain the principles of this application and its practical applications, so that those skilled in the art can better understand and utilize this application. This application is limited only by the claims and their full scope and equivalents.

Claims

1. A location updating method, characterized in that: include: In the case where there is an inclination angle between the virtual character and the contact surface, rotating the virtual character according to the angle difference between the inclination angle and 90 degrees; Obtaining position information corresponding to a target bone of the virtual character, where the target bone refers to a bone in the character skeleton of the virtual character that needs to come into contact with the contact surface; Determine mapping position information of the target bone mapping on the contact surface according to the position information; Calculating an offset between the target bone and the contact surface based on the mapped position information, wherein the offset refers to a distance between a bottom of a collision detection body and the contact surface, and the collision detection body refers to a capsule body corresponding to the virtual character; The main skeleton and the target skeleton of the virtual character are simultaneously adjusted in position according to the offset, wherein the adjustment distance is the same as the offset and the direction is moving toward the contact surface. The main skeleton refers to the middle skeleton connecting the upper body skeleton and the lower body skeleton of the virtual character.

2. The location updating method according to claim 1, wherein: The obtaining of the position information corresponding to the target skeleton of the virtual character includes: Selecting a target character bone that is closest to the contact surface from the character bones corresponding to the virtual character as the target bone; Determine a world coordinate system to which the virtual character belongs, and determine the position information corresponding to the target skeleton based on the world coordinate system.

3. The location updating method according to claim 1, wherein: Determining the mapping position information of the target bone mapping on the contact surface according to the position information includes: Determining a bone position of the target bone according to the position information, and creating an auxiliary line between the bone position and the contact surface; A contact point is determined based on an intersection of the contact surface and the auxiliary line, and position information of the contact point is used as the mapped position information.

4. The location updating method according to claim 1, wherein: The calculating the offset between the target bone and the contact surface based on the mapping position information includes: Determining a collision detection body associated with the virtual character; Calculating a height difference between a target position corresponding to the mapped position information and the collision detection object; The height difference is determined as the offset between the target bone and the contact surface.

5. The location updating method according to claim 1, wherein: The simultaneously adjusting the positions of the main skeleton and the target skeleton of the virtual character relative to the contact surface according to the offset includes: Determining the main skeleton of the virtual character; The positions of the main skeleton and the target skeleton are adjusted simultaneously according to the offset, and the adjustment results are used as the position update results of the main skeleton and the target skeleton of the virtual character relative to the contact surface.

6. The location updating method according to any one of claims 1 to 5, characterized in that: Also includes: When the number of the target bones is greater than or equal to a preset number threshold, calculating the offset between each target bone and the contact surface; sorting the offsets in ascending order, and selecting a target offset from the offsets between each target bone and the contact surface according to the sorting result; Accordingly, the positions of the main skeleton and the target skeleton of the virtual character relative to the contact surface are updated according to the offset, including: The positions of the main skeleton and the target skeleton of the virtual character relative to the contact surface are updated according to the target offset.

7. The location updating method according to any one of claims 1 to 5, characterized in that: After the step of updating the positions of the main skeleton and the target skeleton of the virtual character relative to the contact surface according to the offset is performed, the method further includes: A visualization area including the virtual character and the contact surface is rendered and displayed according to the position update result.

8. A location updating device, characterized in that: include: a rotation module configured to rotate the virtual character according to an angle difference between the tilt angle and 90 degrees when there is an inclination angle between the virtual character and the contact surface; An acquisition module is configured to acquire position information corresponding to a target bone of the virtual character, where the target bone refers to a bone in the character skeleton of the virtual character that needs to come into contact with the contact surface; a determination module configured to determine mapping position information of the target bone mapping on the contact surface according to the position information; a calculation module configured to calculate an offset between the target bone and the contact surface based on the mapped position information, wherein the offset refers to a distance between a bottom of a collision detection body and the contact surface, and the collision detection body refers to a capsule body corresponding to the virtual character; The update module is configured to simultaneously adjust the positions of the main skeleton and the target skeleton of the virtual character according to the offset, wherein the adjustment distance is the same as the offset and the direction is to move toward the contact surface. The main skeleton refers to the middle skeleton connecting the upper body skeleton and the lower body skeleton of the virtual character.

9. A computing device, characterized in that include: memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing computer instructions, characterized in that: When the instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Attitude determination method and device of virtual object in three-dimensional virtual environment and medium

    CN108245893A

  • Location updating method and device, equipment and storage medium

    CN109966741A