Version: 2022.3

PhysicsScene

struct in UnityEngine

切换到手册

描述

表示 3D 物理场景的单个实例。

公共函数

BoxCast沿射线投射盒体并返回有关命中对象的详细信息。
CapsuleCast向物理场景中的所有碰撞体投射胶囊体,并返回有关命中对象的详细信息。
InterpolateBodiesInterpolates Rigidbodies in this PhysicsScene.
IsEmpty获取物理场景是否为空。
IsValid获取物理场景是否有效。
OverlapBox查找与给定盒体接触或位于盒体内部的所有碰撞体,并将它们存储到缓冲区中。
OverlapCapsule在物理世界中检查给定胶囊体,并在用户提供的缓冲区中返回所有重叠的碰撞体。
OverlapSphere计算与球体接触或位于球体内部的碰撞体,并将它们存储到提供的缓冲区中。
Raycast向场景中的所有碰撞体投射一条射线,该射线起点为 /origin/,朝向 /direction/,长度为 /maxDistance/。
ResetInterpolationPosesResets the Transform positions of interpolated and extrapolated Rigidbodies in this PhysicsScene to Rigidbody.position and Transform rotations to Rigidbody.rotation.
Simulate进行与此 PhysicsScene 关联的物理模拟。
SphereCast沿射线投射球体并返回有关命中对象的详细信息。