CN109558676B - Collision detection method and device, computing equipment and storage medium - Google Patents

Collision detection method and device, computing equipment and storage medium Download PDF

Info

Publication number
CN109558676B
CN109558676B CN201811436669.XA CN201811436669A CN109558676B CN 109558676 B CN109558676 B CN 109558676B CN 201811436669 A CN201811436669 A CN 201811436669A CN 109558676 B CN109558676 B CN 109558676B
Authority
CN
China
Prior art keywords
detected
granularity
objects
grid layer
interval
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811436669.XA
Other languages
Chinese (zh)
Other versions
CN109558676A (en
Inventor
梁宇轩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Xishanju Shiyou Technology Co ltd
Zhuhai Kingsoft Digital Network Technology Co Ltd
Original Assignee
Chengdu Xishanju Shiyou Technology Co ltd
Zhuhai Kingsoft Digital Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu Xishanju Shiyou Technology Co ltd, Zhuhai Kingsoft Digital Network Technology Co Ltd filed Critical Chengdu Xishanju Shiyou Technology Co ltd
Priority to CN201811436669.XA priority Critical patent/CN109558676B/en
Publication of CN109558676A publication Critical patent/CN109558676A/en
Application granted granted Critical
Publication of CN109558676B publication Critical patent/CN109558676B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/30Circuit design
    • G06F30/32Circuit design at the digital level
    • G06F30/333Design for testability [DFT], e.g. scan chain or built-in self-test [BIST]

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Evolutionary Computation (AREA)
  • Geometry (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Image Analysis (AREA)

Abstract

The application provides a collision detection method and device, computing equipment and storage medium, wherein the method comprises the steps of obtaining at least two objects to be detected and determining the object granularity of each object to be detected; establishing a corresponding grid layer according to the object granularity of each object to be detected, wherein the grid granularity of the grid layer is determined according to the object granularity of the object to be detected; determining grid layer coordinates of each object to be detected on a corresponding grid layer; and determining the collision relation of the at least two objects to be detected according to the grid layer coordinates of the at least two objects to be detected. By adopting the method, on the basis of ensuring the improvement of the collision detection performance, preprocessing and high-cost data structure reconstruction operation are abandoned, the system performance consumption is greatly saved, and the user experience is improved.

Description

Collision detection method and device, computing equipment and storage medium
Technical Field
The present application relates to the field of internet technologies, and in particular, to a collision detection method and apparatus, a computing device, and a storage medium.
Background
At present, collision detection is widely applied to different technical fields, such as games, animation production and the like. For most engines, movement and collisions between a large number of objects can cause a number of problems, and common collision detection methods include: BVH algorithm, quadtree algorithm, etc., but the complexity of BVH algorithm, quadtree algorithm, etc. is higher, many needs to be preprocessed or needs to reconstruct the data structure with higher cost, consumes a lot of expenditure, and has poor user experience effect.
Disclosure of Invention
In view of the foregoing, embodiments of the present disclosure provide a collision detection method and apparatus, a computing device and a storage medium, so as to solve the technical drawbacks in the prior art.
In a first aspect, an embodiment of the present disclosure provides a collision detection method, including:
acquiring at least two objects to be detected, and determining the object granularity of each object to be detected;
establishing a corresponding grid layer according to the object granularity of each object to be detected, wherein the grid granularity of the grid layer is determined according to the object granularity of the object to be detected;
determining grid layer coordinates of each object to be detected on a corresponding grid layer;
And determining the collision relation of the at least two objects to be detected according to the grid layer coordinates of the at least two objects to be detected.
Optionally, establishing a corresponding grid layer according to the object granularity of each object to be detected includes:
pre-establishing at least two object granularity intervals;
marking each object to be detected to a corresponding object granularity interval according to the object granularity of each object to be detected;
if the number of the objects to be detected recorded in the object granularity interval is greater than or equal to a preset threshold value, a corresponding grid layer is established for the object granularity interval.
Optionally, establishing a corresponding grid layer according to the object granularity of each object to be detected includes:
acquiring the object granularity of an ith object to be detected in the at least two objects to be detected, wherein i is a positive integer;
establishing at least two object granularity intervals by taking the object granularity of the ith object to be detected as an object granularity upper limit, wherein the maximum value of each object granularity interval does not exceed the object granularity upper limit;
if the object granularity of the (i+1) th object to be detected is smaller than the object granularity of the (i) th object to be detected, determining a corresponding object granularity interval according to the object granularity of the (i+1) th object to be detected;
If the object granularity of the (i+1) th object to be detected is larger than the object granularity of the (i) th object to be detected, establishing a new object granularity interval by taking the object granularity of the (i+1) th object to be detected as an updated object granularity upper limit;
marking each object to be detected to a corresponding object granularity interval according to the object granularity of each object to be detected;
if the number of the objects to be detected recorded in the object granularity interval is greater than or equal to a preset threshold value, a corresponding grid layer is established for the object granularity interval.
Optionally, the method further comprises:
if the number of the objects to be detected in the object granularity interval is smaller than a preset threshold value, marking the objects to be detected in the object granularity interval to a grid layer corresponding to an object granularity interval, which is adjacent to the object granularity interval to which the objects to be detected are marked, and the minimum value of the object granularity interval is not smaller than the maximum value of the object granularity interval in which the objects to be detected are located.
Optionally, the grid layer coordinates include an object granularity of the object to be detected, an abscissa of the object to be detected on the grid layer, and an ordinate of the object to be detected on the grid layer,
The determining the grid layer coordinates of each object to be detected on the corresponding grid layer comprises the following steps:
and converting the grid layer into a granularity coordinate system by taking the granularity of each object to be detected as a z axis, the abscissa of each object to be detected on the grid layer as an x axis and the ordinate of each object to be detected on the grid layer as a y axis, and determining the coordinate of each object to be detected on the granularity coordinate system.
Optionally, determining the collision relationship of the at least two objects to be detected according to the respective grid layer coordinates of the at least two objects to be detected includes:
and determining the collision relation of the at least two objects to be detected according to the coordinates of each object to be detected in the granularity coordinate system.
Optionally, determining the collision relationship of the at least two objects to be detected according to the coordinates of each of the at least two objects to be detected in the granularity coordinate system includes:
for the objects to be detected positioned on the same grid layer, determining a first collision relation of at least two objects to be detected according to the x-axis and y-axis coordinates of each object to be detected in the granularity coordinate system;
For the objects to be detected positioned on different grid layers, determining a second collision relation of the at least two objects to be detected according to the x-axis, y-axis and z-axis coordinates of each object to be detected in the granularity coordinate system;
and determining the collision relation of the at least two objects to be detected according to the first collision relation and the second collision relation.
In a second aspect, an embodiment of the present specification further provides a collision detecting apparatus including:
the first acquisition module is configured to acquire at least two objects to be detected and determine the object granularity of each object to be detected;
the first grid layer establishing module is configured to establish a corresponding grid layer according to the object granularity of each object to be detected, wherein the grid granularity of the grid layer is determined according to the object granularity of the object to be detected;
the grid layer coordinate determining module is configured to determine grid layer coordinates of each object to be detected on a corresponding grid layer;
and the collision relation determining module is configured to determine the collision relation of the at least two objects to be detected according to the grid layer coordinates of the at least two objects to be detected.
Optionally, the first mesh layer establishing module includes:
the interval establishing sub-module is configured to pre-establish at least two object granularity intervals;
the first marking submodule is configured to mark each object to be detected to a corresponding object granularity interval according to the object granularity of each object to be detected;
the second grid layer establishing sub-module is configured to establish a corresponding grid layer for the object granularity interval if the number of objects to be detected recorded in the object granularity interval is greater than or equal to a preset threshold value.
Optionally, the first mesh layer establishing module includes:
a second obtaining submodule configured to obtain an object granularity of an i-th object to be detected of the at least two objects to be detected, wherein i is a positive integer;
the second establishing submodule is configured to establish at least two object granularity intervals by taking the object granularity of the ith object to be detected as an object granularity upper limit, wherein the maximum value of each object granularity interval does not exceed the object granularity upper limit;
the first judging submodule is configured to determine a corresponding object granularity interval according to the object granularity of the (i+1) th object to be detected if the object granularity of the (i+1) th object to be detected is smaller than the object granularity of the (i) th object to be detected;
A second judging sub-module, configured to establish a new object granularity interval by taking the object granularity of the (i+1) th object to be detected as an updated object granularity upper limit if the object granularity of the (i+1) th object to be detected is greater than the object granularity of the (i) th object to be detected;
the second marking submodule is configured to mark each object to be detected to a corresponding object granularity interval according to the object granularity of each object to be detected;
the third grid layer establishing sub-module is configured to establish a corresponding grid layer for the object granularity interval if the number of objects to be detected recorded in the object granularity interval is greater than or equal to a preset threshold value.
Optionally, the apparatus further includes:
and the third marking module is configured to mark the objects to be detected in the object granularity interval to a grid layer corresponding to the object granularity interval, which is adjacent to the object granularity interval to which the objects to be detected are marked, and in which the minimum value of the object granularity interval is not less than the maximum value of the object granularity interval in which the objects to be detected are located, if the number of the objects to be detected in the object granularity interval is less than a preset threshold value.
Optionally, the grid layer coordinates include an object granularity of the object to be detected, an abscissa of the object to be detected on the grid layer, and an ordinate of the object to be detected on the grid layer,
The grid layer coordinate determination module is further configured to:
and converting the grid layer into a granularity coordinate system by taking the granularity of each object to be detected as a z axis, the abscissa of each object to be detected on the grid layer as an x axis and the ordinate of each object to be detected on the grid layer as a y axis, and determining the coordinate of each object to be detected on the granularity coordinate system.
Optionally, the collision relation determination module is further configured to:
and determining the collision relation of the at least two objects to be detected according to the coordinates of each object to be detected in the granularity coordinate system.
Optionally, the collision relation determining module includes:
the first collision relation determining submodule is configured to determine a first collision relation of at least two objects to be detected according to the x-axis coordinate and the y-axis coordinate of each object to be detected in the granularity coordinate system for the objects to be detected positioned on the same grid layer;
a second collision relation determining sub-module configured to determine, for objects to be detected located at different grid layers, a second collision relation of the at least two objects to be detected according to x-axis, y-axis and z-axis coordinates of each of the at least two objects to be detected in the granularity coordinate system;
A collision relationship determination sub-module configured to determine a collision relationship of the at least two objects to be detected from the first collision relationship and the second collision relationship.
In a third aspect, an embodiment of the present disclosure also provides a computing device including a memory, a processor, and computer instructions stored on the memory and executable on the processor, the processor executing the instructions to implement the steps of the collision detection method as described above when the instructions are executed by the processor.
In a fourth aspect, an embodiment of the present description also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the steps of the collision detection method as described above.
The application provides a collision detection method and device, computing equipment and storage medium, wherein the method comprises the steps of obtaining at least two objects to be detected and determining the object granularity of each object to be detected; establishing a corresponding grid layer according to the object granularity of each object to be detected, wherein the grid granularity of the grid layer is determined according to the object granularity of the object to be detected; determining grid layer coordinates of each object to be detected on a corresponding grid layer; and determining the collision relation of the at least two objects to be detected according to the grid layer coordinates of the at least two objects to be detected. By adopting the method, on the basis of ensuring the improvement of the collision detection performance, preprocessing and high-cost data structure reconstruction operation are abandoned, the system performance consumption is greatly saved, and the user experience is improved.
Drawings
FIG. 1 is a block diagram of a computing device provided by one or more embodiments of the present description;
FIG. 2 is a flow chart of a collision detection method provided in one or more embodiments of the present disclosure;
FIG. 3 is a schematic diagram of a grid layer structure in a collision detection method according to one or more embodiments of the present disclosure;
fig. 4 is a schematic structural diagram of a granularity coordinate system in a collision detection method according to one or more embodiments of the present disclosure;
fig. 5 is a schematic structural diagram of a collision relationship of an object to be detected in a multi-layer mesh layer according to one or more embodiments of the present disclosure;
FIG. 6 is a flow diagram of a collision detection method provided by one or more embodiments of the present disclosure;
FIG. 7 is a schematic view of an object granularity section of a collision detection method according to one or more embodiments of the present disclosure;
FIG. 8 is a schematic diagram of a structure of an object granularity section of a bucket for example according to one or more embodiments of the collision detection method provided in the present disclosure;
FIG. 9 is a schematic structural view of a collision detection device according to one or more embodiments of the present disclosure;
FIG. 10 is a time-consuming illustration of three collision detection provided in one or more embodiments of the present disclosure.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. The present application may be embodied in many other forms than those herein described, and those skilled in the art will readily appreciate that the present application may be similarly embodied without departing from the spirit or essential characteristics thereof, and therefore the present application is not limited to the specific embodiments disclosed below.
The terminology used in the one or more embodiments of the specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of the specification. As used in this specification, one or more embodiments and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in one or more embodiments of the present specification refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that, although the terms first, second, etc. may be used in one or more embodiments of this specification to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first may also be referred to as a second, and similarly, a second may also be referred to as a first, without departing from the scope of one or more embodiments of the present description. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "responsive to a determination", depending on the context.
First, terms related to one or more embodiments of the present invention will be explained.
Dorkeeper: chinese in the embodiments of the present specification is interpreted as "watchdog", which is a mesh layer determination system that determines the number of mesh layers corresponding to an incoming object and the mesh granularity of the mesh layers by monitoring the object that enters the system. The dorkeeper counts the sizes of all objects passing through the system by recording the sizes of the objects, and determines the number of layers of the grid layer to be built and the grid granularity of each grid layer by utilizing an algorithm of the dorkeeper to the network layer.
In the present specification, a collision detection method and apparatus, a computing device, and a storage medium are provided, and detailed description is given one by one in the following embodiments.
Fig. 1 is a block diagram illustrating a configuration of a computing device 100 according to an embodiment of the present description. The components of the computing device 100 include, but are not limited to, a memory 110 and a processor 120. Processor 120 is coupled to memory 110 via bus 130 and database 150 is used to store data.
Computing device 100 also includes access device 140, access device 140 enabling computing device 100 to communicate via one or more networks 160. Examples of such networks include the Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the internet. The access device 140 may include one or more of any type of network interface, wired or wireless (e.g., a Network Interface Card (NIC)), such as an IEEE802.11 Wireless Local Area Network (WLAN) wireless interface, a worldwide interoperability for microwave access (Wi-MAX) interface, an ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a bluetooth interface, a Near Field Communication (NFC) interface, and so forth.
In one embodiment of the present description, the other components of computing device 100 described above and not shown in FIG. 1 may also be connected to each other, such as by a bus. It should be understood that the block diagram of the computing device shown in FIG. 1 is for exemplary purposes only and is not intended to limit the scope of the present description. Those skilled in the art may add or replace other components as desired.
Computing device 100 may be any type of stationary or mobile computing device including a mobile computer or mobile computing device (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), mobile phone (e.g., smart phone), wearable computing device (e.g., smart watch, smart glasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or PC. Computing device 100 may also be a mobile or stationary server.
Wherein the processor 120 may perform the steps of the method shown in fig. 2. Fig. 2 is a schematic flow chart illustrating a collision detection method according to an embodiment of the specification, including steps 202 to 208.
Step 202: and acquiring at least two objects to be detected, and determining the object granularity of each object to be detected.
In one or more embodiments of the present disclosure, the number of the objects to be detected is at least two, or may be three or more, and the number of the objects to be detected is suitable for obtaining according to practical applications, which is not limited in any way.
In practical application, the obtained objects to be detected include at least two sets of objects to be detected, where the objects to be detected include, but are not limited to, regular or irregular graphics in a game scene, such as a character or an attack prop.
In one or more embodiments of the present disclosure, the dorkeepers may be used to directly detect the object granularity of each object to be detected after a suitable number of objects to be detected are obtained.
Step 204: and establishing a corresponding grid layer according to the object granularity of each object to be detected, wherein the grid granularity of the grid layer is determined according to the object granularity of the object to be detected.
In one or more embodiments of the present disclosure, the obtained at least two objects to be detected have different granularity, and a corresponding mesh layer is established according to the object granularity of each object to be detected, that is, each object to be detected having different object granularity will establish a corresponding mesh layer. Because the granularity of the at least two obtained objects to be detected is different, the number of the corresponding grid layers established according to the granularity of the objects to be detected is at least two or more.
Referring to fig. 3, if the number of the obtained objects to be detected is 3 and the object granularities of the 3 objects to be detected are all different, corresponding 3 mesh layers, namely, mesh layer 1, mesh layer 2 and mesh layer 3 are established according to the object granularity of each object to be detected.
In practical application, the number of the obtained objects to be detected and the number of the built grid layers are not in one-to-one correspondence, one grid layer is built corresponding to the objects to be detected with the same object granularity, and the number of the grid layers is determined according to the object granularity of the objects to be detected.
In one or more embodiments of the present disclosure, the mesh granularity of the mesh layer is determined according to the object granularity of the object to be detected, so as to ensure that the object to be detected can be mapped into the mesh of the mesh layer, so that the object granularity of the object to be detected is not greater than the mesh granularity of the mesh layer. In practical use, the mesh granularity of the mesh layer is larger than or equal to the object granularity of the object to be detected.
In one or more embodiments of the present disclosure, establishing a corresponding mesh layer according to an object granularity of each object to be detected includes:
pre-establishing at least two object granularity intervals;
Marking each object to be detected to a corresponding object granularity interval according to the object granularity of each object to be detected;
if the number of the objects to be detected recorded in the object granularity interval is greater than or equal to a preset threshold value, a corresponding grid layer is established for the object granularity interval.
In one or more embodiments of the present disclosure, the object granularity interval may be divided by using a variety of division algorithms, for example, an average division manner, an incremental or decremental division manner, and so on. The application is not limited to this, and reasonable division is performed according to actual needs.
In one or more embodiments of the present disclosure, the object granularity interval and the mesh layer are in non-one-to-one correspondence, and when the number of objects to be detected recorded in the object granularity interval is greater than or equal to a preset threshold, a corresponding mesh layer is established for the object granularity interval that meets the preset threshold.
For example, the preset threshold value is 20, and when the number of objects to be detected recorded in the object granularity interval is greater than or equal to 20, a corresponding grid layer is established for the object granularity interval meeting the preset threshold value.
In practical applications, besides determining whether to build up a grid layer by using a preset threshold, it may also be determined whether to build up a grid layer by using other methods, for example, when the ratio of the granularity interval of the previous object to the granularity interval of the next object is greater than or equal to 2 or 4, the corresponding grid layer may be built up for the granularity interval of the previous object.
Step 206: and determining grid layer coordinates of each object to be detected on the corresponding grid layer.
In one or more embodiments of the present disclosure, after establishing a corresponding grid layer according to an object granularity of each object to be detected, mapping each object to be detected into a corresponding grid layer, and determining grid layer coordinates of each object to be detected on the corresponding grid layer.
In one or more embodiments of the present disclosure, the grid layer coordinates include an object granularity of an object to be detected, an abscissa of the object to be detected on the grid layer, and an ordinate of the object to be detected on the grid layer.
When the grid layer coordinates include the object granularity of the object to be detected, the abscissa of the object to be detected on the grid layer and the ordinate of the object to be detected on the grid layer, determining the grid layer coordinates of each object to be detected on the corresponding grid layer includes:
and converting the grid layer into a granularity coordinate system by taking the granularity of each object to be detected as a z axis, the abscissa of each object to be detected on the grid layer as an x axis and the ordinate of each object to be detected on the grid layer as a y axis, and determining the coordinate of each object to be detected on the granularity coordinate system.
Referring to fig. 4, taking 2 objects to be detected as examples, 2 mesh layers established according to the object granularity of the objects to be detected as 2 layers, the coordinates of each object to be detected determined according to the granularity coordinate system will be described in detail.
Firstly, the 2 grid layers are converted into a granularity coordinate system, wherein the granularity coordinate system uses the granularity of an object as a z axis, the position of the object to be detected on a granularity plane is represented by an x axis and a y axis, and the coordinate of the central point of the object to be detected on the granularity plane is represented by the coordinate of the central point of the object to be detected on the granularity plane. It can be seen from the particle size coordinate system that the coordinates of the object a to be detected in the lower mesh layer in the particle size coordinate system are [ 6.5,5.5,2 ], that is, the object to be detected is on a plane with the particle size of 2mm, and the coordinates of the object to be detected on the plane are (6.5,5.5). The coordinates of the object B to be detected in the upper mesh layer in the granularity coordinate system are [ 6.5,5.5,4 ], that is, the object B to be detected is on a plane with granularity of 4mm, and the coordinates thereof on the plane are (6.5,5.5). Then, by mapping object a to the upper mesh layer, the mapping of object a overlaps with object B; or by mapping the object B to the lower mesh layer, the mapping of the object B overlaps with the object a, whereby it can be determined that the object a and the object B inevitably collide.
Step 208: and determining the collision relation of the at least two objects to be detected according to the grid layer coordinates of the at least two objects to be detected.
In one or more embodiments of the present disclosure, determining the collision relationship of the at least two objects to be detected according to the grid layer coordinates of each of the at least two objects to be detected includes:
and determining the collision relation of the at least two objects to be detected according to the coordinates of each object to be detected in the granularity coordinate system.
Wherein determining the collision relationship of the at least two objects to be detected according to the coordinates of each of the at least two objects to be detected in the granularity coordinate system includes:
for the objects to be detected positioned on the same grid layer, determining a first collision relation of at least two objects to be detected according to the x-axis and y-axis coordinates of each object to be detected in the granularity coordinate system;
for the objects to be detected positioned on different grid layers, determining a second collision relation of the at least two objects to be detected according to the x-axis, y-axis and z-axis coordinates of each object to be detected in the granularity coordinate system;
And determining the collision relation of the at least two objects to be detected according to the first collision relation and the second collision relation.
In actual use, firstly, an object to be detected is put into a plurality of matched grid layers according to the granularity of the object, then collision relation detection is carried out on the object to be detected in each grid layer to obtain a first collision detection result, cross-layer collision detection is carried out on the object to be detected in a plurality of grid layers, the collision relation of the object to be detected in the adjacent grid layers is detected to obtain a second collision detection result, and finally the final collision relation detection result of the object to be detected in the plurality of grid layers can be obtained from the first collision detection result and the second collision detection result.
Referring to fig. 5, a collision relation detection manner of an object to be detected will be described by taking three mesh layers a, b, and c as an example.
In fig. 5, a mesh layer a1 is a map of the mesh layer a.
The collision relation detection of the object to be detected comprises two modes, namely detection towards the direction of a father layer according to the coordinates of a grid layer with smaller object granularity and the coordinates of a grid layer with larger object granularity of the upper layer, which is called upward cross-layer detection; the other is to detect the direction of the sub-layer according to the coordinates of the grid layer with larger object granularity and the coordinates of the grid layer with smaller object granularity of the next layer, which is called as downward cross-layer detection.
The upward cross-layer detection mode specifically comprises the following steps: the object 1 in the grid layer b is mapped to a region 11 with the same coordinates in the grid layer a, and collision of the object 1 with the object in the grid layer a is detected. Firstly, the object 1 inevitably collides with the object in the region 11 with the same coordinates in the grid layer a, and then the collision detection is carried out on the object 1 and the object in 8 gray grid sub-regions around the region 11 with the same coordinates in the grid layer a according to the same-layer detection method.
The downward cross-layer detection mode specifically comprises the following steps: mapping a rectangular ABCD area corresponding to one object in the grid layer b into the grid layer c, and determining an object detection area in the grid layer c according to the rectangular ABCD area: and the rectangular A 'B' C 'D' area is obtained by outwards expanding the boundary of the rectangular ABCD area mapped on the grid layer C by a sub-layer partition size which is the size of one grid of the grid layer C.
In the downward cross-layer detection approach, it is also necessary to detect which objects in grid layer c collide with objects mapped in the rectangular ABCD area of grid layer c. Firstly, the object in the rectangular ABCD area will inevitably collide with the object in the rectangular a 'B' C 'D' area, and then the object in the rectangular ABCD area is collided with the object in the other gray grid sub-areas except the periphery of the corresponding rectangular ABCD area in the rectangular a 'B' C 'D' area according to the existing same-layer detection method.
In practical application, when collision detection is performed on objects to be detected in a single-layer grid layer, a Hash structure is adopted, a nine-grid detection mode is adopted in which one object to be detected occupies one grid, but the grid layers in the embodiment of the specification are multiple, the division granularity of each grid layer is different, the space grid granularity of each grid layer is different just like a quadtree, then the objects to be detected with different object granularity are placed in the grid layers with different grid granularity, when collision relation detection is performed on the objects to be detected in the same layer, the collision relation among the objects to be detected is detected in a nine-grid mode, and the collision relation among the objects to be detected in different layers is detected in a quadtree-like mode.
Therefore, the weight removing operation of the object to be detected is completely avoided, and because the objects to be detected with different sizes are placed in different grid layers, overlapping detection among the objects to be detected in the same layer is avoided, so that the collision detection precision of the objects to be detected is always accurate.
In one or more embodiments of the present disclosure, a Doorkeeper is first used to obtain an object granularity of each object to be detected, then a corresponding multi-layer mesh layer is built according to the object granularity, then each object to be detected is placed into a mesh layer matched with the mesh layer granularity according to the object granularity, so that after the obtained object to be detected can be detected in each layer of mesh layer internal collision relation, collision relation detection is performed across the mesh layers, a final collision relation detection result, that is, who collides with the object to be detected, is obtained, the multi-layer mesh partitioning method is used to perform collision relation detection on the object to be detected, and a Doorkeeper for performing mesh layer partitioning is designed, and according to the obtained object granularity of the object to be detected, a preset mesh layer partitioning algorithm is adopted to implement automatic partitioning of the mesh layers, so that the obtained collision relation detection precision is higher, and meanwhile, a large amount of expenses are saved.
The processor 120 may perform the steps of the method shown in fig. 6. Fig. 6 is a schematic flow chart diagram illustrating a collision detection method according to an embodiment of the specification, including steps 602 to 618.
Step 602: and acquiring at least two objects to be detected, and determining the object granularity of each object to be detected.
Step 604: and acquiring the object granularity of the ith object to be detected in the at least two objects to be detected, wherein i is a positive integer.
Step 606: and establishing at least two object granularity intervals by taking the object granularity of the ith object to be detected as an object granularity upper limit, wherein the maximum value of each object granularity interval does not exceed the object granularity upper limit.
Step 608: if the object granularity of the (i+1) th object to be detected is smaller than the object granularity of the (i) th object to be detected, determining a corresponding object granularity interval according to the object granularity of the (i+1) th object to be detected.
Step 610: if the object granularity of the (i+1) th object to be detected is larger than the object granularity of the (i) th object to be detected, establishing a new object granularity interval by taking the object granularity of the (i+1) th object to be detected as an updated object granularity upper limit.
Step 612: marking each object to be detected to a corresponding object granularity interval according to the object granularity of each object to be detected.
Step 614: if the number of the objects to be detected recorded in the object granularity interval is greater than or equal to a preset threshold value, a corresponding grid layer is established for the object granularity interval.
In one or more embodiments of the present disclosure, if the number of objects to be detected in the object granularity interval is smaller than a preset threshold, the objects to be detected in the object granularity interval are marked to a mesh layer corresponding to an object granularity interval adjacent to the object granularity interval to which the objects to be detected are marked, and the minimum value of the object granularity interval is not smaller than the maximum value of the object granularity interval in which the objects to be detected are located.
Referring to fig. 7, if the object granularity interval includes [ 6,4 ], [ 4,2 ], [ 2,1 ], where the preset threshold is 10, and the number of objects to be detected in the object granularity interval [ 4,2 ] is 8, and it may be determined that the number of objects to be detected in the interval is less than the preset threshold 10, marking the objects to be detected in the object granularity interval [ 4,2 ] to a mesh layer corresponding to the object granularity interval in which the objects to be detected are marked to the object granularity interval [ 4,2 ], and the minimum value of the object granularity interval is not less than the mesh layer corresponding to the object granularity interval of the maximum value 4 of the object granularity interval in which the objects to be detected are located, that is, the mesh layer corresponding to the object granularity interval [ 6,4 ]. The minimum value of the object granularity interval [ 6,4 ] is 4, the maximum value of the object granularity interval [ 4,2 ] is 4, and the object granularity interval of which the minimum value is not smaller than the object granularity interval [ 4,2 ] is [ 6,4 ].
In one or more embodiments of the present specification, the object granularity interval is simply referred to as a "bucket" for example.
Firstly, defining two constants step and c, after the dorkeeper obtains an object set to be detected, firstly obtaining the object granularity of one object i to be detected in the object set to be detected, then marking the object granularity of the object i to be detected as K, establishing a grid layer with the grid granularity of K, and then establishing n 'barrels' according to K by adopting a preset dividing mode, wherein the 'barrels' respectively comprise: the terms "k/step n, k/step (n-1)", …, [ k/step 2, k/step ] and [ k/step, k ] are used, i.e. the first "bucket" is represented by the interval [ k/step, k ], the second "bucket" is represented by the interval [ k/step 2, k/step ] and the nth "bucket" is represented by the interval [ k/step n, k/step (n-1) ", and other formulas may be used in practical application to divide the intervals of" bucket ", for example, the average division (the equal size of each interval) mentioned in the above embodiment may be selected according to the practical requirement, and the application is not limited in any way.
And after the object granularity of the second object i+1 to be detected is obtained, obtaining the object granularity of the second object i+1 to be detected.
If the object granularity of the first object i+1 to be detected is larger than the object granularity of the second object i+1 to be detected, a corresponding object granularity interval is found for the second object i+1 to be detected, and the second object i+1 to be detected is placed in a corresponding bucket, for example, if the object granularity size e [ k/step n, k/step (n-1) ] of the second object i+1 to be detected, the second object i+1 to be detected is placed in a bucket corresponding to the [ k/step n, k/step (n-1) ], and the "placement" herein does not mean that the object to be detected is placed in a bucket structure, and the bucket is a numerical container, and only the bucket +1 is put in this moment. After the second object i+1 to be detected is put into the barrel, checking the number of the objects to be detected in the barrel, if the number is larger than or equal to a threshold value c, establishing a grid layer with grid granularity equal to the right end point of the barrel interval, namely after the second object i+1 to be detected is put into the barrel corresponding to the k/step n, k/step n-1, the value of the barrel is larger than or equal to c, and establishing a grid layer with grid granularity equal to k/step n-1.
If the object granularity of the first object i+1 to be detected is smaller than that of the second object i+1 to be detected, then setting m=k step, establishing a 'bucket' with a grid granularity of m, establishing a grid layer with a grid granularity of m, checking whether the value of the 'bucket' is larger than or equal to a threshold value c, if not, deleting the grid layer with the grid granularity of k, putting the object in the 'bucket' into the grid layer with the grid granularity of m, modifying the variable k into m, namely always recording the right end point of the maximum interval of the variable k until all objects to be detected in the object set to be detected, acquired by the dorkeeper, establish the corresponding grid layer according to the rule, and then ending.
In practical application, after a detected object is deleted, whether the detected object is in a bucket corresponding to a maximum interval [ k/step, k ] needs to be judged, if not, the detected object is assumed to belong to the bucket, and then a grid layer with the grid granularity of b is deleted; if the value of the bucket is equal to 0 after deleting the detected object, deleting the grid layer with the grid granularity of k, reserving the grid layer with the grid granularity of k/step, modifying k/step into k, and sequentially modifying the rest grid granularity. Note that as long as the value of [ k/step, k ] is greater than 0, the mesh layer divided into the granularity k is not deleted regardless of whether it is smaller than c.
FIG. 8 shows a state diagram of the above object granularity interval shown in a "bucket" structure, in which the object granularity of the object to be detected is k, k/step 2, k/step 3, k/step 4, k/step 5, the "bucket" divided according to the object granularity includes [ k/step, k ], [ k/step 2, k/step ], [ k/step ] 3, k/step ], [ k/step ] 2 ], k/step [ 4, k/step [ 3 ], k/step [ 5, k/step [ 4 ], and the number of objects to be detected in the bucket [ k/step, k ] is smaller than c, the number of objects to be detected in the bucket [ k/step ] 2, k/step ] is smaller than c, the number of objects to be detected in the barrel [ k/step.
Step 616: and determining grid layer coordinates of each object to be detected on the corresponding grid layer.
Step 618: and determining the collision relation of the at least two objects to be detected according to the grid layer coordinates of the at least two objects to be detected.
In one or more embodiments of the present disclosure, a mesh layer is established in an object granularity interval, the object granularity interval is presented in a "bucket" concept, if one "bucket" has a mesh layer to be established, then objects in the "bucket" are placed in the one corresponding mesh layer, but if the number of objects in one "bucket" is too small, and no corresponding mesh layer is established, then objects in the "bucket" are placed in a mesh layer of a closest "bucket" with a mesh layer established on the right, following this rule, an optimal number of layers and mesh layers with granularity can be established according to the object granularities of all objects to be detected, so that when the objects to be detected use the mesh layer to perform collision relation detection, the detection result is more accurate and time-saving, and the experience effect of the user is greatly improved.
Referring to fig. 9, an embodiment of the present disclosure further provides a collision detecting apparatus, including:
A first obtaining module 902 configured to obtain at least two objects to be detected, and determine an object granularity of each of the objects to be detected;
a first mesh layer establishing module 904 configured to establish a corresponding mesh layer according to an object granularity of each object to be detected, where the mesh granularity of the mesh layer is determined according to the object granularity of the object to be detected;
a grid layer coordinate determining module 906 configured to determine grid layer coordinates of each object to be detected on its corresponding grid layer;
the collision relation determining module 908 is configured to determine a collision relation of the at least two objects to be detected according to respective grid layer coordinates of the at least two objects to be detected.
Optionally, the first mesh layer establishing module 904 includes:
the interval establishing sub-module is configured to pre-establish at least two object granularity intervals;
the first marking submodule is configured to mark each object to be detected to a corresponding object granularity interval according to the object granularity of each object to be detected;
the second grid layer establishing sub-module is configured to establish a corresponding grid layer for the object granularity interval if the number of objects to be detected recorded in the object granularity interval is greater than or equal to a preset threshold value.
Optionally, the first mesh layer establishing module 904 includes:
a second obtaining submodule configured to obtain an object granularity of an i-th object to be detected of the at least two objects to be detected, wherein i is a positive integer;
the second establishing submodule is configured to establish at least two object granularity intervals by taking the object granularity of the ith object to be detected as an object granularity upper limit, wherein the maximum value of each object granularity interval does not exceed the object granularity upper limit;
the first judging submodule is configured to determine a corresponding object granularity interval according to the object granularity of the (i+1) th object to be detected if the object granularity of the (i+1) th object to be detected is smaller than the object granularity of the (i) th object to be detected;
a second judging sub-module, configured to establish a new object granularity interval by taking the object granularity of the (i+1) th object to be detected as an updated object granularity upper limit if the object granularity of the (i+1) th object to be detected is greater than the object granularity of the (i) th object to be detected;
the second marking submodule is configured to mark each object to be detected to a corresponding object granularity interval according to the object granularity of each object to be detected;
The third grid layer establishing sub-module is configured to establish a corresponding grid layer for the object granularity interval if the number of objects to be detected recorded in the object granularity interval is greater than or equal to a preset threshold value.
Optionally, the apparatus further includes:
and the third marking module is configured to mark the objects to be detected in the object granularity interval to a grid layer corresponding to the object granularity interval, which is adjacent to the object granularity interval to which the objects to be detected are marked, and in which the minimum value of the object granularity interval is not less than the maximum value of the object granularity interval in which the objects to be detected are located, if the number of the objects to be detected in the object granularity interval is less than a preset threshold value.
Optionally, the grid layer coordinates include an object granularity of the object to be detected, an abscissa of the object to be detected on the grid layer, and an ordinate of the object to be detected on the grid layer,
the grid layer coordinate determination module 906 is further configured to:
and converting the grid layer into a granularity coordinate system by taking the granularity of each object to be detected as a z axis, the abscissa of each object to be detected on the grid layer as an x axis and the ordinate of each object to be detected on the grid layer as a y axis, and determining the coordinate of each object to be detected on the granularity coordinate system.
Optionally, the collision relation determination module 908 is further configured to:
and determining the collision relation of the at least two objects to be detected according to the coordinates of each object to be detected in the granularity coordinate system.
Optionally, the collision relation determining module includes:
the first collision relation determining submodule is configured to determine a first collision relation of at least two objects to be detected according to the x-axis coordinate and the y-axis coordinate of each object to be detected in the granularity coordinate system for the objects to be detected positioned on the same grid layer;
a second collision relation determining sub-module configured to determine, for objects to be detected located at different grid layers, a second collision relation of the at least two objects to be detected according to x-axis, y-axis and z-axis coordinates of each of the at least two objects to be detected in the granularity coordinate system;
a collision relationship determination sub-module configured to determine a collision relationship of the at least two objects to be detected from the first collision relationship and the second collision relationship.
In one or more embodiments of the present disclosure, the collision detection device uses a Doorkeeper to establish a plurality of grid layers for a set of objects to be detected, where the plurality of grid layers divide the number of layers and the grid granularity according to the object granularity of the objects to be detected in the set of objects to be detected, then each object to be detected in the set of objects to be detected is put into a matched grid layer to perform collision detection calculation, and the collision detection device has a characteristic of dynamic adjustment, so that a better grid layer establishment performance can be maintained regardless of the scene, and the number of layers and the grid granularity of the grid layer can be set by itself all the time, so that the detection precision is higher, the time consumption is less, and the user experience is improved when the objects to be detected perform collision detection in the optimal grid layer.
Referring to fig. 10, in one or more embodiments of the present disclosure, a collision detection method is provided for performing collision detection on an object by using a method for establishing multiple mesh layers, and a Doorkeeper may be used to automatically divide the number of layers of the mesh layers and the granularity of the mesh layers.
Comparing the collision detection method provided by one or more embodiments of the present disclosure with the grid division method and the quadtree in the prior art, it can be seen from fig. 10 that, when the collision detection method provided by one or more embodiments of the present disclosure performs collision detection on a plurality of objects, the collision detection time of the collision detection method of the present disclosure is far longer than that of the grid division method and the quadtree in the prior art, and the collision detection effect is also optimal.
An embodiment of the present disclosure also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the steps of the collision detection method as described above.
The above is an exemplary version of a computer-readable storage medium of the present embodiment. It should be noted that, the technical solution of the storage medium and the technical solution of the collision detection method belong to the same concept, and details of the technical solution of the storage medium, which are not described in detail, can be referred to the description of the technical solution of the collision detection method.
The computer instructions include computer program code that may be in source code form, object code form, executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the computer readable medium contains content that can be appropriately scaled according to the requirements of jurisdictions in which such content is subject to legislation and patent practice, such as in certain jurisdictions in which such content is subject to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
It should be noted that, for the sake of simplicity of description, the foregoing method embodiments are all expressed as a series of combinations of actions, but it should be understood by those skilled in the art that the present application is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present application. Further, those skilled in the art will appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily all required for the present application.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to the related descriptions of other embodiments.
The preferred embodiments of the application disclosed above are intended only to assist in the explanation of the application. Alternative embodiments are not intended to be exhaustive or to limit the application to the precise form disclosed. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the application and the practical application, to thereby enable others skilled in the art to best understand and utilize the application. The application is limited only by the claims and the full scope and equivalents thereof.

Claims (16)

1. A collision detection method, characterized by comprising:
acquiring at least two objects to be detected, and determining the object granularity of each object to be detected, wherein the object granularities of the at least two objects to be detected are different;
establishing a corresponding grid layer according to the object granularity of each object to be detected, wherein the grid granularity of the grid layer is determined according to the object granularity of the object to be detected;
determining grid layer coordinates of each object to be detected on a corresponding grid layer;
determining whether the mapping of any one of the at least two objects to be detected on the upper grid layer or the lower grid layer of the corresponding grid layer overlaps with the other object to be detected according to the grid layer coordinates of each of the at least two objects to be detected, and if so, determining that the at least two objects to be detected are necessarily collided, wherein the grid granularity of the upper grid layer is larger than that of the lower grid layer.
2. The method of claim 1, wherein establishing a corresponding mesh layer according to an object granularity of each of the objects to be detected comprises:
pre-establishing at least two object granularity intervals;
Marking each object to be detected to a corresponding object granularity interval according to the object granularity of each object to be detected;
if the number of the objects to be detected recorded in the object granularity interval is greater than or equal to a preset threshold value, a corresponding grid layer is established for the object granularity interval.
3. The method of claim 1, wherein establishing a corresponding mesh layer according to an object granularity of each of the objects to be detected comprises:
acquiring the object granularity of an ith object to be detected in the at least two objects to be detected, wherein i is a positive integer;
establishing at least two object granularity intervals by taking the object granularity of the ith object to be detected as an object granularity upper limit, wherein the maximum value of each object granularity interval does not exceed the object granularity upper limit;
if the object granularity of the (i+1) th object to be detected is smaller than the object granularity of the (i) th object to be detected, determining a corresponding object granularity interval according to the object granularity of the (i+1) th object to be detected;
if the object granularity of the (i+1) th object to be detected is larger than the object granularity of the (i) th object to be detected, establishing a new object granularity interval by taking the object granularity of the (i+1) th object to be detected as an updated object granularity upper limit;
Marking each object to be detected to a corresponding object granularity interval according to the object granularity of each object to be detected;
if the number of the objects to be detected recorded in the object granularity interval is greater than or equal to a preset threshold value, a corresponding grid layer is established for the object granularity interval.
4. A method according to claim 2 or 3, further comprising:
if the number of the objects to be detected in the object granularity interval is smaller than a preset threshold value, marking the objects to be detected in the object granularity interval to a grid layer corresponding to an object granularity interval, which is adjacent to the object granularity interval to which the objects to be detected are marked, and the minimum value of the object granularity interval is not smaller than the maximum value of the object granularity interval in which the objects to be detected are located.
5. The method of claim 1, wherein the grid layer coordinates include an object granularity of an object to be detected, an abscissa of the object to be detected on the grid layer, and an ordinate of the object to be detected on the grid layer,
the determining the grid layer coordinates of each object to be detected on the corresponding grid layer comprises the following steps:
and converting the grid layer into a granularity coordinate system by taking the granularity of each object to be detected as a z axis, the abscissa of each object to be detected on the grid layer as an x axis and the ordinate of each object to be detected on the grid layer as a y axis, and determining the coordinate of each object to be detected on the granularity coordinate system.
6. The method of claim 5, wherein determining the collision relationship of the at least two objects to be detected based on the respective grid layer coordinates of the at least two objects to be detected comprises:
and determining the collision relation of the at least two objects to be detected according to the coordinates of each object to be detected in the granularity coordinate system.
7. The method of claim 6, wherein determining the collision relationship of the at least two objects to be detected from the coordinates of each of the at least two objects to be detected in the granularity coordinate system comprises:
for the objects to be detected positioned on the same grid layer, determining a first collision relation of at least two objects to be detected according to the x-axis and y-axis coordinates of each object to be detected in the granularity coordinate system;
for the objects to be detected positioned on different grid layers, determining a second collision relation of the at least two objects to be detected according to the x-axis, y-axis and z-axis coordinates of each object to be detected in the granularity coordinate system;
and determining the collision relation of the at least two objects to be detected according to the first collision relation and the second collision relation.
8. A collision detection apparatus, characterized by comprising:
the device comprises a first acquisition module, a second acquisition module and a first detection module, wherein the first acquisition module is configured to acquire at least two objects to be detected and determine the object granularity of each object to be detected, and the object granularities of the at least two objects to be detected are different;
the first grid layer establishing module is configured to establish a corresponding grid layer according to the object granularity of each object to be detected, wherein the grid granularity of the grid layer is determined according to the object granularity of the object to be detected;
the grid layer coordinate determining module is configured to determine grid layer coordinates of each object to be detected on a corresponding grid layer;
the collision relation determining module is configured to determine whether the mapping of any one of the at least two objects to be detected on the upper grid layer or the lower grid layer of the corresponding grid layer overlaps with the other object to be detected according to the grid layer coordinates of each of the at least two objects to be detected, and if so, determine that the at least two objects to be detected inevitably collide, wherein the grid granularity of the upper grid layer is larger than that of the lower grid layer.
9. The apparatus of claim 8, wherein the first mesh layer establishment module comprises:
The interval establishing sub-module is configured to pre-establish at least two object granularity intervals;
the first marking submodule is configured to mark each object to be detected to a corresponding object granularity interval according to the object granularity of each object to be detected;
the second grid layer establishing sub-module is configured to establish a corresponding grid layer for the object granularity interval if the number of objects to be detected recorded in the object granularity interval is greater than or equal to a preset threshold value.
10. The apparatus of claim 8, wherein the first mesh layer establishment module comprises:
a second obtaining submodule configured to obtain an object granularity of an i-th object to be detected of the at least two objects to be detected, wherein i is a positive integer;
the second establishing submodule is configured to establish at least two object granularity intervals by taking the object granularity of the ith object to be detected as an object granularity upper limit, wherein the maximum value of each object granularity interval does not exceed the object granularity upper limit;
the first judging submodule is configured to determine a corresponding object granularity interval according to the object granularity of the (i+1) th object to be detected if the object granularity of the (i+1) th object to be detected is smaller than the object granularity of the (i) th object to be detected;
A second judging sub-module, configured to establish a new object granularity interval by taking the object granularity of the (i+1) th object to be detected as an updated object granularity upper limit if the object granularity of the (i+1) th object to be detected is greater than the object granularity of the (i) th object to be detected;
the second marking submodule is configured to mark each object to be detected to a corresponding object granularity interval according to the object granularity of each object to be detected;
the third grid layer establishing sub-module is configured to establish a corresponding grid layer for the object granularity interval if the number of objects to be detected recorded in the object granularity interval is greater than or equal to a preset threshold value.
11. The apparatus according to claim 9 or 10, further comprising:
and the third marking module is configured to mark the objects to be detected in the object granularity interval to a grid layer corresponding to the object granularity interval, which is adjacent to the object granularity interval to which the objects to be detected are marked, and in which the minimum value of the object granularity interval is not less than the maximum value of the object granularity interval in which the objects to be detected are located, if the number of the objects to be detected in the object granularity interval is less than a preset threshold value.
12. The apparatus of claim 8, wherein the grid layer coordinates include an object granularity of an object to be detected, an abscissa of the object to be detected on the grid layer, and an ordinate of the object to be detected on the grid layer,
the grid layer coordinate determination module is further configured to:
and converting the grid layer into a granularity coordinate system by taking the granularity of each object to be detected as a z axis, the abscissa of each object to be detected on the grid layer as an x axis and the ordinate of each object to be detected on the grid layer as a y axis, and determining the coordinate of each object to be detected on the granularity coordinate system.
13. The apparatus of claim 12, wherein the collision relationship determination module is further configured to:
and determining the collision relation of the at least two objects to be detected according to the coordinates of each object to be detected in the granularity coordinate system.
14. The apparatus of claim 13, wherein the collision relationship determination module comprises:
the first collision relation determining submodule is configured to determine a first collision relation of at least two objects to be detected according to the x-axis coordinate and the y-axis coordinate of each object to be detected in the granularity coordinate system for the objects to be detected positioned on the same grid layer;
A second collision relation determining sub-module configured to determine, for objects to be detected located at different grid layers, a second collision relation of the at least two objects to be detected according to x-axis, y-axis and z-axis coordinates of each of the at least two objects to be detected in the granularity coordinate system;
a collision relationship determination sub-module configured to determine a collision relationship of the at least two objects to be detected from the first collision relationship and the second collision relationship.
15. A computing device comprising a memory, a processor and computer instructions stored on the memory and executable on the processor, wherein execution of the instructions by the processor implements the steps of the method of any one of claims 1 to 7 when executed by the processor.
16. A computer readable storage medium storing computer instructions which, when executed by a processor, implement the steps of the method of any one of claims 1 to 7.
CN201811436669.XA 2018-11-28 2018-11-28 Collision detection method and device, computing equipment and storage medium Active CN109558676B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811436669.XA CN109558676B (en) 2018-11-28 2018-11-28 Collision detection method and device, computing equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811436669.XA CN109558676B (en) 2018-11-28 2018-11-28 Collision detection method and device, computing equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109558676A CN109558676A (en) 2019-04-02
CN109558676B true CN109558676B (en) 2023-11-10

Family

ID=65867632

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811436669.XA Active CN109558676B (en) 2018-11-28 2018-11-28 Collision detection method and device, computing equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109558676B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110505493B (en) * 2019-09-04 2022-07-15 广州方硅信息技术有限公司 Collision detection method based on game, game interaction method and live broadcast system
CN116036604B (en) * 2023-01-28 2023-05-30 腾讯科技(深圳)有限公司 Data processing method, device, computer and readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107292886A (en) * 2017-08-11 2017-10-24 厦门市美亚柏科信息股份有限公司 Object intrusion detection method and device based on mesh generation and neutral net
CN108446496A (en) * 2018-03-21 2018-08-24 景乾峰 Water front collision checking method and device in real time in a kind of marine simulator

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6069923B2 (en) * 2012-07-20 2017-02-01 セイコーエプソン株式会社 Robot system, robot, robot controller
US9989352B2 (en) * 2015-03-20 2018-06-05 Chuck Coleman Playing surface collision detection system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107292886A (en) * 2017-08-11 2017-10-24 厦门市美亚柏科信息股份有限公司 Object intrusion detection method and device based on mesh generation and neutral net
CN108446496A (en) * 2018-03-21 2018-08-24 景乾峰 Water front collision checking method and device in real time in a kind of marine simulator

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于网格包络的工业机器人仿真碰撞检测算法;赵亮等;《中国机械工程》;20170228(第03期);第68-73页 *
高级碰撞检测(二)——居于格子的大量单位的检测方法;lbq09047128;《CSDN博客》;20141220;第1-2页 *

Also Published As

Publication number Publication date
CN109558676A (en) 2019-04-02

Similar Documents

Publication Publication Date Title
CN110991311B (en) Target detection method based on dense connection deep network
CN109558676B (en) Collision detection method and device, computing equipment and storage medium
EP3428838A2 (en) Skin condition detection method and electronic device
CN112487210A (en) Abnormal device identification method, electronic device, and medium
CN108961316A (en) Image processing method, device and server
CN111617483A (en) Map editing method and device
CN106470435B (en) The method and system of identification WiFi groups
CN114205831B (en) Method, device, storage medium and equipment for determining optimization scheme
CN111491307A (en) Mobile broadband network signal strength grade determination method and device
CN114218421A (en) Resource recall method and device and network side equipment
CN111736751B (en) Stroke redrawing method, device and readable storage medium
CN116188917B (en) Defect data generation model training method, defect data generation method and device
CN112445704A (en) Test method, test device and storage medium
CN109493427B (en) Intelligent model training method and device and collision detection method and device
CN115238837B (en) Data processing method and device, electronic equipment and storage medium
CN111898276A (en) Overhead line model processing method and device, computer equipment and medium
CN111127481A (en) Image identification method and device based on TOF image communication area
CN116415652A (en) Data generation method and device, readable storage medium and terminal equipment
CN103675763B (en) A kind of based on hardware-accelerated vector quantization VTS radar video rendering method
CN110310354B (en) Vertex identification method and device in three-dimensional scene
CN111481108B (en) Repositioning method and device for sweeper
JP2023550926A (en) Neural network model-based depth estimation
CN108132992B (en) Personnel information basic address coding method and system and electronic equipment
CN112905792A (en) Text clustering method, device and equipment based on non-text scene and storage medium
CN108668285B (en) PCI planning method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 519000 Room 102, 202, 302 and 402, No. 325, Qiandao Ring Road, Tangjiawan Town, high tech Zone, Zhuhai City, Guangdong Province, Room 102 and 202, No. 327 and Room 302, No. 329

Applicant after: Zhuhai Jinshan Digital Network Technology Co.,Ltd.

Applicant after: CHENGDU XISHANJU SHIYOU TECHNOLOGY Co.,Ltd.

Address before: 519000 Room 102, 202, 302 and 402, No. 325, Qiandao Ring Road, Tangjiawan Town, high tech Zone, Zhuhai City, Guangdong Province, Room 102 and 202, No. 327 and Room 302, No. 329

Applicant before: ZHUHAI KINGSOFT ONLINE GAME TECHNOLOGY Co.,Ltd.

Applicant before: CHENGDU XISHANJU SHIYOU TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant