Version: 2022.3
言語: 日本語

Physics2D

class in UnityEngine

マニュアルに切り替える

説明

2D 物理システムのグローバル設定とヘルパー関数です。

Static 変数

AllLayersすべてのレイヤーを含むレイヤーマスク定数
angularSleepToleranceA Rigidbody cannot sleep if its angular velocity is above this tolerance threshold.
autoSyncTransformsSet whether to automatically sync changes to the Transform component with the physics engine.
baumgarteScale重複の解決にかける速度を管理するスケール要素
baumgarteTOIScaleTOI 重複の解決にかける速度を管理するスケール要素
callbacksOnDisableUse this to control whether or not the appropriate OnCollisionExit2D or OnTriggerExit2D callbacks should be called when a Collider2D is disabled.
defaultContactOffsetThe default contact offset of the newly created Colliders.
defaultPhysicsSceneThe PhysicsScene2D automatically created when Unity starts.
DefaultRaycastLayersデフォルトで Raycast に関係するすべてのレイヤーを含むレイヤー定数
gravity重力加速度
IgnoreRaycastLayerデフォルトのレイヤーマスク定数である Igonore Raycast
jobOptionsA set of options that control how physics operates when using the job system to multithread the physics simulation.
linearSleepToleranceこの許容値を上回る直線速度がある場合、リジッドボディはスリープしません。
maxAngularCorrection制限を解決する際に使用される最大角位置修正量。行き過ぎ防止に役立ちます。
maxLinearCorrection制限を解決する際に使用される最大直線位置修正量。行き過ぎ防止に役立ちます。
MaxPolygonShapeVerticesThe maximum number of vertices allowed per primitive polygon shape type (PhysicsShapeType2D.Polygon). (Read Only)
maxRotationSpeed物理更新毎のリジッドボディの最大角速度。この値を増やし過ぎると数値的な問題の原因になります。
maxTranslationSpeed物理更新毎のリジッドボディの最大直線速度。この値を増やし過ぎると数値的な問題の原因になります。
positionIterationsオブジェクトの位置について考慮する場合の物理ソルバーの反復回数
queriesHitTriggersレイキャストでトリガーに設定しているコライダーを検知するか
queriesStartInCollidersSet the raycasts or linecasts that start inside Colliders to detect or not detect those Colliders.
reuseCollisionCallbacksDetermines whether the garbage collector should reuse only a single instance of a Collision2D type for all collision callbacks.
simulationModeControls when Unity executes the 2D physics simulation.
timeToSleepリジッドボディがスリープするまでの秒単位での最低時間
velocityIterationsオブジェクトの速度について考慮する場合の物理ソルバーの反復回数
velocityThreshold相対直線速度を持つ衝突は、このしきい値を下回ると弾力がないものとして処理されます。

Static 関数

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. Note: This method will be deprecated in a future build and it is recommended to use BoxCast instead.
CapsuleCastCasts a capsule against Colliders in the Scene, returning the first Collider to contact with it.
CapsuleCastAllCasts a capsule against Colliders in the Scene, returning all Colliders that contact with it.
CapsuleCastNonAllocCasts a capsule into the Scene, returning Colliders that contact with it into the provided results array. Note: This method will be deprecated in a future build and it is recommended to use CapsuleCast instead.
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. Note: This method will be deprecated in a future build and it is recommended to use CircleCast instead.
ClosestPointReturns a point on the perimeter of the Collider that is closest to the specified position.
DistanceCalculates the minimum distance between two Colliders.
GetContactsRetrieves all Colliders in contact with the Collider.
GetIgnoreCollision衝突判定システムが collider1 と collider2 間のすべての衝突/トリガーを無視するかを確認します。
GetIgnoreLayerCollisionChecks whether collisions between the specified layers be ignored or not.
GetLayerCollisionMask指定したレイヤーに衝突する可能性があるレイヤーを示す衝突のレイヤーマスクを取得します。
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. Note: This method will be deprecated in a future build and it is recommended to use GetRayIntersection instead.
IgnoreCollision collider1 と collider2 のペア間の衝突/トリガーを検知するか無視するようにします
IgnoreLayerCollision指定されたレイヤーのペア間の衝突を検知するか無視するか選択します
IsTouchingChecks whether the passed Colliders are in contact or not.
IsTouchingLayersChecks whether the Collider is touching any Colliders on the specified layerMask or not.
LinecastCasts a line segment against Colliders in the Scene.
LinecastAllCasts a line against Colliders in the Scene.
LinecastNonAllocCasts a line against Colliders in the Scene. Note: This method will be deprecated in a future build and it is recommended to use Linecast instead.
OverlapAreaChecks 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. Note: This method will be deprecated in a future build and it is recommended to use OverlapArea instead.
OverlapBoxChecks if a Collider falls within a box area.
OverlapBoxAllGet a list of all Colliders that fall within a box area.
OverlapBoxNonAllocGet a list of all Colliders that fall within a box area. Note: This method will be deprecated in a future build and it is recommended to use OverlapBox instead.
OverlapCapsuleChecks if a Collider falls within a capsule area.
OverlapCapsuleAllGet a list of all Colliders that fall within a capsule area.
OverlapCapsuleNonAllocGet a list of all Colliders that fall within a capsule area. Note: This method will be deprecated in a future build and it is recommended to use OverlapCapsule instead.
OverlapCircleChecks 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. Note: This method will be deprecated in a future build and it is recommended to use OverlapCircle instead.
OverlapColliderGets a list of all Colliders that overlap the given Collider.
OverlapPointChecks 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. Note: This method will be deprecated in a future build and it is recommended to use OverlapPoint instead.
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. Note: This method will be deprecated in a future build and it is recommended to use Raycast instead.
SetLayerCollisionMask指定したレイヤーに衝突する可能性があるレイヤーを示す衝突のレイヤーマスクを設定します。
SimulateSimulate physics in the Scene.
SyncTransformsSynchronizes.