Physical collision method and electronic device

CN122990133APending Publication Date: 2026-10-27HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510547188.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-27
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0003]发明人发现,相关技术中的3D互动壁纸在进行碰撞检测等处理时,性能开销比较大,导致电子设备出现功耗上升、帧率下降等问题

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122990133A_ABST
    Figure CN122990133A_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a physical collision method and an electronic device. The method comprises: receiving a first operation of a user; the first operation is used to instruct to display a first wallpaper; the first wallpaper is a 3D interactive wallpaper; the first wallpaper comprises a virtual target object, a virtual path and a virtual non-path area except the virtual path; in a virtual environment corresponding to the first wallpaper, the virtual target object can move along the virtual path; in response to the first operation, loading a graphic resource and convex polygon data of the first wallpaper; the area formed by the convex polygon data corresponds to part or all of the virtual non-path area; displaying the first wallpaper based on the graphic resource; defining a convex polygon collision body based on the convex polygon data; in response to a second operation of the user, performing physical collision based on the convex polygon collision body; the second operation is used to trigger the virtual target object to move in the virtual environment. The method can reduce the performance overhead of the electronic device, reduce the power consumption of the electronic device, and prevent the frame rate from falling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic technology, specifically to a physical collision method and an electronic device. Background Technology

[0002] In recent years, with the improvement of electronic device performance and the increasing demand for interactive experiences from users, 3D interactive wallpapers have been gradually introduced into electronic devices to enhance the interactivity between users and devices. 3D interactive wallpapers typically rely on physical collision technology. Specifically, physical collision involves processes such as collision detection and collision response. Taking a 3D maze wallpaper as an example, users can control the movement of dynamic virtual objects (such as virtual balls) in the 3D maze in real time through gravity sensing or touch operation. During this process, the electronic device performs collision detection, detecting whether the dynamic virtual objects collide with virtual obstacles (such as virtual walls). When a dynamic virtual object collides with a virtual obstacle, it performs an appropriate collision response, such as bouncing or decelerating.

[0003] The inventors discovered that 3D interactive wallpapers in related technologies incur significant performance overhead during collision detection and other processing, leading to problems such as increased power consumption and decreased frame rate in electronic devices. Summary of the Invention

[0004] This application provides a physical collision method and an electronic device that can reduce the performance overhead of the electronic device, reduce the power consumption of the electronic device, and prevent frame rate drop.

[0005] In a first aspect, this application provides a physical collision method, which is performed by an electronic device and includes:

[0006] The system receives a first user operation; the first operation instructs the display of a first wallpaper, which is a 3D interactive wallpaper. The first wallpaper includes a virtual target object, a virtual path, and a virtual non-path area excluding the virtual path. In the virtual environment corresponding to the first wallpaper, the virtual target object can move along the virtual path. In response to the first operation, the system loads the graphic resources and convex polygon data of the first wallpaper. The area formed by the convex polygon data corresponds to part or all of the virtual non-path area. The system displays the first wallpaper based on the graphic resources. The system defines a convex polygon collider based on the convex polygon data. In response to a second user operation, the system performs a physical collision based on the convex polygon collider. The second operation triggers the virtual target object to move in the virtual environment.

[0007] In the virtual environment simulated by the first wallpaper, the virtual target object is a movable virtual object. The virtual target object can be implemented using virtual colliders. The virtual target object can be different in different wallpapers. In a specific embodiment, the first wallpaper is a 3D maze wallpaper, and the virtual target object is a virtual ball within the 3D maze.

[0008] In the virtual environment simulated by the first wallpaper, the virtual path is also the movement path of the virtual target object. In other words, the virtual target object can move along the virtual path. That is, the virtual target object can move along the virtual path. The virtual target object can collide with the boundary of the virtual path.

[0009] In the virtual environment simulated by the first wallpaper, the virtual non-path region refers to the area outside the virtual path. It can be understood that at least part of the boundary of the virtual non-path region coincides with the boundary of the virtual path. Therefore, the virtual target object can collide with the boundary of the virtual path, which can also be understood as: the virtual target object can collide with a portion of the boundary of the non-virtual path (the boundary that coincides with the virtual path).

[0010] After receiving the user's first operation, the electronic device needs to display the first wallpaper (3D interactive wallpaper). On the other hand, after detecting the user's second operation, that is, during the movement of the virtual target object in the virtual environment, the electronic device needs to perform physical collision, including collision detection and collision response.

[0011] The physical collision method provided in this application, upon receiving a first operation, i.e., upon receiving an instruction to display a 3D interactive wallpaper, loads the graphic resources of the first wallpaper and the convex polygon data of the first wallpaper. The graphic resources of the first wallpaper can be used to render and display the first wallpaper to present a wallpaper interface with a 3D effect. The area formed by the convex polygon data of the first wallpaper corresponds to part or all of the virtual non-path area. That is, the area formed by the convex polygon data is part or all of the virtual non-path area. Specifically, the convex polygon data is 2D data, which can be obtained by segmenting the virtual non-path area in the 2D image corresponding to the first wallpaper. The convex polygon data is used to perform physical collision. The physical collision method provided in this application defines a convex polygon collision body based on the convex polygon data and performs physical collision based on the convex polygon collision body, thus having at least the following beneficial effects:

[0012] First, convex polygon data is 2D data, with a small data volume. Moreover, convex polygon data is simple, so it occupies less memory, is less likely to cause system lag, and reduces device performance overhead, thus improving user experience.

[0013] Secondly, defining a convex polygon collider based on convex polygon data results in a simple structure. During collision detection, only the normal axis of the convex polygon needs to be detected, significantly reducing the computational load for collision detection and response. Therefore, physical collision based on convex polygon colliders can greatly reduce the performance overhead and power consumption of electronic devices, and reduce the time spent on physical collision processing per frame, preventing frame drops, preventing frame rate drops, and improving user experience.

[0014] Third, the convex polygon collider is a 2D collider, which can perform 2D physics collisions through a 2D physics engine. The 2D physics engine is more lightweight, further reducing the performance overhead of electronic devices, further reducing the power consumption of electronic devices, and further preventing frame rate drops.

[0015] In one possible implementation, the graphics resource is 3D model data or 2D image data.

[0016] When the graphic resources are 3D model data, the rendered wallpaper has a better stereoscopic effect, the simulated virtual scene is more realistic, and the user's visual experience is improved.

[0017] When the graphic resource of the first wallpaper is 2D image data, this 2D image data contains 3D visual features that can present the display effect of the first wallpaper. Optionally, the corresponding 2D image data can be obtained by projecting, calibrating, or taking screenshots of the 3D model of the first wallpaper. When the graphic resource of the first wallpaper is 2D image data, the data volume is small and simple, the memory occupied by loading data is small, further reducing device performance overhead and improving user experience.

[0018] In one possible implementation, the first wallpaper includes multiple regions, the graphic resources include multiple graphic resource blocks corresponding one-to-one with the multiple regions, and the convex polygon data includes multiple convex polygon data blocks corresponding one-to-one with the multiple regions. Loading the graphic resources and convex polygon data of the first wallpaper includes: determining a target region from the multiple regions based on the screen size of the electronic device and the position of a virtual target object in the first wallpaper; the size of the target region is greater than or equal to the screen size of the electronic device, and the virtual target object is located in the target region; determining the target graphic resource block corresponding to the target region from the multiple graphic resource blocks; determining the target convex polygon data block corresponding to the target region from the multiple convex polygon data blocks; and loading the target graphic resource block and the target convex polygon data block.

[0019] It can be understood that a graphic resource block is a set of graphic resources representing a certain area in the first wallpaper. A convex polygon data block is a set of convex polygon data representing a certain area contained in the first wallpaper.

[0020] Optionally, the screen size can be represented by resolution, and the size of each area of ​​the first wallpaper can also be represented by resolution.

[0021] The target area is larger than or equal to the screen size of the electronic device, meaning the target area can cover the screen of the electronic device, allowing the screen to be fully displayed without any blank space; the virtual target object is located in the target area, meaning the area displayed on the screen contains the virtual target object.

[0022] In this implementation, the graphics resources are divided into multiple graphics resource blocks, and the convex polygon data is divided into multiple convex polygon data blocks. The target region is determined by the screen size and the position of the virtual target object. Based on the target region, the target graphics resource block corresponding to the target region is determined from the multiple graphics resource blocks, and the target convex polygon data block corresponding to the target region is determined from the multiple convex polygon data blocks. Then, the target graphics resource block and the target convex polygon data block are loaded. In this way, when the screen is fully displayed and the virtual target object is shown on the screen, only the image resource block and convex polygon data corresponding to the target region need to be loaded, reducing the amount of data loaded, improving loading speed, and reducing memory usage. Therefore, it can save memory for electronic devices and reduce device performance overhead. Furthermore, by dividing the graphics resources and convex polygon data into blocks, electronic devices with different screen sizes can select different graphics resource blocks and convex polygon data blocks. Therefore, this method can adapt to electronic devices with different screen sizes, eliminating the need to design multiple 3D models or 2D images, thus reducing design overhead.

[0023] In one possible implementation, displaying the first wallpaper based on graphic resources includes: displaying the target area of ​​the first wallpaper based on the target graphic resource block.

[0024] It is understandable that when the size of the target area is equal to the screen size of the electronic device, the electronic device displays the entire target area based on the target graphic resource block.

[0025] When the size of the target area is larger than the screen size of the electronic device, the electronic device displays a portion of the target area (same as the screen size) based on the target graphic resource block.

