1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- #ifndef B2_EDGE_SHAPE_H
- #define B2_EDGE_SHAPE_H
- #include <Box2D/Collision/Shapes/b2Shape.h>
- class b2EdgeShape : public b2Shape
- {
- public:
- b2EdgeShape();
-
- void Set(const b2Vec2& v1, const b2Vec2& v2);
-
- b2Shape* Clone(b2BlockAllocator* allocator) const;
-
- int32 GetChildCount() const;
-
- bool TestPoint(const b2Transform& transform, const b2Vec2& p) const;
-
- bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input,
- const b2Transform& transform, int32 childIndex) const;
-
- void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const;
-
- void ComputeMass(b2MassData* massData, float32 density) const;
-
-
- b2Vec2 m_vertex1, m_vertex2;
-
- b2Vec2 m_vertex0, m_vertex3;
- bool m_hasVertex0, m_hasVertex3;
- };
- inline b2EdgeShape::b2EdgeShape()
- {
- m_type = e_edge;
- m_radius = b2_polygonRadius;
- m_vertex0.x = 0.0f;
- m_vertex0.y = 0.0f;
- m_vertex3.x = 0.0f;
- m_vertex3.y = 0.0f;
- m_hasVertex0 = false;
- m_hasVertex3 = false;
- }
- #endif
|