Version: 2023.2
言語: 日本語

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 重複の解決にかける速度を管理するスケール要素
bounceThresholdAny collisions with a relative linear velocity below this threshold will be treated as inelastic so no bounce will occur.
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物理更新毎のリジッドボディの最大角速度。この値を増やし過ぎると数値的な問題の原因になります。
maxSubStepCountThe maximum number of simulation sub-steps allowed per-frame when simulation sub-stepping is enabled.
maxTranslationSpeed物理更新毎のリジッドボディの最大直線速度。この値を増やし過ぎると数値的な問題の原因になります。
minSubStepFPSThe minimum FPS allowed for a simulation step before sub-stepping will be used.
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.
simulationLayersThe Rigidbody2D and Collider2D layers to simulate.
simulationModeControls when Unity executes the 2D physics simulation.
timeToSleepリジッドボディがスリープするまでの秒単位での最低時間
useSubStepContactsWhether to calculate contacts for all simulation sub-steps or only the first sub-step.
useSubSteppingWhether to use simulation sub-stepping during a simulation step.
velocityIterationsオブジェクトの速度について考慮する場合の物理ソルバーの反復回数

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.
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.
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.
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 2D Colliders in the Scene.
GetRayIntersectionAllCast a 3D ray against the 2D Colliders in the Scene.
GetRayIntersectionNonAllocCast a 3D ray against the 2D Colliders in the Scene.
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.
OverlapAreaChecks if a Collider falls within a rectangular area.
OverlapAreaAllGet a list of all Colliders that fall within a rectangular area.
OverlapBoxChecks if a Collider falls within a box area.
OverlapBoxAllGet a list of all Colliders that fall within a box area.
OverlapCapsuleChecks if a Collider falls within a capsule area.
OverlapCapsuleAllGet a list of all Colliders that fall within a capsule area.
OverlapCircleChecks if a Collider falls within a circular area.
OverlapCircleAllGet a list of all Colliders that fall within a circular area.
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.
RaycastCasts a ray against Colliders in the Scene.
RaycastAllCasts a ray against Colliders in the Scene, returning all Colliders that contact with it.
SetLayerCollisionMask指定したレイヤーに衝突する可能性があるレイヤーを示す衝突のレイヤーマスクを設定します。
SimulateSimulate physics in the default physics scene.
SyncTransformsSynchronizes.