[0026] In one possible implementation, defining a convex polygon collider based on convex polygon data includes: defining a target convex polygon collider based on a target convex polygon data block.

[0027] In this implementation, the target convex polygon collider is defined based on the target convex polygon data block, eliminating the need to define all convex polygon colliders, simplifying the process and further reducing the performance overhead of the device.

[0028] In one possible implementation, in response to a second user action, performing a physical collision based on a convex polygon collider includes: in response to a second user action, performing a physical collision based on a target convex polygon collider.

[0029] In this implementation, physical collision is performed through the target convex polygon collider, eliminating the need for all convex polygon colliders to participate in the physical collision. This simplifies the collision detection and response process and further reduces device performance overhead.

[0030] In one possible implementation, the method further includes: in response to a change in the position of the virtual target object in the first wallpaper, if the position of the virtual target object meets a preset position condition, returning to the execution step: determining a target area from multiple areas based on the screen size of the electronic device and the position of the virtual target object in the first wallpaper.

[0031] In other words, after the position of the virtual target object changes, it can be determined whether data needs to be reloaded based on preset position conditions. If so, the above steps are repeated to redefine the target area, reload the target graphic resource block and target convex polygon data block corresponding to the target area, and re-render and display the interface. This achieves the interface update.

[0032] One possible implementation is that, when the position of a virtual target object changes, after the interface is updated, the graphics resource blocks and convex polygon data blocks in the invisible areas can be discarded to free up memory and further reduce performance overhead.

[0033] In one possible implementation, before loading the graphic resources and convex polygon data of the first wallpaper, the method further includes: dividing the graphic resources into blocks to obtain multiple graphic resource blocks that correspond one-to-one with multiple regions; and dividing the convex polygon data into blocks to obtain multiple convex polygon data blocks that correspond one-to-one with multiple regions.

[0034] In one possible implementation, a target region is determined from multiple regions based on the screen size of the electronic device and the position of the virtual target object in the first wallpaper. This includes: determining the number of screens of the electronic device; if the electronic device has only one screen, determining the target region from multiple regions based on the screen size of the electronic device and the position of the virtual target object in the first wallpaper; if the electronic device has multiple screens, determining candidate regions corresponding to each screen from multiple regions based on the size of each screen and the position of the virtual target object in the first wallpaper, and determining the union of the candidate regions corresponding to all screens of the electronic device as the target region; wherein the size of the target candidate region corresponding to the target screen is greater than or equal to the size of the target screen, and the virtual target object is located in the target candidate region, and the target screen is any one of the multiple screens of the electronic device.

[0035] It's understandable that in electronic devices with multiple screens, users might switch screens while displaying the first wallpaper. In this implementation, the target area is the union of candidate areas for all screens; that is, the target area includes candidate areas for all screens of the electronic device. This way, when loading data, the necessary graphics resources and convex polygon data for each screen can be loaded into memory. Therefore, when the user switches screens, there's no need to load data again; only the corresponding area needs to be rendered and displayed based on the new screen size, enabling fast display switching, improving the smoothness of screen transitions, and enhancing the user experience.

[0036] In one possible implementation, the electronic device includes a first screen in use, and displays a target area of ​​a first wallpaper based on a target graphic resource block, including: displaying a first candidate area based on a graphic resource block corresponding to a first candidate area in the target graphic resource block; the first candidate area is a candidate area corresponding to the first screen; and performing physical collision based on a target convex polygon collider in response to a second operation by the user, including: performing physical collision based on a convex polygon collider corresponding to the first candidate area in the target convex polygon collider in response to the second operation by the user.

[0037] In other words, when an electronic device uses the first screen, the graphical resources of the first candidate area corresponding to the first screen are used to display the interface, and physical collision is performed based on the convex polygon data of the first candidate area corresponding to the first screen. This simplifies the rendering and display workload, simplifies the physical collision processing process, and reduces the performance overhead of the electronic device.

[0038] In one possible implementation, the electronic device further includes a second screen, and the method further includes: in response to the user switching the screen used from the first screen to the second screen, displaying a second candidate region based on the graphics resource block corresponding to the second candidate region in the target graphics resource block; the second candidate region is a candidate region corresponding to the second screen; and in response to the user's second operation, performing a physical collision based on the convex polygon collider corresponding to the second candidate region in the target convex polygon collider.

[0039] In other words, when the screen used by the electronic device switches to the second screen, the graphical resource display interface is based on the second candidate area corresponding to the second screen, and physical collision is performed based on the convex polygon data of the second candidate area corresponding to the second screen. This simplifies the rendering and display workload, simplifies the physical collision processing process, and reduces the performance overhead of the electronic device.

[0040] Moreover, in this implementation, the same target graphic resource block and target convex polygon data block are loaded in the electronic device cache before and after the user switches screens. Furthermore, when displayed on different screens, the display is based on the position of the virtual target object, that is, the relative position of the virtual target object in the virtual environment is the same. Therefore, it can present a continuous display effect after switching screens, improving the user experience.

[0041] In one possible implementation, the screen is a logical screen of the electronic device.

[0042] It's understandable that the logical screen of most electronic devices is consistent with the physical screen, but in some electronic devices, the logical screen and physical screen are not consistent. For example, a pseudo-multi-screen device may have one physical screen, but multiple logical screens.

[0043] In this implementation, the target area is determined by the number of logical screens, and the display is based on the logical screens, which is consistent with the actual display logic of the electronic device. This improves the accuracy of display control and collision detection for electronic devices, especially pseudo-multi-screen devices.

[0044] In one possible implementation, the first operation is either triggering the setting of the first wallpaper or triggering the display of the interface containing the first wallpaper.

[0045] Optionally, the first operation may be, for example, setting a 3D interactive theme, setting a 3D interactive wallpaper as a lock screen wallpaper, setting a 3D interactive wallpaper as a desktop wallpaper, or setting a 3D interactive wallpaper as an always-on wallpaper.

[0046] Optionally, if the desktop wallpaper is the first wallpaper, the first operation can be an operation that triggers the display of the desktop, such as unlocking the screen. If the lock screen wallpaper is the first wallpaper, the first operation can be an operation that triggers the display of the lock screen interface, such as pressing the power button. If the always-on display wallpaper is the first wallpaper, the first operation can be an operation that triggers the display of the always-on display interface, such as lifting the electronic device or double-tapping the screen.

[0047] In one possible implementation, the first wallpaper is a 3D maze wallpaper.

[0048] In one possible implementation, before loading the graphic resources and convex polygon data of the first wallpaper, the method further includes: obtaining a 3D model of the first wallpaper; generating a corresponding 2D image based on the 3D model of the first wallpaper; marking the boundaries of a virtual path in the 2D image; determining concave polygons formed by the boundaries of non-path regions in the 2D image based on the boundaries of the virtual path; dividing the concave polygons into multiple convex polygons; and obtaining the data of the multiple convex polygons to obtain convex polygon data.

[0049] Optionally, the convex polygon can be a triangle, quadrilateral, convex pentagon, convex hexagon, etc.

[0050] Optionally, the boundaries of the virtual path can be defined using AI.

[0051] Optionally, the 2D image can be a projection of the 3D model of the first wallpaper, or a screenshot, etc.

[0052] In this implementation, concave polygons are generated based on 2D images by defining the boundaries of virtual paths. Concave polygons can then be easily and quickly obtained by segmentation, thus providing convex polygon data, simplifying the algorithm process, and improving its efficiency.

[0053] Secondly, this application provides an apparatus included in an electronic device, which has the function of implementing the behaviors of the electronic device in the first aspect and possible implementations thereof. The function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above-described functions. For example, a receiving module or unit, a processing module or unit, etc.

[0054] In one implementation, a physical collision device is provided, which can be applied to an electronic device. The physical collision device may include a receiving module, a loading module, a display module, and a physical collision processing module.

[0055] The receiving module is used to: receive a first operation from the user; the first operation is used to instruct the display of a first wallpaper, the first wallpaper is a 3D interactive wallpaper, the first wallpaper includes a virtual target object, a virtual path and a virtual non-path area other than the virtual path, in the virtual environment corresponding to the first wallpaper, the virtual target object can move along the virtual path;

[0056] The loading module is used to: in response to the first operation, load the graphic resources and convex polygon data of the first wallpaper; the area formed by the convex polygon data corresponds to part or all of the virtual non-path area;

[0057] The display module is used to: display the first wallpaper based on graphic resources;

[0058] The physics collision handling module is used to: define convex polygon colliders based on convex polygon data;

[0059] The physics collision handling module is also used to: perform physics collision based on a convex polygon collider in response to a second user operation; the second operation is used to trigger the virtual target object to move in the virtual environment.

[0060] Thirdly, this application provides an electronic device, which includes: one or more processors and a memory; the memory is coupled to one or more processors, and the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the electronic device to perform any method of the technical solution in the first aspect.

[0061] Fourthly, a chip system applied to an electronic device, the chip system comprising one or more processors, the one or more processors being used to invoke computer instructions to cause the electronic device to perform any one of the methods of the technical solution of the first aspect.

[0062] Optionally, the chip system may also include memory, which is connected to the processor via circuitry or wires.

[0063] Alternatively, the chip system may also include a communication interface.

[0064] Fifthly, this application provides a computer-readable storage medium including instructions that, when executed on an electronic device, cause the electronic device to perform any one of the methods in the first aspect of the technical solution.

