~ubuntu-branches/ubuntu/wily/box2d/wily

« back to all changes in this revision

Viewing changes to Box2D/Box2D/Collision/Shapes/b2ChainShape.cpp

  • Committer: Package Import Robot
  • Author(s): Markus Koschany
  • Date: 2014-05-30 18:42:02 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20140530184202-hosw11agojg02ac3
Tags: 2.3.1+ds-1
* Imported Upstream version 2.3.1+ds.
* Fix debian/watch to determine new releases by parsing
  the SVN tags of upstream's version control system.
* Update get-orig-source target for new release.
* dh_strip override: Replace $VER variable with 2.3.0 string.
* debian/copyright: Add new Public Domain and Apache 2.0 license.
* libbox2d-dev.install:
  - Install *.cmake files in /usr/lib/$(DEB_HOST_MULTIARCH)/cmake/Box2D.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#include <Box2D/Collision/Shapes/b2ChainShape.h>
20
20
#include <Box2D/Collision/Shapes/b2EdgeShape.h>
21
21
#include <new>
22
 
#include <memory.h>
 
22
#include <string.h>
23
23
 
24
24
b2ChainShape::~b2ChainShape()
25
25
{
 
26
        Clear();
 
27
}
 
28
 
 
29
void b2ChainShape::Clear()
 
30
{
26
31
        b2Free(m_vertices);
27
32
        m_vertices = NULL;
28
33
        m_count = 0;
56
61
        b2Assert(count >= 2);
57
62
        for (int32 i = 1; i < count; ++i)
58
63
        {
59
 
                b2Vec2 v1 = vertices[i-1];
60
 
                b2Vec2 v2 = vertices[i];
61
64
                // If the code crashes here, it means your vertices are too close together.
62
 
                b2Assert(b2DistanceSquared(v1, v2) > b2_linearSlop * b2_linearSlop);
 
65
                b2Assert(b2DistanceSquared(vertices[i-1], vertices[i]) > b2_linearSlop * b2_linearSlop);
63
66
        }
64
67
 
65
68
        m_count = count;