Version: 5.3 (switch to 5.4b)
ЯзыкEnglish
  • C#
  • JS

Язык программирования

Выберите подходящий для вас язык программирования. Все примеры кода будут представлены на выбранном языке.

Physics2D

class in UnityEngine

Предложить изменения

Успех!

Благодарим вас за то, что вы помогаете нам улучшить качество документации по Unity. Однако, мы не можем принять любой перевод. Мы проверяем каждый предложенный вами вариант перевода и принимаем его только если он соответствует оригиналу.

Закрыть

Ошибка внесения изменений

По определённым причинам предложенный вами перевод не может быть принят. Пожалуйста <a>попробуйте снова</a> через пару минут. И выражаем вам свою благодарность за то, что вы уделяете время, чтобы улучшить документацию по Unity.

Закрыть

Отменить

Руководство

Описание

Global settings and helpers for 2D physics.

Статические переменные

AllLayersМаска слоя, которая включает в себя все слои.
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.
changeStopsCallbacksWhether or not to stop reporting collision callbacks immediately if any of the objects involved in the collision are deleted/moved.
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.
minPenetrationForPenaltyThe minimum contact penetration radius allowed before any separation impulse force is applied. Extreme caution should be used when modifying this value as making this smaller means that polygons will have an insufficient buffer for continuous collision and making it larger may create artefacts for vertex collision.
positionIterationsThe number of iterations of the physics solver when considering objects' positions.
queriesHitTriggersDo raycasts detect Colliders configured as triggers?
queriesStartInCollidersDo ray/line casts that start inside a collider(s) detect those collider(s)?
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.

Статические функции

BoxCastCasts a box against colliders in the scene, returning the first collider to contact with it.
BoxCastAllПускает луч в виде box против коллайдеров в сцене, возвращая все коллайдеры, которые контактируют с ним.
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.
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.
GetRayIntersectionAllCast a 3D ray against the colliders in the scene returning all the colliders along the ray.
GetRayIntersectionNonAllocCast a 3D ray against the colliders in the scene returning the colliders along the ray.
IgnoreCollisionMakes the collision detection system ignore all collisions/triggers between collider1 and collider2.
IgnoreLayerCollisionChoose whether to detect or ignore collisions between a specified pair of layers.
IsTouchingCheck whether collider1 is touching collider2 or not.
IsTouchingLayersChecks whether the collider is touching any colliders on the specified layerMask or not.
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.
OverlapPointПроверяет, пересекается ли коллайдер с точкой в пространстве.
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.