[0065] Sixthly, this application provides a computer program product, which includes computer program code that, when executed on an electronic device, causes the electronic device to perform any one of the methods in the first aspect of the technical solution. Attached Figure Description

[0066] Figure 1 This is an example of a lock screen interface for a different electronic device provided in the embodiments of this application;

[0067] Figure 2 This is a schematic diagram of an example wallpaper setting process provided in an embodiment of this application;

[0068] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0069] Figure 4 This is a software structure block diagram of an electronic device provided in an embodiment of this application;

[0070] Figure 5 This is a flowchart illustrating an example of a physical collision method provided in an embodiment of this application;

[0071] Figure 6 This is a 2D image corresponding to a 3D maze scene provided in an embodiment of this application;

[0072] Figure 7This is a schematic diagram illustrating an example of generating graphic resources and convex polygon data for a 3D interactive wallpaper, provided in an embodiment of this application.

[0073] Figure 8 This is a flowchart illustrating another example of a physical collision method provided in an embodiment of this application;

[0074] Figure 9 This is a schematic diagram illustrating the principle of region division provided in an embodiment of this application;

[0075] Figure 10 This is a schematic diagram illustrating an example of region division provided in an embodiment of this application;

[0076] Figure 11 This is a flowchart illustrating yet another example of a physical collision method provided in this application embodiment;

[0077] Figure 12 This is a schematic diagram of the structure of a physical collision device provided in an embodiment of this application. Detailed Implementation

[0078] The technical solutions of the embodiments of this application will be described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; "and / or" in this text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of the embodiments of this application, "multiple" refers to two or more than two.

[0079] Hereinafter, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first," "second," or "third" may explicitly or implicitly include one or more of that feature.

[0080] References to "one embodiment" or "some embodiments" as described in this application specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this application specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0081] To better understand the embodiments of this application, the terms or concepts that may be involved in the embodiments are explained below.

[0082] 1. Wallpaper

[0083] In this embodiment, wallpaper refers to the background image or dynamic interface of an electronic device. Depending on the display effect, wallpapers can be categorized into static wallpapers, dynamic wallpapers, etc. Depending on the scenario and function, wallpapers can be categorized into lock screen wallpapers, desktop wallpapers, and always-on wallpapers, etc. Specifically, lock screen wallpapers are those displayed on the lock screen when the electronic device's screen is locked. Desktop wallpapers are those displayed on the desktop (main interface) of the electronic device. Always-on wallpapers are those displayed on the always-on screen when the electronic device's screen is off.

[0084] 2. 3D Interactive Wallpaper

[0085] 3D interactive wallpapers are a type of dynamic wallpaper, referring to wallpapers that feature dynamic display effects of 3D virtual scenes and enable physical interaction. Examples of 3D interactive wallpapers include 3D maze wallpapers, particle interactive wallpapers, 3D underwater world wallpapers, and 3D cityscape wallpapers.

[0086] For example, Figure 1 The example shown is a 3D maze lock screen wallpaper, illustrating the lock screen interfaces of different electronic devices. Figure 1 As shown, on the lock screen, the electronic device can display a 3D maze wallpaper. This wallpaper simulates a real maze scene, displaying a virtual map path 101, a virtual ball 102, a virtual hole 103, and other content. Users can move the virtual ball 102 along the virtual map path 101 using gravity sensing (e.g., tilting the device) or touch operations (e.g., dragging the virtual ball 102). When the virtual ball 102 collides with the boundary of the virtual map path 101 (which can be understood as virtual obstacles), it can change direction or slow down. When the virtual ball 102 enters the virtual hole 103, a preset game event is triggered, such as game failure.

[0087] 3. Physical collision

[0088] In this application, physical collision refers to virtual physical collision, that is, the phenomenon in which two or more objects come into contact and interact during movement in a virtual scene. Physical collision involves processes such as collision detection and collision response. Physical collision follows the laws of conservation of momentum and energy in dynamics. As mentioned above... Figure 1 In the example shown, the virtual ball 102 collides physically with the boundary of the virtual map path 101.

[0089] In a virtual environment, the core components for implementing physical collisions include: physical colliders (or simply colliders), rigid bodies, and physics engines.

[0090] 4. Collision body

[0091] Colliders are used to define or describe the physical boundaries of objects for collision detection. Colliders can be static or dynamic. A static collider is a collider whose position remains fixed in a virtual scene, typically used to represent immovable objects in the environment (such as the ground, walls, or fixed obstacles). Static colliders do not participate in the physics engine's motion calculations; they only serve as reference boundaries for collision detection. An example of a static collider is... Figure 1 The boundary of virtual map path 101 in the image. A dynamic collider is a movable collider that is subject to the laws of physics. A dynamic collider can respond to external forces, gravity, or user interactions (such as being pushed, falling, or bouncing upon impact). An example of a dynamic collider is... Figure 1 The virtual ball 102 in the image.

[0092] Additionally, colliders include a special type called triggers. Triggers are used to detect when objects (dynamic colliders) enter or leave an area, triggering game events such as trap activation. For example, a trigger might be... Figure 1 Virtual hole 103 in the middle.

[0093] In 3D virtual scenes, three-dimensional mesh colliders are often used. A three-dimensional mesh is a series of triangular facets, including vertex coordinate data, index coordinate data, normal data, and texture coordinates.

[0094] 5. Rigid body

[0095] Rigid bodies are used to give virtual objects (such as dynamic colliders) physical properties (mass, gravity, velocity, etc.) so that they can participate in physical simulations.

[0096] 6. Physics Engine

[0097] The physics engine is used for collision detection and collision response based on colliders.

[0098] 7. Collision Detection

[0099] In this application, collision detection refers to the detection and handling of physical collisions in a virtual scene. Specifically, collision detection involves determining whether dynamic and static colliders intersect (or contain or overlap), calculating the intersection point, predicting the intersection time, and predicting the motion path of the dynamic colliders.

[0100] 8. Collision Response

[0101] In this application, the collision response is calculated based on the collision detection results, such as the direction and speed of the rebound or sliding of the dynamic collider based on the collision normal and the mass of the dynamic collider.

[0102] The application scenarios and technical challenges of this application are described below.

[0103] The method provided in this application can be applied to wallpaper scenarios on electronic devices, including lock screen wallpaper scenarios, desktop wallpaper scenarios, and always-on wallpaper scenarios, without limitation. The wallpaper setting process will be explained first.

[0104] It's understandable that the way to set wallpapers can vary depending on the electronic device and the application (app) installed on it. For example, you can set the wallpaper within the device's settings app, or you can set it within a separate wallpaper app or theme app; there's no limitation on this. For ease of understanding, we'll use setting the wallpaper within the settings app as an example here.

[0105] For example, Figure 2 This is a schematic diagram of an example wallpaper setting process provided in an embodiment of this application. Taking a mobile phone as an example, as shown... Figure 2 As shown in Figure (a), the phone's home screen can display an icon 201 for the Settings app. When the user clicks the Settings app icon 201, the phone responds to the user's click and enters the Settings app interface 202, as shown... Figure 2 As shown in Figure (b), the settings app interface 202 includes desktop and personalization options 203. Users can tap the desktop and personalization options 203, and the phone responds by displaying the desktop and personalization interface 204, as shown in Figure (b). Figure 2 As shown in Figure (c).

[0106] The desktop and personalization interface 204 includes wallpaper options 205, theme options 206, and always-on display 207. Wallpaper option 205 is used to set the desktop wallpaper and lock screen wallpaper separately. Always-on display 207 is used to set the always-on display wallpaper. Theme option 206 is used to set the desktop and lock screen interfaces to the same theme, making the core content or style of the desktop and lock screen interfaces the same or similar, including wallpapers, time components, etc. In other words, the theme option 206 can be used to set both the desktop and lock screen wallpapers simultaneously. In some embodiments, theme option 206 can also set the always-on display, desktop, and lock screen interfaces to the same theme.

[0107] Here, we will use setting the wallpaper for the desktop and lock screen via theme option 206 as an example. Figure 2As shown in Figure (c), when the user clicks the theme option 206, the phone responds to the user's click and displays the theme interface 208, as follows. Figure 2 As shown in Figure (d), the theme interface 208 can include various types of themes, such as recommended themes, classic themes, and interactive themes. Interactive themes can include various types, such as the 3D maze theme 209. When a user clicks on the 3D maze theme 209, the phone responds by setting the desktop and lock screen themes to the 3D maze theme; therefore, both the desktop wallpaper and the lock screen wallpaper are set to the 3D maze wallpaper.

[0108] 3D interactive wallpapers can enhance user interaction with devices and improve user experience. However, during user interaction, 3D interactive wallpapers typically involve physical collisions, requiring collision detection and response. Collision detection in 3D interactive wallpapers generally relies on the 3D mesh data of the 3D model. This method has the following problems: First, the complex geometry of the 3D model (such as multi-layered structures and winding channels) leads to a surge in the amount of mesh data for physical collisions. The physics engine needs to calculate millions of polygon collisions frame by frame, requiring collision detection and response through complex mesh data. This places a significant burden on the central processing unit (CPU) or graphics processing unit (GPU) of electronic devices, resulting in high performance overhead, increased power consumption, and overheating of electronic devices, and even frame rate fluctuations, severely impacting user experience. Second, the complex mesh data leads to high runtime memory usage for the physics engine, which can easily cause stuttering or forced degradation in resource-constrained scenarios (such as background multitasking).

