CN101615305A - The method and apparatus of collision detection - Google Patents

The method and apparatus of collision detection Download PDF

Info

Publication number
CN101615305A
CN101615305A CN200910161503A CN200910161503A CN101615305A CN 101615305 A CN101615305 A CN 101615305A CN 200910161503 A CN200910161503 A CN 200910161503A CN 200910161503 A CN200910161503 A CN 200910161503A CN 101615305 A CN101615305 A CN 101615305A
Authority
CN
China
Prior art keywords
model
collision
dough sheet
triangle
space
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.)
Granted
Application number
CN200910161503A
Other languages
Chinese (zh)
Other versions
CN101615305B (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN2009101615036A priority Critical patent/CN101615305B/en
Publication of CN101615305A publication Critical patent/CN101615305A/en
Application granted granted Critical
Publication of CN101615305B publication Critical patent/CN101615305B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a kind of method and apparatus of collision detection, belong to field of network game.Described method comprises: for first model and second model to be detected in the recreation generates the collision dough sheet respectively; Obtain the 3d space information in the collision dough sheet of first model, second model; And be converted to figure on the 2D plane, obtain first figure of first model and the second graph of second model; Detect first figure and second graph and whether intersect, if then first model and second model bump, otherwise, do not bump.Described device comprises: creation module, acquisition module, modular converter and detection module.The present invention is converted into the detection of figure in the 2D plane by the collision detection with the 3D model, has greatly reduced the calculated amount of collision detection, has shortened the time of collision detection, has improved the efficient of collision detection.

Description

The method and apparatus of collision detection
Technical field
The present invention relates to field of network game, particularly a kind of method and apparatus of collision detection.
Background technology
The collision of object is recurrent in recreation, and how the collision of inspected object is a very critical technical problems.Especially in the flight shooting game,, can greatly influence player's interest if can not address this problem well.Collision detection can be surveyed the physical edge of each object in the recreation, and whether each object that detects in the recreation bumps.When two 3D objects hit together, this collision detection technology can prevent that them from passing mutually.For example, the personage in recreation is when bumping against the wall, and the collision detection technology can be determined both positions and mutual interactively according to the characteristic between personage and the wall, thereby guarantees that this personage neither can be through walls and mistake can not knock wall down yet.
The collision detection that the commercial 3D recreation of success is at present generally adopted is BSP (Binary Space Partitioning, y-bend space segmentation) tree mode and a packing box mode.BSP tree is to be used for the data description of control detection order and direction, judges by the method for finding out two division surfaces between object whether two objects intersect, if the division surface existence does not then bump.Whether the packing box mode is exactly to adopt the square or the ball-type body of a description usefulness to wrap 3D subject integral body, or major part, calculate according to information such as describing distance with packing box, position then to bump.This square and ball-type body also can be replaced by other shapes.
By calculate realizing, this calculating is more complicated all usually in the 3D environment for existing collision detection technology, and it is also long to calculate the required time, and therefore, the efficient of collision detection is lower.
Summary of the invention
In order to solve the problem that prior art exists, the embodiment of the invention provides a kind of method and apparatus of collision detection.Described technical scheme is as follows:
A kind of method of collision detection, described method comprises:
For first model and second model to be detected in the recreation generates the collision dough sheet respectively;
Obtain the 3d space information in the collision dough sheet of 3d space information in the collision dough sheet of described first model and described second model;
With the 3d space information translation of obtaining is figure on the 2D plane, obtains first figure of described first model and the second graph of described second model respectively;
Whether detect described first figure and second graph and intersect, if then described first model and second model bump, otherwise described first model and second model do not bump.
Described for first model and second model to be detected in the recreation generates the collision dough sheet respectively, specifically comprise:
According to default rule, for first model and second model to be detected in the recreation generates the collision dough sheet respectively, described default rule is: the distance of the center of gravity of collision dough sheet and the center of gravity of model to be detected must not surpass default value.
Described default rule is specially: the cross section of the area maximum of collision dough sheet and model to be detected is on same plane.
Described is that first model and second model to be detected in the recreation generates respectively after the collision dough sheet, also comprises:
The identical name of collision dough sheet called after with the collision dough sheet and described second model of described first model;
Obtain the 3d space information in the collision dough sheet of 3d space information in the collision dough sheet of described first model and described second model, specifically comprise:
Search the collision dough sheet of described first model and second model according to described name, obtain the 3d space information in the collision dough sheet of 3d space information in the collision dough sheet of described first model and described second model.
After described first model and second model bump, also comprise:
For any model in described first model and second model, if the object under this model also comprises other model, then do not show this model, show described other model.
With the 3d space information translation of obtaining is figure on the 2D plane, specifically comprises:
When described 3d space information is the 3d space triangle information representing, the 3d space triangle information representing of obtaining is converted to triangle on the 2D plane;
When described 3d space information is the non-triangle information representing of 3d space, earlier the non-triangle information representing of described 3d space is converted to the 3d space triangle information representing, will obtain this 3d space triangle information representing again and be converted to triangle on the 2D plane.
A kind of device of collision detection, described device comprises:
Creation module is for first model and second model to be detected in the recreation generates the collision dough sheet respectively;
Acquisition module is used for obtaining the 3d space information in the collision dough sheet of the 3d space information of collision dough sheet of described first model and described second model;
Modular converter, the 3d space information translation that is used for that described acquisition module is obtained is the figure on the 2D plane, obtains first figure of described first model and the second graph of described second model respectively;
Whether detection module is used to detect described first figure and described second graph and intersects, if then described first model and second model bump, otherwise described first model and second model do not bump.
Described creation module specifically comprises:
Creating unit is used for according to default rule, and for first model and second model to be detected in the recreation generates the collision dough sheet respectively, described default rule is: the distance of the center of gravity of collision dough sheet and the center of gravity of model to be detected must not surpass default value.
Described default rule is specially: the cross section of the area maximum of collision dough sheet and model to be detected is on same plane.
Described creation module also comprises:
The name unit is used for the identical name of collision dough sheet called after with the collision dough sheet and described second model of described first model;
Described acquisition module specifically comprises:
Search the unit, be used for searching the collision dough sheet of described first model and second model according to described name;
Acquiring unit, be used for described search the collision dough sheet that finds described first model and second model in the unit after, obtain the 3d space information in the collision dough sheet of 3d space information in the collision dough sheet of described first model and described second model.
Described device also comprises:
The display process module, be used for judging after described first model and second model bump at described detection module, for any model in described first model and second model, if the object under this arbitrary model also comprises other model, then do not show this arbitrary model, show described other model.
Described modular converter specifically comprises:
The triangle converting unit, when the 3d space information that is used for obtaining when described acquisition module is the 3d space triangle information representing, this 3d space triangle information representing is converted to triangle on the 2D plane, obtains the triangle of described first model and the triangle of described second model respectively;
Non-triangle converting unit, when the 3d space information of obtaining when described acquisition module is the non-triangle information representing of 3d space, earlier the non-triangle information representing of described 3d space is converted to the 3d space triangle information representing, again this 3d space triangle information representing is converted to the triangle on the 2D plane, obtains the triangle of described first model and the triangle of described second model respectively.
Said method that the embodiment of the invention provides and device are converted into the detection of the figure in the 2D plane by the collision detection with the 3D model, have greatly reduced the calculated amount of collision detection, have shortened the time of collision detection, have improved the efficient of collision detection.And, because the collision dough sheet is created in the 3D model, be easy to make amendment, can realize the collision detection of zones of different by revising the collision dough sheet, simple, convenient.In addition, not very high to the requirement of the similarity of collision dough sheet and model, can use collision dough sheet to carry out collision detection with certain difference.When the object in the recreation comprised a plurality of model, if one of them model bumps, then other model also still showed, thereby had strengthened the authenticity of recreation, had promoted game player's experience.
Description of drawings
Fig. 1 be the embodiment of the invention provide to the synoptic diagram that detects of a plurality of models in the recreation;
Fig. 2 is the method flow diagram of the collision detection that provides of the embodiment of the invention;
Fig. 3 is the synoptic diagram of the generation collision dough sheet that provides of the embodiment of the invention;
Fig. 4 be the embodiment of the invention provide judge the synoptic diagram whether triangle intersects;
Fig. 5 is a kind of structural drawing of device of the collision detection that provides of the embodiment of the invention;
Fig. 6 is the another kind of structural drawing of the device of the collision detection that provides of the embodiment of the invention.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, embodiment of the present invention is described further in detail below in conjunction with accompanying drawing.
The embodiment of the invention provides a kind of method of collision detection, comprising:
For first model and second model to be detected in the recreation generates the collision dough sheet respectively; Obtain the 3d space information in the collision dough sheet of the 3d space information in the collision dough sheet of first model and second model; With the 3d space information translation of obtaining is figure on the 2D plane, obtains first figure of first model and the second graph of second model respectively; Whether detect first figure and second graph and intersect, if then first model and second model bump, otherwise first model and second model do not bump.
The model that relates in the embodiment of the invention is meant the 3D model, is generally the 3D model in the online game.This model can use multiple modeling tool to generate, and generates as using 3D MAX.Object in the online game can be made up of a model, also can be made up of a plurality of models.For example, a kind of large aircraft is made up of fuselage model and wing model etc.When an object was made up of a plurality of models, each model all had the collision dough sheet of oneself.
Described collision dough sheet generates in model, and the color of this collision dough sheet can be provided with as required, as is set to the color different with model to be detected.And the transparency that the collision dough sheet can also be set is different value, as transparent, translucent, 70% transparent or the like.Preferably, in order to strengthen the vivid effect of recreation, promote the experience of recreation, make the user be not aware of collision detection process, can collide dough sheet and be set to transparently, be sightless for the game player, and promptly the game player can't see the existence of this collision dough sheet in the process of playing games, this collision dough sheet is the usefulness for collision detection only, thereby avoided because the user sees the collision dough sheet and brings bad influence to game experiencing.
Can when initialization, do for model to be detected generates the step of colliding dough sheet in the embodiment of the invention, promptly only generate the primary collision dough sheet to get final product, when each run is played, all carry out collision detection then according to the collision dough sheet that has generated.In addition, can also be when each run to be played, all interim the generation collided dough sheet, and then carries out collision detection according to the collision dough sheet of this generation, and the action that promptly generates the collision dough sheet all regenerates the collision dough sheet for repeatedly at every turn.Preferably,, save resource, avoid unnecessary repetition, adopt the mode that when initialization, generates the collision dough sheet usually in order to raise the efficiency.
Collision checking method in the embodiment of the invention can be applied to the collision detection of a plurality of models, for example, referring to Fig. 1, player's aircraft and enemy's aircraft two class aircrafts are arranged in the recreation, player's aircraft and enemy's aircraft all can emission bullets, in game process, need be to carrying out collision detection between player's aircraft and bullet and enemy's aircraft and the bullet.Wherein, the process of the collision detection of any two models is all identical, is that example is specifically described two models are carried out collision detection below, when a plurality of models are carried out collision detection, can repeat this collision detection process.
Referring to Fig. 2, the method for the collision detection that the embodiment of the invention provides specifically comprises:
Step 201: generate transparent collision dough sheet respectively for first model and second model to be detected in the recreation in advance;
Wherein, the collision dough sheet of first model and second model can generate according to default rule, this default rule can for: the center of gravity of collision dough sheet must not surpass the value of presetting with the distance of the center of gravity of model to be detected.When the shape of collision dough sheet not simultaneously, this default value can be identical, also can be different, and can make amendment at any time as required.Preferably, described default value can be according to the difference of impingement area plate shape and difference is provided with this value less usually, thereby guarantees that the collision dough sheet can be too not far away from the model center of gravity, to improve the accuracy of collision detection.For example, model to be detected is a triangle, and when the collision dough sheet was triangle, this default value can be set to 3 pixels, and when the collision dough sheet was square, this default value can be set to 5 pixels or the like.
Preferably, can above-mentioned rule be set to: the cross section of the area maximum of collision dough sheet and model to be detected is on same plane.Because model to be detected is the 3D stereoscopic model, have a plurality of cross sections, when generating the collision dough sheet, plane according to the area maximum generates the collision dough sheet, the plane of promptly colliding dough sheet and area maximum is on same plane, and the center of gravity of colliding dough sheet this moment is the most approaching with the center of gravity of model to be detected, then guarantee to collide dough sheet and model to be detected more approaching, comprise shape near and area near etc., thereby improve the accuracy of collision detection.Referring to Fig. 3, the collision dough sheet that generates for model aircraft is a triangle, and the wing section of this triangle and this model aircraft is on same plane.
Usually, the collision dough sheet is represented with triangle, a collision dough sheet can comprise one or more triangles, concrete number can be adjusted as required, the triangle number that comprises when the collision dough sheet more for a long time, the similarity of itself and model is high more, the precision of collision detection is also high more, therefore, when when higher, can suitably increasing the quantity of collision dough sheet intermediate cam shape to the accuracy requirement of collision detection.Preferably, the calculated amount when reducing collision detection under the situation that precision can meet the demands, makes as far as possible to comprise less triangle in the collision dough sheet that it is simple more good more promptly to collide dough sheet.For example, for the recreation with the depression angle observation shown in Figure 1, only comprise a triangle in the collision dough sheet according to generation shown in Figure 3, greatly reduced the calculated amount of collision detection, and the precision that detects also can meet the demands for this recreation fully.
In addition, for the ease of determining the scope of collision detection, the object of search collision detection, further, can also be with the identical name of collision dough sheet called after of the collision dough sheet and second model of first model, when making collision detection, can search the collision dough sheet of this first model and the collision dough sheet of second model, thereby initiate collision detection these two models according to this identical name.In actual applications, if a plurality of models are carried out collision detection simultaneously, then can be with identical name of the equal called after of the collision dough sheet of these a plurality of models, when search, can search the collision dough sheet that all meet the model to be detected of this name, thereby initiate collision detection these a plurality of models according to this name.
Step 202: when running game, search the collision dough sheet of first model and second model;
Particularly, can find the collision dough sheet of first model and second model according to the name of collision dough sheet.For example, the name for the name of collision dough sheet in the step 201 is " CollisionArea ", and during running game, search meets the collision dough sheet of this name, then can search the collision dough sheet of first model and the collision dough sheet of second model.
The function that all with good grounds name of common 3D engine is searched for, therefore the detailed process of search collision dough sheet just no longer is described in detail herein.
Step 203: obtain the 3d space triangle information representing in the collision dough sheet of the 3d space triangle information representing in the collision dough sheet of first model and second model respectively;
Described 3d space triangle information representing has comprised the three-dimensional coordinate information in the 3d space.Present embodiment is that example describes to obtain the 3d space triangle information representing, in actual applications, also can obtain the 3d space information of other shape, as 3d space square information, 3d space rectangle information, 3d space parallelogram information etc.Because the 3d space polygon all can be regarded as and is made up of one or more 3d space triangles, can be regarded as by two 3d space triangles as the 3d space square and to form, and in the 2D planar graph, judge that the algorithm whether two triangles intersect is the simplest, therefore, for convenience of calculation, improve counting yield, save computing time, preferably, adopt the mode of obtaining the 3d space triangle information representing in the present embodiment.In actual applications, if what obtain is the non-triangle information representing of 3d space, then is converted into the 3d space triangle information representing earlier, and then carries out follow-up step.
Step 204: the 3d space triangle information representing of obtaining is converted to triangle on the 2D plane, obtains the triangle of first model and the triangle of second model respectively;
Triangle on the described 2D plane only comprises two-dimensional coordinate information, i.e. the information of horizontal ordinate x and ordinate y.The 3d space triangle information representing is converted to triangle on the 2D plane, is meant that coordinate conversion with leg-of-mutton each summit of 3d space is the coordinate on the 2D plane.
Step 205: detect the triangle of first model and the triangle of second model and whether intersect, if then execution in step 206; Otherwise, execution in step 207;
Wherein, the triangle of first model can be for one or more, and the triangle of second model also can be for one or more, and testing process is specific as follows:
Whether 1) first model comprises a triangle A, and second model comprises a triangle B, then detect triangle A and B and intersect, if intersect, then first model and second model bump, otherwise, do not bump;
2) first model comprises a triangle A, second model comprises a plurality of triangle B1~Bn, wherein, n is the natural number greater than 1, then detect triangle A whether with triangle B1~Bn in any intersect, as long as one of them intersects triangle A and B1~Bn, then first model and second model just bump, and a plurality of intersecting certain and wherein also must bump, when having only among triangle A and the triangle B1~Bn which also non-intersect, show that first model and second model do not bump against;
3) first model comprises a plurality of triangle A1~An, second model comprises a triangle B, wherein, n is the natural number greater than 1, then detect triangle B whether with triangle A1~An in any intersect, if, then first model and second model bump, otherwise, do not bump, with 2) in the process described similar, still be that second model comprises a plurality of triangles so difference only comprises a plurality of triangles at first model;
4) first model and second model all comprise a plurality of triangles, detect in a plurality of triangles of first model any triangle whether with a plurality of triangles of second model at least one triangle intersect, if then first model and second model bump, otherwise, do not bump.Also can detect in a plurality of triangles of second model any triangle whether with a plurality of triangles of first model at least one triangle intersect, if then first model and second model bump, otherwise, do not bump.
For example, referring to Fig. 4, first model of player's aircraft comprises A1 and two triangles of A2 on the 2D plane, and second model of enemy's aircraft comprises B1, B2 on the 2D plane and B3 totally three triangles.During at least a in detecting following situation, can judge first model and second model bumps: A1 and B1 intersect, and A1 and B2 intersect, and A1 and B3 intersect, and A2 and B1 intersect, and A2 and B2 intersect, and A2 and B3 intersect; If above-mentioned situation does not all occur, then first model and second model do not bump.Particularly, whether the triangle that detects in two 2D spaces intersects, and a variety of methods are arranged in the prior art, just repeats no more herein.
In addition, in the embodiment of the invention, if obtain be the non-triangle information representing of 3d space the time, also can not be converted into the 3d space triangle information representing earlier, but directly being converted into the figure in 2D space, the 2D space diagram after this conversion may be a triangle, may not be triangle also.If this 2D space diagram is a triangle, judges then whether the triangle of first model and the triangle of second model intersect, thereby carry out collision detection.If this 2D space diagram still is not a triangle, as be rectangle, rhombus, trapezoidal, hexagon etc., then there is dual mode to judge: 1) can directly judge to the figure in this 2D space, adopt corresponding algorithm to judge whether the 2D space diagram of two models intersects according to this shape, as judge whether rectangle and rhombus intersect, thereby carry out collision detection; 2) can also earlier this 2D space diagram be converted to one or more triangles, as hexagon being converted to 4 triangles, and then judge whether the triangle of conversion back first model is crossing with the triangle of second model, thereby carry out collision detection.Owing to judging that the algorithm whether triangle intersects is fairly simple, preferably, adopt the above-mentioned second way to judge.
Step 206: judge first model and second model bumps, flow process finishes.
Step 207: judge first model and second model does not bump, flow process finishes.
Further, judging after first model and second model bump, said method also comprises:
For any model in first model and second model, if the object under this model also comprises other model, then do not show this model, it is replaced with animation or the Flash that preprepared this model is gone up or smashed, form the animation display of collision part, present the effect that this model is gone up or smashed to the user, this moment, other model except that this model then normally showed, and after this animation or Flash finish playing, this other model still normally shows, to the user present be certain parts of this object go up or smash after remain the effect of other parts.For example, when large aircraft was made up of fuselage model and wing model, if detect wing model and enemy plane bumps, what then blast was fallen only was wing model, and the fuselage model does not bump, still keep, therefore, the animation that meeting display machines wing model was gone up after this collision took place, and the fuselage part of not going up, wing section does not show that then promptly aircraft is not gone up, and has been the body incompleteness.
Referring to Fig. 5, the embodiment of the invention also provides a kind of device of collision detection, comprising:
Creation module 501 is for first model and second model to be detected in the recreation generates the collision dough sheet respectively;
Acquisition module 502 is used for obtaining the 3d space information in the collision dough sheet of the 3d space information of collision dough sheet of first model and second model;
Modular converter 503, the 3d space information translation that acquisition module 502 is obtained is the triangle on the 2D plane, obtains first figure of first model and the second graph of second model respectively;
Whether detection module 504 is used to detect first figure and the second graph that modular converter 503 obtains and intersects, if then first model and second model bump, otherwise first model and second model do not bump.
Referring to Fig. 6, wherein, creation module 501 can specifically comprise:
Creating unit 501a is used for according to default rule, and for first model and second model to be detected in the recreation generates the collision dough sheet respectively, default rule is: the distance of the center of gravity of collision dough sheet and the center of gravity of model to be detected must not surpass default value.Preferably, can will should default rule specifically be set to: the cross section of the area maximum of collision dough sheet and model to be detected is on same plane.
Further, creation module 501 can also comprise:
Name unit 501b is used for the identical name of collision dough sheet called after with the collision dough sheet and second model of first model; Correspondingly, acquisition module 502 specifically comprises:
Search unit 502a, be used for searching the collision dough sheet of first model and second model according to above-mentioned name;
Acquiring unit 502b is used for after searching the collision dough sheet that unit 502a finds first model and second model, obtains the 3d space information in the collision dough sheet of the 3d space information in the collision dough sheet of first model and second model.
In the present embodiment, detection module 504 specifically comprises:
Detecting unit, be used for when the second graph of first figure of first model and second model is a plurality of triangle, detect in a plurality of triangles of first model any triangle whether with a plurality of triangles of second model at least one triangle intersect, if, then first model and second model bump, otherwise first model and second model do not bump.
In the present embodiment, further, said apparatus can also comprise:
Display process module 505, be used for judging after first model and second model bump, for any model in first model and second model, if the object under this arbitrary model also comprises other model at detection module 504, then do not show this arbitrary model, show other model.
In the present embodiment, modular converter 503 specifically comprises:
Triangle converting unit 503a, when the 3d space information that is used for obtaining when acquisition module 502 is the 3d space triangle information representing, this 3d space triangle information representing is converted to triangle on the 2D plane, obtains the triangle of first model and the triangle of second model respectively;
Non-triangle converting unit 503b, when the 3d space information of obtaining when acquisition module 502 is the non-triangle information representing of 3d space, earlier the non-triangle information representing of this 3d space is converted to the 3d space triangle information representing, again this 3d space triangle information representing is converted to the triangle on the 2D plane, obtains the triangle of first model and the triangle of second model respectively.
Said method that the embodiment of the invention provides and device, collision detection in can being applied to play between a plurality of objects or a plurality of model, be particularly suitable for having the application scenarios of certain observation visual angle, in this case can be too not high to the accuracy requirement of collision detection, this method and apparatus all can satisfy accuracy requirement.For example, can be applied to the collision detection that the recreation of observation visual angle is overlooked in shown in Figure 1 having.Collision detection in the embodiment of the invention is not to carry out in 3d space, but in the 2D space, carry out, when the player sees that player's aircraft and enemy's aircraft have joining in the interface, then technique scheme will be judged this two plane collision, no matter and whether this aircraft bumps against in 3d space.Even player's aircraft and enemy's aircraft in height have bigger gap, not collision fully, but the result who sees on game screen still has been these two plane collisions.
Said method that the embodiment of the invention provides and device are converted into the detection of the figure in the 2D plane by the collision detection with the 3D model, have greatly reduced the calculated amount of collision detection, have shortened the time of collision detection, have improved the efficient of collision detection.And, because the collision dough sheet is created in the 3D model, be easy to make amendment, can realize the collision detection of zones of different by revising the collision dough sheet, simple, convenient.In addition, not very high to the requirement of the similarity of collision dough sheet and model, can use collision dough sheet to carry out collision detection with certain difference.When the object in the recreation comprised a plurality of model, if one of them model bumps, then other model also still showed, and shows the animation that this model that bumps is smashed, thereby had strengthened the authenticity of recreation, had promoted game player's experience.
The all or part of of the technique scheme that the embodiment of the invention provides can be finished by the relevant hardware of programmed instruction, described program can be stored in the storage medium that can read, and this storage medium comprises: various media that can be program code stored such as ROM, RAM, magnetic disc or CD.
The above only is preferred embodiment of the present invention, and is in order to restriction the present invention, within the spirit and principles in the present invention not all, any modification of being done, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (12)

