【问题标题】:What's the difference between getLocalBounds and getGlobalBounds in sfml c++?sfml c++中的getLocalBounds和getGlobalBounds有什么区别?
【发布时间】:2021-12-28 03:25:52
【问题描述】:

我正在为我的对象进行碰撞检测,只是想知道为什么我应该使用 GlobalBounds 而不是 LocalBounds?或者我使用哪个功能无关紧要?

【问题讨论】:

    标签: c++ sfml


    【解决方案1】:

    简单来说:global bounds = local bounds + transformations,由于您大部分时间都想处理转换后的位置、缩放或旋转,因此全局边界比本地边界更有用。
    当然,总有一些用例,局部边界可能很有用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-06-20
      • 2020-05-04
      • 2014-03-01
      • 2011-04-05
      • 2011-10-18
      • 1970-01-01
      • 2010-09-09
      • 1970-01-01
      相关资源
      最近更新 更多