[0109] To address this, this application provides a physical collision method. This method loads the graphic resources of a 3D interactive wallpaper and the convex polygon data corresponding to a virtual non-path region, and renders and displays the wallpaper based on these resources to present a 3D effect. The virtual non-path region is the area in the (simulated) virtual scene corresponding to the 3D interactive wallpaper, excluding the virtual path. The convex polygon data corresponding to the virtual non-path region is 2D data, with a small data volume. Furthermore, the convex polygon data is simple, thus occupying less memory, reducing system lag, lowering device performance overhead, and improving user experience. In addition, this method defines a convex polygon collider based on the convex polygon data. When the user performs an interactive operation, physical collision is performed based on the convex polygon collider. Using the convex polygon collider for physical collision requires only a small amount of simple convex polygon collision calculations, reducing computational complexity, lowering device performance overhead, lowering device power consumption, preventing frame rate fluctuations, and improving user experience.

[0110] The structure of the electronic device to which the method provided in this application is applicable will be described below.

[0111] The physical collision method provided in this application can be applied to electronic devices that can install applications (APPs), such as mobile phones, tablets, wearable devices, in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, and personal digital assistants (PDAs). This application does not impose any restrictions on the specific type of electronic device.

[0112] For example, Figure 3 This is a schematic diagram of the structure of an electronic device 100 provided in an embodiment of this application. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0113] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0114] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0115] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.

[0116] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0117] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0118] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.

[0119] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

[0120] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses the layered architecture Android system as an example to exemplify the software structure of electronic device 100.

[0121] Figure 4 This is a software structure block diagram of an electronic device 100 according to an embodiment of this application. The layered architecture divides the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer. The application layer may include a series of application packages.

[0122] like Figure 4 As shown, the application package may include applications such as Settings, Wallpaper, Camera, Gallery, Calendar, Call, Map, Music, Video, and SMS. Among them, the Settings application and Wallpaper application can be used to set at least one of the following for electronic devices: desktop wallpaper, lock screen wallpaper, and always-on wallpaper.

[0123] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0124] like Figure 4 As shown, the application framework layer can include a Java framework layer (also known as the Java layer or framework layer) and a native framework layer (also known as the native layer or C++ framework layer). The Java layer can include a window manager, content providers, a view system, a phone manager, a resource manager, a notification manager, etc. The native layer can include a physics collision module, a rendering engine, and a surface composition module (SurfaceFlinger), etc.

[0125] A physics collision module is used to implement physical collisions. The physics collision module may include a graphics engine and a physics engine. The graphics engine is used to load the graphic resources of the 3D interactive wallpaper and the convex polygon data corresponding to non-path areas in the 3D interactive wallpaper. Alternatively, in some embodiments, the graphics engine is used to divide the graphic resources of the 3D interactive wallpaper into multiple graphic resource blocks, divide the convex polygon data into multiple convex polygon data blocks, and load the graphic resource blocks and convex polygon data blocks according to one or more of the following: the screen size of the electronic device, the position of the virtual target object in the 3D interactive wallpaper, and the number of screens of the electronic device. The physics engine is used to define convex polygon colliders based on the convex polygon data and perform physical collisions based on the convex polygon colliders. In addition, the physics engine is also used to assign physical properties to dynamic colliders through rigid bodies.

[0126] It is understood that the physics collision module shown in this embodiment is only an example. In other embodiments, physics collision can also be implemented using modules with other names or other structures. For example, the physics engine and the graphics engine can also be integrated into the same module.

[0127] The rendering engine is used to perform rendering. Optionally, the rendering engine can perform rendering based on a rendering thread. SurfaceFlinger is used to composite the rendered data to obtain image frames.

[0128] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.

[0129] Content providers store and retrieve data, making that data accessible to applications. This data can include videos, images, audio, phone calls made and received, browsing history and bookmarks, phone books, and more.

[0130] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.

[0131] The phone manager is used to provide communication functions for electronic device 100. For example, it manages call status (including connection and disconnection).

[0132] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.

[0133] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.

[0134] The Android runtime consists of core libraries and a virtual machine. The Android runtime is responsible for scheduling and managing the Android system.

[0135] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.

[0136] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0137] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.

[0138] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.

[0139] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.

[0140] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0141] A 2D graphics engine is a graphics engine for 2D drawing.

[0142] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.

[0143] For ease of understanding, the following embodiments of this application will be described using the following methods: Figure 3 and Figure 4 Taking the electronic device with the structure shown as an example, the physical collision method provided in the embodiments of this application will be specifically described in conjunction with the accompanying drawings and application scenarios.

[0144] Figure 5 This is a flowchart illustrating an example of a physical collision method provided in an embodiment of this application. The method includes:

[0145] S101, In response to the user's preset operation 1 (also known as the first operation), the graphics engine in the local layer loads the graphic resources and convex polygon data of the 3D interactive wallpaper (also known as the first wallpaper).

[0146] In this embodiment, 3D interactive wallpaper refers to wallpaper with a 3D effect that is ultimately presented on the interface. Under the 3D interactive wallpaper, the electronic device can respond to the user's interactive operations. As mentioned above, 3D interactive wallpaper can be used as desktop wallpaper, lock screen wallpaper, or always-on wallpaper, and there is no limitation in this regard.

[0147] It can be understood that the graphic resources of 3D interactive wallpapers are used to simulate (i.e., correspond to) a 3D virtual scene. The virtual scene corresponding to the 3D interactive wallpaper includes virtual target objects, virtual paths, and virtual non-path areas. Visually speaking, the 3D interactive wallpaper includes virtual target objects, virtual paths, and virtual non-path areas. The virtual non-path area is the area in the 3D interactive wallpaper excluding the virtual path. A virtual target object refers to a virtual object in the virtual scene that can move in response to a user's preset operation 2. A virtual path is the path that a virtual target object can traverse in the virtual scene. In other words, in the virtual scene corresponding to the 3D interactive wallpaper, the virtual target object can move along the virtual path. In the virtual scene, the virtual target object can collide with the boundary of the virtual path. It can be understood that the boundary of the virtual non-path area at least partially coincides with the boundary of the virtual path; therefore, in some cases, the collision between the virtual target object and the boundary of the virtual path also means the collision between the virtual target object and the boundary of the virtual non-path area.

[0148] The area formed by the convex polygon data corresponds to the virtual non-path area in the 3D interactive wallpaper.

[0149] User preset action 1 refers to the action that can trigger the display of the 3D interactive wallpaper. Specifically, user preset action 1 includes, but is not limited to: 1) triggering the setting of the 3D interactive wallpaper. For example, as mentioned above... Figure 2 As shown, you can set a 3D interactive theme, a 3D interactive wallpaper as the lock screen wallpaper, a 3D interactive wallpaper as the desktop wallpaper, or a 3D interactive wallpaper as the always-on wallpaper. 2) When the wallpaper is set to a 3D interactive wallpaper, the operation that triggers the display of the interface containing the 3D interactive wallpaper is executed. Specifically, if the desktop wallpaper is a 3D interactive wallpaper, the default operation 1 can be an operation that triggers the display of the desktop, such as unlocking the screen. If the lock screen wallpaper is a 3D interactive wallpaper, the default operation 1 can be an operation that triggers the display of the lock screen interface, such as pressing the power button. If the always-on wallpaper is a 3D interactive wallpaper, the default operation 1 can be an operation that triggers the display of the always-on screen interface, such as lifting the electronic device, double-tapping the screen, etc.

[0150] In simple terms, when the user's preset action 1 triggers the display of the 3D interactive wallpaper, the graphics engine is triggered to load the graphic resources and convex polygon data of the 3D interactive wallpaper. The graphic resources and convex polygon data of the 3D interactive wallpaper can be pre-processed and stored in a preset storage path. The process of generating the graphic resources and convex polygon data of the 3D interactive wallpaper will be further explained in subsequent embodiments.

[0151] Electronic devices can render interfaces with 3D visual features, i.e., interfaces with 3D effects, based on the graphic resources of 3D interactive wallpapers. In other words, the graphic resources of 3D interactive wallpapers are resources used to display interfaces with 3D effects. However, it should be understood that the graphic resources of 3D interactive wallpapers are not necessarily 3D resources. Optionally, the graphic resources of 3D interactive wallpapers can be 3D model data or 2D image data, without limitation. When the graphic resources of 3D interactive wallpapers are 2D image data, the 2D image data contains 3D visual features. It can be understood that visual features can include perspective features, projection features, geometric structure features, material features, lighting features, etc. 3D visual features refer to visual features that present a 3D effect. Specifically, 3D visual features, from a perspective perspective, exhibit a certain depth, with variations in size, distance, and vanishing point, thus conveying depth. From a projection perspective, they possess shadows or projected shapes, creating a three-dimensional effect. From a geometric structure perspective, they are complex structures built from cubes, with occlusion relationships at the edges, exhibiting hierarchy. From a material perspective, they possess contrast in light and shadow, simulating the direction of a light source. Furthermore, they possess texture, presenting the properties of an object. In short, a 2D image containing 3D visual features can be understood as the content within the 2D image presenting a 3D visual effect. That is, the attributes of a 2D image are two-dimensional (X-dimensional and Y-dimensional), but the content presented in the 2D image is 3D content; therefore, from a visual perspective, it has a 3D visual effect.

[0152] The model of a 3D interactive wallpaper can be converted into a corresponding 2D image through projection, calibration, etc. The 2D image (or 2D wallpaper) contains 2D paths corresponding to virtual paths in the virtual scene, and 2D non-path areas corresponding to virtual non-path areas. The 2D non-path areas can be divided into multiple convex polygons. That is, the area formed by multiple convex polygons corresponds to part or all of the virtual non-path area.

