Hierarchical management method and device based on Box2D
A management method and a technology of a management device, which are applied in special data processing applications, sports accessories, indoor games, etc., and can solve the problems of 2D planes without thickness and wear-through, etc.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0027] Please refer to figure 1 , a hierarchical management method based on Box2D, including steps:
[0028] S1. Send rays through Box2D according to the edge of the selected object, and record the contact point where the rays pass through the rigid body;
[0029] The step S1 is specifically:
[0030] Send rays through Box2D according to the left and right edges of the selected object, and record the contact point where each ray passes through the rigid body.
[0031] S2. Establish a table corresponding to the ray, and store the contact points of the ray into the table;
[0032] The step S2 is specifically:
[0033] Create a table corresponding to each ray, and store the contact points of this ray into the table.
[0034] S3. Traverse the nodes corresponding to all contact points in the table, and perform hierarchical management according to the nodes and the nodes in the hierarchical management table.
[0035] Described step S3 specifically comprises:
[0036] S31. Trav...
Embodiment 2
[0039] The difference between this embodiment and Embodiment 1 is that this embodiment will further illustrate how the above-mentioned Box2D-based hierarchical management method of the present invention is realized in combination with specific application scenarios:
[0040] When an object is touched, rays are sent through Box2D according to the left and right edges of the touched object, and the contact point where each ray passes through the rigid body is recorded.
[0041] The height of the contact point obtained by the ray is used as the basis. The higher the y value of the contact point, the smaller the level, and vice versa;
[0042] Create a table corresponding to each ray, and store the contact points of this ray into the table.
[0043] Specifically, the table corresponding to the left ray is the left table, and the table corresponding to the right ray is the right table;
[0044] Respectively traversing the nodes corresponding to all contact points in the left table...
Embodiment 3
[0048] Please refer to figure 2 , a hierarchical management device 1 based on Box2D, comprising a memory 2, a processor 3 and a computer program stored in the memory 2 and operable on the processor 3, the processor 3 implements the first embodiment when executing the program each step in the .
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 

