Virtual object interaction method and apparatus, medium, and electronic device

By determining the adsorption range of virtual objects in virtual game scenarios and controlling their contact, the large resource overhead and lag problems caused by virtual building materials distance calculation are solved, and the user experience is improved.

WO2025130250A1PCT designated stage expired Publication Date: 2025-06-26BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/122802
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-21
Filing Date
2024-09-30
Publication Date
2025-06-26

AI Technical Summary

Technical Problem

In virtual game scenarios, due to the distance calculation of a large number of virtual building materials, electronic equipment resource overhead is likely to cause lag and damage the user experience.

Method used

By determining the adsorption range between virtual objects, the contact between virtual objects is controlled based on the displacement amount, and unnecessary distance calculation is reduced.

Benefits of technology

Reduces the computing overhead in virtual object interaction, reduces lag, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024122802_26062025_PF_FP_ABST
    Figure CN2024122802_26062025_PF_FP_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of the Internet, and relates to a virtual object interaction method and apparatus, a medium, and an electronic device. The virtual object interaction method comprises: displaying a virtual scene, wherein the virtual scene comprises a first virtual object and at least one second virtual object; in response to the first virtual object being located in an area associated with the at least one second virtual object, on the basis of an amount of displacement between the first virtual object and the second virtual object, determining whether the first virtual object is within an adsorption range; and in response to determining that the first virtual object is within the adsorption range, controlling the first virtual object to be in contact with the second virtual object. The embodiments of the present disclosure can realize automatic contact between virtual objects while reducing the calculation overhead, thereby reducing the lag phenomenon and further improving user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Virtual object interaction method, device, medium and electronic device

[0001] This application claims priority to Chinese Patent Application No. 202311776233.6 filed on December 21, 2023, and the contents of the above-mentioned Chinese patent application disclosure are hereby incorporated by reference in their entirety as a part of this application. Technical Field

[0002] Embodiments of the present disclosure relate to a virtual object interaction method, device, medium, and electronic device. Background Art

[0003] With the development of Internet technology, electronic devices can realize richer virtual scenes, such as construction-type virtual game scenes. Construction-type virtual game scenes use virtual building materials as basic units, and various different virtual buildings are built through the combination of virtual building materials.

[0004] For example, the distance between two virtual building materials is used to determine whether to perform automatic control so that the two automatically touch each other. However, virtual scenes are relatively rich, with a large number of building material units. A large number of distance calculations will cause high resource consumption of electronic equipment, especially in game scenarios, which can easily cause lag and thus damage the user experience.

[0005] Summary of the Invention

[0006] The present disclosure provides a virtual object interaction method, comprising:

[0007] Displaying a virtual scene, wherein the virtual scene includes a first virtual object and at least one second virtual object;

[0008] In response to the first virtual object being located in an area associated with at least one of the second virtual objects, determining whether the first virtual object is in an adsorption range based on a displacement between the first virtual object and the second virtual object;

[0009] In response to determining that the first virtual object is within the adsorption range, the first virtual object is controlled to contact the second virtual object.

[0010] The present disclosure provides a virtual object interaction device, comprising:

[0011] a display module configured to display a virtual scene, wherein the virtual scene includes a first virtual object and at least one second virtual object;

[0012] a first determining module configured to, in response to the first virtual object being located in an area associated with at least one second virtual object, determine whether the first virtual object is in an adsorption range based on a displacement between the first virtual object and the second virtual object;

[0013] The control module is configured to control the first virtual object to contact the second virtual object in response to determining that the first virtual object is in the adsorption range.

[0014] The present disclosure provides a computer-readable medium having a computer program stored thereon, which implements the above-mentioned virtual object interaction method when executed by a processing device.

[0015] The present disclosure provides an electronic device, comprising:

[0016] a storage device having a computer program stored thereon;

[0017] The processing device is configured to execute the computer program in the storage device to implement the virtual object interaction method described above. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The above and other features, advantages and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale. In the drawings:

[0019] FIG1 is a schematic diagram illustrating an adsorption effect according to the present disclosure.

[0020] FIG2 is a flowchart showing a virtual object interaction method according to an exemplary embodiment of the present disclosure.