[0153] A convex polygon is defined as follows: if any one of the sides of a polygon is extended infinitely in both directions to form a straight line, all other sides lie on the same side of this straight line. The interior angles of a convex polygon are not anomalous angles (angles greater than 180° but less than 360°). The line segment between any two vertices of a convex polygon lies inside the polygon or on its edge. A convex polygon has no indentations and is entirely convex. The convex polygons involved in the embodiments of this application may include one or more of triangles, quadrilaterals, convex pentagons, etc. The convex polygon data is 2D data used for subsequent physical collision (collision detection and / or collision response), which will be explained in detail in later steps.

[0154] Optionally, in this application, the virtual scene corresponding to the 3D interactive wallpaper can be a 3D maze scene, a particle interactive scene, a 3D underwater world scene, a 3D cityscape scene, etc. Taking a 3D maze scene as an example, please refer to the above. Figure 1 The virtual target object is a virtual object in the maze scene that can move in response to a user's preset operation, such as a virtual ball; the virtual path is the path along which the virtual ball moves; the virtual non-path area is the area outside the virtual path, such as a virtual wall. The virtual ball may collide with the boundaries of the virtual path, and in some cases, such as the boundaries of the virtual wall. Figure 1 The 2D image corresponding to the 3D maze scene shown can be as follows: Figure 6 As shown.

[0155] Taking a 3D underwater world animation scene as an example, the virtual target object is an object in the underwater world scene that can move in response to the user's preset operation 2, such as a virtual diver character; the virtual path is the path that the virtual diver character can move along, and the virtual diver character can collide with the boundary of the virtual path. The virtual non-path area is the area outside the virtual path, such as virtual coral, virtual marine life, virtual bubbles, etc. The virtual diver character can collide with the boundary of the virtual path (that is, the boundary of the virtual non-path area), and in some cases, such as the boundary of virtual coral, the boundary of virtual marine life, and the boundary of virtual bubbles.

[0156] The loading of the graphics resources and convex polygon data of the 3D interactive wallpaper by the graphics engine can be understood as the graphics engine transferring the graphics resources and convex polygon data of the 3D interactive wallpaper from a low-speed storage medium to a high-speed cache or memory to accelerate processor access. It should be understood that the cache or memory of electronic devices is limited, and storing too much data can lead to significant performance overhead, resulting in increased device power consumption and frame rate fluctuations (such as frame rate drops). In this embodiment, the convex polygon data is 2D data, which is small in size and relatively simple, occupying less memory. Therefore, during the data loading stage, it can reduce device performance overhead, reduce device power consumption, and reduce frame rate fluctuations.

[0157] S102, The rendering engine performs rendering based on the graphic resources of the 3D interactive wallpaper to display the interface containing the 3D interactive wallpaper.

[0158] Specifically, when the graphic resource of the 3D interactive wallpaper is 3D model data, the rendering engine renders the 3D wallpaper based on the 3D model data to display the interface (desktop, lock screen, or always-on screen) containing the 3D interactive wallpaper. When the graphic resource of the 3D interactive wallpaper is 2D image data, the rendering engine renders a 2D image with 3D visual effects based on the 2D image data to display the interface containing the 3D interactive wallpaper.

[0159] The specific process of rendering based on the 3D interactive wallpaper's graphic resources by the rendering engine will not be elaborated here. After rendering, the final displayed interface containing the 3D interactive wallpaper can be, for example, as shown below. Figure 1 As shown.

[0160] S103, the physics engine defines (or sets) convex polygon colliders based on convex polygon data.

[0161] Since convex polygon data is 2D data, a 2D physics engine can be used for 2D physics collision detection and response. For example, the Box2D physics engine, the Unity physics engine, the Chipmunk physics engine, or the BulletPhysics physics engine can be used.

[0162] Specifically, the definition of a convex polygon collider can include: a) Vertex definition. The physics engine can sort the vertices of the convex polygon data in a clockwise (CW) or counterclockwise (CCW) order, ensuring they do not intersect. b) Physical property binding. The physics engine assigns parameters for physical properties such as mass, friction, and restitution to the collider.

[0163] In addition, the physics engine defines dynamic colliders based on the models corresponding to virtual target objects.

[0164] S104. In response to the user's preset operation 2 (also known as the second operation), the physics engine performs physical collision based on the convex polygon collider.

[0165] Preset Operation 2 is the operation used to trigger the response of the 3D interactive wallpaper, also known as the interactive operation. Specifically, Preset Operation 2 is used to trigger the movement of virtual target objects in the virtual environment. It should be understood that the corresponding Preset Operation 2 may be different for different devices and different scenarios of 3D interactive wallpapers. Taking a 3D maze wallpaper as an example, Preset Operation 2 can be a gravity sensor operation or a touch operation on a virtual target object.

[0166] When the electronic device detects preset operation 2, in response to preset operation 2, the physics engine can assign physical properties to the dynamic collider through rigid bodies, and perform 2D physical collision based on the convex polygon collider, including 2D collision detection and collision response.

[0167] Regarding 2D collision detection, in a specific embodiment, algorithms such as the Separating Axis Theorem (SAT) and the Gilbert–Johnson–Keerthi Algorithm (GJK) can be used. Taking the SAT algorithm as an example, 2D collision detection can include the following steps: a) Projecting all edge normals (a total of n1+n2 axes) of the two convex polygon colliders. b) If the projections of all n1+n2 axes overlap, the two convex polygon colliders collide; otherwise, they do not collide. It should be understood that, depending on the application scenario, the virtual target object can be a convex polygon collider or a spherical collider. When the virtual target object is a spherical collider, whether a collision occurs can be determined based on the center and radius of the spherical collider, as well as the distance between the center of the sphere and the edge of the convex polygon.

[0168] Regarding the collision response, at least the following processes are included: a) Calculating the collision normal and penetration depth. Specifically, the axis corresponding to the minimum translation vector (MTV) that leads to separation can be found to determine the collision normal. The penetration depth is determined by the projection interval of the two convex polygons onto the collision normal (i.e., the axis corresponding to the MTV). b) Velocity correction. Based on the law of conservation of momentum and the coefficient of restitution, the velocity is adjusted according to the object's mass, velocity, and collision normal, and the rebound direction and velocity loss are also adjusted.

[0169] It's understandable that performing physical collisions based on convex polygon colliders offers several advantages. Firstly, the convex polygon collider has a simple structure; collision detection only requires detecting the normal axis of the convex polygon, significantly reducing the computational load for collision detection and response. Therefore, physical collisions based on convex polygon colliders can greatly reduce the performance overhead and power consumption of electronic devices, and decrease the time spent on physical collision processing per frame, preventing frame drops and frame rate decreases, thus improving the user experience. Secondly, convex polygon colliders are 2D colliders, allowing for 2D physical collisions through a 2D physics engine. A 2D physics engine is more lightweight, which also reduces the performance overhead and power consumption of electronic devices, preventing frame rate drops.

[0170] The graphic resources and convex polygon data of the 3D interactive wallpaper in step S101 above can be pre-stored in a preset path on the electronic device. The generation process of the graphic resources and convex polygon data of the 3D interactive wallpaper is described below.

[0171] In a specific embodiment, when the graphic resources of the 3D interactive wallpaper are 2D image data, the graphic resources and convex polygon data of the 3D interactive wallpaper can be generated according to the following process. The execution subject of the following process can be a graphics engine or other modules.

[0172] 1) Obtain the 3D interactive wallpaper model.

[0173] 2) Generate the corresponding 2D image based on the 3D interactive wallpaper model.

[0174] Optionally, if the graphic resource of the 3D interactive wallpaper is 3D model data, the 3D interactive wallpaper model data obtained in step 1) can be stored in a preset storage path. If the graphic resource of the 3D interactive wallpaper is 2D image data, the 2D image generated in step 2) can be stored in a preset storage path.

[0175] Optionally, a screenshot of the 3D interactive wallpaper model can be captured and used as the corresponding 2D image. Alternatively, a 2D projection image of the 3D interactive wallpaper model can be generated and used as the 2D image.

[0176] 3) Define the boundaries of the 2D path in the 2D image.

[0177] Optionally, the boundaries of the 2D path can be manually defined or defined based on artificial intelligence (AI), without any limitation.

[0178] 4) Determine the concave polygon formed by the boundary of the 2D non-path region based on the boundary of the 2D path. The 2D non-path region is the region in the 2D image other than the 2D path.

[0179] Specifically, the boundaries of the 2D path are marked in the 2D image to fit the virtual path. It should be understood that after marking the boundaries of the 2D path, the boundaries divide the 2D image into two regions: one side is the 2D path region, and the other side is the 2D non-path region. The boundary of the 2D non-path region is a concave polygon. This concave polygon can be an irregular concave polygon.

[0180] See Figure 7 Continuing with the example of a 3D maze scene, such as... Figure 7 As shown in Figure (a), the boundaries of the 2D paths in the 2D image corresponding to the 3D maze model are marked with points and lines, shown as 701 (red points and lines) in the figure. Boundary 701 divides the 2D image into 2D path regions 702 and 2D non-path regions 703. The 2D non-path regions 703 form concave polygons. See also... Figure 7 In Figure (b), the boundary of the 2D non-path region 703 is shown as a blue line, and the shape of the boundary is a concave polygon.

