Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef B2_EDGE_SHAPE_H
00020 #define B2_EDGE_SHAPE_H
00021
00022 #include <Box2D/Collision/Shapes/b2Shape.h>
00023
00027 class b2EdgeShape : public b2Shape
00028 {
00029 public:
00030 b2EdgeShape();
00031
00033 void Set(const b2Vec2& v1, const b2Vec2& v2);
00034
00036 b2Shape* Clone(b2BlockAllocator* allocator) const;
00037
00039 int32 GetChildCount() const;
00040
00042 bool TestPoint(const b2Transform& transform, const b2Vec2& p) const;
00043
00045 bool RayCast(b2RayCastOutput* output, const b2RayCastInput& input,
00046 const b2Transform& transform, int32 childIndex) const;
00047
00049 void ComputeAABB(b2AABB* aabb, const b2Transform& transform, int32 childIndex) const;
00050
00052 void ComputeMass(b2MassData* massData, float32 density) const;
00053
00055 b2Vec2 m_vertex1, m_vertex2;
00056
00058 b2Vec2 m_vertex0, m_vertex3;
00059 bool m_hasVertex0, m_hasVertex3;
00060 };
00061
00062 inline b2EdgeShape::b2EdgeShape()
00063 {
00064 m_type = e_edge;
00065 m_radius = b2_polygonRadius;
00066 m_vertex0.x = 0.0f;
00067 m_vertex0.y = 0.0f;
00068 m_vertex3.x = 0.0f;
00069 m_vertex3.y = 0.0f;
00070 m_hasVertex0 = false;
00071 m_hasVertex3 = false;
00072 }
00073
00074 #endif