[0021] FIG3 is a schematic diagram showing a process of determining a target starting point according to an exemplary embodiment of the present disclosure.

[0022] FIG4 is a schematic diagram showing a circular boundary according to an exemplary embodiment of the present disclosure.

[0023] FIG5 is a schematic diagram showing an intersection of a second virtual object and a circular boundary according to an exemplary embodiment of the present disclosure.

[0024] FIG6 is a block diagram showing a virtual object interaction device according to an exemplary embodiment of the present disclosure.

[0025] FIG7 is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0026] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.

[0027] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0028] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.

[0029] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0030] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".

[0031] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0032] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0033] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the operation requested will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operations of the disclosed technical solution based on the prompt message.

[0034] As an optional but non-limiting implementation, in response to receiving a user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. Furthermore, the pop-up window may also contain a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.

[0035] It is understandable that the above notification and user authorization process are merely illustrative and do not limit the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0036] At the same time, it is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) must comply with the requirements of relevant laws, regulations and relevant provisions.

[0037] For example, the distance between two virtual building materials is used to determine whether to perform automatic control so that the two automatically touch each other. However, virtual scenes are relatively rich, with a large number of building material units. A large number of distance calculations will cause high resource consumption of electronic equipment, especially in game scenarios, which can easily cause lag and thus damage the user experience.

[0038] Furthermore, approximating simple geometric objects doesn't accurately represent diverse shapes, making it impossible to accurately calculate the minimum distance between two virtual building materials, resulting in gaps or overlaps in the adsorption effect. For example, Figure 1 shows an adsorption effect illustrated in the present disclosure. In Figure 1, there is overlap between two virtual objects, requiring the user to manually fine-tune the adsorption result.

[0039] In view of this, in order to solve the above problems, the embodiments of the present disclosure provide a virtual object interaction method, device, medium and electronic device.

[0040] FIG2 is a flowchart of a virtual object interaction method according to an exemplary embodiment of the present disclosure. The virtual object interaction method can be performed by an electronic device, specifically by a virtual object interaction device, which can be implemented by software and / or hardware. Referring to FIG2 , the virtual object interaction method may include the following steps:

[0041] Step 210: displaying a virtual scene, where the virtual scene includes a first virtual object and at least one second virtual object;

[0042] Step 220 , in response to the first virtual object being located in an area associated with at least one second virtual object, determining whether the first virtual object is in an adsorption range based on a displacement between the first virtual object and the second virtual object;

[0043] Step 230 : In response to determining that the first virtual object is in the adsorption range, control the first virtual object to contact the second virtual object.

[0044] The first virtual object and the second virtual object may be virtual objects of any shape, and the first virtual object and the second virtual object are virtual objects set in a virtual scene, and the virtual scene may be a two-dimensional virtual scene or a three-dimensional virtual scene. As an example, the virtual scene may be a construction-related virtual game scene, and the corresponding virtual objects may be virtual building materials.

[0045] It is worth noting that the first virtual object can be a virtual object that the user moves within the virtual scene via the electronic device, and the second virtual object can be a stationary virtual object. As the user moves the first virtual object via the electronic device, it may gradually approach the second virtual object. The user's continuous movement of the first virtual object toward the second virtual object indicates the user's desire to bring the first virtual object into contact with the second virtual object.

[0046] When the first virtual object is located in an area associated with at least one second virtual object, the displacement between the first virtual object and the second virtual object is calculated. This displacement represents the shortest displacement required for the first virtual object and the second virtual object to achieve contact. It should be understood that when the first virtual object is not located in an area associated with a second virtual object, the displacement between the first virtual object and the second virtual object does not need to be calculated.

[0047] It is worth noting that when the first virtual object is determined to be within the adsorption range, the electronic device may control the movement of the first virtual object based on the vector corresponding to the currently determined displacement (i.e., the modulus). This means that the first virtual object is no longer under the user's control, and the electronic device controls the movement of the first virtual object based on the vector corresponding to the displacement. The contact position between the first virtual object and the second virtual object includes the edge points of the vector corresponding to the displacement, respectively, on the first and second virtual objects.