[0181] A concave polygon is defined as follows: at least one side extends infinitely in both directions to form a straight line, with the other sides distributed on either side of this straight line. A concave polygon has at least one dominant angle among its interior angles. At least two vertices of a concave polygon have a line segment connecting them that lies outside the polygon. A concave polygon has at least one concave section in its structure.

[0182] 5) Divide the concave polygon into multiple convex polygons and store the data of the convex polygons.

[0183] See also Figure 7 ,like Figure 7 As shown in Figure (b), the 2D non-path region 703 of the convex polygon can be divided into convex polygons such as triangles and quadrilaterals. Different convex polygons are shown in different colors in the figure.

[0184] It is understood that the above process can be completed before the electronic device leaves the factory, or it can be triggered by a preset operation after the electronic device leaves the factory, and there is no limitation on this.

[0185] The above embodiments introduce a physical collision method that can reduce device performance overhead. Regarding the application of 3D interactive wallpapers, the inventors also found that in related technologies, electronic devices with different screen sizes and / or shapes (different resolutions) need to adapt 3D models with different structures, resulting in significant design overhead. For example, wearable devices such as smartwatches have small screens, mostly circular, requiring 3D models that can display small circular interactive wallpaper interfaces. Smartphones typically have rectangular screens, requiring 3D models that can display rectangular interactive wallpaper interfaces. Tablet computers typically have square or rectangular screens, and are relatively large, requiring 3D models that can display large square interactive wallpaper interfaces. Therefore, for these three types of electronic devices, at least four types of 3D models need to be adapted, leading to high design costs. Moreover, in related technologies, when loading 3D models and collider data, all data is loaded at once, resulting in high memory usage and significant performance overhead for the electronic device.

[0186] Based on this, the physical collision method provided in this application divides the graphic resources and convex polygon data of the 3D interactive wallpaper into blocks. When loading the graphic resources and convex polygon data of the 3D interactive wallpaper, the data blocks to be loaded are determined according to the screen size of the electronic device and the location of the virtual target object (corresponding to the dynamic collider), and the data is loaded in blocks. In this way, on the one hand, the same 3D model design can be reused for electronic devices with different screen resolutions, reducing design overhead; on the other hand, the memory usage of block-based data loading reduces performance overhead and device overhead.

[0187] For example, Figure 8 A flowchart illustrating another physical collision method provided in this application embodiment is shown below. Figure 8 As shown, step S101 above may include:

[0188] S1011. The graphics engine in the local layer divides the 3D interactive wallpaper into multiple regions, and divides the graphic resources and convex polygon data of the 3D interactive wallpaper into blocks according to the multiple regions, so as to obtain multiple graphic resource blocks corresponding to the multiple regions, and convex polygon data blocks corresponding to the multiple regions.

[0189] Specifically, the 3D interactive wallpaper can be divided into multiple regions according to a preset division method, based on its visual effects. Then, based on these regions, the graphic resources and convex polygon data of the 3D interactive wallpaper are further divided. Each graphic resource block corresponds to one region in the 3D interactive wallpaper, and each convex polygon data block corresponds to one region. A preset division method, for example, is to divide the 3D interactive wallpaper into n regions of equal size, where n is an integer greater than 2. For example, n could be 16.

[0190] Specifically, if the graphic resource of the 3D interactive wallpaper is 3D model data, then the 3D model data is divided into multiple model data blocks, and each model data block corresponds to a region of the 3D interactive wallpaper. If the graphic resource of the 3D interactive wallpaper is 2D image data, then the 2D image data is divided into multiple image data blocks, and each image data block corresponds to a region of the 2D image.

[0191] It can be understood that a graphic resource block is a set of graphic resources representing a certain area in a 3D interactive wallpaper. A convex polygon data block is a set of convex polygon data representing a certain area. Therefore, multiple graphic resource blocks correspond one-to-one with multiple polygon data blocks.

[0192] Of course, in other embodiments, multiple graphics resource blocks may correspond to one region, or multiple convex polygon data blocks may correspond to one region; this is not limited.

[0193] For example, Figure 9 This is a schematic diagram illustrating the principle of region division provided in an embodiment of this application. Taking the graphic resources of a 3D interactive wallpaper as 2D image data as an example, such as... Figure 9 As shown in Figure (a), the 3D interactive wallpaper can be divided into 16 equal-sized regions, which are shown as regions 1 to 16 in the figure. Correspondingly, the 2D image data is divided into 16 image data blocks, each corresponding to... Figure 9 A region in Figure (a). Thus, based on a single image data block, it is ultimately possible to display... Figure 9 An image of a region in figure (a). For example... Figure 9As shown in Figure (b), the convex polygon data can also be divided into 16 convex polygon data blocks, each corresponding to a region of the 3D interactive wallpaper, that is, to an image data block. The convex polygon data block corresponding to any image data block contains the data of all convex polygons within the region where that image data block is located. For example, Figure 9 In the diagram, convex polygon data block 1 corresponds to region 1, and convex polygon data block 1 includes the data of all convex polygons within region 1.

[0194] Multiple graphic resource blocks and multiple convex polygon data blocks can be stored in a preset storage path and a one-to-one correspondence can be established, or a correspondence can be established with each region of the 3D interactive wallpaper. For example, a correspondence can be established between graphic resource block 1 and region 1, and a correspondence can be established between convex polygon data block 1 and region 1.

[0195] Optionally, step S1011 can be executed before the electronic device leaves the factory, or it can be executed after the electronic device leaves the factory, triggered by preset conditions, such as by the user setting the wallpaper.

[0196] S1012. In response to the user's preset operation 1, the graphics engine determines a target area from multiple areas based on the screen size of the electronic device, the position of the virtual target object, etc. The target area is greater than or equal to the screen size, and the virtual target object is located within the target area.

[0197] The preset operation 1 is as described in the above embodiment and will not be repeated.

[0198] Optionally, screen size can be characterized by resolution. For example, in landscape orientation, the screen resolution can be 2400×1080, meaning there are 2400 pixels horizontally and 1080 pixels vertically. The size of 3D interactive wallpapers is similar.

[0199] The position of a virtual target object refers to its location within the virtual environment corresponding to the 3D interactive wallpaper.

[0200] Specifically, the graphics engine can determine m adjacent regions from n regions of the 3D interactive wallpaper, and these m adjacent regions form the target region. The target region satisfies the following conditions: 1) its size is greater than or equal to the screen size of the electronic device; 2) the current virtual target object is located within the target region.

[0201] S1013, The graphics engine determines the target graphics resource block corresponding to the target region from multiple graphics resource blocks.

[0202] S1014. The graphics engine determines the target convex polygon data block corresponding to the target region from multiple convex polygon data blocks.

[0203] S1015, The graphics engine loads the target graphics resource block and the target convex polygon data block.

[0204] As shown above, each graphic resource block corresponds one-to-one with multiple regions, and each convex polygon data block also corresponds one-to-one with multiple regions. Therefore, based on the regions included in the target region, the graphic resource block corresponding to the target region can be determined from among the multiple graphic resource blocks. The graphic resource block corresponding to the target region is called the target graphic resource block. Similarly, based on the regions included in the target region, the convex polygon data block corresponding to the target region can be determined from among the multiple convex polygon data blocks. The convex polygon data block corresponding to the target region is called the target graphic resource block.

[0205] Please see also Figure 9 and Figure 10 For example, dividing the 3D interactive wallpaper into 16 areas, such as Figure 10 As shown in Figure (a), if the electronic device is a mobile phone with a rectangular screen approximately equal in size to the eight areas of the 3D interactive wallpaper, and the virtual target object, i.e., the virtual ball, is currently located in area 2, then, based on the screen size and the position of the virtual ball, the target area can be determined to be the area composed of areas 1, 2, 5, 6, 9, 10, 13, and 14. The graphics engine then retrieves the graphics resource blocks and convex polygon data blocks corresponding to areas 1, 2, 5, 6, 9, 10, 13, and 14.

[0206] like Figure 10 As shown in Figure (b), if the electronic device is a tablet computer with a square screen of the same size as the 3D interactive wallpaper, and the current virtual ball is located in region 2, then the target region can be determined to be the region consisting of regions 1 to 16 (i.e., all the divided regions). Therefore, the target graphic resource block is all the divided graphic resource blocks, and the target convex polygon data block is all the divided convex polygon data blocks.

[0207] like Figure 10 As shown in Figure (c), if the electronic device is a smartwatch with a circular screen, the diameter of which is approximately equal to the length of two areas in the 3D interactive wallpaper, and the current virtual ball is located in area 2, then the target area can be determined to be the region composed of areas 1, 2, 5, and 6. The graphics engine then retrieves the graphics resource blocks and convex polygon data blocks corresponding to areas 1, 2, 5, and 6.

[0208] like Figure 10As shown in Figure (d), if the electronic device is a tablet computer with a rectangular screen approximately equal in size to the 12 areas of the 3D interactive wallpaper, and the current virtual ball is located in area 2, then the target area can be determined to be the region consisting of areas 1 to 12. The graphics engine then retrieves the graphics resource blocks and convex polygon data blocks corresponding to areas 1 to 12.

