CapsuleShape3D
A 3D capsule shape used for physics collision.
A 3D capsule shape used for physics collision.
A 3D capsule shape, intended for use in physics. Usually used to provide a shape for a CollisionShape3D.
Performance: CapsuleShape3D is fast to check collisions against. It is faster than CylinderShape3D, but slower than SphereShape3D and BoxShape3D.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
CapsuleShape3DConstructor
public CapsuleShape3D();Properties3
HeightProperty
public float Height { get; set; }The capsule's full height, including the hemispheres.
Note: The CapsuleShape3D.Height of a capsule must be at least twice its CapsuleShape3D.Radius. Otherwise, the capsule becomes a sphere. If the CapsuleShape3D.Height is less than twice the CapsuleShape3D.Radius, the properties adjust to a valid value.
MidHeightProperty
public float MidHeight { get; set; }The capsule's height, excluding the hemispheres. This is the height of the central cylindrical part in the middle of the capsule, and is the distance between the centers of the two hemispheres. This is a wrapper for CapsuleShape3D.Height.
RadiusProperty
public float Radius { get; set; }The capsule's radius.
Note: The CapsuleShape3D.Radius of a capsule cannot be greater than half of its CapsuleShape3D.Height. Otherwise, the capsule becomes a sphere. If the CapsuleShape3D.Radius is greater than half of the CapsuleShape3D.Height, the properties adjust to a valid value.
Methods6
GetHeightfloat
public float GetHeight();floatGetMidHeightfloat
public float GetMidHeight();floatGetRadiusfloat
public float GetRadius();floatSetHeightvoid
public void SetHeight(float height);| Name | Type | Default |
|---|---|---|
height | float | — |
SetMidHeightvoid
public void SetMidHeight(float midHeight);| Name | Type | Default |
|---|---|---|
midHeight | float | — |
SetRadiusvoid
public void SetRadius(float radius);| Name | Type | Default |
|---|---|---|
radius | float | — |