diff --git a/cocos/physics/CCPhysicsBody.h b/cocos/physics/CCPhysicsBody.h index 8c365d0cb1..e11b54126c 100644 --- a/cocos/physics/CCPhysicsBody.h +++ b/cocos/physics/CCPhysicsBody.h @@ -200,6 +200,13 @@ public: */ inline const Vector& getShapes() const { return _shapes; } + /** + * Get the first shape of the body shapes. + * + * @return The first shape in this body. + */ + inline PhysicsShape* getFirstShape() const { return _shapes.size() >= 1 ? _shapes.at(0) : nullptr; } + /** * get the shape of the body. *