[0048] Through the above technical solution, when a first virtual object is located in an area associated with at least one second virtual object, whether the first virtual object is within the adsorption range is determined based on the displacement between the first virtual object and the second virtual object. This can achieve automatic contact of virtual objects while reducing computing overhead, reduce lag, and thus improve user experience.

[0049] In some embodiments, the above-mentioned step of determining whether the first virtual object is in the adsorption range based on the displacement between the first virtual object and the second virtual object in response to the first virtual object moving to the area associated with at least one second virtual object can be implemented as follows: in response to the first virtual object moving to the area associated with at least one second virtual object, taking the preset point of the first virtual object as the first starting point, calculating the distance from the first starting point to each point on the contour line of the second virtual object, and in response to the distance meeting the preset requirements, determining the point corresponding to the distance as the second starting point; calculating the distance from the second starting point to each point on the contour line of the first virtual object, and in response to the distance meeting the preset requirements, determining whether the point corresponding to the distance coincides with the first starting point, and in response to non-coincidence, taking the point as the new first starting point; in response to coincidence, determining the displacement between the first virtual object and the second virtual object according to the coordinates of the second starting point and the coordinates of the first starting point; and determining whether the first virtual object is in the adsorption range based on the displacement.

[0050] The preset point of the first virtual object may be any point in the first virtual object or a designated point. The designated point may be, for example, the center point of a circular boundary surrounding the first virtual object.

[0051] Among them, the preset requirements include the shortest distance among all distances from the calculated target starting point to each point on the contour line of the target virtual object. When the target starting point is the first starting point, the corresponding target virtual object is the second virtual object; when the target starting point is the second starting point, the target virtual object is the first virtual object.

[0052] Figure 3 is a schematic diagram illustrating the process of determining a target starting point according to an exemplary embodiment of the present disclosure. Referring to Figure 3 , object A is a first virtual object, object B is a second virtual object, and point O shown in Figure 3 is a preset point of the first virtual object. Starting from point O, the distance from point O to each point on the contour line of the second virtual object is calculated. If the distance from point O to point B1 meets the preset requirements, point B1 corresponding to the distance from point O to point B1 is determined as the second starting point.

[0053] Calculate the distance from point B1 to each point on the contour line of the first virtual object. If the distance from point B1 to point A1 meets the preset requirements, and point A1 corresponding to the distance from point B1 to point A1 does not coincide with point O, then determine point A1 as the new first starting point;

[0054] Continue to use point A1 as the new first starting point, calculate the distance from point A1 to each point on the contour line of the second virtual object, and if the distance from point A1 to point B2 meets the preset requirements, then determine point B2 corresponding to the distance from point A1 to point B2 as the second starting point;

[0055] Calculate the distance from point B2 to each point on the contour line of the first virtual object. If the distance from point B2 to point A2 meets the preset requirements, and point A2 corresponding to the distance from point B2 to point A2 does not coincide with point A1, then determine point A2 as the new first starting point;

[0056] Continue using point A2 as the new first starting point, calculate the distance from point A2 to each point on the contour line of the second virtual object, and if the distance from point A2 to point B3 meets the preset requirements, then determine point B3 corresponding to the distance from point A2 to point B3 as the second starting point;

[0057] Calculate the distance from point B3 to each point on the contour line of the first virtual object. If the distance from point B3 to point A3 meets the preset requirements and point A3 corresponding to the distance from point B3 to point A3 does not coincide with point A2, then determine point A3 as the new first starting point.

[0058] Continue to use point A3 as the new first starting point, calculate the distance from point A3 to each point on the contour line of the second virtual object, and if the distance from point A3 to point B3 meets the preset requirements, then determine point B3 corresponding to the distance from point A3 to point B3 as the second starting point; calculate the distance from point B3 to each point on the contour line of the first virtual object, and if the distance from point B3 to point A3 meets the preset requirements, and point A3 corresponding to the distance from point B3 to point A3 coincides with the first starting point, then determine the displacement based on the coordinates of point A3 and point B3.

