As<T>()
Return the specified geometric shape stored inside this Geometry Holder object.
Read time 1 minuteLast updated 9 days ago
Definition
- Type: Method
- Namespace: UnityEngine.LowLevelPhysics
- Assembly: UnityEngine.PhysicsModule
public T As<T>() where T : struct, IGeometry
Returns
Type | Description |
|---|---|
| T | Returns the basic geometric shape which is stored in the GeometryHolder. |
Remarks
This function throws an InvalidOperationException if you try to request a geometric shape that is not stored in the GeometryHolder.
In the case of CapsuleGeometry, when Unity retrieves the shape from a CapsuleCollider component, the CapsuleCollider.direction is not included. For this reason, you should assume the direction is always along the X axis.
Additional Resources: BoxGeometry, SphereGeometry, CapsuleGeometry, ConvexMeshGeometry, TriangleMeshGeometry, TerrainGeometry.