[0209] Depend on Figure 10 As can be seen, on the one hand, the method of this application divides the graphics resources and convex polygon data into blocks. Electronic devices with different screen sizes can select different graphics resource blocks and convex polygon data blocks. Therefore, this method can adapt to electronic devices with different screens without designing multiple 3D models or 2D images, thus reducing design overhead. On the other hand, when the graphics engine loads data and the rendering engine renders data, it can load and render only the graphics resource blocks and convex polygon data blocks corresponding to a portion of the area. That is, it is not necessary to load and render all graphics resources and all convex polygon data blocks, thus saving the memory of electronic devices and reducing the performance overhead of the devices.

[0210] Correspondingly, step S102 above may include:

[0211] S1021, The rendering engine performs rendering based on the target graphic resource block to display the display interface containing the target area in the 3D interactive wallpaper.

[0212] Correspondingly, step S103 above may include:

[0213] S1031, The physics engine defines the target convex polygon collider based on the target convex polygon data block.

[0214] In this step, the target convex polygon collider is defined based on the target convex polygon data block, eliminating the need to define all convex polygon colliders, simplifying the process and further reducing the performance overhead of the device.

[0215] Correspondingly, step S104 above may include:

[0216] S1041. In response to the user's preset operation 2, the physics engine performs physical collision based on the target convex polygon collider.

[0217] Preset operation 2 is the same as in the above embodiment, and will not be repeated here.

[0218] In this step, physical collision is performed through the target convex polygon collider, eliminating the need for all convex polygon colliders to participate in the physical collision, thus simplifying the collision detection and response process and further reducing equipment performance overhead.

[0219] It is understood that after step S1041, the method may further include the following steps:

[0220] S105. In response to a change in the position of the virtual target object, the graphics engine determines whether the target position meets the preset position conditions. If yes, it returns to step S1012; otherwise, it returns to step S105.

[0221] In other words, after the position of the virtual target object changes, the graphics engine can determine whether data needs to be reloaded based on preset position conditions. If so, it returns to steps S1012 to S1041 above to redefine the target area, reload the target graphics resource block and the target convex polygon data block, and re-render and display the interface. This achieves interface updates. Furthermore, after the interface update, data blocks in invisible areas can be discarded to free up memory and further reduce performance overhead.

[0222] If the target position does not meet the preset position conditions, return to step S105 to continue detecting changes in the position of the virtual target object in order to further determine whether data needs to be reloaded.

[0223] A virtual target object meeting preset positional conditions indicates that the interface needs to be updated, or is about to need an update. These preset positional conditions can be set according to actual needs; for example, they could be: the distance between the virtual target object and the edge of the virtual area corresponding to the currently displayed interface is less than a preset threshold. In other words, the virtual target object is relatively close to the screen edge.

[0224] In another embodiment of this application, when the electronic device includes multiple screens, the target graphic resource block and the target convex polygon data block can be determined according to the following process. Specifically, see... Figure 11 In step S1012 above, in response to the user's preset operation 1, the graphics engine determines the target area in the 3D interactive wallpaper based on the screen size of the electronic device, the position of the virtual target object, etc., including:

[0225] S201, In response to the user's preset operation 1, the graphics engine obtains the number of screens of the electronic device.

[0226] It's understandable that different types of electronic devices may have different numbers of screens. For a candybar phone, the number of screens is one, while for a foldable phone, the number of screens may be two or more.

[0227] Optionally, the number of screens in an electronic device can be either physical screens or logical screens, depending on the display logic of the device. When there are multiple logical screens, the electronic device can be called a pseudo-multi-screen device. In this type of device, the screen is physically a single screen, but logically, it is divided into multiple areas.

[0228] Specifically, in one implementation, the screen count parameter can be obtained through the display manager. If the screen count parameter is 1, it indicates that the electronic device is a single-screen device. If the screen count parameter is greater than 1, it indicates that the electronic device is a multi-screen device.

[0229] In another implementation, for pseudo-multi-screen devices, the number of logical screens can be determined by using a window manager to determine changes in window positions and by combining this with the screen's folding state.

[0230] S202. If the electronic device has only one screen, the graphics engine determines the target area in the 3D interactive wallpaper based on the screen size of the electronic device, the position of the virtual target object, etc.

[0231] S203. If the electronic device has multiple screens, the graphics engine determines candidate regions for each screen from multiple regions based on the size of each screen, the position of the virtual target object, etc. The size of each candidate region is greater than or equal to the size of the screen, and the virtual target object is located within that candidate region.

[0232] Taking any screen—the target screen—as an example, the candidate region corresponding to the target screen is called the target candidate region. The size of the target candidate region is greater than or equal to the size of the target screen, and the virtual target object is located within the target candidate region.

[0233] Step S204 is executed after step S203.

[0234] S204. The graphics engine determines the target region by the union of the candidate regions corresponding to all screens of the electronic device.

[0235] In other words, the target area includes candidate areas corresponding to all screens of the electronic device.

[0236] It is understandable that users may switch screens while an electronic device is displaying a 3D interactive wallpaper. In this embodiment, the target area includes candidate areas corresponding to all screens of the electronic device. In this way, when loading data, all the data required by each screen can be loaded into memory. Therefore, when the user switches screens, there is no need to load data again. It is only necessary to render and display the corresponding area according to the size of the switched screen, which can quickly switch displays, improve the smoothness of screen switching, and enhance the user experience.

[0237] Specifically, in a screen switching scenario, if the current electronic device is using screen 1 (also known as the first screen), then in step S204 above:

[0238] The above step S1021, where the rendering engine performs rendering based on the target graphics resource block to display a display interface containing the target area of ​​the 3D interactive wallpaper, may include:

[0239] The rendering engine performs rendering based on the graphics resource block corresponding to candidate region 1 in the target graphics resource block, so as to display a display interface containing candidate region 1 (also known as the first candidate region) on screen 1. Candidate region 1 is a candidate region determined from multiple regions of the 3D interactive wallpaper according to screen 1.

[0240] In step S1041 above, in response to the user's preset operation 2, the physics engine performs physical collision based on the target convex polygon collider, which may include:

[0241] In response to the user's preset operation 2, the physics engine performs physical collision based on the convex polygon collider of the candidate region 1 corresponding to screen 1 in the target convex polygon collider.

[0242] After the user switches screens, the electronic device performs the following actions:

[0243] In response to the user switching the screen from screen 1 to screen 2 (also known as the second screen), the rendering engine performs rendering based on the graphics resource block corresponding to candidate region 2 (also known as the second candidate region) in the target graphics resource block, so as to display the display interface containing candidate region 2 on screen 2. Candidate region 2 is a candidate region determined from multiple regions of the 3D interactive wallpaper based on screen 2.

[0244] In response to preset operation 2, the physics engine performs physical collision based on the convex polygon collider of the candidate region 2 corresponding to screen 2 in the target convex polygon collider.

[0245] In this implementation, the same target graphic resource block and target convex polygon data block are loaded in the electronic device cache before and after the user switches screens. Moreover, when displayed on different screens, the display is based on the position of the virtual target object, that is, the relative position of the virtual target object in the virtual environment is the same. Therefore, it can present a continuous display effect after switching screens, improving the user experience.

[0246] The foregoing has detailed examples of the physical collision methods provided in the embodiments of this application. It is understood that, in order to achieve the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in conjunction with the embodiments, but such implementation should not be considered beyond the scope of this application.

[0247] See Figure 12 This application also provides a physical collision device 1200, which can be applied to electronic devices and includes a receiving module 1201, a loading module 1202, a display module 1203, and a physical collision processing module 1204.

[0248] The receiving module 1201 is used to: receive a first operation from the user; the first operation is used to instruct the display of a first wallpaper, the first wallpaper is a 3D interactive wallpaper, the first wallpaper includes a virtual target object, a virtual path and a virtual non-path area other than the virtual path, and in the virtual environment corresponding to the first wallpaper, the virtual target object can move along the virtual path;

[0249] Loading module 1202 is used to: in response to the first operation, load the graphic resources and convex polygon data of the first wallpaper; the area formed by the convex polygon data corresponds to part or all of the virtual non-path area;

[0250] Display module 1203 is used for: displaying a first wallpaper based on graphic resources;

[0251] The physics collision handling module 1204 is used to: define convex polygon colliders based on convex polygon data;

[0252] The physics collision handling module 1204 is also used to: perform physics collision based on a convex polygon collider in response to a second operation by the user; the second operation is used to trigger the virtual target object to move in the virtual environment.

[0253] In one embodiment, the graphics resource is 3D model data or 2D image data.

[0254] In one embodiment, the first wallpaper includes multiple regions, the graphic resources include multiple graphic resource blocks corresponding one-to-one with the multiple regions, and the convex polygon data includes multiple convex polygon data blocks corresponding one-to-one with the multiple regions; the loading module 1202 is specifically used to: determine a target region from the multiple regions based on the screen size of the electronic device and the position of the virtual target object in the first wallpaper; the size of the target region is greater than or equal to the screen size of the electronic device, and the virtual target object is located in the target region; determine the target graphic resource block corresponding to the target region from the multiple graphic resource blocks; determine the target convex polygon data block corresponding to the target region from the multiple convex polygon data blocks; and load the target graphic resource block and the target convex polygon data block.

[0255] In one embodiment, the display module 1203 is specifically used to: display the target area of ​​the first wallpaper based on the target graphic resource block; the physical collision processing module 1204 is specifically used to: define the target convex polygon collider based on the target convex polygon data block; the physical collision processing module 1204 is also specifically used to: perform physical collision based on the target convex polygon collider in response to the user's second operation.

[0256] In one embodiment, the physical collision processing module 1204 is further configured to: in response to a change in the position of a virtual target object in the first wallpaper, if the position of the virtual target object meets a preset position condition, return to the execution step: determine a target area from multiple areas based on the screen size of the electronic device and the position of the virtual target object in the first wallpaper.

