返回介绍

Physics2D 二维物理

发布于 2019-12-18 15:38:17 字数 10823 浏览 1465 评论 0 收藏 0

Description 描述

Global settings and helpers for 2D physics.
这个类为二维的物理提供全局的设置和辅助功能。

Static Variables 静态变量

AllLayersLayer mask constant that includes all layers.
图层遮罩常量,包括所有层。
angularSleepToleranceA rigid-body cannot sleep if its angular velocity is above this tolerance.
刚体的角速度如果超过这个公差,是无法进入休眠状态的。
baumgarteScaleThe scale factor that controls how fast overlaps are resolved.
控制如何快速解决重叠的缩放系数。
baumgarteTOIScaleThe scale factor that controls how fast TOI overlaps are resolved.(TOI: Time of Impact)
控制如何快速解决撞击时重叠的缩放系数。(TOI:撞击的时间)
DefaultRaycastLayersLayer mask constant that includes all layers participating in raycasts by default.
一个图层遮罩常量,包含所有默认参与光线投射的图层。
gravityAcceleration due to gravity.
重力加速度。
IgnoreRaycastLayerLayer mask constant for the default layer that ignores raycasts.
一个图层遮罩常量,包含默认忽略参与光线投射的图层。
linearSleepToleranceA rigid-body cannot sleep if its linear velocity is above this tolerance.
刚体的线速度如果超过这个公差,是无法进入休眠状态的。
maxAngularCorrectionThe maximum angular position correction used when solving constraints. This helps to prevent overshoot.
最大角位置修正在解决约束的时候被使用。这有助于防止运动过度。
maxLinearCorrectionThe maximum linear position correction used when solving constraints. This helps to prevent overshoot.
最大线性位置修正在解决约束的时候被使用。这有助于防止运动过度。
maxRotationSpeedThe maximum angular speed of a rigid-body per physics update. Increasing this can cause numerical problems.
每次物理更新刚体的最大角速度。增加这个值会导致数值问题。
maxTranslationSpeedThe maximum linear speed of a rigid-body per physics update. Increasing this can cause numerical problems.
每次物理更新刚体的最大线速度。增加这个值会导致数值问题。
positionIterationsThe number of iterations of the physics solver when considering objects' positions.
当考虑对象位置时,物理求解器的迭代次数。
raycastsHitTriggersDo raycasts detect Colliders configured as triggers?
是否让光线投射检测触发器?
timeToSleepThe time in seconds that a rigid-body must be still before it will go to sleep.
以秒为单位,刚体将要休眠前,在这段时间内必须保持静止。
velocityIterationsThe number of iterations of the physics solver when considering objects' velocities.
当考虑对象速度时,物理求解器的迭代次数。
velocityThresholdAny collisions with a relative linear velocity below this threshold will be treated as inelastic.
任何碰撞的相对线速度低于这个临界值将被视为非弹性的碰撞。

Static Functions 静态函数

BoxCastCasts a box against colliders in the scene, returning the first collider to contact with it.
对场景内的碰撞器们投射出一个方形,返回第一个接触到投射的碰撞器。
BoxCastAllCasts a box against colliders in the scene, returning all colliders that contact with it.
对场景内的碰撞器们投射出一个箱子,返回所有投射接触到碰撞器。
BoxCastNonAllocCasts a box into the scene, returning colliders that contact with it into the provided results array.
在场景内投射出一个箱子,把检测到的碰撞器放入提供结果数组,用这样的方式来返回投射到碰撞器。
CircleCastCasts a circle against colliders in the scene, returning the first collider to contact with it.
对场景内的碰撞器们投射出一个圆形,返回投射接触到的第一个碰撞器。
CircleCastAllCasts a circle against colliders in the scene, returning all colliders that contact with it.
对场景内的碰撞器们投射出一个圆形,返回所有投射接触到的碰撞器。
CircleCastNonAllocCasts a circle into the scene, returning colliders that contact with it into the provided results array.
对场景内投射一个圆形,把检测到的碰撞器放入提供结果数组,用这样的方式来返回投射到碰撞器。
GetIgnoreCollisionChecks whether the collision detection system will ignore all collisions/triggers between collider1 and collider2 or not.
获取碰撞检测系统中是否会忽略collider1和collider2之间的碰撞/触发。(如果忽略碰撞,返回true)
GetIgnoreLayerCollisionShould collisions between the specified layers be ignored?
指定的层之间的应该忽略碰撞吗?
GetRayIntersectionCast a 3D ray against the colliders in the scene returning the first collider along the ray.
对场景内的碰撞器们投射一条3D射线,沿着射线返回射到的第一个碰撞器。
GetRayIntersectionAllCast a 3D ray against the colliders in the scene returning all the colliders along the ray.
对场景内的碰撞器们投射一条3D射线,沿着射线返回所有接触到的碰撞器。
GetRayIntersectionNonAllocCast a 3D ray against the colliders in the scene returning the colliders along the ray.
对场景内的碰撞器们投射一条3D射线,沿着射线返回所有接触到的碰撞器。
IgnoreCollisionMakes the collision detection system ignore all collisions/triggers between collider1 and collider2.
使碰撞检测系统忽略collider1和collider2之间的所有碰撞/触发。
IgnoreLayerCollisionChoose whether to detect or ignore collisions between a specified pair of layers.
在指定的两个层上,选择检测或忽略它们之间的碰撞。
LinecastCasts a line against colliders in the scene.
对场景内的碰撞器们投射出一条线。
LinecastAllCasts a line against colliders in the scene.
对场景内的碰撞器们投射出一条直线。
LinecastNonAllocCasts a line against colliders in the scene.
对场景内的碰撞器们投射出一条直线。
OverlapAreaCheck if a collider falls within a rectangular area.
检测一个碰撞器是否与落在一个矩形区域(里面)。
OverlapAreaAllGet a list of all colliders that fall within a rectangular area.
获取一个列表包括所有碰撞器,那些碰撞器是落入一个矩形区域中的才行。
OverlapAreaNonAllocGet a list of all colliders that fall within a specified area.
获取落入特殊区域内的所有碰撞器。
OverlapCircleCheck if a collider falls within a circular area.
检测一个碰撞器是否与落在一个圆形区域(里面)。
OverlapCircleAllGet a list of all colliders that fall within a circular area.
获取落入圆形区域内的所有碰撞器列表。
OverlapCircleNonAllocGet a list of all colliders that fall within a circular area.
获取落入圆形区域内的所有碰撞器列表。
OverlapPointCheck if a collider overlaps a point in space.
检测一个碰撞器是否与世界空间中的一个点重叠。
OverlapPointAllGet a list of all colliders that overlap a point in space.
得到一个列表,里面是所有与世界中的点重叠的碰撞器。
OverlapPointNonAllocGet a list of all colliders that overlap a point in space.
得到一个列表,里面是所有与世界中的点重叠的碰撞器。
RaycastCasts a ray against colliders in the scene.
对场景内的碰撞器们投射出一条光线。
RaycastAllCasts a ray against colliders in the scene, returning all colliders that contact with it.
对场景内的碰撞器们投射出一条光线,返回接触到的所有碰撞器。
RaycastNonAllocCasts a ray into the scene.
在场景中投射一条光线。

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文