2D physics world manager class for the scene

场景对应的2D物理管理类

实现

构造函数

属性

name: string

An internal identifier used to find the manager by Scene3D.

用于通过 Scene3D 查找管理器的内部标识符

__managerName: string = "Physics2DWorldManager"

2Dphysics manager class name

2D物理管理类类名

访问器

方法

  • 参数

    • res: ColliderBase[]

      返回的ColliderBase数组

    • bounds: any

      要查询的AABB包围盒

    返回 void

    查询物理世界中所有可能与提供的AABB重叠的内容

    Query the physical world for all possible overlaps with the provided AABB

  • 参数

    返回 void

    查询物理世界中对射线路径上的所有形状,可以获取最近点、任意点、还是 n 点。射线投射会忽略包含起点的形状。

    Query the physical world for all shapes on a ray path, either the closest point, any point, or n points. Ray casting ignores shapes that contain the starting point.

  • 参数

    • positionIterations: number

      位置迭代次数

    返回 void

    设置物理世界模拟中位置的迭代次数.

    Set the number of iterations of the physics world simulation.

  • 参数

    • velocityIterations: number

      速度迭代次数

    返回 void

    设置物理世界模拟中速度的迭代次数,迭代次数越多越精确,性能越差.

    Set the number of iterations of the physics world simulation, the more iterations, the more accurate, but the more performance.