[0257] In one embodiment, the loading module 1202 is further configured to: divide the graphic resources into blocks to obtain multiple graphic resource blocks that correspond one-to-one with multiple regions; and divide the convex polygon data into blocks to obtain multiple convex polygon data blocks that correspond one-to-one with multiple regions.

[0258] In one embodiment, the loading module 1202 is specifically configured to: determine the number of screens of the electronic device; if the electronic device has only one screen, determine a target area from multiple areas based on the screen size of the electronic device and the position of the virtual target object in the first wallpaper; if the electronic device has multiple screens, determine candidate areas corresponding to each screen from multiple areas based on the size of each screen and the position of the virtual target object in the first wallpaper, and determine the union of the candidate areas corresponding to all screens of the electronic device as the target area; wherein the size of the target candidate area corresponding to the target screen is greater than or equal to the size of the target screen, and the virtual target object is located in the target candidate area, and the target screen is any one of the multiple screens of the electronic device.

[0259] In one embodiment, the electronic device includes a first screen in use, and the display module 1203 is specifically used to: display a first candidate region based on the graphic resource block corresponding to the first candidate region in the target graphic resource block; the first candidate region is the candidate region corresponding to the first screen; the physical collision processing module 1204 is specifically used to: in response to a second operation of the user, perform physical collision based on the convex polygon collider corresponding to the first candidate region in the target convex polygon collider.

[0260] In one embodiment, the electronic device further includes a second screen, and the display module 1203 is specifically configured to: in response to the user switching the screen used from the first screen to the second screen, display a second candidate region based on the graphics resource block corresponding to the second candidate region in the target graphics resource block; the second candidate region is the candidate region corresponding to the second screen; the physical collision processing module 1204 is specifically configured to: in response to the user's second operation, perform physical collision based on the convex polygon collider corresponding to the second candidate region in the target convex polygon collider.

[0261] In one embodiment, the screen is a logical screen of an electronic device.

[0262] In one embodiment, the first operation is to trigger the operation of setting the first wallpaper or to trigger the operation of displaying the interface where the first wallpaper is located.

[0263] In one embodiment, the first wallpaper is a 3D maze wallpaper.

[0264] This application embodiment can divide the electronic device into functional modules according to the above method example. For example, each function can be divided into a separate functional module, such as a detection unit, a processing unit, a display unit, etc., or two or more functions can be integrated into one module. The integrated module can be implemented in hardware or as a software functional module. It should be noted that the module division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.

[0265] It should be noted that all relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.

[0266] The electronic device provided in this embodiment is used to execute the above-described physical collision method, and therefore can achieve the same effect as the above-described implementation method.

[0267] When using integrated units, the electronic device may also include a processing module, a storage module, and a communication module. The processing module is used to control and manage the operation of the electronic device. The storage module supports the execution of stored program code and data. The communication module supports communication between the electronic device and other devices.

[0268] The processing module can be a processor or a controller. It can implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a digital signal processor (DSP), and a microprocessor, etc. The storage module can be a memory. The communication module can specifically be a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip, or other devices that interact with other electronic devices.

[0269] In one embodiment, when the processing module is a processor and the storage module is a memory, the electronic device involved in this embodiment can be a device having... Figure 3 The device with the structure shown.

[0270] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the physical collision method of any of the above embodiments.

[0271] This application also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned steps to implement the physical collision method described in the above embodiments.

[0272] In addition, embodiments of this application also provide an apparatus, which may specifically be a chip, component or module. The apparatus may include a connected processor and a memory; wherein the memory is used to store computer execution instructions, and when the apparatus is running, the processor may execute the computer execution instructions stored in the memory to cause the chip to execute the physical collision method in the above method embodiments.

[0273] In this embodiment, the electronic device, computer-readable storage medium, computer program product or chip are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding methods provided above, and will not be repeated here.

[0274] Through the above description of the embodiments, those skilled in the art will understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0275] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another apparatus, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0276] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0277] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0278] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0279] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A physical collision method, said method being performed by an electronic device, characterized in that, The method includes: The system receives a first operation from the user; the first operation is used to instruct the display of a first wallpaper, which is a 3D interactive wallpaper. The first wallpaper includes a virtual target object, a virtual path, and a virtual non-path area other than the virtual path. In the virtual environment corresponding to the first wallpaper, the virtual target object can move along the virtual path. In response to the first operation, the graphic resources and convex polygon data of the first wallpaper are loaded; the area formed by the convex polygon data corresponds to part or all of the virtual non-path area; The first wallpaper is displayed based on the aforementioned graphic resources; Define a convex polygon collider based on the convex polygon data; In response to a second user action, a physical collision is performed based on the convex polygon collider; the second action is used to trigger the virtual target object to move in the virtual environment.

2. The method according to claim 1, characterized in that, The graphic resources are 3D model data or 2D image data.

3. The method according to claim 1 or 2, characterized in that, The first wallpaper includes multiple regions, the graphic resources include multiple graphic resource blocks that correspond one-to-one with the multiple regions, and the convex polygon data includes multiple convex polygon data blocks that correspond one-to-one with the multiple regions; The loading of the graphic resources and convex polygon data of the first wallpaper includes: A target area is determined from the plurality of areas based on the screen size of the electronic device and the position of the virtual target object in the first wallpaper; the size of the target area is greater than or equal to the screen size of the electronic device, and the virtual target object is located in the target area; Determine the target graphic resource block corresponding to the target region from the plurality of graphic resource blocks; Determine the target convex polygon data block corresponding to the target region from the plurality of convex polygon data blocks; Load the target graphics resource block and the target convex polygon data block.

4. The method according to claim 3, characterized in that, The process of displaying the first wallpaper based on the graphic resource includes: Based on the target graphic resource block, the target area of ​​the first wallpaper is displayed; The definition of a convex polygon collider based on the convex polygon data includes: Define the target convex polygon collider based on the target convex polygon data block; The second user action, performing a physical collision based on the convex polygon collider, includes: In response to the user's second operation, a physical collision is performed based on the target convex polygon collider.

5. The method according to claim 3 or 4, characterized in that, The method further includes: In response to a change in the position of the virtual target object in the first wallpaper, if the position of the virtual target object meets a preset position condition, the process returns to the following step: determining a target area from the plurality of areas based on the screen size of the electronic device and the position of the virtual target object in the first wallpaper.

6. The method according to any one of claims 3 to 5, characterized in that, Before loading the graphic resources and convex polygon data of the first wallpaper, the method further includes: The graphic resources are divided into blocks to obtain multiple graphic resource blocks that correspond one-to-one with the multiple regions; The convex polygon data is divided into blocks to obtain multiple convex polygon data blocks that correspond one-to-one with the multiple regions.

7. The method according to any one of claims 4 to 6, characterized in that, The step of determining the target area from the plurality of areas based on the screen size of the electronic device and the position of the virtual target object in the first wallpaper includes: Determine the number of screens in the electronic device; If the electronic device has only one screen, then the target area is determined from the plurality of areas based on the screen size of the electronic device and the position of the virtual target object in the first wallpaper. If the electronic device has multiple screens, then based on the size of each screen and the position of the virtual target object in the first wallpaper, candidate regions corresponding to each screen are determined from the multiple regions respectively, and the union of the candidate regions corresponding to all screens of the electronic device is determined as the target region; wherein, the size of the target candidate region corresponding to the target screen is greater than or equal to the size of the target screen, and the virtual target object is located in the target candidate region, and the target screen is any one of the multiple screens of the electronic device.

8. The method according to claim 7, characterized in that, The electronic device includes a first screen in use, and the step of displaying the target area of ​​the first wallpaper based on the target graphic resource block includes: Based on the graphic resource block corresponding to the first candidate region in the target graphic resource block, the first candidate region is displayed; the first candidate region is the candidate region corresponding to the first screen. The step of performing a physical collision based on the target convex polygon collider in response to the user's second operation includes: In response to the user's second operation, a physical collision is performed based on the convex polygon collider corresponding to the first candidate region in the target convex polygon collider.

9. The method according to claim 8, characterized in that, The electronic device further includes a second screen, and the method further includes: In response to the user switching the screen from the first screen to the second screen, the second candidate region is displayed based on the graphics resource block corresponding to the second candidate region in the target graphics resource block; the second candidate region is the candidate region corresponding to the second screen. In response to the user's second operation, a physical collision is performed based on the convex polygon collider corresponding to the second candidate region in the target convex polygon collider.

10. The method according to any one of claims 7 to 9, characterized in that, The screen is the logical screen of the electronic device.

11. The method according to any one of claims 1 to 10, characterized in that, The first operation is either to trigger the setting of the first wallpaper or to trigger the display of the interface containing the first wallpaper.

12. The method according to any one of claims 1 to 11, characterized in that, The first wallpaper is a 3D maze wallpaper.

13. An electronic device, characterized in that, The electronic device includes: one or more processors, and memory; The memory is coupled to the one or more processors, the memory being used to store computer program code, the computer program code including computer instructions, the one or more processors invoking the computer instructions to cause the electronic device to perform the method as described in any one of claims 1 to 12.

14. A chip system, characterized in that, The chip system is applied to an electronic device, the chip system including one or more processors, the one or more processors being used to invoke computer instructions to cause the electronic device to perform the method as described in any one of claims 1 to 12.

15. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1 to 12.