1, a kind of method of collision detection is characterized in that, described method comprises:
For first model and second model to be detected in the recreation generates the collision dough sheet respectively;
Obtain the 3d space information in the collision dough sheet of 3d space information in the collision dough sheet of described first model and described second model;
With the 3d space information translation of obtaining is figure on the 2D plane, obtains first figure of described first model and the second graph of described second model respectively;
Whether detect described first figure and second graph and intersect, if then described first model and second model bump, otherwise described first model and second model do not bump.
2, the method for collision detection according to claim 1 is characterized in that, and is described for first model and second model to be detected in the recreation generates the collision dough sheet respectively, specifically comprises:
According to default rule, for first model and second model to be detected in the recreation generates the collision dough sheet respectively, described default rule is: the distance of the center of gravity of collision dough sheet and the center of gravity of model to be detected must not surpass default value.
3, the method for collision detection according to claim 2 is characterized in that, described default rule is specially: the cross section of the area maximum of collision dough sheet and model to be detected is on same plane.
4, the method for collision detection according to claim 1 is characterized in that, described is that first model and second model to be detected in the recreation generates respectively after the collision dough sheet, also comprises:
The identical name of collision dough sheet called after with the collision dough sheet and described second model of described first model;
Obtain the 3d space information in the collision dough sheet of 3d space information in the collision dough sheet of described first model and described second model, specifically comprise:
Search the collision dough sheet of described first model and second model according to described name, obtain the 3d space information in the collision dough sheet of 3d space information in the collision dough sheet of described first model and described second model.
5, the method for collision detection according to claim 1 is characterized in that, after described first model and second model bump, also comprises:
For any model in described first model and second model, if the object under this model also comprises other model, then do not show this model, show described other model.
6, according to the method for the described collision detection of arbitrary claim in the claim 1 to 5, it is characterized in that, is figure on the 2D plane with the 3d space information translation of obtaining, and specifically comprises:
When described 3d space information is the 3d space triangle information representing, the 3d space triangle information representing of obtaining is converted to triangle on the 2D plane;
When described 3d space information is the non-triangle information representing of 3d space, earlier the non-triangle information representing of described 3d space is converted to the 3d space triangle information representing, will obtain this 3d space triangle information representing again and be converted to triangle on the 2D plane.
7, a kind of device of collision detection is characterized in that, described device comprises:
Creation module is for first model and second model to be detected in the recreation generates the collision dough sheet respectively;
Acquisition module is used for obtaining the 3d space information in the collision dough sheet of the 3d space information of collision dough sheet of described first model and described second model;
Modular converter, the 3d space information translation that is used for that described acquisition module is obtained is the figure on the 2D plane, obtains first figure of described first model and the second graph of described second model respectively;
Whether detection module is used to detect described first figure and described second graph and intersects, if then described first model and second model bump, otherwise described first model and second model do not bump.
8, the device of collision detection according to claim 7 is characterized in that, described creation module specifically comprises:
Creating unit is used for according to default rule, and for first model and second model to be detected in the recreation generates the collision dough sheet respectively, described default rule is: the distance of the center of gravity of collision dough sheet and the center of gravity of model to be detected must not surpass default value.
9, the device of collision detection according to claim 8 is characterized in that, described default rule is specially: the cross section of the area maximum of collision dough sheet and model to be detected is on same plane.
10, the device of collision detection according to claim 7 is characterized in that, described creation module also comprises:
The name unit is used for the identical name of collision dough sheet called after with the collision dough sheet and described second model of described first model;
Described acquisition module specifically comprises:
Search the unit, be used for searching the collision dough sheet of described first model and second model according to described name;
Acquiring unit, be used for described search the collision dough sheet that finds described first model and second model in the unit after, obtain the 3d space information in the collision dough sheet of 3d space information in the collision dough sheet of described first model and described second model.
11, the device of collision detection according to claim 7 is characterized in that, described device also comprises:
The display process module, be used for judging after described first model and second model bump at described detection module, for any model in described first model and second model, if the object under this arbitrary model also comprises other model, then do not show this arbitrary model, show described other model.
According to the device of the described collision detection of claim 7 to 11, it is characterized in that 12, described modular converter specifically comprises:
The triangle converting unit, when the 3d space information that is used for obtaining when described acquisition module is the 3d space triangle information representing, this 3d space triangle information representing is converted to triangle on the 2D plane, obtains the triangle of described first model and the triangle of described second model respectively;
Non-triangle converting unit, when the 3d space information of obtaining when described acquisition module is the non-triangle information representing of 3d space, earlier the non-triangle information representing of described 3d space is converted to the 3d space triangle information representing, again this 3d space triangle information representing is converted to the triangle on the 2D plane, obtains the triangle of described first model and the triangle of described second model respectively.
CN2009101615036A 2009-07-24 2009-07-24 Method and device for detecting collision Active CN101615305B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009101615036A CN101615305B (en) 2009-07-24 2009-07-24 Method and device for detecting collision

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009101615036A CN101615305B (en) 2009-07-24 2009-07-24 Method and device for detecting collision