[0059] In other embodiments, the above-mentioned step of determining whether the first virtual object is in the adsorption range based on the displacement between the first virtual object and the second virtual object in response to the first virtual object moving to the area associated with at least one second virtual object can be implemented as follows: in response to the first virtual object moving to the area associated with at least one second virtual object, if the preset condition is not met, sampling the first target coordinate and the second target coordinate in sequence, the first target coordinate is the coordinate on the second virtual object closest to the fixed-point coordinate on the first virtual object, and the second target coordinate is the coordinate on the first virtual object closest to the fixed-point coordinate on the second virtual object, in two adjacent samplings, the fixed-point coordinate in the next sampling is the first target coordinate or the second target coordinate in the previous sampling, and the fixed-point coordinate in the first sampling is the preset point; in response to the preset condition being met, determining the displacement between the first virtual object and the second virtual object based on the last sampled target coordinate and the fixed-point coordinate used for sampling the target coordinate; and determining whether the first virtual object is in the adsorption range based on the displacement and the preset distance threshold.

[0060] The preset point in this embodiment may be any point in the virtual object or a designated point. The designated point may be, for example, the center point of the minimum bounding box for enclosing the outline of the virtual object.

[0061] The preset condition is whether the number of sampling times reaches the preset number.

[0062] Still using the example shown in FIG3 , point O is the fixed point coordinate in the first sampling, and the preset point is used. The first target coordinate sampled is point B1. Subsequently, the second target coordinate sampled is point A1. Subsequently, the first target coordinate sampled is point B2. The second target coordinate sampled is point A2. The first target coordinate sampled is point B3. The second target coordinate sampled is point A3. When the second target coordinate sampled is point A3, the number of sampling times has reached the preset number. Then, the displacement between the first virtual object and the second virtual object is determined based on points A3 and B3.

[0063] As an example, the preset distance threshold can be a parameter based on the displacement that assists in determining whether the first virtual object is within the adsorption range. For example, when the displacement is less than the preset distance threshold, the first virtual object is determined to be within the adsorption range; when the displacement is greater than or equal to the preset distance threshold, the first virtual object is determined to be outside the adsorption range. The preset distance threshold can be set based on actual circumstances and is not detailed in this embodiment.

[0064] The above method is applicable to calculating the shortest distance between virtual objects of arbitrary shapes. The shortest distance between the first virtual object and the second virtual object is directly determined based on the original shapes of the first virtual object and the second virtual object, without approximating the first virtual object and the second virtual object as other simple objects. This can improve the accuracy of the shortest distance between virtual objects. On this basis, when the shortest distance between the first virtual object and the second virtual object is less than a preset distance threshold, the first virtual object and the second virtual object are automatically adsorbed according to the vector corresponding to the shortest distance, thereby improving the effect of automatic adsorption.

[0065] It is understandable that when the module length is equal to or greater than the preset distance threshold, the electronic device will not actively control the movement of the first virtual object.

[0066] In some embodiments, the above method also includes: determining a circular boundary surrounding the first virtual object; wherein each point on the contour line of the first virtual object is located inside the circular boundary; determining whether the second virtual object intersects with the circular boundary; and when the second virtual object intersects with the circular boundary, determining that the first virtual object is located in an area associated with at least one second virtual object.

[0067] It is worth noting that when the distance between two virtual objects is too far, the possibility that their closest distance is less than the preset distance threshold is low. If it is still determined whether the first virtual object is in the adsorption range, it will cause a large resource overhead of the electronic device, especially in game scenarios, which is easy to cause lag, thereby damaging the user experience.

[0068] To this end, through the above method, it is first determined whether the second virtual object intersects with the circular boundary. In the case of intersection, it is determined that the first virtual object is located in an area associated with at least one second virtual object, and then it is determined whether the first virtual object is in the adsorption range, thereby reducing the resource overhead of the electronic device.

[0069] In some embodiments, the above-mentioned determination of the circular boundary surrounding the first virtual object includes: determining a bounding box of the first virtual object; wherein the distance between the center point of the bounding box and the vertex of the bounding box is a first distance; based on the first distance and a preset distance threshold, determining the target adsorption radius, the preset distance threshold is a parameter for determining whether the first virtual object is in the adsorption range based on the displacement; determining the circular boundary surrounding the first virtual object according to the target adsorption radius and the center point of the bounding box.

