Version:

Capsule Shape Component

The Capsule Shape component creates a transparent capsule that’s oriented on the local Z axis. The dimensions of the capsule can be edited with the Height and Radius properties. The Capsule Shape component is not a mesh, but rather a helper geometry that can be used to define volumes for area lights, shape gradients, audio, vegetation, PhysX, and any application that can utilize the Shape EBus. For more information on using Shape components, see Shape components.

Provider

O3DE Core (LmbrCentral) Gem

Capsule Shape properties

Capsule Shape component properties

PropertyDescriptionValuesDefault
VisibleEnable to always display the shape in the viewport, even when the entity is not selected. Disable to hide the shape when the entity is not selected.BooleanEnabled
Game ViewEnable to display the shape while in game mode.BooleanDisabled
FilledEnable to display the shape as filled. Disable to display the shape as a wireframe.BooleanEnabled
Shape ColorThe color of the shape.Eight bits per channel color: 0-255255,255,199
HeightThe height of the shape in meters. The height value must be at least twice the value of Radius.0.0 to Infinity1.0
RadiusThe radius of the shape in meters. The radius value must be no more than half the value of Height.0.0 to Infinity0.25
Translation OffsetTranslation offset of the shape relative to its entity.Vector3: -Infinity to InfinityX:0.0, Y:0.0, Z:0.0
EditChoose the Edit button to enter Edit mode. In Edit mode, you can modify the dimensions of the shape in the viewport using the methods outlined in Edit mode actions below. While in Edit mode, the Edit menu in the menu bar displays available actions and hotkeys. To exit Edit mode, choose Done in the component interface.

Edit mode actions

The edit mode provides two sub-modes. You can switch between sub-modes using the buttons in the Viewport UI Cluster in the top left of the Editor, by using the keyboard hotkeys listed below, or by using Ctrl + Mousewheel Up/Down.

ModeIconKeyboard HotkeyDescription
DimensionsShape component mode dimensions submode icon1Left-click and drag the black handles on the ends of the Capsule Shape to edit the Height. By default, each end of the capsule can be separately edited. Hold Shift to edit both ends symmetrically. Left-click and drag the black handle situated halfway along the Capsule Shape to edit the Radius.
Translation OffsetShape component mode translation offset submode icon2Left-click and drag the linear or planar manipulators to edit the Translation Offset.
Reset Current ModeRResets the properties manipulated by the current sub-mode to their default values.

CapsuleShapeComponentRequestsBus

Use the following request functions with the CapsuleShapeComponentRequestsBus EBus interface to communicate with Capsule Shape components in your game.

Request NameDescriptionParameterReturnScriptable
GetCapsuleConfigurationReturns the configuration of the capsule shape.NoneCapsuleShapeConfig object that contains the properties Height and Radius.Yes
SetHeightSets the Height of the capsule shape.Height: FloatNoneYes
SetRadiusSets the Radius of the capsule shape.Radius: FloatNoneYes

Refer to Shape component Ebus interface for a description of functions that are available to all Shape components.