Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

CapsuleShape2D

继承: Shape2D < Resource < RefCounted < Object

用于物理碰撞的 2D 胶囊形状。

描述

2D 胶囊形状,旨在用于物理学。通常用于为 CollisionShape2D 提供形状。

性能:CapsuleShape2D 可以快速检查碰撞,但比 RectangleShape2DCircleShape2D 慢。

属性

float

height

30.0

float

radius

10.0


属性说明

float height = 30.0

  • void set_height ( float value )

  • float get_height ( )

胶囊体的高度。


float radius = 10.0

  • void set_radius ( float value )

  • float get_radius ( )

胶囊体的半径。