[0070] It is worth noting that the bounding box is used to enclose all contour lines of the first virtual object. As an example, each side of the bounding box is tangent to at least one point on the contour line of the first virtual object.

[0071] Figure 4 is a schematic diagram illustrating a circular boundary according to an exemplary embodiment of the present disclosure. Referring to Figure 4 , point O is the center point of a bounding box surrounding a first virtual object, point Q1 is a vertex of the bounding box, and the distance between point O and point Q1 is a first distance; the distance between point Q1 and point Q2 is a second distance (i.e., a preset distance threshold).

[0072] Figure 5 is a schematic diagram illustrating a second virtual object intersecting a circular boundary according to an exemplary embodiment of the present disclosure. Referring to Figure 5 , when the second virtual object intersects the circular boundary, it is determined that the first virtual object is located in an area associated with at least one second virtual object.

[0073] By the above method, the circular boundary is rationally set to reduce the computational overhead of the electronic device while being applicable to the calculation of the shortest distance between virtual objects of arbitrary shapes.

[0074] In some embodiments, the distance from the target starting point to each point on the contour line of the target virtual object is calculated in the following manner: calling an application programming interface in the game engine to calculate the distance from the target starting point to each point on the contour line of the target virtual object, where the target starting point is the first starting point or the second starting point, and the target virtual object is the first virtual object or the second virtual object.

[0075] Among them, the explanation of the target starting point and the target virtual object can refer to the above-mentioned related embodiments, and this embodiment will not be described in detail here.

[0076] The game engine may be a Unity engine, which is a real-time 3D (three-dimensional) interactive content creation and operation platform. The application programming interface is an interface for calculating the distance from a target starting point to each point on the contour line of a target virtual object.

[0077] In the above manner, by calling the interface provided in the Unity engine for calculating the distance from the target starting point to each point on the contour line of the target virtual object, the distance from the target starting point to each point on the contour line of the target virtual object can be determined. Therefore, when developers develop applications for implementing the above-mentioned virtual object interaction method, they do not need to access the source code corresponding to the interface or understand the details of the internal working mechanism, thereby simplifying the development difficulty.

[0078] In addition, an application programming interface for determining the coordinates of the first target and the second target in the game engine may be called to implement sampling of the coordinates of the first target and the second target.

[0079] The present disclosure further provides a virtual object interaction device. FIG6 is a block diagram of a virtual object interaction device according to an exemplary embodiment of the present disclosure. Referring to FIG6 , the virtual object interaction device 600 includes:

[0080] A display module 601 is configured to display a virtual scene, where the virtual scene includes a first virtual object and at least one second virtual object;

[0081] A first determining module 602 is configured to determine whether the first virtual object is in an adsorption range based on a displacement between the first virtual object and the second virtual object in response to the first virtual object being located in an area associated with at least one second virtual object;

[0082] The control module 603 is configured to control the first virtual object to contact the second virtual object in response to determining that the first virtual object is in the adsorption range.

[0083] Optionally, the first determining module 602 includes:

[0084] a first response submodule configured to, in response to the first virtual object moving to an area associated with at least one second virtual object, use a preset point of the first virtual object as a first starting point, calculate a distance from the first starting point to each point on a contour line of the second virtual object, and, in response to the distance meeting a preset requirement, determine a point corresponding to the distance as a second starting point;

[0085] a second response submodule configured to calculate a distance from the second starting point to each point on the contour line of the first virtual object, and in response to the distance meeting a preset requirement, determine whether the point corresponding to the distance coincides with the first starting point, and in response to the non-coincidence, use the point as a new first starting point;

[0086] a third response submodule, configured to determine, in response to the coincidence, a displacement between the first virtual object and the second virtual object based on the coordinates of the second starting point and the coordinates of the first starting point;

[0087] The first determining submodule is configured to determine whether the first virtual object is in the adsorption range based on the displacement.

[0088] Optionally, the virtual object interaction device 600 further includes:

[0089] A second determining module is configured to determine a circular boundary surrounding the first virtual object, wherein each point on the contour line of the first virtual object is located inside the circular boundary;

[0090] a determination module, configured to determine whether the second virtual object intersects with the circular boundary;

