I am trying to get sprite shape like this:
auto sprite = getChildByName("mysprite");
auto shape = sprite->getPhysicsBody()->getShape(1);
PhysicsShapePolygon* shapepoly = dynamic_cast<PhysicsShapePolygon*>(shape);
but throws error, cannot dynamic_cast PhysicsShape to PhysicsShapePolygon, but I saw same PhysicsShape to PhysicsShapePolygon dynamic_cast in cpp-test example as function parameter.
In short I am trying to get sprite shape to get polygon point ; this is only possible by casting PhysicsShapePolygon from sprite->getPhysicsBody()->getShape(1);
method. Maybe I mixed too much can anyone help?
I need to use these methods;
Pshapepoly->getPointsCount()
Pshapepoly->getPoints()