Publications (2)

Publication Number Publication Date
CN101615305A true CN101615305A (en) 2009-12-30
CN101615305B CN101615305B (en) 2011-07-20

Family

ID=41494926

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009101615036A Active CN101615305B (en) 2009-07-24 2009-07-24 Method and device for detecting collision

Country Status (1)

Country Link
CN (1) CN101615305B (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102682466A (en) * 2011-03-17 2012-09-19 腾讯科技(深圳)有限公司 Method, device and system for realizing dynamic blocking in three-dimensional role playing game
CN102819667A (en) * 2012-07-20 2012-12-12 北京理工大学 Method for optimizing launching time sequence of coordinated attack of aircraft based on time constraint library
CN103413348A (en) * 2013-07-08 2013-11-27 中国大唐集团科学技术研究院有限公司 Virtual reality roaming process collision detection optimization design method and system thereof
WO2014079351A1 (en) * 2012-11-22 2014-05-30 Tencent Technology (Shenzhen) Company Limited Data processing device and method for interaction detection
CN104408774A (en) * 2014-12-11 2015-03-11 中国科学院合肥物质科学研究院 Detection method for collision between solid mesh models based on GPU (Graphics Processing Unit) acceleration
CN104699946A (en) * 2014-12-30 2015-06-10 北京像素软件科技股份有限公司 Game scene management method and device
CN105590339A (en) * 2015-12-15 2016-05-18 广州南沙3D打印创新研究院 Collision detection method and system for three-dimensional model
CN105719310A (en) * 2014-08-13 2016-06-29 北京毕普创新科技有限公司 Collision detecting method and device
CN105786833A (en) * 2014-12-22 2016-07-20 阿里巴巴集团控股有限公司 Webpage element collision judgment method and device
US9626829B2 (en) 2012-11-22 2017-04-18 Tencent Technology (Shenzhen) Company Limited Data processing device and method for interaction detection
CN106582024A (en) * 2016-10-14 2017-04-26 网易(杭州)网络有限公司 Processing method and apparatus when object is collided
CN108492882A (en) * 2018-03-06 2018-09-04 沈阳东软医疗系统有限公司 A kind of collision checking method and device
CN108970113A (en) * 2018-07-26 2018-12-11 广州多益网络股份有限公司 A kind of collision checking method, device, equipment and medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100428218C (en) * 2002-11-13 2008-10-22 北京航空航天大学 Universal virtual environment roaming engine computer system
CN101071515A (en) * 2007-06-25 2007-11-14 北京金山软件有限公司 Method for realizing three-dimensional game collision detection at server end

Cited By (26)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102682466B (en) * 2011-03-17 2016-02-24 腾讯科技(深圳)有限公司 The method, the Apparatus and system that dynamically stop is realized in three-dimensional character game for play
CN102682466A (en) * 2011-03-17 2012-09-19 腾讯科技(深圳)有限公司 Method, device and system for realizing dynamic blocking in three-dimensional role playing game
CN102819667A (en) * 2012-07-20 2012-12-12 北京理工大学 Method for optimizing launching time sequence of coordinated attack of aircraft based on time constraint library
CN102819667B (en) * 2012-07-20 2016-04-27 北京理工大学 Timing optimization method is launched in aircraft concerted attack based on time-constrain storehouse
US9626829B2 (en) 2012-11-22 2017-04-18 Tencent Technology (Shenzhen) Company Limited Data processing device and method for interaction detection
WO2014079351A1 (en) * 2012-11-22 2014-05-30 Tencent Technology (Shenzhen) Company Limited Data processing device and method for interaction detection
CN103840979A (en) * 2012-11-22 2014-06-04 腾讯科技(深圳)有限公司 Data processing apparatus and method for bump detection
CN103840979B (en) * 2012-11-22 2015-04-22 腾讯科技(深圳)有限公司 Data processing apparatus and method for bump detection
CN103413348B (en) * 2013-07-08 2016-06-01 中国大唐集团科学技术研究院有限公司 Virtual reality roam procedure collision detection optimization design method and system
CN103413348A (en) * 2013-07-08 2013-11-27 中国大唐集团科学技术研究院有限公司 Virtual reality roaming process collision detection optimization design method and system thereof
CN105719310B (en) * 2014-08-13 2019-12-20 北京毕普创新科技有限公司 Collision detection method and device
CN105719310A (en) * 2014-08-13 2016-06-29 北京毕普创新科技有限公司 Collision detecting method and device
CN104408774B (en) * 2014-12-11 2016-02-17 中国科学院合肥物质科学研究院 A kind of based on GPU accelerate entity patch model between collision checking method
CN104408774A (en) * 2014-12-11 2015-03-11 中国科学院合肥物质科学研究院 Detection method for collision between solid mesh models based on GPU (Graphics Processing Unit) acceleration
CN105786833B (en) * 2014-12-22 2019-06-18 阿里巴巴集团控股有限公司 A kind of web page element collision judgment method and device
CN105786833A (en) * 2014-12-22 2016-07-20 阿里巴巴集团控股有限公司 Webpage element collision judgment method and device
CN104699946B (en) * 2014-12-30 2018-10-30 北京像素软件科技股份有限公司 A kind of management method and device of scene of game
CN104699946A (en) * 2014-12-30 2015-06-10 北京像素软件科技股份有限公司 Game scene management method and device
CN105590339B (en) * 2015-12-15 2019-03-15 广州南沙3D打印创新研究院 The collision checking method and system of threedimensional model
CN105590339A (en) * 2015-12-15 2016-05-18 广州南沙3D打印创新研究院 Collision detection method and system for three-dimensional model
CN106582024A (en) * 2016-10-14 2017-04-26 网易(杭州)网络有限公司 Processing method and apparatus when object is collided
CN106582024B (en) * 2016-10-14 2020-05-29 网易(杭州)网络有限公司 Method and device for processing object impact
CN108492882A (en) * 2018-03-06 2018-09-04 沈阳东软医疗系统有限公司 A kind of collision checking method and device
CN108492882B (en) * 2018-03-06 2021-08-31 东软医疗系统股份有限公司 Collision detection method and device
CN108970113A (en) * 2018-07-26 2018-12-11 广州多益网络股份有限公司 A kind of collision checking method, device, equipment and medium
CN108970113B (en) * 2018-07-26 2021-07-23 广州多益网络股份有限公司 Collision detection method, device, equipment and medium

Also Published As

Publication number Publication date
CN101615305B (en) 2011-07-20

Similar Documents

Publication Publication Date Title
CN101615305B (en) Method and device for detecting collision
US20220139027A1 (en) Scene data obtaining method and model training method, apparatus and computer readable storage medium using the same
CN105590339B (en) The collision checking method and system of threedimensional model
CN108257103B (en) Method and device for eliminating occlusion of game scene, processor and terminal
Tang et al. Interactive continuous collision detection between deformable models using connectivity-based culling
CN101281654A (en) Method for processing cosmically complex three-dimensional scene based on eight-fork tree
CN104408774B (en) A kind of based on GPU accelerate entity patch model between collision checking method
CN108211354A (en) The generation method and device of virtual resource in 3D scene of game
US8130220B2 (en) Method, medium and apparatus detecting model collisions
US20030117397A1 (en) Systems and methods for generating virtual reality (VR) file(s) for complex virtual environments
CN101071515A (en) Method for realizing three-dimensional game collision detection at server end
CN109376383B (en) Explosion view generation method based on collision detection
CN105389850A (en) Novel visibility generation method for large-scale three-dimensional scene
US20110202318A1 (en) Interference determination device, interference determination method, and computer program product
CN104462688B (en) A kind of electric network information equipment operating simulation system
CN101984443A (en) Improved flexible cloth collision processing method
US20030117398A1 (en) Systems and methods for rendering frames of complex virtual environments
CN109242973A (en) A kind of crash tests method, apparatus, electronic equipment and storage medium
Huagen et al. A parallel collision detection algorithm based on hybrid bounding volume hierarchy
Schauer et al. Performance comparison between state-of-the-art point-cloud based collision detection approaches on the CPU and GPU
EP3776488B1 (en) Using a low-detail representation of surfaces to influence a high-detail representation of the surfaces
Domaradzki et al. Fracturing sparse-voxel-octree objects using dynamical voronoi patterns
Sajo et al. Controlling the Accuracy and Efficiency of Collision Detection in 2d Games using Hitboxes
Alfrink et al. Real-Time Spatio-Temporal Databases: Bridging the Gap Between Experimentable Digital Twins and Databases
Zhao et al. A new collision detection algorithm suitable for complex virtual environment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant