Version: 2022.3
言語: 日本語

Physics

class in UnityEngine

マニュアルに切り替える

説明

物理システムのグローバル設定とヘルパーメソッドです。

Static 変数

AllLayersすべてのレイヤーを選択するレイヤーマスク定数
autoSyncTransformsWhether or not to automatically sync transform changes with the physics system whenever a Transform component changes.
bounceThresholdこの相対速度を下回るオブジェクトがぶつかっても跳ねません(デフォルトでは2になっています)。必ず正の値にしてください。
clothGravityCloth Gravity setting. Set gravity for all cloth components.
defaultContactOffset新しく生成されたコライダーのデフォルト接触オフセット
defaultMaxAngularSpeedDefault maximum angular speed of the dynamic Rigidbody, in radians (default 50).
defaultMaxDepenetrationVelocityThe maximum default velocity needed to move a Rigidbody's collider out of another collider's surface penetration. Must be positive.
defaultPhysicsSceneThe PhysicsScene automatically created when Unity starts.
DefaultRaycastLayersデフォルトの Raycast レイヤーを選択するレイヤーマスク定数
defaultSolverIterationsdefaultSolverIterations は、リジッドボディのジョイントと接点が解決される精度を定義します。デフォルトは 6。正数でなければなりません。
defaultSolverVelocityIterationsThe defaultSolverVelocityIterations affects how accurately the Rigidbody joints and collision contacts are resolved. (default 1). Must be positive.
gravityThe gravity applied to all rigid bodies in the Scene.
IgnoreRaycastLayer無視するレイキャストレイヤーを選択するレイヤーマスク定数
improvedPatchFrictionEnables an improved patch friction mode that guarantees static and dynamic friction do not exceed analytical results.
interCollisionDistanceSets the minimum separation distance for cloth inter-collision.
interCollisionStiffnessSets the cloth inter-collision stiffness.
invokeCollisionCallbacksWhether or not MonoBehaviour collision messages will be sent by the physics system.
queriesHitBackfacesWhether physics queries should hit back-face triangles.
queriesHitTriggers(Raycast, SphereCast, Overlap テストなどによる)検索がトリガーに当たるかのデフォルト設定を指定します。
reuseCollisionCallbacksDetermines whether the garbage collector should reuse only a single instance of a Collision type for all collision callbacks.
simulationModeControls when Unity executes the physics simulation.
sleepThresholdオブジェクトがスリープ状態に入る、質量で正規化された運動エネルギーのしきい値。

Static 関数

BakeMeshPrepares the mesh for use with a MeshCollider and uses default cooking options.
BoxCastボックスのレイを飛ばし、オブジェクトコライダーの付いたオブジェクトがヒットするかを調べ、ヒットしたら詳細情報を返します
BoxCastAll Physics.BoxCast と似ていますが、衝突結果をすべて返します。
BoxCastNonAllocdirection に沿ってボックスを投射し、与えられたバッファに衝突情報を保存します。
CapsuleCastCasts a capsule against all colliders in the Scene and returns detailed information on what was hit.
CapsuleCastAll Physics.CapsuleCast のようですが、この関数はヒットしたすべての情報を取得します
CapsuleCastNonAllocCasts a capsule against all colliders in the Scene and returns detailed information on what was hit into the buffer.
CheckBox指定したボックスが他のコライダーと重なっているか確認します。
CheckCapsuleワールド空間内のコライダーのいずれかがカプセル型と重なっているか。
CheckSphere指定の位置に球体を作成し、start から end までの間にコライダーの付いたオブジェクトがヒットするか調べます。ヒットした場合、true を返します。
ClosestPointReturns a point on the given collider that is closest to the specified location.
ComputePenetrationCompute the minimal translation required to separate the given colliders apart at specified poses.
GetIgnoreCollision衝突判定システムが collider1 と collider2 間のすべての衝突/トリガーを無視するかを確認します。
GetIgnoreLayerCollisionレイヤーの衝突判定が無効化されているかどうか
IgnoreCollision2 つのコライダーの衝突判定を無効化します
IgnoreLayerCollision2 つのレイヤーによるコライダーの衝突判定を無効化しますIgnoreLayerCollision は影響されたコライダーのトリガー状態をリセットします。そのため、この機能の呼び出しに応じて OnTriggerExit と OnTriggerEnter メッセージを受け取るかもしれません。
Linecast始点と終点を設定してそこに線を張り、コライダーがヒットした場合 true を返します
OverlapBox指定したボックスと重なっているコライダーをすべて見つけます。
OverlapBoxNonAlloc指定したボックスと重なっているコライダーをすべて見つけ、バッファ内に保存します。
OverlapCapsule指定したカプセルを物理ベースの世界で確認し、重なるコライダーをすべて返します。
OverlapCapsuleNonAlloc指定したカプセルを物理ベースの世界で確認し、重なるコライダーをすべてユーザー指定のバッファに返します。
OverlapSphereComputes and stores colliders touching or inside the sphere.
OverlapSphereNonAlloc球に触れている/中にあるコライダーを演算し、与えたバッファに保存します。
RaycastCasts a ray, from point origin, in direction direction, of length maxDistance, against all colliders in the Scene.
RaycastAllCasts a ray through the Scene and returns all hits. Note that order of the results is undefined.
RaycastNonAllocCast a ray through the Scene and store the hits into the buffer.
RebuildBroadphaseRegionsRebuild the broadphase interest regions as well as set the world boundaries.
SimulateSimulate physics in the Scene.
SphereCast球体のレイを飛ばし、オブジェクトコライダーの付いたオブジェクトがヒットするかを調べ、ヒットしたら詳細情報を返します
SphereCastAll Physics.SphereCast と似ていますがゴミを発生させません。
SphereCastNonAlloc球形を direction に沿って投射し、バッファに結果を保存します。
SyncTransformsApply Transform changes to the physics engine.

Events

ContactEventSubscribe to this event to read all collisions that occurred during the physics simulation step.
ContactModifyEventSubscribe to this event to be able to customize the collision response for contact pairs.
ContactModifyEventCCDSubscribe to this event to be able to customize the collision response of CCD generated contact pairs.

デリゲート

ContactEventDelegate