- bounceThreshold
- CapsuleCastAll
- CapsuleCast
- CheckCapsule
- CheckSphere
- GetIgnoreLayerCollision
- gravity
- IgnoreCollision
- IgnoreLayerCollision
- Linecast
- maxAngularVelocity
- minPenetrationForPenalty
- OverlapSphere
- RaycastAll
- Raycast
- sleepAngularVelocity
- sleepVelocity
- solverIterationCount
- SphereCastAll
- SphereCast
Physics.SphereCastAll 所有球体投射
static function SphereCastAll (origin : Vector3, radius : float, direction : Vector3, distance : float = Mathf.Infinity, layerMask : int = kDefaultRaycastLayers) : RaycastHit[]
Parameters参数
- originThe center of the sphere at the start of the sweep.
在扫描起点的球体中心点。 - radiusThe radius of the sphere.
球体的半径。 - directionThe direction into which to sweep the sphere.
球体扫描的方向 - distanceThe length of the sweep
扫描的长度 - layerMaskA Layer mask that is used to selectively ignore colliders when casting a capsule.
根据Layer mask层的不同来忽略碰撞体。
RaycastHit[] - an array of all colliders hit in the sweep.
返回扫描碰到所有碰撞体的数组。
Description描述
Like Physics.SphereCast, but this function will return all hits the sphere sweep intersects.
和Physics.SphereCast 不同的是这个函数返回所有交互的碰撞体信息。
Casts a sphere against all colliders in the scene and returns detailed information on each collider which was hit. This is useful when a Raycast does not give enough precision, because you want to find out if an object of a specific size, such as a character, will be able to move somewhere without colliding with anything on the way.
做一个球型物体的投射,对于场景中的所有物体。返回每一个碰撞体的信息。对球型物体做投射时,如果和碰撞体碰撞,raycasthit 结构返回碰撞信息。这可以用在光线投射无法满足要求时的情况下。例如要判断角色(有空间大小尺寸)是否和一个物体发生碰撞。
参见: Physics.SphereCast, Physics.CapsuleCast, Physics.Raycast, Rigidbody.SweepTest
• static function SphereCastAll (ray : Ray, radius : float, distance : float = Mathf.Infinity, layerMask : int = kDefaultRaycastLayers) : RaycastHit[]
Parameters参数
- originThe center of the sphere at the start of the sweep.
在扫描起点的球体中心点。 - radiusThe radius of the sphere.
球体的半径。 - directionThe direction into which to sweep the sphere.
球体扫描的方向 - hitInfoIf true is returned, hitInfo will contain more information about where the collider was hit (See Also: RaycastHit).
如果返回true,hitInfo将包含碰到器碰撞的更多信息。 - distanceThe length of the sweep
扫描的长度 - layerMaskA Layer mask that is used to selectively ignore colliders when casting a capsule.
根据Layer mask层的不同来忽略碰撞体。
RaycastHit[] - an array of all colliders hit in the sweep. *listonly*
返回扫描碰到所有碰撞体的数组。
Description描述