[0091] The third determining module is configured to determine that the first virtual object is located in an area associated with at least one second virtual object when the second virtual object intersects the circular boundary.

[0092] Optionally, the second determining module is specifically configured to:

[0093] Determine a bounding box of the first virtual object; wherein the distance between the center point of the bounding box and the vertex of the bounding box is a first distance;

[0094] Determining a target adsorption radius based on the first distance and a preset distance threshold; the preset distance threshold is a parameter for determining whether the first virtual object is within the adsorption range based on the displacement;

[0095] A circular boundary surrounding the first virtual object is determined according to the target adsorption radius and the center point of the bounding box.

[0096] Optionally, calculate the distance from the target starting point to each point on the contour of the target virtual object using the following method:

[0097] An application programming interface in the game engine is called to calculate the distance from a target starting point to each point on a contour line of a target virtual object, where the target starting point is the first starting point or the second starting point, and the target virtual object is the first virtual object or the second virtual object.

[0098] Optionally, the preset requirement includes the shortest distance among all distances calculated from the target starting point to each point on the contour line of the target virtual object, the target starting point is the first starting point or the second starting point, and the target virtual object is the first virtual object or the second virtual object.

[0099] The implementation of each module in the virtual object interaction device 600 may refer to the above-mentioned related embodiments, and will not be described in detail in this embodiment.

[0100] The embodiment of the present disclosure further provides a computer-readable medium having a computer program stored thereon, which implements the steps of the above-mentioned virtual object interaction method when executed by a processing device.

[0101] The present disclosure also provides an electronic device, including:

[0102] a storage device having a computer program stored thereon;

[0103] The processing device is configured to execute the computer program in the storage device to implement the steps of the above-mentioned virtual object interaction method.

[0104] Reference is now made to FIG7 , which illustrates a schematic diagram of the structure of an electronic device 700 suitable for implementing embodiments of the present disclosure. Terminal devices in embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. The electronic device illustrated in FIG7 is merely an example and should not limit the functionality or scope of use of embodiments of the present disclosure.

[0105] As shown in Figure 7, electronic device 700 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 into a random access memory (RAM) 703. Various programs and data required for the operation of electronic device 700 are also stored in RAM 703. Processing device 701, ROM 702, and RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to bus 704.

[0106] Typically, the following devices may be connected to the I / O interface 705: an input device 706 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 708 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 709. The communication device 709 may allow the electronic device 700 to communicate with other devices wirelessly or by wire to exchange data. Although FIG. 7 shows the electronic device 700 with various devices, it should be understood that not all of the devices shown are required to be implemented or present. More or fewer devices may be implemented or present instead.

[0107] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 709, or installed from the storage device 708, or installed from the ROM 702. When the computer program is executed by the processing device 701, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.

[0108] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.

[0109] In some embodiments, the electronic devices can communicate using any currently known or later developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or later developed network.

[0110] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0111] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: displays a virtual scene, which includes a first virtual object and at least one second virtual object; in response to the first virtual object being located in an area associated with the at least one second virtual object, determines whether the first virtual object is in an adsorption range based on the displacement between the first virtual object and the second virtual object; and in response to determining that the first virtual object is in the adsorption range, controls the first virtual object to contact the second virtual object.

[0112] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0113] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0114] The modules described in the embodiments of the present disclosure may be implemented in software or hardware, wherein the name of a module does not necessarily limit the module itself.

[0115] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.

[0116] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0117] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.

[0118] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0119] Although the subject matter has been described using language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims. Regarding the apparatus in the above-described embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments related to the method and will not be elaborated upon here.

Claims

1. A virtual object interaction method, comprising: Displaying a virtual scene, wherein the virtual scene includes a first virtual object and at least one second virtual object; In response to the first virtual object being located in an area associated with at least one of the second virtual objects, determining whether the first virtual object is in an adsorption range based on a displacement between the first virtual object and the second virtual object; In response to determining that the first virtual object is in the adsorption range, the first virtual object is controlled to contact the second virtual object.

