46 #ifndef __CU_POLYGON_OBSTACLE_H__
47 #define __CU_POLYGON_OBSTACLE_H__
49 #include "CUSimpleObstacle.h"
50 #include <cugl/math/CUPoly2.h>
55 #pragma mark Polygon Obstacle
78 #pragma mark Scene Graph Methods
106 #pragma mark Constructors
157 #pragma mark Static Constructors
168 static std::shared_ptr<PolygonObstacle>
alloc(
const Poly2& poly) {
169 std::shared_ptr<PolygonObstacle> result = std::make_shared<PolygonObstacle>();
170 return (result->init(poly) ? result :
nullptr);
186 static std::shared_ptr<PolygonObstacle>
alloc(
const Poly2& poly,
const Vec2& anchor) {
187 std::shared_ptr<PolygonObstacle> result = std::make_shared<PolygonObstacle>();
188 return (result->init(poly,anchor) ? result :
nullptr);
193 #pragma mark Dimensions
312 #pragma mark Physics Methods
float x
Definition: CUVec2.h:66
float y
Definition: CUVec2.h:68
void setPolygon(const Poly2 &value)
PolygonObstacle(void)
Definition: CUPolygonObstacle.h:114
void setHeight(float value)
Definition: CUPolygonObstacle.h:254
static std::shared_ptr< PolygonObstacle > alloc(const Poly2 &poly)
Definition: CUPolygonObstacle.h:168
Definition: CUPoly2.h:115
void markDirty(bool value)
Definition: CUObstacle.h:811
static std::shared_ptr< PolygonObstacle > alloc(const Poly2 &poly, const Vec2 &anchor)
Definition: CUPolygonObstacle.h:186
const Rect & getBounds() const
Definition: CUPoly2.h:834
int _fixCount
Definition: CUPolygonObstacle.h:74
void setAnchor(const Vec2 &value)
Definition: CUPolygonObstacle.h:278
const Poly2 & getPolygon() const
Definition: CUPolygonObstacle.h:298
Definition: CUPolygonObstacle.h:63
b2Fixture ** _geoms
Definition: CUPolygonObstacle.h:70
b2PolygonShape * _shapes
Definition: CUPolygonObstacle.h:68
virtual bool init(const Poly2 &poly)
Definition: CUPolygonObstacle.h:137
const Vec2 & getAnchor() const
Definition: CUPolygonObstacle.h:266
Definition: CUSimpleObstacle.h:63
float width
Definition: CUSize.h:61
virtual void releaseFixtures() override
void setSize(float width, float height)
Definition: CUPolygonObstacle.h:218
void setWidth(float value)
Definition: CUPolygonObstacle.h:236
virtual void resetDebug() override
float height
Definition: CUSize.h:63
Poly2 _polygon
Definition: CUPolygonObstacle.h:66
virtual ~PolygonObstacle()
const Size & getSize() const
Definition: CUPolygonObstacle.h:199
float getWidth() const
Definition: CUPolygonObstacle.h:225
Size size
Definition: CURect.h:51
Vec2 _anchor
Definition: CUPolygonObstacle.h:72
virtual void createFixtures() override
Definition: CUAnimationNode.h:52
float getHeight() const
Definition: CUPolygonObstacle.h:243
virtual bool init()
Definition: CUObstacle.h:156
void setSize(const Size &value)
Definition: CUPolygonObstacle.h:210
void resize(const Size &size)