1. <tfoot id='f20zY'></tfoot>

  2. <i id='f20zY'><tr id='f20zY'><dt id='f20zY'><q id='f20zY'><span id='f20zY'><b id='f20zY'><form id='f20zY'><ins id='f20zY'></ins><ul id='f20zY'></ul><sub id='f20zY'></sub></form><legend id='f20zY'></legend><bdo id='f20zY'><pre id='f20zY'><center id='f20zY'></center></pre></bdo></b><th id='f20zY'></th></span></q></dt></tr></i><div id='f20zY'><tfoot id='f20zY'></tfoot><dl id='f20zY'><fieldset id='f20zY'></fieldset></dl></div>

        <bdo id='f20zY'></bdo><ul id='f20zY'></ul>

      <small id='f20zY'></small><noframes id='f20zY'>

      <legend id='f20zY'><style id='f20zY'><dir id='f20zY'><q id='f20zY'></q></dir></style></legend>
    1. Java/libGDX - 如何检查多边形与矩形或圆形的碰撞

      时间:2023-05-19
    2. <legend id='T8gPJ'><style id='T8gPJ'><dir id='T8gPJ'><q id='T8gPJ'></q></dir></style></legend>
      <tfoot id='T8gPJ'></tfoot>

        <tbody id='T8gPJ'></tbody>
        <bdo id='T8gPJ'></bdo><ul id='T8gPJ'></ul>

          <small id='T8gPJ'></small><noframes id='T8gPJ'>

          <i id='T8gPJ'><tr id='T8gPJ'><dt id='T8gPJ'><q id='T8gPJ'><span id='T8gPJ'><b id='T8gPJ'><form id='T8gPJ'><ins id='T8gPJ'></ins><ul id='T8gPJ'></ul><sub id='T8gPJ'></sub></form><legend id='T8gPJ'></legend><bdo id='T8gPJ'><pre id='T8gPJ'><center id='T8gPJ'></center></pre></bdo></b><th id='T8gPJ'></th></span></q></dt></tr></i><div id='T8gPJ'><tfoot id='T8gPJ'></tfoot><dl id='T8gPJ'><fieldset id='T8gPJ'></fieldset></dl></div>

              • 本文介绍了Java/libGDX - 如何检查多边形与矩形或圆形的碰撞的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                限时送ChatGPT账号..

                我是 libGDX 的新手,据我所知,Intersector 类具有 Rectangle/Rectangle、Circle/Circle、Circle/Rectangle 和 Polygon/Polygon 的重叠方法,但由于某种原因,它似乎没有检查多边形/矩形或多边形/圆形的任何方法.

                I'm new to libGDX and from what I can tell the Intersector class has overlap methods for Rectangle/Rectangle, Circle/Circle, Circle/Rectangle, and Polygon/Polygon, but for some reason it doesn't seem to have any methods for checking Polygon/Rectangle or Polygon/Circle.

                有没有推荐的方法来检查多边形和矩形/圆之间的碰撞?

                Is there a recommended way to check for collision between polygon and rect/circle?

                另外,是否有某些原因将其排除在 Intersector 类之外?(即,我应该避免它吗?如果是,推荐的替代方法是什么?)

                Also, is there some reason why this has been left out of the Intersector class? (ie, should I avoid it? If so, what's the recommended alternative?)

                推荐答案

                处理这些碰撞的最佳方法是使用像 Box2D 这样的物理引擎,它已经与 Libgdx 打包在一起.当 Box2D 中发生碰撞时,会触发一个事件,您可以轻松处理该事件.所以你应该看看这里.

                The best way to handle those collisions would be to use a physics engine like Box2D which already comes packed with Libgdx. When a collision occurs in Box2D a event gets fired and you can easly handle that event. So you should probably take a look here.

                当然还有其他处理碰撞检测的方法.只需一点点数学知识,您可能就可以自己弄清楚您需要什么,而且 Box2D 还提供了许多其他可以让您受益的功能.

                Of course there are other ways of dealing of dealing with collision detection. With a little bit of maths you could probaly figure out just what you need on your own, also Box2D comes with alot of other features that will benefit you.

                这篇关于Java/libGDX - 如何检查多边形与矩形或圆形的碰撞的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:如何在 Libgdx 中支持 OpenGL ES GL10、GL11 和 GL20? 下一篇:如何通过代理设置 libGDX 项目

                相关文章

                最新文章

                  <bdo id='oqfxo'></bdo><ul id='oqfxo'></ul>

                <small id='oqfxo'></small><noframes id='oqfxo'>

                  <legend id='oqfxo'><style id='oqfxo'><dir id='oqfxo'><q id='oqfxo'></q></dir></style></legend>

                1. <tfoot id='oqfxo'></tfoot>
                    <i id='oqfxo'><tr id='oqfxo'><dt id='oqfxo'><q id='oqfxo'><span id='oqfxo'><b id='oqfxo'><form id='oqfxo'><ins id='oqfxo'></ins><ul id='oqfxo'></ul><sub id='oqfxo'></sub></form><legend id='oqfxo'></legend><bdo id='oqfxo'><pre id='oqfxo'><center id='oqfxo'></center></pre></bdo></b><th id='oqfxo'></th></span></q></dt></tr></i><div id='oqfxo'><tfoot id='oqfxo'></tfoot><dl id='oqfxo'><fieldset id='oqfxo'></fieldset></dl></div>