2. The method according to claim 1, wherein: In response to the first virtual object moving to an area associated with at least one of the second virtual objects, determining whether the first virtual object is in an adsorption range based on a displacement between the first virtual object and the second virtual object includes: In response to the first virtual object moving to an area associated with at least one of the second virtual objects, taking a preset point of the first virtual object as a first starting point, calculating a distance from the first starting point to each point on a contour line of the second virtual object, and in response to the distance meeting a preset requirement, determining the point corresponding to the distance as a second starting point; Calculating the distance from the second starting point to each point on the contour line of the first virtual object, and in response to the distance meeting the preset requirement, determining whether the point corresponding to the distance coincides with the first starting point, and in response to not coinciding, using the point as a new first starting point; In response to the coincidence, determining a displacement between the first virtual object and the second virtual object according to the coordinates of the second starting point and the coordinates of the first starting point; Based on the displacement, it is determined whether the first virtual object is in an adsorption range.

3. The method according to claim 1, further comprising: Determine a circular boundary surrounding the first virtual object, wherein each point on the contour line of the first virtual object is located inside the circular boundary; Determining whether the second virtual object intersects with the circular boundary; In the case where the second virtual object intersects the circular boundary, it is determined that the first virtual object is located in a region associated with at least one of the second virtual objects.

4. The method according to claim 3, wherein: The determining a circular boundary surrounding the first virtual object includes: Determine a bounding box of the first virtual object, wherein a distance between a center point of the bounding box and a vertex of the bounding box is a first distance; Determine a target adsorption radius based on the first distance and a preset distance threshold, wherein the preset distance threshold is a parameter for determining whether the first virtual object is within the adsorption range based on the displacement; The circular boundary surrounding the first virtual object is determined according to the target adsorption radius and the center point of the bounding box.

5. The method according to claim 2, wherein: The distance from the target starting point to each point on the contour of the target virtual object is calculated as follows: Calling an application programming interface in the game engine to calculate the distance from the target starting point to each point on the contour line of the target virtual object, wherein the target starting point is the first starting point or the second starting point, and the target virtual object is the first virtual object or the second virtual object.

6. The method according to claim 2, wherein: The preset requirement includes the shortest distance among all distances from the calculated target starting point to each point on the contour line of the target virtual object, wherein the target starting point is the first starting point or the second starting point, and the target virtual object is the first virtual object or the second virtual object.

7. A virtual object interaction device, comprising: A display module, configured to display a virtual scene, wherein the virtual scene includes a first virtual object and at least one second virtual object; a first determination module configured to determine whether the first virtual object is in an adsorption range based on a displacement between the first virtual object and the second virtual object in response to the first virtual object being located in an area associated with at least one of the second virtual objects; as well as The control module is configured to control the first virtual object to contact the second virtual object in response to determining that the first virtual object is in the adsorption range.

8. The device according to claim 7, wherein: The first determining module comprises: A first response submodule is configured to, in response to the first virtual object moving to an area associated with at least one of the second virtual objects, use a preset point of the first virtual object as a first starting point, calculate a distance from the first starting point to each point on a contour line of the second virtual object, and in response to the distance meeting a preset requirement, determine the point corresponding to the distance as a second starting point; A second response submodule is configured to calculate the distance from the second starting point to each point on the contour line of the first virtual object, and in response to the distance meeting the preset requirement, determine whether the point corresponding to the distance coincides with the first starting point, and in response to not coinciding, use the point as a new first starting point; The third response submodule is configured to respond to the coincidence according to the coordinates of the second starting point and the coordinates of the first starting point. Determine the displacement between the first virtual object and the second virtual object; The first determination submodule is configured to determine whether the first virtual object is in an adsorption range based on the displacement.

9. A computer readable medium having a computer program stored thereon, wherein: When the program is executed by a processing device, the method described in any one of claims 1 to 6 is implemented.

10. An electronic device, comprising: a storage device having a computer program stored thereon; as well as A processing device is configured to execute the computer program in the storage device to implement the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Target positioning method and device in virtual interaction scene and electronic equipment

    CN110147159A

  • Virtual object processing method and device, equipment and storage medium

    CN114445604A

  • Virtual object interaction method and device, storage medium and electronic equipment

    CN115721925A

  • Virtual object interaction method and device

    CN115888111A

  • Virtual object interaction method and device, medium and electronic equipment

    CN117753008A