CapsuleShape2D

Hereda: Shape2D < Resource < RefCounted < Object

Una forma de cápsula 2D utilizada para colisiones físicas.

Descripción

Una forma de cápsula 2D, para ser usada en física. Normalmente usada para proveer una forma para un CollisionShape2D.

Rendimiento: CapsuleShape2D es rápida para comprobar colisiones, pero es más lenta que RectangleShape2D y CircleShape2D.

Propiedades

float

height

30.0

float

mid_height

float

radius

10.0


Descripciones de Propiedades

float height = 30.0 🔗

  • void set_height(value: float)

  • float get_height()

The capsule's full height, including the semicircles.

Note: The height of a capsule must be at least twice its radius. Otherwise, the capsule becomes a circle. If the height is less than twice the radius, the properties adjust to a valid value.


float mid_height 🔗

  • void set_mid_height(value: float)

  • float get_mid_height()

La altura de la cápsula, excluyendo los semicírculos. Esta es la altura de la parte rectangular central en el medio de la cápsula, y es la distancia entre los centros de los dos semicírculos. Esto es un envoltorio para height.


float radius = 10.0 🔗

  • void set_radius(value: float)

  • float get_radius()

The capsule's radius.

Note: The radius of a capsule cannot be greater than half of its height. Otherwise, the capsule becomes a circle. If the radius is greater than half of the height, the properties adjust to a valid value.