Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergej Reich <sergej.reich@googlemail.com>2012-06-08 20:13:01 +0400
committerSergej Reich <sergej.reich@googlemail.com>2012-06-08 20:13:01 +0400
commit82d3d9f2ba47bbf2f868b5a970d1fe149eba13e2 (patch)
treee99d947080f8e787059d86500f01dd6c1ad616e4 /extern/bullet2/src/LinearMath
parent221a7878223e983372ba830e4ca1a17067abf2ba (diff)
Update Bullet to version 2.80 (bullet svn revision 2537)
Remove Jamfiles and other unused files that stuck around during previous updates. Add patches for local changes to the patches directory. Update readme.txt, it had outdated infromation.
Diffstat (limited to 'extern/bullet2/src/LinearMath')
-rw-r--r--extern/bullet2/src/LinearMath/btAabbUtil2.h6
-rw-r--r--extern/bullet2/src/LinearMath/btAlignedAllocator.cpp15
-rw-r--r--extern/bullet2/src/LinearMath/btAlignedObjectArray.h33
-rw-r--r--extern/bullet2/src/LinearMath/btConvexHull.h6
-rw-r--r--extern/bullet2/src/LinearMath/btConvexHullComputer.cpp2751
-rw-r--r--extern/bullet2/src/LinearMath/btConvexHullComputer.h103
-rw-r--r--extern/bullet2/src/LinearMath/btDefaultMotionState.h6
-rw-r--r--extern/bullet2/src/LinearMath/btGrahamScan2dConvexHull.h110
-rw-r--r--extern/bullet2/src/LinearMath/btHashMap.h16
-rw-r--r--extern/bullet2/src/LinearMath/btIDebugDraw.h7
-rw-r--r--extern/bullet2/src/LinearMath/btList.h6
-rw-r--r--extern/bullet2/src/LinearMath/btMinMax.h8
-rw-r--r--extern/bullet2/src/LinearMath/btPoint3.h24
-rw-r--r--extern/bullet2/src/LinearMath/btPoolAllocator.h5
-rw-r--r--extern/bullet2/src/LinearMath/btQuadWord.h6
-rw-r--r--extern/bullet2/src/LinearMath/btQuaternion.h53
-rw-r--r--extern/bullet2/src/LinearMath/btQuickprof.cpp3
-rw-r--r--extern/bullet2/src/LinearMath/btQuickprof.h15
-rw-r--r--extern/bullet2/src/LinearMath/btRandom.h6
-rw-r--r--extern/bullet2/src/LinearMath/btScalar.h37
-rw-r--r--extern/bullet2/src/LinearMath/btSerializer.cpp1145
-rw-r--r--extern/bullet2/src/LinearMath/btSerializer.h30
-rw-r--r--extern/bullet2/src/LinearMath/btSimdMinMax.h41
-rw-r--r--extern/bullet2/src/LinearMath/btTransform.h6
-rw-r--r--extern/bullet2/src/LinearMath/btTransformUtil.h6
-rw-r--r--extern/bullet2/src/LinearMath/btVector3.h6
26 files changed, 3707 insertions, 743 deletions
diff --git a/extern/bullet2/src/LinearMath/btAabbUtil2.h b/extern/bullet2/src/LinearMath/btAabbUtil2.h
index 532ce1bf633..42b721dea22 100644
--- a/extern/bullet2/src/LinearMath/btAabbUtil2.h
+++ b/extern/bullet2/src/LinearMath/btAabbUtil2.h
@@ -14,8 +14,8 @@ subject to the following restrictions:
-#ifndef AABB_UTIL2
-#define AABB_UTIL2
+#ifndef BT_AABB_UTIL2
+#define BT_AABB_UTIL2
#include "btTransform.h"
#include "btVector3.h"
@@ -231,6 +231,6 @@ SIMD_FORCE_INLINE void btTransformAabb(const btVector3& localAabbMin,const btVec
}
#endif //USE_BANCHLESS
-#endif
+#endif //BT_AABB_UTIL2
diff --git a/extern/bullet2/src/LinearMath/btAlignedAllocator.cpp b/extern/bullet2/src/LinearMath/btAlignedAllocator.cpp
index 189b759d237..c4c0ceb2ed2 100644
--- a/extern/bullet2/src/LinearMath/btAlignedAllocator.cpp
+++ b/extern/bullet2/src/LinearMath/btAlignedAllocator.cpp
@@ -58,16 +58,18 @@ static inline void btAlignedFreeDefault(void *ptr)
free(ptr);
}
#else
+
+
+
+
+
static inline void *btAlignedAllocDefault(size_t size, int alignment)
{
void *ret;
char *real;
- unsigned long offset;
-
real = (char *)sAllocFunc(size + sizeof(void *) + (alignment-1));
if (real) {
- offset = (alignment - (unsigned long)(real + sizeof(void *))) & (alignment-1);
- ret = (void *)((real + sizeof(void *)) + offset);
+ ret = btAlignPointer(real + sizeof(void *),alignment);
*((void **)(ret)-1) = (void *)(real);
} else {
ret = (void *)(real);
@@ -110,7 +112,6 @@ void* btAlignedAllocInternal (size_t size, int alignment,int line,char* filen
{
void *ret;
char *real;
- unsigned long offset;
gTotalBytesAlignedAllocs += size;
gNumAlignedAllocs++;
@@ -118,9 +119,7 @@ void* btAlignedAllocInternal (size_t size, int alignment,int line,char* filen
real = (char *)sAllocFunc(size + 2*sizeof(void *) + (alignment-1));
if (real) {
- offset = (alignment - (unsigned long)(real + 2*sizeof(void *))) &
-(alignment-1);
- ret = (void *)((real + 2*sizeof(void *)) + offset);
+ ret = (void*) btAlignPointer((real + 2*sizeof(void *), alignment);
*((void **)(ret)-1) = (void *)(real);
*((int*)(ret)-2) = size;
diff --git a/extern/bullet2/src/LinearMath/btAlignedObjectArray.h b/extern/bullet2/src/LinearMath/btAlignedObjectArray.h
index 955bb128e83..36090e13c89 100644
--- a/extern/bullet2/src/LinearMath/btAlignedObjectArray.h
+++ b/extern/bullet2/src/LinearMath/btAlignedObjectArray.h
@@ -28,6 +28,7 @@ subject to the following restrictions:
#define BT_USE_PLACEMENT_NEW 1
//#define BT_USE_MEMCPY 1 //disable, because it is cumbersome to find out for each platform where memcpy is defined. It can be in <memory.h> or <string.h> or otherwise...
+#define BT_ALLOW_ARRAY_COPY_OPERATOR // enabling this can accidently perform deep copies of data if you are not careful
#ifdef BT_USE_MEMCPY
#include <memory.h>
@@ -53,7 +54,19 @@ class btAlignedObjectArray
//PCK: added this line
bool m_ownsMemory;
- protected:
+#ifdef BT_ALLOW_ARRAY_COPY_OPERATOR
+public:
+ SIMD_FORCE_INLINE btAlignedObjectArray<T>& operator=(const btAlignedObjectArray<T> &other)
+ {
+ copyFromArray(other);
+ return *this;
+ }
+#else//BT_ALLOW_ARRAY_COPY_OPERATOR
+private:
+ SIMD_FORCE_INLINE btAlignedObjectArray<T>& operator=(const btAlignedObjectArray<T> &other);
+#endif//BT_ALLOW_ARRAY_COPY_OPERATOR
+
+protected:
SIMD_FORCE_INLINE int allocSize(int size)
{
return (size ? size*2 : 1);
@@ -140,21 +153,29 @@ class btAlignedObjectArray
SIMD_FORCE_INLINE const T& at(int n) const
{
+ btAssert(n>=0);
+ btAssert(n<size());
return m_data[n];
}
SIMD_FORCE_INLINE T& at(int n)
{
+ btAssert(n>=0);
+ btAssert(n<size());
return m_data[n];
}
SIMD_FORCE_INLINE const T& operator[](int n) const
{
+ btAssert(n>=0);
+ btAssert(n<size());
return m_data[n];
}
SIMD_FORCE_INLINE T& operator[](int n)
{
+ btAssert(n>=0);
+ btAssert(n<size());
return m_data[n];
}
@@ -171,6 +192,7 @@ class btAlignedObjectArray
SIMD_FORCE_INLINE void pop_back()
{
+ btAssert(m_size>0);
m_size--;
m_data[m_size].~T();
}
@@ -291,8 +313,9 @@ class btAlignedObjectArray
}
};
+
template <typename L>
- void quickSortInternal(L CompareFunc,int lo, int hi)
+ void quickSortInternal(const L& CompareFunc,int lo, int hi)
{
// lo is the lower index, hi is the upper index
// of the region of array a that is to be sorted
@@ -322,7 +345,7 @@ class btAlignedObjectArray
template <typename L>
- void quickSort(L CompareFunc)
+ void quickSort(const L& CompareFunc)
{
//don't sort 0 or 1 elements
if (size()>1)
@@ -334,7 +357,7 @@ class btAlignedObjectArray
///heap sort from http://www.csse.monash.edu.au/~lloyd/tildeAlgDS/Sort/Heap/
template <typename L>
- void downHeap(T *pArr, int k, int n,L CompareFunc)
+ void downHeap(T *pArr, int k, int n, const L& CompareFunc)
{
/* PRE: a[k+1..N] is a heap */
/* POST: a[k..N] is a heap */
@@ -380,7 +403,7 @@ class btAlignedObjectArray
}
template <typename L>
- void heapSort(L CompareFunc)
+ void heapSort(const L& CompareFunc)
{
/* sort a[0..N-1], N.B. 0 to N-1 */
int k;
diff --git a/extern/bullet2/src/LinearMath/btConvexHull.h b/extern/bullet2/src/LinearMath/btConvexHull.h
index a23fa4d550f..69c52bc6f83 100644
--- a/extern/bullet2/src/LinearMath/btConvexHull.h
+++ b/extern/bullet2/src/LinearMath/btConvexHull.h
@@ -16,8 +16,8 @@ subject to the following restrictions:
///includes modifications/improvements by John Ratcliff, see BringOutYourDead below.
-#ifndef CD_HULL_H
-#define CD_HULL_H
+#ifndef BT_CD_HULL_H
+#define BT_CD_HULL_H
#include "btVector3.h"
#include "btAlignedObjectArray.h"
@@ -237,5 +237,5 @@ private:
};
-#endif
+#endif //BT_CD_HULL_H
diff --git a/extern/bullet2/src/LinearMath/btConvexHullComputer.cpp b/extern/bullet2/src/LinearMath/btConvexHullComputer.cpp
new file mode 100644
index 00000000000..c03c901c051
--- /dev/null
+++ b/extern/bullet2/src/LinearMath/btConvexHullComputer.cpp
@@ -0,0 +1,2751 @@
+/*
+Copyright (c) 2011 Ole Kniemeyer, MAXON, www.maxon.net
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#include <string.h>
+
+#include "btConvexHullComputer.h"
+#include "btAlignedObjectArray.h"
+#include "btMinMax.h"
+#include "btVector3.h"
+
+#ifdef __GNUC__
+ #include <stdint.h>
+#elif defined(_MSC_VER)
+ typedef __int32 int32_t;
+ typedef __int64 int64_t;
+ typedef unsigned __int32 uint32_t;
+ typedef unsigned __int64 uint64_t;
+#else
+ typedef int int32_t;
+ typedef long long int int64_t;
+ typedef unsigned int uint32_t;
+ typedef unsigned long long int uint64_t;
+#endif
+
+
+//The definition of USE_X86_64_ASM is moved into the build system. You can enable it manually by commenting out the following lines
+//#if (defined(__GNUC__) && defined(__x86_64__) && !defined(__ICL)) // || (defined(__ICL) && defined(_M_X64)) bug in Intel compiler, disable inline assembly
+// #define USE_X86_64_ASM
+//#endif
+
+
+//#define DEBUG_CONVEX_HULL
+//#define SHOW_ITERATIONS
+
+#if defined(DEBUG_CONVEX_HULL) || defined(SHOW_ITERATIONS)
+ #include <stdio.h>
+#endif
+
+// Convex hull implementation based on Preparata and Hong
+// Ole Kniemeyer, MAXON Computer GmbH
+class btConvexHullInternal
+{
+ public:
+
+ class Point64
+ {
+ public:
+ int64_t x;
+ int64_t y;
+ int64_t z;
+
+ Point64(int64_t x, int64_t y, int64_t z): x(x), y(y), z(z)
+ {
+ }
+
+ bool isZero()
+ {
+ return (x == 0) && (y == 0) && (z == 0);
+ }
+
+ int64_t dot(const Point64& b) const
+ {
+ return x * b.x + y * b.y + z * b.z;
+ }
+ };
+
+ class Point32
+ {
+ public:
+ int32_t x;
+ int32_t y;
+ int32_t z;
+ int index;
+
+ Point32()
+ {
+ }
+
+ Point32(int32_t x, int32_t y, int32_t z): x(x), y(y), z(z), index(-1)
+ {
+ }
+
+ bool operator==(const Point32& b) const
+ {
+ return (x == b.x) && (y == b.y) && (z == b.z);
+ }
+
+ bool operator!=(const Point32& b) const
+ {
+ return (x != b.x) || (y != b.y) || (z != b.z);
+ }
+
+ bool isZero()
+ {
+ return (x == 0) && (y == 0) && (z == 0);
+ }
+
+ Point64 cross(const Point32& b) const
+ {
+ return Point64(y * b.z - z * b.y, z * b.x - x * b.z, x * b.y - y * b.x);
+ }
+
+ Point64 cross(const Point64& b) const
+ {
+ return Point64(y * b.z - z * b.y, z * b.x - x * b.z, x * b.y - y * b.x);
+ }
+
+ int64_t dot(const Point32& b) const
+ {
+ return x * b.x + y * b.y + z * b.z;
+ }
+
+ int64_t dot(const Point64& b) const
+ {
+ return x * b.x + y * b.y + z * b.z;
+ }
+
+ Point32 operator+(const Point32& b) const
+ {
+ return Point32(x + b.x, y + b.y, z + b.z);
+ }
+
+ Point32 operator-(const Point32& b) const
+ {
+ return Point32(x - b.x, y - b.y, z - b.z);
+ }
+ };
+
+ class Int128
+ {
+ public:
+ uint64_t low;
+ uint64_t high;
+
+ Int128()
+ {
+ }
+
+ Int128(uint64_t low, uint64_t high): low(low), high(high)
+ {
+ }
+
+ Int128(uint64_t low): low(low), high(0)
+ {
+ }
+
+ Int128(int64_t value): low(value), high((value >= 0) ? 0 : (uint64_t) -1LL)
+ {
+ }
+
+ static Int128 mul(int64_t a, int64_t b);
+
+ static Int128 mul(uint64_t a, uint64_t b);
+
+ Int128 operator-() const
+ {
+ return Int128((uint64_t) -(int64_t)low, ~high + (low == 0));
+ }
+
+ Int128 operator+(const Int128& b) const
+ {
+#ifdef USE_X86_64_ASM
+ Int128 result;
+ __asm__ ("addq %[bl], %[rl]\n\t"
+ "adcq %[bh], %[rh]\n\t"
+ : [rl] "=r" (result.low), [rh] "=r" (result.high)
+ : "0"(low), "1"(high), [bl] "g"(b.low), [bh] "g"(b.high)
+ : "cc" );
+ return result;
+#else
+ uint64_t lo = low + b.low;
+ return Int128(lo, high + b.high + (lo < low));
+#endif
+ }
+
+ Int128 operator-(const Int128& b) const
+ {
+#ifdef USE_X86_64_ASM
+ Int128 result;
+ __asm__ ("subq %[bl], %[rl]\n\t"
+ "sbbq %[bh], %[rh]\n\t"
+ : [rl] "=r" (result.low), [rh] "=r" (result.high)
+ : "0"(low), "1"(high), [bl] "g"(b.low), [bh] "g"(b.high)
+ : "cc" );
+ return result;
+#else
+ return *this + -b;
+#endif
+ }
+
+ Int128& operator+=(const Int128& b)
+ {
+#ifdef USE_X86_64_ASM
+ __asm__ ("addq %[bl], %[rl]\n\t"
+ "adcq %[bh], %[rh]\n\t"
+ : [rl] "=r" (low), [rh] "=r" (high)
+ : "0"(low), "1"(high), [bl] "g"(b.low), [bh] "g"(b.high)
+ : "cc" );
+#else
+ uint64_t lo = low + b.low;
+ if (lo < low)
+ {
+ ++high;
+ }
+ low = lo;
+ high += b.high;
+#endif
+ return *this;
+ }
+
+ Int128& operator++()
+ {
+ if (++low == 0)
+ {
+ ++high;
+ }
+ return *this;
+ }
+
+ Int128 operator*(int64_t b) const;
+
+ btScalar toScalar() const
+ {
+ return ((int64_t) high >= 0) ? btScalar(high) * (btScalar(0x100000000LL) * btScalar(0x100000000LL)) + btScalar(low)
+ : -(-*this).toScalar();
+ }
+
+ int getSign() const
+ {
+ return ((int64_t) high < 0) ? -1 : (high || low) ? 1 : 0;
+ }
+
+ bool operator<(const Int128& b) const
+ {
+ return (high < b.high) || ((high == b.high) && (low < b.low));
+ }
+
+ int ucmp(const Int128&b) const
+ {
+ if (high < b.high)
+ {
+ return -1;
+ }
+ if (high > b.high)
+ {
+ return 1;
+ }
+ if (low < b.low)
+ {
+ return -1;
+ }
+ if (low > b.low)
+ {
+ return 1;
+ }
+ return 0;
+ }
+ };
+
+
+ class Rational64
+ {
+ private:
+ uint64_t m_numerator;
+ uint64_t m_denominator;
+ int sign;
+
+ public:
+ Rational64(int64_t numerator, int64_t denominator)
+ {
+ if (numerator > 0)
+ {
+ sign = 1;
+ m_numerator = (uint64_t) numerator;
+ }
+ else if (numerator < 0)
+ {
+ sign = -1;
+ m_numerator = (uint64_t) -numerator;
+ }
+ else
+ {
+ sign = 0;
+ m_numerator = 0;
+ }
+ if (denominator > 0)
+ {
+ m_denominator = (uint64_t) denominator;
+ }
+ else if (denominator < 0)
+ {
+ sign = -sign;
+ m_denominator = (uint64_t) -denominator;
+ }
+ else
+ {
+ m_denominator = 0;
+ }
+ }
+
+ bool isNegativeInfinity() const
+ {
+ return (sign < 0) && (m_denominator == 0);
+ }
+
+ bool isNaN() const
+ {
+ return (sign == 0) && (m_denominator == 0);
+ }
+
+ int compare(const Rational64& b) const;
+
+ btScalar toScalar() const
+ {
+ return sign * ((m_denominator == 0) ? SIMD_INFINITY : (btScalar) m_numerator / m_denominator);
+ }
+ };
+
+
+ class Rational128
+ {
+ private:
+ Int128 numerator;
+ Int128 denominator;
+ int sign;
+ bool isInt64;
+
+ public:
+ Rational128(int64_t value)
+ {
+ if (value > 0)
+ {
+ sign = 1;
+ this->numerator = value;
+ }
+ else if (value < 0)
+ {
+ sign = -1;
+ this->numerator = -value;
+ }
+ else
+ {
+ sign = 0;
+ this->numerator = (uint64_t) 0;
+ }
+ this->denominator = (uint64_t) 1;
+ isInt64 = true;
+ }
+
+ Rational128(const Int128& numerator, const Int128& denominator)
+ {
+ sign = numerator.getSign();
+ if (sign >= 0)
+ {
+ this->numerator = numerator;
+ }
+ else
+ {
+ this->numerator = -numerator;
+ }
+ int dsign = denominator.getSign();
+ if (dsign >= 0)
+ {
+ this->denominator = denominator;
+ }
+ else
+ {
+ sign = -sign;
+ this->denominator = -denominator;
+ }
+ isInt64 = false;
+ }
+
+ int compare(const Rational128& b) const;
+
+ int compare(int64_t b) const;
+
+ btScalar toScalar() const
+ {
+ return sign * ((denominator.getSign() == 0) ? SIMD_INFINITY : numerator.toScalar() / denominator.toScalar());
+ }
+ };
+
+ class PointR128
+ {
+ public:
+ Int128 x;
+ Int128 y;
+ Int128 z;
+ Int128 denominator;
+
+ PointR128()
+ {
+ }
+
+ PointR128(Int128 x, Int128 y, Int128 z, Int128 denominator): x(x), y(y), z(z), denominator(denominator)
+ {
+ }
+
+ btScalar xvalue() const
+ {
+ return x.toScalar() / denominator.toScalar();
+ }
+
+ btScalar yvalue() const
+ {
+ return y.toScalar() / denominator.toScalar();
+ }
+
+ btScalar zvalue() const
+ {
+ return z.toScalar() / denominator.toScalar();
+ }
+ };
+
+
+ class Edge;
+ class Face;
+
+ class Vertex
+ {
+ public:
+ Vertex* next;
+ Vertex* prev;
+ Edge* edges;
+ Face* firstNearbyFace;
+ Face* lastNearbyFace;
+ PointR128 point128;
+ Point32 point;
+ int copy;
+
+ Vertex(): next(NULL), prev(NULL), edges(NULL), firstNearbyFace(NULL), lastNearbyFace(NULL), copy(-1)
+ {
+ }
+
+#ifdef DEBUG_CONVEX_HULL
+ void print()
+ {
+ printf("V%d (%d, %d, %d)", point.index, point.x, point.y, point.z);
+ }
+
+ void printGraph();
+#endif
+
+ Point32 operator-(const Vertex& b) const
+ {
+ return point - b.point;
+ }
+
+ Rational128 dot(const Point64& b) const
+ {
+ return (point.index >= 0) ? Rational128(point.dot(b))
+ : Rational128(point128.x * b.x + point128.y * b.y + point128.z * b.z, point128.denominator);
+ }
+
+ btScalar xvalue() const
+ {
+ return (point.index >= 0) ? btScalar(point.x) : point128.xvalue();
+ }
+
+ btScalar yvalue() const
+ {
+ return (point.index >= 0) ? btScalar(point.y) : point128.yvalue();
+ }
+
+ btScalar zvalue() const
+ {
+ return (point.index >= 0) ? btScalar(point.z) : point128.zvalue();
+ }
+
+ void receiveNearbyFaces(Vertex* src)
+ {
+ if (lastNearbyFace)
+ {
+ lastNearbyFace->nextWithSameNearbyVertex = src->firstNearbyFace;
+ }
+ else
+ {
+ firstNearbyFace = src->firstNearbyFace;
+ }
+ if (src->lastNearbyFace)
+ {
+ lastNearbyFace = src->lastNearbyFace;
+ }
+ for (Face* f = src->firstNearbyFace; f; f = f->nextWithSameNearbyVertex)
+ {
+ btAssert(f->nearbyVertex == src);
+ f->nearbyVertex = this;
+ }
+ src->firstNearbyFace = NULL;
+ src->lastNearbyFace = NULL;
+ }
+ };
+
+
+ class Edge
+ {
+ public:
+ Edge* next;
+ Edge* prev;
+ Edge* reverse;
+ Vertex* target;
+ Face* face;
+ int copy;
+
+ ~Edge()
+ {
+ next = NULL;
+ prev = NULL;
+ reverse = NULL;
+ target = NULL;
+ face = NULL;
+ }
+
+ void link(Edge* n)
+ {
+ btAssert(reverse->target == n->reverse->target);
+ next = n;
+ n->prev = this;
+ }
+
+#ifdef DEBUG_CONVEX_HULL
+ void print()
+ {
+ printf("E%p : %d -> %d, n=%p p=%p (0 %d\t%d\t%d) -> (%d %d %d)", this, reverse->target->point.index, target->point.index, next, prev,
+ reverse->target->point.x, reverse->target->point.y, reverse->target->point.z, target->point.x, target->point.y, target->point.z);
+ }
+#endif
+ };
+
+ class Face
+ {
+ public:
+ Face* next;
+ Vertex* nearbyVertex;
+ Face* nextWithSameNearbyVertex;
+ Point32 origin;
+ Point32 dir0;
+ Point32 dir1;
+
+ Face(): next(NULL), nearbyVertex(NULL), nextWithSameNearbyVertex(NULL)
+ {
+ }
+
+ void init(Vertex* a, Vertex* b, Vertex* c)
+ {
+ nearbyVertex = a;
+ origin = a->point;
+ dir0 = *b - *a;
+ dir1 = *c - *a;
+ if (a->lastNearbyFace)
+ {
+ a->lastNearbyFace->nextWithSameNearbyVertex = this;
+ }
+ else
+ {
+ a->firstNearbyFace = this;
+ }
+ a->lastNearbyFace = this;
+ }
+
+ Point64 getNormal()
+ {
+ return dir0.cross(dir1);
+ }
+ };
+
+ template<typename UWord, typename UHWord> class DMul
+ {
+ private:
+ static uint32_t high(uint64_t value)
+ {
+ return (uint32_t) (value >> 32);
+ }
+
+ static uint32_t low(uint64_t value)
+ {
+ return (uint32_t) value;
+ }
+
+ static uint64_t mul(uint32_t a, uint32_t b)
+ {
+ return (uint64_t) a * (uint64_t) b;
+ }
+
+ static void shlHalf(uint64_t& value)
+ {
+ value <<= 32;
+ }
+
+ static uint64_t high(Int128 value)
+ {
+ return value.high;
+ }
+
+ static uint64_t low(Int128 value)
+ {
+ return value.low;
+ }
+
+ static Int128 mul(uint64_t a, uint64_t b)
+ {
+ return Int128::mul(a, b);
+ }
+
+ static void shlHalf(Int128& value)
+ {
+ value.high = value.low;
+ value.low = 0;
+ }
+
+ public:
+
+ static void mul(UWord a, UWord b, UWord& resLow, UWord& resHigh)
+ {
+ UWord p00 = mul(low(a), low(b));
+ UWord p01 = mul(low(a), high(b));
+ UWord p10 = mul(high(a), low(b));
+ UWord p11 = mul(high(a), high(b));
+ UWord p0110 = UWord(low(p01)) + UWord(low(p10));
+ p11 += high(p01);
+ p11 += high(p10);
+ p11 += high(p0110);
+ shlHalf(p0110);
+ p00 += p0110;
+ if (p00 < p0110)
+ {
+ ++p11;
+ }
+ resLow = p00;
+ resHigh = p11;
+ }
+ };
+
+ private:
+
+ class IntermediateHull
+ {
+ public:
+ Vertex* minXy;
+ Vertex* maxXy;
+ Vertex* minYx;
+ Vertex* maxYx;
+
+ IntermediateHull(): minXy(NULL), maxXy(NULL), minYx(NULL), maxYx(NULL)
+ {
+ }
+
+ void print();
+ };
+
+ enum Orientation {NONE, CLOCKWISE, COUNTER_CLOCKWISE};
+
+ template <typename T> class PoolArray
+ {
+ private:
+ T* array;
+ int size;
+
+ public:
+ PoolArray<T>* next;
+
+ PoolArray(int size): size(size), next(NULL)
+ {
+ array = (T*) btAlignedAlloc(sizeof(T) * size, 16);
+ }
+
+ ~PoolArray()
+ {
+ btAlignedFree(array);
+ }
+
+ T* init()
+ {
+ T* o = array;
+ for (int i = 0; i < size; i++, o++)
+ {
+ o->next = (i+1 < size) ? o + 1 : NULL;
+ }
+ return array;
+ }
+ };
+
+ template <typename T> class Pool
+ {
+ private:
+ PoolArray<T>* arrays;
+ PoolArray<T>* nextArray;
+ T* freeObjects;
+ int arraySize;
+
+ public:
+ Pool(): arrays(NULL), nextArray(NULL), freeObjects(NULL), arraySize(256)
+ {
+ }
+
+ ~Pool()
+ {
+ while (arrays)
+ {
+ PoolArray<T>* p = arrays;
+ arrays = p->next;
+ p->~PoolArray<T>();
+ btAlignedFree(p);
+ }
+ }
+
+ void reset()
+ {
+ nextArray = arrays;
+ freeObjects = NULL;
+ }
+
+ void setArraySize(int arraySize)
+ {
+ this->arraySize = arraySize;
+ }
+
+ T* newObject()
+ {
+ T* o = freeObjects;
+ if (!o)
+ {
+ PoolArray<T>* p = nextArray;
+ if (p)
+ {
+ nextArray = p->next;
+ }
+ else
+ {
+ p = new(btAlignedAlloc(sizeof(PoolArray<T>), 16)) PoolArray<T>(arraySize);
+ p->next = arrays;
+ arrays = p;
+ }
+ o = p->init();
+ }
+ freeObjects = o->next;
+ return new(o) T();
+ };
+
+ void freeObject(T* object)
+ {
+ object->~T();
+ object->next = freeObjects;
+ freeObjects = object;
+ }
+ };
+
+ btVector3 scaling;
+ btVector3 center;
+ Pool<Vertex> vertexPool;
+ Pool<Edge> edgePool;
+ Pool<Face> facePool;
+ btAlignedObjectArray<Vertex*> originalVertices;
+ int mergeStamp;
+ int minAxis;
+ int medAxis;
+ int maxAxis;
+ int usedEdgePairs;
+ int maxUsedEdgePairs;
+
+ static Orientation getOrientation(const Edge* prev, const Edge* next, const Point32& s, const Point32& t);
+ Edge* findMaxAngle(bool ccw, const Vertex* start, const Point32& s, const Point64& rxs, const Point64& sxrxs, Rational64& minCot);
+ void findEdgeForCoplanarFaces(Vertex* c0, Vertex* c1, Edge*& e0, Edge*& e1, Vertex* stop0, Vertex* stop1);
+
+ Edge* newEdgePair(Vertex* from, Vertex* to);
+
+ void removeEdgePair(Edge* edge)
+ {
+ Edge* n = edge->next;
+ Edge* r = edge->reverse;
+
+ btAssert(edge->target && r->target);
+
+ if (n != edge)
+ {
+ n->prev = edge->prev;
+ edge->prev->next = n;
+ r->target->edges = n;
+ }
+ else
+ {
+ r->target->edges = NULL;
+ }
+
+ n = r->next;
+
+ if (n != r)
+ {
+ n->prev = r->prev;
+ r->prev->next = n;
+ edge->target->edges = n;
+ }
+ else
+ {
+ edge->target->edges = NULL;
+ }
+
+ edgePool.freeObject(edge);
+ edgePool.freeObject(r);
+ usedEdgePairs--;
+ }
+
+ void computeInternal(int start, int end, IntermediateHull& result);
+
+ bool mergeProjection(IntermediateHull& h0, IntermediateHull& h1, Vertex*& c0, Vertex*& c1);
+
+ void merge(IntermediateHull& h0, IntermediateHull& h1);
+
+ btVector3 toBtVector(const Point32& v);
+
+ btVector3 getBtNormal(Face* face);
+
+ bool shiftFace(Face* face, btScalar amount, btAlignedObjectArray<Vertex*> stack);
+
+ public:
+ Vertex* vertexList;
+
+ void compute(const void* coords, bool doubleCoords, int stride, int count);
+
+ btVector3 getCoordinates(const Vertex* v);
+
+ btScalar shrink(btScalar amount, btScalar clampAmount);
+};
+
+
+btConvexHullInternal::Int128 btConvexHullInternal::Int128::operator*(int64_t b) const
+{
+ bool negative = (int64_t) high < 0;
+ Int128 a = negative ? -*this : *this;
+ if (b < 0)
+ {
+ negative = !negative;
+ b = -b;
+ }
+ Int128 result = mul(a.low, (uint64_t) b);
+ result.high += a.high * (uint64_t) b;
+ return negative ? -result : result;
+}
+
+btConvexHullInternal::Int128 btConvexHullInternal::Int128::mul(int64_t a, int64_t b)
+{
+ Int128 result;
+
+#ifdef USE_X86_64_ASM
+ __asm__ ("imulq %[b]"
+ : "=a" (result.low), "=d" (result.high)
+ : "0"(a), [b] "r"(b)
+ : "cc" );
+ return result;
+
+#else
+ bool negative = a < 0;
+ if (negative)
+ {
+ a = -a;
+ }
+ if (b < 0)
+ {
+ negative = !negative;
+ b = -b;
+ }
+ DMul<uint64_t, uint32_t>::mul((uint64_t) a, (uint64_t) b, result.low, result.high);
+ return negative ? -result : result;
+#endif
+}
+
+btConvexHullInternal::Int128 btConvexHullInternal::Int128::mul(uint64_t a, uint64_t b)
+{
+ Int128 result;
+
+#ifdef USE_X86_64_ASM
+ __asm__ ("mulq %[b]"
+ : "=a" (result.low), "=d" (result.high)
+ : "0"(a), [b] "r"(b)
+ : "cc" );
+
+#else
+ DMul<uint64_t, uint32_t>::mul(a, b, result.low, result.high);
+#endif
+
+ return result;
+}
+
+int btConvexHullInternal::Rational64::compare(const Rational64& b) const
+{
+ if (sign != b.sign)
+ {
+ return sign - b.sign;
+ }
+ else if (sign == 0)
+ {
+ return 0;
+ }
+
+ // return (numerator * b.denominator > b.numerator * denominator) ? sign : (numerator * b.denominator < b.numerator * denominator) ? -sign : 0;
+
+#ifdef USE_X86_64_ASM
+
+ int result;
+ int64_t tmp;
+ int64_t dummy;
+ __asm__ ("mulq %[bn]\n\t"
+ "movq %%rax, %[tmp]\n\t"
+ "movq %%rdx, %%rbx\n\t"
+ "movq %[tn], %%rax\n\t"
+ "mulq %[bd]\n\t"
+ "subq %[tmp], %%rax\n\t"
+ "sbbq %%rbx, %%rdx\n\t" // rdx:rax contains 128-bit-difference "numerator*b.denominator - b.numerator*denominator"
+ "setnsb %%bh\n\t" // bh=1 if difference is non-negative, bh=0 otherwise
+ "orq %%rdx, %%rax\n\t"
+ "setnzb %%bl\n\t" // bl=1 if difference if non-zero, bl=0 if it is zero
+ "decb %%bh\n\t" // now bx=0x0000 if difference is zero, 0xff01 if it is negative, 0x0001 if it is positive (i.e., same sign as difference)
+ "shll $16, %%ebx\n\t" // ebx has same sign as difference
+ : "=&b"(result), [tmp] "=&r"(tmp), "=a"(dummy)
+ : "a"(denominator), [bn] "g"(b.numerator), [tn] "g"(numerator), [bd] "g"(b.denominator)
+ : "%rdx", "cc" );
+ return result ? result ^ sign // if sign is +1, only bit 0 of result is inverted, which does not change the sign of result (and cannot result in zero)
+ // if sign is -1, all bits of result are inverted, which changes the sign of result (and again cannot result in zero)
+ : 0;
+
+#else
+
+ return sign * Int128::mul(m_numerator, b.m_denominator).ucmp(Int128::mul(m_denominator, b.m_numerator));
+
+#endif
+}
+
+int btConvexHullInternal::Rational128::compare(const Rational128& b) const
+{
+ if (sign != b.sign)
+ {
+ return sign - b.sign;
+ }
+ else if (sign == 0)
+ {
+ return 0;
+ }
+ if (isInt64)
+ {
+ return -b.compare(sign * (int64_t) numerator.low);
+ }
+
+ Int128 nbdLow, nbdHigh, dbnLow, dbnHigh;
+ DMul<Int128, uint64_t>::mul(numerator, b.denominator, nbdLow, nbdHigh);
+ DMul<Int128, uint64_t>::mul(denominator, b.numerator, dbnLow, dbnHigh);
+
+ int cmp = nbdHigh.ucmp(dbnHigh);
+ if (cmp)
+ {
+ return cmp * sign;
+ }
+ return nbdLow.ucmp(dbnLow) * sign;
+}
+
+int btConvexHullInternal::Rational128::compare(int64_t b) const
+{
+ if (isInt64)
+ {
+ int64_t a = sign * (int64_t) numerator.low;
+ return (a > b) ? 1 : (a < b) ? -1 : 0;
+ }
+ if (b > 0)
+ {
+ if (sign <= 0)
+ {
+ return -1;
+ }
+ }
+ else if (b < 0)
+ {
+ if (sign >= 0)
+ {
+ return 1;
+ }
+ b = -b;
+ }
+ else
+ {
+ return sign;
+ }
+
+ return numerator.ucmp(denominator * b) * sign;
+}
+
+
+btConvexHullInternal::Edge* btConvexHullInternal::newEdgePair(Vertex* from, Vertex* to)
+{
+ btAssert(from && to);
+ Edge* e = edgePool.newObject();
+ Edge* r = edgePool.newObject();
+ e->reverse = r;
+ r->reverse = e;
+ e->copy = mergeStamp;
+ r->copy = mergeStamp;
+ e->target = to;
+ r->target = from;
+ e->face = NULL;
+ r->face = NULL;
+ usedEdgePairs++;
+ if (usedEdgePairs > maxUsedEdgePairs)
+ {
+ maxUsedEdgePairs = usedEdgePairs;
+ }
+ return e;
+}
+
+bool btConvexHullInternal::mergeProjection(IntermediateHull& h0, IntermediateHull& h1, Vertex*& c0, Vertex*& c1)
+{
+ Vertex* v0 = h0.maxYx;
+ Vertex* v1 = h1.minYx;
+ if ((v0->point.x == v1->point.x) && (v0->point.y == v1->point.y))
+ {
+ btAssert(v0->point.z < v1->point.z);
+ Vertex* v1p = v1->prev;
+ if (v1p == v1)
+ {
+ c0 = v0;
+ if (v1->edges)
+ {
+ btAssert(v1->edges->next == v1->edges);
+ v1 = v1->edges->target;
+ btAssert(v1->edges->next == v1->edges);
+ }
+ c1 = v1;
+ return false;
+ }
+ Vertex* v1n = v1->next;
+ v1p->next = v1n;
+ v1n->prev = v1p;
+ if (v1 == h1.minXy)
+ {
+ if ((v1n->point.x < v1p->point.x) || ((v1n->point.x == v1p->point.x) && (v1n->point.y < v1p->point.y)))
+ {
+ h1.minXy = v1n;
+ }
+ else
+ {
+ h1.minXy = v1p;
+ }
+ }
+ if (v1 == h1.maxXy)
+ {
+ if ((v1n->point.x > v1p->point.x) || ((v1n->point.x == v1p->point.x) && (v1n->point.y > v1p->point.y)))
+ {
+ h1.maxXy = v1n;
+ }
+ else
+ {
+ h1.maxXy = v1p;
+ }
+ }
+ }
+
+ v0 = h0.maxXy;
+ v1 = h1.maxXy;
+ Vertex* v00 = NULL;
+ Vertex* v10 = NULL;
+ int32_t sign = 1;
+
+ for (int side = 0; side <= 1; side++)
+ {
+ int32_t dx = (v1->point.x - v0->point.x) * sign;
+ if (dx > 0)
+ {
+ while (true)
+ {
+ int32_t dy = v1->point.y - v0->point.y;
+
+ Vertex* w0 = side ? v0->next : v0->prev;
+ if (w0 != v0)
+ {
+ int32_t dx0 = (w0->point.x - v0->point.x) * sign;
+ int32_t dy0 = w0->point.y - v0->point.y;
+ if ((dy0 <= 0) && ((dx0 == 0) || ((dx0 < 0) && (dy0 * dx <= dy * dx0))))
+ {
+ v0 = w0;
+ dx = (v1->point.x - v0->point.x) * sign;
+ continue;
+ }
+ }
+
+ Vertex* w1 = side ? v1->next : v1->prev;
+ if (w1 != v1)
+ {
+ int32_t dx1 = (w1->point.x - v1->point.x) * sign;
+ int32_t dy1 = w1->point.y - v1->point.y;
+ int32_t dxn = (w1->point.x - v0->point.x) * sign;
+ if ((dxn > 0) && (dy1 < 0) && ((dx1 == 0) || ((dx1 < 0) && (dy1 * dx < dy * dx1))))
+ {
+ v1 = w1;
+ dx = dxn;
+ continue;
+ }
+ }
+
+ break;
+ }
+ }
+ else if (dx < 0)
+ {
+ while (true)
+ {
+ int32_t dy = v1->point.y - v0->point.y;
+
+ Vertex* w1 = side ? v1->prev : v1->next;
+ if (w1 != v1)
+ {
+ int32_t dx1 = (w1->point.x - v1->point.x) * sign;
+ int32_t dy1 = w1->point.y - v1->point.y;
+ if ((dy1 >= 0) && ((dx1 == 0) || ((dx1 < 0) && (dy1 * dx <= dy * dx1))))
+ {
+ v1 = w1;
+ dx = (v1->point.x - v0->point.x) * sign;
+ continue;
+ }
+ }
+
+ Vertex* w0 = side ? v0->prev : v0->next;
+ if (w0 != v0)
+ {
+ int32_t dx0 = (w0->point.x - v0->point.x) * sign;
+ int32_t dy0 = w0->point.y - v0->point.y;
+ int32_t dxn = (v1->point.x - w0->point.x) * sign;
+ if ((dxn < 0) && (dy0 > 0) && ((dx0 == 0) || ((dx0 < 0) && (dy0 * dx < dy * dx0))))
+ {
+ v0 = w0;
+ dx = dxn;
+ continue;
+ }
+ }
+
+ break;
+ }
+ }
+ else
+ {
+ int32_t x = v0->point.x;
+ int32_t y0 = v0->point.y;
+ Vertex* w0 = v0;
+ Vertex* t;
+ while (((t = side ? w0->next : w0->prev) != v0) && (t->point.x == x) && (t->point.y <= y0))
+ {
+ w0 = t;
+ y0 = t->point.y;
+ }
+ v0 = w0;
+
+ int32_t y1 = v1->point.y;
+ Vertex* w1 = v1;
+ while (((t = side ? w1->prev : w1->next) != v1) && (t->point.x == x) && (t->point.y >= y1))
+ {
+ w1 = t;
+ y1 = t->point.y;
+ }
+ v1 = w1;
+ }
+
+ if (side == 0)
+ {
+ v00 = v0;
+ v10 = v1;
+
+ v0 = h0.minXy;
+ v1 = h1.minXy;
+ sign = -1;
+ }
+ }
+
+ v0->prev = v1;
+ v1->next = v0;
+
+ v00->next = v10;
+ v10->prev = v00;
+
+ if (h1.minXy->point.x < h0.minXy->point.x)
+ {
+ h0.minXy = h1.minXy;
+ }
+ if (h1.maxXy->point.x >= h0.maxXy->point.x)
+ {
+ h0.maxXy = h1.maxXy;
+ }
+
+ h0.maxYx = h1.maxYx;
+
+ c0 = v00;
+ c1 = v10;
+
+ return true;
+}
+
+void btConvexHullInternal::computeInternal(int start, int end, IntermediateHull& result)
+{
+ int n = end - start;
+ switch (n)
+ {
+ case 0:
+ result.minXy = NULL;
+ result.maxXy = NULL;
+ result.minYx = NULL;
+ result.maxYx = NULL;
+ return;
+ case 2:
+ {
+ Vertex* v = originalVertices[start];
+ Vertex* w = v + 1;
+ if (v->point != w->point)
+ {
+ int32_t dx = v->point.x - w->point.x;
+ int32_t dy = v->point.y - w->point.y;
+
+ if ((dx == 0) && (dy == 0))
+ {
+ if (v->point.z > w->point.z)
+ {
+ Vertex* t = w;
+ w = v;
+ v = t;
+ }
+ btAssert(v->point.z < w->point.z);
+ v->next = v;
+ v->prev = v;
+ result.minXy = v;
+ result.maxXy = v;
+ result.minYx = v;
+ result.maxYx = v;
+ }
+ else
+ {
+ v->next = w;
+ v->prev = w;
+ w->next = v;
+ w->prev = v;
+
+ if ((dx < 0) || ((dx == 0) && (dy < 0)))
+ {
+ result.minXy = v;
+ result.maxXy = w;
+ }
+ else
+ {
+ result.minXy = w;
+ result.maxXy = v;
+ }
+
+ if ((dy < 0) || ((dy == 0) && (dx < 0)))
+ {
+ result.minYx = v;
+ result.maxYx = w;
+ }
+ else
+ {
+ result.minYx = w;
+ result.maxYx = v;
+ }
+ }
+
+ Edge* e = newEdgePair(v, w);
+ e->link(e);
+ v->edges = e;
+
+ e = e->reverse;
+ e->link(e);
+ w->edges = e;
+
+ return;
+ }
+ }
+ // lint -fallthrough
+ case 1:
+ {
+ Vertex* v = originalVertices[start];
+ v->edges = NULL;
+ v->next = v;
+ v->prev = v;
+
+ result.minXy = v;
+ result.maxXy = v;
+ result.minYx = v;
+ result.maxYx = v;
+
+ return;
+ }
+ }
+
+ int split0 = start + n / 2;
+ Point32 p = originalVertices[split0-1]->point;
+ int split1 = split0;
+ while ((split1 < end) && (originalVertices[split1]->point == p))
+ {
+ split1++;
+ }
+ computeInternal(start, split0, result);
+ IntermediateHull hull1;
+ computeInternal(split1, end, hull1);
+#ifdef DEBUG_CONVEX_HULL
+ printf("\n\nMerge\n");
+ result.print();
+ hull1.print();
+#endif
+ merge(result, hull1);
+#ifdef DEBUG_CONVEX_HULL
+ printf("\n Result\n");
+ result.print();
+#endif
+}
+
+#ifdef DEBUG_CONVEX_HULL
+void btConvexHullInternal::IntermediateHull::print()
+{
+ printf(" Hull\n");
+ for (Vertex* v = minXy; v; )
+ {
+ printf(" ");
+ v->print();
+ if (v == maxXy)
+ {
+ printf(" maxXy");
+ }
+ if (v == minYx)
+ {
+ printf(" minYx");
+ }
+ if (v == maxYx)
+ {
+ printf(" maxYx");
+ }
+ if (v->next->prev != v)
+ {
+ printf(" Inconsistency");
+ }
+ printf("\n");
+ v = v->next;
+ if (v == minXy)
+ {
+ break;
+ }
+ }
+ if (minXy)
+ {
+ minXy->copy = (minXy->copy == -1) ? -2 : -1;
+ minXy->printGraph();
+ }
+}
+
+void btConvexHullInternal::Vertex::printGraph()
+{
+ print();
+ printf("\nEdges\n");
+ Edge* e = edges;
+ if (e)
+ {
+ do
+ {
+ e->print();
+ printf("\n");
+ e = e->next;
+ } while (e != edges);
+ do
+ {
+ Vertex* v = e->target;
+ if (v->copy != copy)
+ {
+ v->copy = copy;
+ v->printGraph();
+ }
+ e = e->next;
+ } while (e != edges);
+ }
+}
+#endif
+
+btConvexHullInternal::Orientation btConvexHullInternal::getOrientation(const Edge* prev, const Edge* next, const Point32& s, const Point32& t)
+{
+ btAssert(prev->reverse->target == next->reverse->target);
+ if (prev->next == next)
+ {
+ if (prev->prev == next)
+ {
+ Point64 n = t.cross(s);
+ Point64 m = (*prev->target - *next->reverse->target).cross(*next->target - *next->reverse->target);
+ btAssert(!m.isZero());
+ int64_t dot = n.dot(m);
+ btAssert(dot != 0);
+ return (dot > 0) ? COUNTER_CLOCKWISE : CLOCKWISE;
+ }
+ return COUNTER_CLOCKWISE;
+ }
+ else if (prev->prev == next)
+ {
+ return CLOCKWISE;
+ }
+ else
+ {
+ return NONE;
+ }
+}
+
+btConvexHullInternal::Edge* btConvexHullInternal::findMaxAngle(bool ccw, const Vertex* start, const Point32& s, const Point64& rxs, const Point64& sxrxs, Rational64& minCot)
+{
+ Edge* minEdge = NULL;
+
+#ifdef DEBUG_CONVEX_HULL
+ printf("find max edge for %d\n", start->point.index);
+#endif
+ Edge* e = start->edges;
+ if (e)
+ {
+ do
+ {
+ if (e->copy > mergeStamp)
+ {
+ Point32 t = *e->target - *start;
+ Rational64 cot(t.dot(sxrxs), t.dot(rxs));
+#ifdef DEBUG_CONVEX_HULL
+ printf(" Angle is %f (%d) for ", (float) btAtan(cot.toScalar()), (int) cot.isNaN());
+ e->print();
+#endif
+ if (cot.isNaN())
+ {
+ btAssert(ccw ? (t.dot(s) < 0) : (t.dot(s) > 0));
+ }
+ else
+ {
+ int cmp;
+ if (minEdge == NULL)
+ {
+ minCot = cot;
+ minEdge = e;
+ }
+ else if ((cmp = cot.compare(minCot)) < 0)
+ {
+ minCot = cot;
+ minEdge = e;
+ }
+ else if ((cmp == 0) && (ccw == (getOrientation(minEdge, e, s, t) == COUNTER_CLOCKWISE)))
+ {
+ minEdge = e;
+ }
+ }
+#ifdef DEBUG_CONVEX_HULL
+ printf("\n");
+#endif
+ }
+ e = e->next;
+ } while (e != start->edges);
+ }
+ return minEdge;
+}
+
+void btConvexHullInternal::findEdgeForCoplanarFaces(Vertex* c0, Vertex* c1, Edge*& e0, Edge*& e1, Vertex* stop0, Vertex* stop1)
+{
+ Edge* start0 = e0;
+ Edge* start1 = e1;
+ Point32 et0 = start0 ? start0->target->point : c0->point;
+ Point32 et1 = start1 ? start1->target->point : c1->point;
+ Point32 s = c1->point - c0->point;
+ Point64 normal = ((start0 ? start0 : start1)->target->point - c0->point).cross(s);
+ int64_t dist = c0->point.dot(normal);
+ btAssert(!start1 || (start1->target->point.dot(normal) == dist));
+ Point64 perp = s.cross(normal);
+ btAssert(!perp.isZero());
+
+#ifdef DEBUG_CONVEX_HULL
+ printf(" Advancing %d %d (%p %p, %d %d)\n", c0->point.index, c1->point.index, start0, start1, start0 ? start0->target->point.index : -1, start1 ? start1->target->point.index : -1);
+#endif
+
+ int64_t maxDot0 = et0.dot(perp);
+ if (e0)
+ {
+ while (e0->target != stop0)
+ {
+ Edge* e = e0->reverse->prev;
+ if (e->target->point.dot(normal) < dist)
+ {
+ break;
+ }
+ btAssert(e->target->point.dot(normal) == dist);
+ if (e->copy == mergeStamp)
+ {
+ break;
+ }
+ int64_t dot = e->target->point.dot(perp);
+ if (dot <= maxDot0)
+ {
+ break;
+ }
+ maxDot0 = dot;
+ e0 = e;
+ et0 = e->target->point;
+ }
+ }
+
+ int64_t maxDot1 = et1.dot(perp);
+ if (e1)
+ {
+ while (e1->target != stop1)
+ {
+ Edge* e = e1->reverse->next;
+ if (e->target->point.dot(normal) < dist)
+ {
+ break;
+ }
+ btAssert(e->target->point.dot(normal) == dist);
+ if (e->copy == mergeStamp)
+ {
+ break;
+ }
+ int64_t dot = e->target->point.dot(perp);
+ if (dot <= maxDot1)
+ {
+ break;
+ }
+ maxDot1 = dot;
+ e1 = e;
+ et1 = e->target->point;
+ }
+ }
+
+#ifdef DEBUG_CONVEX_HULL
+ printf(" Starting at %d %d\n", et0.index, et1.index);
+#endif
+
+ int64_t dx = maxDot1 - maxDot0;
+ if (dx > 0)
+ {
+ while (true)
+ {
+ int64_t dy = (et1 - et0).dot(s);
+
+ if (e0 && (e0->target != stop0))
+ {
+ Edge* f0 = e0->next->reverse;
+ if (f0->copy > mergeStamp)
+ {
+ int64_t dx0 = (f0->target->point - et0).dot(perp);
+ int64_t dy0 = (f0->target->point - et0).dot(s);
+ if ((dx0 == 0) ? (dy0 < 0) : ((dx0 < 0) && (Rational64(dy0, dx0).compare(Rational64(dy, dx)) >= 0)))
+ {
+ et0 = f0->target->point;
+ dx = (et1 - et0).dot(perp);
+ e0 = (e0 == start0) ? NULL : f0;
+ continue;
+ }
+ }
+ }
+
+ if (e1 && (e1->target != stop1))
+ {
+ Edge* f1 = e1->reverse->next;
+ if (f1->copy > mergeStamp)
+ {
+ Point32 d1 = f1->target->point - et1;
+ if (d1.dot(normal) == 0)
+ {
+ int64_t dx1 = d1.dot(perp);
+ int64_t dy1 = d1.dot(s);
+ int64_t dxn = (f1->target->point - et0).dot(perp);
+ if ((dxn > 0) && ((dx1 == 0) ? (dy1 < 0) : ((dx1 < 0) && (Rational64(dy1, dx1).compare(Rational64(dy, dx)) > 0))))
+ {
+ e1 = f1;
+ et1 = e1->target->point;
+ dx = dxn;
+ continue;
+ }
+ }
+ else
+ {
+ btAssert((e1 == start1) && (d1.dot(normal) < 0));
+ }
+ }
+ }
+
+ break;
+ }
+ }
+ else if (dx < 0)
+ {
+ while (true)
+ {
+ int64_t dy = (et1 - et0).dot(s);
+
+ if (e1 && (e1->target != stop1))
+ {
+ Edge* f1 = e1->prev->reverse;
+ if (f1->copy > mergeStamp)
+ {
+ int64_t dx1 = (f1->target->point - et1).dot(perp);
+ int64_t dy1 = (f1->target->point - et1).dot(s);
+ if ((dx1 == 0) ? (dy1 > 0) : ((dx1 < 0) && (Rational64(dy1, dx1).compare(Rational64(dy, dx)) <= 0)))
+ {
+ et1 = f1->target->point;
+ dx = (et1 - et0).dot(perp);
+ e1 = (e1 == start1) ? NULL : f1;
+ continue;
+ }
+ }
+ }
+
+ if (e0 && (e0->target != stop0))
+ {
+ Edge* f0 = e0->reverse->prev;
+ if (f0->copy > mergeStamp)
+ {
+ Point32 d0 = f0->target->point - et0;
+ if (d0.dot(normal) == 0)
+ {
+ int64_t dx0 = d0.dot(perp);
+ int64_t dy0 = d0.dot(s);
+ int64_t dxn = (et1 - f0->target->point).dot(perp);
+ if ((dxn < 0) && ((dx0 == 0) ? (dy0 > 0) : ((dx0 < 0) && (Rational64(dy0, dx0).compare(Rational64(dy, dx)) < 0))))
+ {
+ e0 = f0;
+ et0 = e0->target->point;
+ dx = dxn;
+ continue;
+ }
+ }
+ else
+ {
+ btAssert((e0 == start0) && (d0.dot(normal) < 0));
+ }
+ }
+ }
+
+ break;
+ }
+ }
+#ifdef DEBUG_CONVEX_HULL
+ printf(" Advanced edges to %d %d\n", et0.index, et1.index);
+#endif
+}
+
+
+void btConvexHullInternal::merge(IntermediateHull& h0, IntermediateHull& h1)
+{
+ if (!h1.maxXy)
+ {
+ return;
+ }
+ if (!h0.maxXy)
+ {
+ h0 = h1;
+ return;
+ }
+
+ mergeStamp--;
+
+ Vertex* c0 = NULL;
+ Edge* toPrev0 = NULL;
+ Edge* firstNew0 = NULL;
+ Edge* pendingHead0 = NULL;
+ Edge* pendingTail0 = NULL;
+ Vertex* c1 = NULL;
+ Edge* toPrev1 = NULL;
+ Edge* firstNew1 = NULL;
+ Edge* pendingHead1 = NULL;
+ Edge* pendingTail1 = NULL;
+ Point32 prevPoint;
+
+ if (mergeProjection(h0, h1, c0, c1))
+ {
+ Point32 s = *c1 - *c0;
+ Point64 normal = Point32(0, 0, -1).cross(s);
+ Point64 t = s.cross(normal);
+ btAssert(!t.isZero());
+
+ Edge* e = c0->edges;
+ Edge* start0 = NULL;
+ if (e)
+ {
+ do
+ {
+ int64_t dot = (*e->target - *c0).dot(normal);
+ btAssert(dot <= 0);
+ if ((dot == 0) && ((*e->target - *c0).dot(t) > 0))
+ {
+ if (!start0 || (getOrientation(start0, e, s, Point32(0, 0, -1)) == CLOCKWISE))
+ {
+ start0 = e;
+ }
+ }
+ e = e->next;
+ } while (e != c0->edges);
+ }
+
+ e = c1->edges;
+ Edge* start1 = NULL;
+ if (e)
+ {
+ do
+ {
+ int64_t dot = (*e->target - *c1).dot(normal);
+ btAssert(dot <= 0);
+ if ((dot == 0) && ((*e->target - *c1).dot(t) > 0))
+ {
+ if (!start1 || (getOrientation(start1, e, s, Point32(0, 0, -1)) == COUNTER_CLOCKWISE))
+ {
+ start1 = e;
+ }
+ }
+ e = e->next;
+ } while (e != c1->edges);
+ }
+
+ if (start0 || start1)
+ {
+ findEdgeForCoplanarFaces(c0, c1, start0, start1, NULL, NULL);
+ if (start0)
+ {
+ c0 = start0->target;
+ }
+ if (start1)
+ {
+ c1 = start1->target;
+ }
+ }
+
+ prevPoint = c1->point;
+ prevPoint.z++;
+ }
+ else
+ {
+ prevPoint = c1->point;
+ prevPoint.x++;
+ }
+
+ Vertex* first0 = c0;
+ Vertex* first1 = c1;
+ bool firstRun = true;
+
+ while (true)
+ {
+ Point32 s = *c1 - *c0;
+ Point32 r = prevPoint - c0->point;
+ Point64 rxs = r.cross(s);
+ Point64 sxrxs = s.cross(rxs);
+
+#ifdef DEBUG_CONVEX_HULL
+ printf("\n Checking %d %d\n", c0->point.index, c1->point.index);
+#endif
+ Rational64 minCot0(0, 0);
+ Edge* min0 = findMaxAngle(false, c0, s, rxs, sxrxs, minCot0);
+ Rational64 minCot1(0, 0);
+ Edge* min1 = findMaxAngle(true, c1, s, rxs, sxrxs, minCot1);
+ if (!min0 && !min1)
+ {
+ Edge* e = newEdgePair(c0, c1);
+ e->link(e);
+ c0->edges = e;
+
+ e = e->reverse;
+ e->link(e);
+ c1->edges = e;
+ return;
+ }
+ else
+ {
+ int cmp = !min0 ? 1 : !min1 ? -1 : minCot0.compare(minCot1);
+#ifdef DEBUG_CONVEX_HULL
+ printf(" -> Result %d\n", cmp);
+#endif
+ if (firstRun || ((cmp >= 0) ? !minCot1.isNegativeInfinity() : !minCot0.isNegativeInfinity()))
+ {
+ Edge* e = newEdgePair(c0, c1);
+ if (pendingTail0)
+ {
+ pendingTail0->prev = e;
+ }
+ else
+ {
+ pendingHead0 = e;
+ }
+ e->next = pendingTail0;
+ pendingTail0 = e;
+
+ e = e->reverse;
+ if (pendingTail1)
+ {
+ pendingTail1->next = e;
+ }
+ else
+ {
+ pendingHead1 = e;
+ }
+ e->prev = pendingTail1;
+ pendingTail1 = e;
+ }
+
+ Edge* e0 = min0;
+ Edge* e1 = min1;
+
+#ifdef DEBUG_CONVEX_HULL
+ printf(" Found min edges to %d %d\n", e0 ? e0->target->point.index : -1, e1 ? e1->target->point.index : -1);
+#endif
+
+ if (cmp == 0)
+ {
+ findEdgeForCoplanarFaces(c0, c1, e0, e1, NULL, NULL);
+ }
+
+ if ((cmp >= 0) && e1)
+ {
+ if (toPrev1)
+ {
+ for (Edge* e = toPrev1->next, *n = NULL; e != min1; e = n)
+ {
+ n = e->next;
+ removeEdgePair(e);
+ }
+ }
+
+ if (pendingTail1)
+ {
+ if (toPrev1)
+ {
+ toPrev1->link(pendingHead1);
+ }
+ else
+ {
+ min1->prev->link(pendingHead1);
+ firstNew1 = pendingHead1;
+ }
+ pendingTail1->link(min1);
+ pendingHead1 = NULL;
+ pendingTail1 = NULL;
+ }
+ else if (!toPrev1)
+ {
+ firstNew1 = min1;
+ }
+
+ prevPoint = c1->point;
+ c1 = e1->target;
+ toPrev1 = e1->reverse;
+ }
+
+ if ((cmp <= 0) && e0)
+ {
+ if (toPrev0)
+ {
+ for (Edge* e = toPrev0->prev, *n = NULL; e != min0; e = n)
+ {
+ n = e->prev;
+ removeEdgePair(e);
+ }
+ }
+
+ if (pendingTail0)
+ {
+ if (toPrev0)
+ {
+ pendingHead0->link(toPrev0);
+ }
+ else
+ {
+ pendingHead0->link(min0->next);
+ firstNew0 = pendingHead0;
+ }
+ min0->link(pendingTail0);
+ pendingHead0 = NULL;
+ pendingTail0 = NULL;
+ }
+ else if (!toPrev0)
+ {
+ firstNew0 = min0;
+ }
+
+ prevPoint = c0->point;
+ c0 = e0->target;
+ toPrev0 = e0->reverse;
+ }
+ }
+
+ if ((c0 == first0) && (c1 == first1))
+ {
+ if (toPrev0 == NULL)
+ {
+ pendingHead0->link(pendingTail0);
+ c0->edges = pendingTail0;
+ }
+ else
+ {
+ for (Edge* e = toPrev0->prev, *n = NULL; e != firstNew0; e = n)
+ {
+ n = e->prev;
+ removeEdgePair(e);
+ }
+ if (pendingTail0)
+ {
+ pendingHead0->link(toPrev0);
+ firstNew0->link(pendingTail0);
+ }
+ }
+
+ if (toPrev1 == NULL)
+ {
+ pendingTail1->link(pendingHead1);
+ c1->edges = pendingTail1;
+ }
+ else
+ {
+ for (Edge* e = toPrev1->next, *n = NULL; e != firstNew1; e = n)
+ {
+ n = e->next;
+ removeEdgePair(e);
+ }
+ if (pendingTail1)
+ {
+ toPrev1->link(pendingHead1);
+ pendingTail1->link(firstNew1);
+ }
+ }
+
+ return;
+ }
+
+ firstRun = false;
+ }
+}
+
+
+static bool pointCmp(const btConvexHullInternal::Point32& p, const btConvexHullInternal::Point32& q)
+{
+ return (p.y < q.y) || ((p.y == q.y) && ((p.x < q.x) || ((p.x == q.x) && (p.z < q.z))));
+}
+
+void btConvexHullInternal::compute(const void* coords, bool doubleCoords, int stride, int count)
+{
+ btVector3 min(btScalar(1e30), btScalar(1e30), btScalar(1e30)), max(btScalar(-1e30), btScalar(-1e30), btScalar(-1e30));
+ const char* ptr = (const char*) coords;
+ if (doubleCoords)
+ {
+ for (int i = 0; i < count; i++)
+ {
+ const double* v = (const double*) ptr;
+ btVector3 p((btScalar) v[0], (btScalar) v[1], (btScalar) v[2]);
+ ptr += stride;
+ min.setMin(p);
+ max.setMax(p);
+ }
+ }
+ else
+ {
+ for (int i = 0; i < count; i++)
+ {
+ const float* v = (const float*) ptr;
+ btVector3 p(v[0], v[1], v[2]);
+ ptr += stride;
+ min.setMin(p);
+ max.setMax(p);
+ }
+ }
+
+ btVector3 s = max - min;
+ maxAxis = s.maxAxis();
+ minAxis = s.minAxis();
+ if (minAxis == maxAxis)
+ {
+ minAxis = (maxAxis + 1) % 3;
+ }
+ medAxis = 3 - maxAxis - minAxis;
+
+ s /= btScalar(10216);
+ if (((medAxis + 1) % 3) != maxAxis)
+ {
+ s *= -1;
+ }
+ scaling = s;
+
+ if (s[0] != 0)
+ {
+ s[0] = btScalar(1) / s[0];
+ }
+ if (s[1] != 0)
+ {
+ s[1] = btScalar(1) / s[1];
+ }
+ if (s[2] != 0)
+ {
+ s[2] = btScalar(1) / s[2];
+ }
+
+ center = (min + max) * btScalar(0.5);
+
+ btAlignedObjectArray<Point32> points;
+ points.resize(count);
+ ptr = (const char*) coords;
+ if (doubleCoords)
+ {
+ for (int i = 0; i < count; i++)
+ {
+ const double* v = (const double*) ptr;
+ btVector3 p((btScalar) v[0], (btScalar) v[1], (btScalar) v[2]);
+ ptr += stride;
+ p = (p - center) * s;
+ points[i].x = (int32_t) p[medAxis];
+ points[i].y = (int32_t) p[maxAxis];
+ points[i].z = (int32_t) p[minAxis];
+ points[i].index = i;
+ }
+ }
+ else
+ {
+ for (int i = 0; i < count; i++)
+ {
+ const float* v = (const float*) ptr;
+ btVector3 p(v[0], v[1], v[2]);
+ ptr += stride;
+ p = (p - center) * s;
+ points[i].x = (int32_t) p[medAxis];
+ points[i].y = (int32_t) p[maxAxis];
+ points[i].z = (int32_t) p[minAxis];
+ points[i].index = i;
+ }
+ }
+ points.quickSort(pointCmp);
+
+ vertexPool.reset();
+ vertexPool.setArraySize(count);
+ originalVertices.resize(count);
+ for (int i = 0; i < count; i++)
+ {
+ Vertex* v = vertexPool.newObject();
+ v->edges = NULL;
+ v->point = points[i];
+ v->copy = -1;
+ originalVertices[i] = v;
+ }
+
+ points.clear();
+
+ edgePool.reset();
+ edgePool.setArraySize(6 * count);
+
+ usedEdgePairs = 0;
+ maxUsedEdgePairs = 0;
+
+ mergeStamp = -3;
+
+ IntermediateHull hull;
+ computeInternal(0, count, hull);
+ vertexList = hull.minXy;
+#ifdef DEBUG_CONVEX_HULL
+ printf("max. edges %d (3v = %d)", maxUsedEdgePairs, 3 * count);
+#endif
+}
+
+btVector3 btConvexHullInternal::toBtVector(const Point32& v)
+{
+ btVector3 p;
+ p[medAxis] = btScalar(v.x);
+ p[maxAxis] = btScalar(v.y);
+ p[minAxis] = btScalar(v.z);
+ return p * scaling;
+}
+
+btVector3 btConvexHullInternal::getBtNormal(Face* face)
+{
+ return toBtVector(face->dir0).cross(toBtVector(face->dir1)).normalized();
+}
+
+btVector3 btConvexHullInternal::getCoordinates(const Vertex* v)
+{
+ btVector3 p;
+ p[medAxis] = v->xvalue();
+ p[maxAxis] = v->yvalue();
+ p[minAxis] = v->zvalue();
+ return p * scaling + center;
+}
+
+btScalar btConvexHullInternal::shrink(btScalar amount, btScalar clampAmount)
+{
+ if (!vertexList)
+ {
+ return 0;
+ }
+ int stamp = --mergeStamp;
+ btAlignedObjectArray<Vertex*> stack;
+ vertexList->copy = stamp;
+ stack.push_back(vertexList);
+ btAlignedObjectArray<Face*> faces;
+
+ Point32 ref = vertexList->point;
+ Int128 hullCenterX(0, 0);
+ Int128 hullCenterY(0, 0);
+ Int128 hullCenterZ(0, 0);
+ Int128 volume(0, 0);
+
+ while (stack.size() > 0)
+ {
+ Vertex* v = stack[stack.size() - 1];
+ stack.pop_back();
+ Edge* e = v->edges;
+ if (e)
+ {
+ do
+ {
+ if (e->target->copy != stamp)
+ {
+ e->target->copy = stamp;
+ stack.push_back(e->target);
+ }
+ if (e->copy != stamp)
+ {
+ Face* face = facePool.newObject();
+ face->init(e->target, e->reverse->prev->target, v);
+ faces.push_back(face);
+ Edge* f = e;
+
+ Vertex* a = NULL;
+ Vertex* b = NULL;
+ do
+ {
+ if (a && b)
+ {
+ int64_t vol = (v->point - ref).dot((a->point - ref).cross(b->point - ref));
+ btAssert(vol >= 0);
+ Point32 c = v->point + a->point + b->point + ref;
+ hullCenterX += vol * c.x;
+ hullCenterY += vol * c.y;
+ hullCenterZ += vol * c.z;
+ volume += vol;
+ }
+
+ btAssert(f->copy != stamp);
+ f->copy = stamp;
+ f->face = face;
+
+ a = b;
+ b = f->target;
+
+ f = f->reverse->prev;
+ } while (f != e);
+ }
+ e = e->next;
+ } while (e != v->edges);
+ }
+ }
+
+ if (volume.getSign() <= 0)
+ {
+ return 0;
+ }
+
+ btVector3 hullCenter;
+ hullCenter[medAxis] = hullCenterX.toScalar();
+ hullCenter[maxAxis] = hullCenterY.toScalar();
+ hullCenter[minAxis] = hullCenterZ.toScalar();
+ hullCenter /= 4 * volume.toScalar();
+ hullCenter *= scaling;
+
+ int faceCount = faces.size();
+
+ if (clampAmount > 0)
+ {
+ btScalar minDist = SIMD_INFINITY;
+ for (int i = 0; i < faceCount; i++)
+ {
+ btVector3 normal = getBtNormal(faces[i]);
+ btScalar dist = normal.dot(toBtVector(faces[i]->origin) - hullCenter);
+ if (dist < minDist)
+ {
+ minDist = dist;
+ }
+ }
+
+ if (minDist <= 0)
+ {
+ return 0;
+ }
+
+ amount = btMin(amount, minDist * clampAmount);
+ }
+
+ unsigned int seed = 243703;
+ for (int i = 0; i < faceCount; i++, seed = 1664525 * seed + 1013904223)
+ {
+ btSwap(faces[i], faces[seed % faceCount]);
+ }
+
+ for (int i = 0; i < faceCount; i++)
+ {
+ if (!shiftFace(faces[i], amount, stack))
+ {
+ return -amount;
+ }
+ }
+
+ return amount;
+}
+
+bool btConvexHullInternal::shiftFace(Face* face, btScalar amount, btAlignedObjectArray<Vertex*> stack)
+{
+ btVector3 origShift = getBtNormal(face) * -amount;
+ if (scaling[0] != 0)
+ {
+ origShift[0] /= scaling[0];
+ }
+ if (scaling[1] != 0)
+ {
+ origShift[1] /= scaling[1];
+ }
+ if (scaling[2] != 0)
+ {
+ origShift[2] /= scaling[2];
+ }
+ Point32 shift((int32_t) origShift[medAxis], (int32_t) origShift[maxAxis], (int32_t) origShift[minAxis]);
+ if (shift.isZero())
+ {
+ return true;
+ }
+ Point64 normal = face->getNormal();
+#ifdef DEBUG_CONVEX_HULL
+ printf("\nShrinking face (%d %d %d) (%d %d %d) (%d %d %d) by (%d %d %d)\n",
+ face->origin.x, face->origin.y, face->origin.z, face->dir0.x, face->dir0.y, face->dir0.z, face->dir1.x, face->dir1.y, face->dir1.z, shift.x, shift.y, shift.z);
+#endif
+ int64_t origDot = face->origin.dot(normal);
+ Point32 shiftedOrigin = face->origin + shift;
+ int64_t shiftedDot = shiftedOrigin.dot(normal);
+ btAssert(shiftedDot <= origDot);
+ if (shiftedDot >= origDot)
+ {
+ return false;
+ }
+
+ Edge* intersection = NULL;
+
+ Edge* startEdge = face->nearbyVertex->edges;
+#ifdef DEBUG_CONVEX_HULL
+ printf("Start edge is ");
+ startEdge->print();
+ printf(", normal is (%lld %lld %lld), shifted dot is %lld\n", normal.x, normal.y, normal.z, shiftedDot);
+#endif
+ Rational128 optDot = face->nearbyVertex->dot(normal);
+ int cmp = optDot.compare(shiftedDot);
+#ifdef SHOW_ITERATIONS
+ int n = 0;
+#endif
+ if (cmp >= 0)
+ {
+ Edge* e = startEdge;
+ do
+ {
+#ifdef SHOW_ITERATIONS
+ n++;
+#endif
+ Rational128 dot = e->target->dot(normal);
+ btAssert(dot.compare(origDot) <= 0);
+#ifdef DEBUG_CONVEX_HULL
+ printf("Moving downwards, edge is ");
+ e->print();
+ printf(", dot is %f (%f %lld)\n", (float) dot.toScalar(), (float) optDot.toScalar(), shiftedDot);
+#endif
+ if (dot.compare(optDot) < 0)
+ {
+ int c = dot.compare(shiftedDot);
+ optDot = dot;
+ e = e->reverse;
+ startEdge = e;
+ if (c < 0)
+ {
+ intersection = e;
+ break;
+ }
+ cmp = c;
+ }
+ e = e->prev;
+ } while (e != startEdge);
+
+ if (!intersection)
+ {
+ return false;
+ }
+ }
+ else
+ {
+ Edge* e = startEdge;
+ do
+ {
+#ifdef SHOW_ITERATIONS
+ n++;
+#endif
+ Rational128 dot = e->target->dot(normal);
+ btAssert(dot.compare(origDot) <= 0);
+#ifdef DEBUG_CONVEX_HULL
+ printf("Moving upwards, edge is ");
+ e->print();
+ printf(", dot is %f (%f %lld)\n", (float) dot.toScalar(), (float) optDot.toScalar(), shiftedDot);
+#endif
+ if (dot.compare(optDot) > 0)
+ {
+ cmp = dot.compare(shiftedDot);
+ if (cmp >= 0)
+ {
+ intersection = e;
+ break;
+ }
+ optDot = dot;
+ e = e->reverse;
+ startEdge = e;
+ }
+ e = e->prev;
+ } while (e != startEdge);
+
+ if (!intersection)
+ {
+ return true;
+ }
+ }
+
+#ifdef SHOW_ITERATIONS
+ printf("Needed %d iterations to find initial intersection\n", n);
+#endif
+
+ if (cmp == 0)
+ {
+ Edge* e = intersection->reverse->next;
+#ifdef SHOW_ITERATIONS
+ n = 0;
+#endif
+ while (e->target->dot(normal).compare(shiftedDot) <= 0)
+ {
+#ifdef SHOW_ITERATIONS
+ n++;
+#endif
+ e = e->next;
+ if (e == intersection->reverse)
+ {
+ return true;
+ }
+#ifdef DEBUG_CONVEX_HULL
+ printf("Checking for outwards edge, current edge is ");
+ e->print();
+ printf("\n");
+#endif
+ }
+#ifdef SHOW_ITERATIONS
+ printf("Needed %d iterations to check for complete containment\n", n);
+#endif
+ }
+
+ Edge* firstIntersection = NULL;
+ Edge* faceEdge = NULL;
+ Edge* firstFaceEdge = NULL;
+
+#ifdef SHOW_ITERATIONS
+ int m = 0;
+#endif
+ while (true)
+ {
+#ifdef SHOW_ITERATIONS
+ m++;
+#endif
+#ifdef DEBUG_CONVEX_HULL
+ printf("Intersecting edge is ");
+ intersection->print();
+ printf("\n");
+#endif
+ if (cmp == 0)
+ {
+ Edge* e = intersection->reverse->next;
+ startEdge = e;
+#ifdef SHOW_ITERATIONS
+ n = 0;
+#endif
+ while (true)
+ {
+#ifdef SHOW_ITERATIONS
+ n++;
+#endif
+ if (e->target->dot(normal).compare(shiftedDot) >= 0)
+ {
+ break;
+ }
+ intersection = e->reverse;
+ e = e->next;
+ if (e == startEdge)
+ {
+ return true;
+ }
+ }
+#ifdef SHOW_ITERATIONS
+ printf("Needed %d iterations to advance intersection\n", n);
+#endif
+ }
+
+#ifdef DEBUG_CONVEX_HULL
+ printf("Advanced intersecting edge to ");
+ intersection->print();
+ printf(", cmp = %d\n", cmp);
+#endif
+
+ if (!firstIntersection)
+ {
+ firstIntersection = intersection;
+ }
+ else if (intersection == firstIntersection)
+ {
+ break;
+ }
+
+ int prevCmp = cmp;
+ Edge* prevIntersection = intersection;
+ Edge* prevFaceEdge = faceEdge;
+
+ Edge* e = intersection->reverse;
+#ifdef SHOW_ITERATIONS
+ n = 0;
+#endif
+ while (true)
+ {
+#ifdef SHOW_ITERATIONS
+ n++;
+#endif
+ e = e->reverse->prev;
+ btAssert(e != intersection->reverse);
+ cmp = e->target->dot(normal).compare(shiftedDot);
+#ifdef DEBUG_CONVEX_HULL
+ printf("Testing edge ");
+ e->print();
+ printf(" -> cmp = %d\n", cmp);
+#endif
+ if (cmp >= 0)
+ {
+ intersection = e;
+ break;
+ }
+ }
+#ifdef SHOW_ITERATIONS
+ printf("Needed %d iterations to find other intersection of face\n", n);
+#endif
+
+ if (cmp > 0)
+ {
+ Vertex* removed = intersection->target;
+ e = intersection->reverse;
+ if (e->prev == e)
+ {
+ removed->edges = NULL;
+ }
+ else
+ {
+ removed->edges = e->prev;
+ e->prev->link(e->next);
+ e->link(e);
+ }
+#ifdef DEBUG_CONVEX_HULL
+ printf("1: Removed part contains (%d %d %d)\n", removed->point.x, removed->point.y, removed->point.z);
+#endif
+
+ Point64 n0 = intersection->face->getNormal();
+ Point64 n1 = intersection->reverse->face->getNormal();
+ int64_t m00 = face->dir0.dot(n0);
+ int64_t m01 = face->dir1.dot(n0);
+ int64_t m10 = face->dir0.dot(n1);
+ int64_t m11 = face->dir1.dot(n1);
+ int64_t r0 = (intersection->face->origin - shiftedOrigin).dot(n0);
+ int64_t r1 = (intersection->reverse->face->origin - shiftedOrigin).dot(n1);
+ Int128 det = Int128::mul(m00, m11) - Int128::mul(m01, m10);
+ btAssert(det.getSign() != 0);
+ Vertex* v = vertexPool.newObject();
+ v->point.index = -1;
+ v->copy = -1;
+ v->point128 = PointR128(Int128::mul(face->dir0.x * r0, m11) - Int128::mul(face->dir0.x * r1, m01)
+ + Int128::mul(face->dir1.x * r1, m00) - Int128::mul(face->dir1.x * r0, m10) + det * shiftedOrigin.x,
+ Int128::mul(face->dir0.y * r0, m11) - Int128::mul(face->dir0.y * r1, m01)
+ + Int128::mul(face->dir1.y * r1, m00) - Int128::mul(face->dir1.y * r0, m10) + det * shiftedOrigin.y,
+ Int128::mul(face->dir0.z * r0, m11) - Int128::mul(face->dir0.z * r1, m01)
+ + Int128::mul(face->dir1.z * r1, m00) - Int128::mul(face->dir1.z * r0, m10) + det * shiftedOrigin.z,
+ det);
+ v->point.x = (int32_t) v->point128.xvalue();
+ v->point.y = (int32_t) v->point128.yvalue();
+ v->point.z = (int32_t) v->point128.zvalue();
+ intersection->target = v;
+ v->edges = e;
+
+ stack.push_back(v);
+ stack.push_back(removed);
+ stack.push_back(NULL);
+ }
+
+ if (cmp || prevCmp || (prevIntersection->reverse->next->target != intersection->target))
+ {
+ faceEdge = newEdgePair(prevIntersection->target, intersection->target);
+ if (prevCmp == 0)
+ {
+ faceEdge->link(prevIntersection->reverse->next);
+ }
+ if ((prevCmp == 0) || prevFaceEdge)
+ {
+ prevIntersection->reverse->link(faceEdge);
+ }
+ if (cmp == 0)
+ {
+ intersection->reverse->prev->link(faceEdge->reverse);
+ }
+ faceEdge->reverse->link(intersection->reverse);
+ }
+ else
+ {
+ faceEdge = prevIntersection->reverse->next;
+ }
+
+ if (prevFaceEdge)
+ {
+ if (prevCmp > 0)
+ {
+ faceEdge->link(prevFaceEdge->reverse);
+ }
+ else if (faceEdge != prevFaceEdge->reverse)
+ {
+ stack.push_back(prevFaceEdge->target);
+ while (faceEdge->next != prevFaceEdge->reverse)
+ {
+ Vertex* removed = faceEdge->next->target;
+ removeEdgePair(faceEdge->next);
+ stack.push_back(removed);
+#ifdef DEBUG_CONVEX_HULL
+ printf("2: Removed part contains (%d %d %d)\n", removed->point.x, removed->point.y, removed->point.z);
+#endif
+ }
+ stack.push_back(NULL);
+ }
+ }
+ faceEdge->face = face;
+ faceEdge->reverse->face = intersection->face;
+
+ if (!firstFaceEdge)
+ {
+ firstFaceEdge = faceEdge;
+ }
+ }
+#ifdef SHOW_ITERATIONS
+ printf("Needed %d iterations to process all intersections\n", m);
+#endif
+
+ if (cmp > 0)
+ {
+ firstFaceEdge->reverse->target = faceEdge->target;
+ firstIntersection->reverse->link(firstFaceEdge);
+ firstFaceEdge->link(faceEdge->reverse);
+ }
+ else if (firstFaceEdge != faceEdge->reverse)
+ {
+ stack.push_back(faceEdge->target);
+ while (firstFaceEdge->next != faceEdge->reverse)
+ {
+ Vertex* removed = firstFaceEdge->next->target;
+ removeEdgePair(firstFaceEdge->next);
+ stack.push_back(removed);
+#ifdef DEBUG_CONVEX_HULL
+ printf("3: Removed part contains (%d %d %d)\n", removed->point.x, removed->point.y, removed->point.z);
+#endif
+ }
+ stack.push_back(NULL);
+ }
+
+ btAssert(stack.size() > 0);
+ vertexList = stack[0];
+
+#ifdef DEBUG_CONVEX_HULL
+ printf("Removing part\n");
+#endif
+#ifdef SHOW_ITERATIONS
+ n = 0;
+#endif
+ int pos = 0;
+ while (pos < stack.size())
+ {
+ int end = stack.size();
+ while (pos < end)
+ {
+ Vertex* kept = stack[pos++];
+#ifdef DEBUG_CONVEX_HULL
+ kept->print();
+#endif
+ bool deeper = false;
+ Vertex* removed;
+ while ((removed = stack[pos++]) != NULL)
+ {
+#ifdef SHOW_ITERATIONS
+ n++;
+#endif
+ kept->receiveNearbyFaces(removed);
+ while (removed->edges)
+ {
+ if (!deeper)
+ {
+ deeper = true;
+ stack.push_back(kept);
+ }
+ stack.push_back(removed->edges->target);
+ removeEdgePair(removed->edges);
+ }
+ }
+ if (deeper)
+ {
+ stack.push_back(NULL);
+ }
+ }
+ }
+#ifdef SHOW_ITERATIONS
+ printf("Needed %d iterations to remove part\n", n);
+#endif
+
+ stack.resize(0);
+ face->origin = shiftedOrigin;
+
+ return true;
+}
+
+
+static int getVertexCopy(btConvexHullInternal::Vertex* vertex, btAlignedObjectArray<btConvexHullInternal::Vertex*>& vertices)
+{
+ int index = vertex->copy;
+ if (index < 0)
+ {
+ index = vertices.size();
+ vertex->copy = index;
+ vertices.push_back(vertex);
+#ifdef DEBUG_CONVEX_HULL
+ printf("Vertex %d gets index *%d\n", vertex->point.index, index);
+#endif
+ }
+ return index;
+}
+
+btScalar btConvexHullComputer::compute(const void* coords, bool doubleCoords, int stride, int count, btScalar shrink, btScalar shrinkClamp)
+{
+ if (count <= 0)
+ {
+ vertices.clear();
+ edges.clear();
+ faces.clear();
+ return 0;
+ }
+
+ btConvexHullInternal hull;
+ hull.compute(coords, doubleCoords, stride, count);
+
+ btScalar shift = 0;
+ if ((shrink > 0) && ((shift = hull.shrink(shrink, shrinkClamp)) < 0))
+ {
+ vertices.clear();
+ edges.clear();
+ faces.clear();
+ return shift;
+ }
+
+ vertices.resize(0);
+ edges.resize(0);
+ faces.resize(0);
+
+ btAlignedObjectArray<btConvexHullInternal::Vertex*> oldVertices;
+ getVertexCopy(hull.vertexList, oldVertices);
+ int copied = 0;
+ while (copied < oldVertices.size())
+ {
+ btConvexHullInternal::Vertex* v = oldVertices[copied];
+ vertices.push_back(hull.getCoordinates(v));
+ btConvexHullInternal::Edge* firstEdge = v->edges;
+ if (firstEdge)
+ {
+ int firstCopy = -1;
+ int prevCopy = -1;
+ btConvexHullInternal::Edge* e = firstEdge;
+ do
+ {
+ if (e->copy < 0)
+ {
+ int s = edges.size();
+ edges.push_back(Edge());
+ edges.push_back(Edge());
+ Edge* c = &edges[s];
+ Edge* r = &edges[s + 1];
+ e->copy = s;
+ e->reverse->copy = s + 1;
+ c->reverse = 1;
+ r->reverse = -1;
+ c->targetVertex = getVertexCopy(e->target, oldVertices);
+ r->targetVertex = copied;
+#ifdef DEBUG_CONVEX_HULL
+ printf(" CREATE: Vertex *%d has edge to *%d\n", copied, c->getTargetVertex());
+#endif
+ }
+ if (prevCopy >= 0)
+ {
+ edges[e->copy].next = prevCopy - e->copy;
+ }
+ else
+ {
+ firstCopy = e->copy;
+ }
+ prevCopy = e->copy;
+ e = e->next;
+ } while (e != firstEdge);
+ edges[firstCopy].next = prevCopy - firstCopy;
+ }
+ copied++;
+ }
+
+ for (int i = 0; i < copied; i++)
+ {
+ btConvexHullInternal::Vertex* v = oldVertices[i];
+ btConvexHullInternal::Edge* firstEdge = v->edges;
+ if (firstEdge)
+ {
+ btConvexHullInternal::Edge* e = firstEdge;
+ do
+ {
+ if (e->copy >= 0)
+ {
+#ifdef DEBUG_CONVEX_HULL
+ printf("Vertex *%d has edge to *%d\n", i, edges[e->copy].getTargetVertex());
+#endif
+ faces.push_back(e->copy);
+ btConvexHullInternal::Edge* f = e;
+ do
+ {
+#ifdef DEBUG_CONVEX_HULL
+ printf(" Face *%d\n", edges[f->copy].getTargetVertex());
+#endif
+ f->copy = -1;
+ f = f->reverse->prev;
+ } while (f != e);
+ }
+ e = e->next;
+ } while (e != firstEdge);
+ }
+ }
+
+ return shift;
+}
+
+
+
+
+
diff --git a/extern/bullet2/src/LinearMath/btConvexHullComputer.h b/extern/bullet2/src/LinearMath/btConvexHullComputer.h
new file mode 100644
index 00000000000..7240ac4fb52
--- /dev/null
+++ b/extern/bullet2/src/LinearMath/btConvexHullComputer.h
@@ -0,0 +1,103 @@
+/*
+Copyright (c) 2011 Ole Kniemeyer, MAXON, www.maxon.net
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+#ifndef BT_CONVEX_HULL_COMPUTER_H
+#define BT_CONVEX_HULL_COMPUTER_H
+
+#include "btVector3.h"
+#include "btAlignedObjectArray.h"
+
+/// Convex hull implementation based on Preparata and Hong
+/// See http://code.google.com/p/bullet/issues/detail?id=275
+/// Ole Kniemeyer, MAXON Computer GmbH
+class btConvexHullComputer
+{
+ private:
+ btScalar compute(const void* coords, bool doubleCoords, int stride, int count, btScalar shrink, btScalar shrinkClamp);
+
+ public:
+
+ class Edge
+ {
+ private:
+ int next;
+ int reverse;
+ int targetVertex;
+
+ friend class btConvexHullComputer;
+
+ public:
+ int getSourceVertex() const
+ {
+ return (this + reverse)->targetVertex;
+ }
+
+ int getTargetVertex() const
+ {
+ return targetVertex;
+ }
+
+ const Edge* getNextEdgeOfVertex() const // clockwise list of all edges of a vertex
+ {
+ return this + next;
+ }
+
+ const Edge* getNextEdgeOfFace() const // counter-clockwise list of all edges of a face
+ {
+ return (this + reverse)->getNextEdgeOfVertex();
+ }
+
+ const Edge* getReverseEdge() const
+ {
+ return this + reverse;
+ }
+ };
+
+
+ // Vertices of the output hull
+ btAlignedObjectArray<btVector3> vertices;
+
+ // Edges of the output hull
+ btAlignedObjectArray<Edge> edges;
+
+ // Faces of the convex hull. Each entry is an index into the "edges" array pointing to an edge of the face. Faces are planar n-gons
+ btAlignedObjectArray<int> faces;
+
+ /*
+ Compute convex hull of "count" vertices stored in "coords". "stride" is the difference in bytes
+ between the addresses of consecutive vertices. If "shrink" is positive, the convex hull is shrunken
+ by that amount (each face is moved by "shrink" length units towards the center along its normal).
+ If "shrinkClamp" is positive, "shrink" is clamped to not exceed "shrinkClamp * innerRadius", where "innerRadius"
+ is the minimum distance of a face to the center of the convex hull.
+
+ The returned value is the amount by which the hull has been shrunken. If it is negative, the amount was so large
+ that the resulting convex hull is empty.
+
+ The output convex hull can be found in the member variables "vertices", "edges", "faces".
+ */
+ btScalar compute(const float* coords, int stride, int count, btScalar shrink, btScalar shrinkClamp)
+ {
+ return compute(coords, false, stride, count, shrink, shrinkClamp);
+ }
+
+ // same as above, but double precision
+ btScalar compute(const double* coords, int stride, int count, btScalar shrink, btScalar shrinkClamp)
+ {
+ return compute(coords, true, stride, count, shrink, shrinkClamp);
+ }
+};
+
+
+#endif //BT_CONVEX_HULL_COMPUTER_H
+
diff --git a/extern/bullet2/src/LinearMath/btDefaultMotionState.h b/extern/bullet2/src/LinearMath/btDefaultMotionState.h
index 7858a10d219..a6b7ef15ac8 100644
--- a/extern/bullet2/src/LinearMath/btDefaultMotionState.h
+++ b/extern/bullet2/src/LinearMath/btDefaultMotionState.h
@@ -1,5 +1,5 @@
-#ifndef DEFAULT_MOTION_STATE_H
-#define DEFAULT_MOTION_STATE_H
+#ifndef BT_DEFAULT_MOTION_STATE_H
+#define BT_DEFAULT_MOTION_STATE_H
#include "btMotionState.h"
@@ -37,4 +37,4 @@ struct btDefaultMotionState : public btMotionState
};
-#endif //DEFAULT_MOTION_STATE_H
+#endif //BT_DEFAULT_MOTION_STATE_H
diff --git a/extern/bullet2/src/LinearMath/btGrahamScan2dConvexHull.h b/extern/bullet2/src/LinearMath/btGrahamScan2dConvexHull.h
new file mode 100644
index 00000000000..d7bd3eb8911
--- /dev/null
+++ b/extern/bullet2/src/LinearMath/btGrahamScan2dConvexHull.h
@@ -0,0 +1,110 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2011 Advanced Micro Devices, Inc. http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
+#ifndef GRAHAM_SCAN_2D_CONVEX_HULL_H
+#define GRAHAM_SCAN_2D_CONVEX_HULL_H
+
+
+#include "btVector3.h"
+#include "btAlignedObjectArray.h"
+
+struct GrahamVector2 : public btVector3
+{
+ GrahamVector2(const btVector3& org, int orgIndex)
+ :btVector3(org),
+ m_orgIndex(orgIndex)
+ {
+ }
+ btScalar m_angle;
+ int m_orgIndex;
+};
+
+
+struct btAngleCompareFunc {
+ btVector3 m_anchor;
+ btAngleCompareFunc(const btVector3& anchor)
+ : m_anchor(anchor)
+ {
+ }
+ bool operator()(const GrahamVector2& a, const GrahamVector2& b) const {
+ if (a.m_angle != b.m_angle)
+ return a.m_angle < b.m_angle;
+ else
+ {
+ btScalar al = (a-m_anchor).length2();
+ btScalar bl = (b-m_anchor).length2();
+ if (al != bl)
+ return al < bl;
+ else
+ {
+ return a.m_orgIndex < b.m_orgIndex;
+ }
+ }
+ }
+};
+
+inline void GrahamScanConvexHull2D(btAlignedObjectArray<GrahamVector2>& originalPoints, btAlignedObjectArray<GrahamVector2>& hull)
+{
+ if (originalPoints.size()<=1)
+ {
+ for (int i=0;i<originalPoints.size();i++)
+ hull.push_back(originalPoints[0]);
+ return;
+ }
+ //step1 : find anchor point with smallest x/y and move it to first location
+ //also precompute angles
+ for (int i=0;i<originalPoints.size();i++)
+ {
+ const btVector3& left = originalPoints[i];
+ const btVector3& right = originalPoints[0];
+ if (left.x() < right.x() || !(right.x() < left.x()) && left.y() < right.y())
+ {
+ originalPoints.swap(0,i);
+ }
+ }
+
+ for (int i=0;i<originalPoints.size();i++)
+ {
+ btVector3 xvec(1,0,0);
+ btVector3 ar = originalPoints[i]-originalPoints[0];
+ originalPoints[i].m_angle = btCross(xvec, ar).dot(btVector3(0,0,1)) / ar.length();
+ }
+
+ //step 2: sort all points, based on 'angle' with this anchor
+ btAngleCompareFunc comp(originalPoints[0]);
+ originalPoints.quickSortInternal(comp,1,originalPoints.size()-1);
+
+ int i;
+ for (i = 0; i<2; i++)
+ hull.push_back(originalPoints[i]);
+
+ //step 3: keep all 'convex' points and discard concave points (using back tracking)
+ for (; i != originalPoints.size(); i++)
+ {
+ bool isConvex = false;
+ while (!isConvex&& hull.size()>1) {
+ btVector3& a = hull[hull.size()-2];
+ btVector3& b = hull[hull.size()-1];
+ isConvex = btCross(a-b,a-originalPoints[i]).dot(btVector3(0,0,1))> 0;
+ if (!isConvex)
+ hull.pop_back();
+ else
+ hull.push_back(originalPoints[i]);
+ }
+ }
+}
+
+#endif //GRAHAM_SCAN_2D_CONVEX_HULL_H
diff --git a/extern/bullet2/src/LinearMath/btHashMap.h b/extern/bullet2/src/LinearMath/btHashMap.h
index e3302b5e9ff..ce07db3ac6b 100644
--- a/extern/bullet2/src/LinearMath/btHashMap.h
+++ b/extern/bullet2/src/LinearMath/btHashMap.h
@@ -1,3 +1,19 @@
+/*
+Bullet Continuous Collision Detection and Physics Library
+Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the use of this software.
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+*/
+
+
#ifndef BT_HASH_MAP_H
#define BT_HASH_MAP_H
diff --git a/extern/bullet2/src/LinearMath/btIDebugDraw.h b/extern/bullet2/src/LinearMath/btIDebugDraw.h
index 48c15806a7d..935502f844f 100644
--- a/extern/bullet2/src/LinearMath/btIDebugDraw.h
+++ b/extern/bullet2/src/LinearMath/btIDebugDraw.h
@@ -14,8 +14,8 @@ subject to the following restrictions:
*/
-#ifndef IDEBUG_DRAW__H
-#define IDEBUG_DRAW__H
+#ifndef BT_IDEBUG_DRAW__H
+#define BT_IDEBUG_DRAW__H
#include "btVector3.h"
#include "btTransform.h"
@@ -46,6 +46,7 @@ class btIDebugDraw
DBG_DrawConstraints = (1 << 11),
DBG_DrawConstraintLimits = (1 << 12),
DBG_FastWireframe = (1<<13),
+ DBG_DrawNormals = (1<<14),
DBG_MAX_DEBUG_DRAW_MODE
};
@@ -413,5 +414,5 @@ class btIDebugDraw
};
-#endif //IDEBUG_DRAW__H
+#endif //BT_IDEBUG_DRAW__H
diff --git a/extern/bullet2/src/LinearMath/btList.h b/extern/bullet2/src/LinearMath/btList.h
index c87b47faf2b..eec80a7064b 100644
--- a/extern/bullet2/src/LinearMath/btList.h
+++ b/extern/bullet2/src/LinearMath/btList.h
@@ -14,8 +14,8 @@ subject to the following restrictions:
-#ifndef GEN_LIST_H
-#define GEN_LIST_H
+#ifndef BT_GEN_LIST_H
+#define BT_GEN_LIST_H
class btGEN_Link {
public:
@@ -67,7 +67,7 @@ private:
btGEN_Link m_tail;
};
-#endif
+#endif //BT_GEN_LIST_H
diff --git a/extern/bullet2/src/LinearMath/btMinMax.h b/extern/bullet2/src/LinearMath/btMinMax.h
index 80601c1e232..5b436e9ba4e 100644
--- a/extern/bullet2/src/LinearMath/btMinMax.h
+++ b/extern/bullet2/src/LinearMath/btMinMax.h
@@ -14,10 +14,10 @@ subject to the following restrictions:
-#ifndef GEN_MINMAX_H
-#define GEN_MINMAX_H
+#ifndef BT_GEN_MINMAX_H
+#define BT_GEN_MINMAX_H
-#include "LinearMath/btScalar.h"
+#include "btScalar.h"
template <class T>
SIMD_FORCE_INLINE const T& btMin(const T& a, const T& b)
@@ -68,4 +68,4 @@ SIMD_FORCE_INLINE void btClamp(T& a, const T& lb, const T& ub)
}
}
-#endif
+#endif //BT_GEN_MINMAX_H
diff --git a/extern/bullet2/src/LinearMath/btPoint3.h b/extern/bullet2/src/LinearMath/btPoint3.h
deleted file mode 100644
index a2020e26d12..00000000000
--- a/extern/bullet2/src/LinearMath/btPoint3.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-
-#ifndef btPoint3_H
-#define btPoint3_H
-
-#include "btVector3.h"
-
-typedef btVector3 btPoint3;
-
-#endif
diff --git a/extern/bullet2/src/LinearMath/btPoolAllocator.h b/extern/bullet2/src/LinearMath/btPoolAllocator.h
index e3b4be9b155..ef2084537a2 100644
--- a/extern/bullet2/src/LinearMath/btPoolAllocator.h
+++ b/extern/bullet2/src/LinearMath/btPoolAllocator.h
@@ -62,6 +62,11 @@ public:
return m_maxElements - m_freeCount;
}
+ int getMaxCount() const
+ {
+ return m_maxElements;
+ }
+
void* allocate(int size)
{
// release mode fix
diff --git a/extern/bullet2/src/LinearMath/btQuadWord.h b/extern/bullet2/src/LinearMath/btQuadWord.h
index c657afd2bb1..d5e9daa45a2 100644
--- a/extern/bullet2/src/LinearMath/btQuadWord.h
+++ b/extern/bullet2/src/LinearMath/btQuadWord.h
@@ -13,8 +13,8 @@ subject to the following restrictions:
*/
-#ifndef SIMD_QUADWORD_H
-#define SIMD_QUADWORD_H
+#ifndef BT_SIMD_QUADWORD_H
+#define BT_SIMD_QUADWORD_H
#include "btScalar.h"
#include "btMinMax.h"
@@ -177,4 +177,4 @@ protected:
};
-#endif //SIMD_QUADWORD_H
+#endif //BT_SIMD_QUADWORD_H
diff --git a/extern/bullet2/src/LinearMath/btQuaternion.h b/extern/bullet2/src/LinearMath/btQuaternion.h
index 15cf5f868d9..ee79f6eaeee 100644
--- a/extern/bullet2/src/LinearMath/btQuaternion.h
+++ b/extern/bullet2/src/LinearMath/btQuaternion.h
@@ -14,8 +14,8 @@ subject to the following restrictions:
-#ifndef SIMD__QUATERNION_H_
-#define SIMD__QUATERNION_H_
+#ifndef BT_SIMD__QUATERNION_H_
+#define BT_SIMD__QUATERNION_H_
#include "btVector3.h"
@@ -212,11 +212,12 @@ public:
/**@brief Return the axis of the rotation represented by this quaternion */
btVector3 getAxis() const
{
- btScalar s_squared = btScalar(1.) - btPow(m_floats[3], btScalar(2.));
+ btScalar s_squared = 1.f-m_floats[3]*m_floats[3];
+
if (s_squared < btScalar(10.) * SIMD_EPSILON) //Check for divide by zero
return btVector3(1.0, 0.0, 0.0); // Arbitrary
- btScalar s = btSqrt(s_squared);
- return btVector3(m_floats[0] / s, m_floats[1] / s, m_floats[2] / s);
+ btScalar s = 1.f/btSqrt(s_squared);
+ return btVector3(m_floats[0] * s, m_floats[1] * s, m_floats[2] * s);
}
/**@brief Return the inverse of this quaternion */
@@ -279,23 +280,25 @@ public:
* Slerp interpolates assuming constant velocity. */
btQuaternion slerp(const btQuaternion& q, const btScalar& t) const
{
- btScalar theta = angle(q);
- if (theta != btScalar(0.0))
+ btScalar magnitude = btSqrt(length2() * q.length2());
+ btAssert(magnitude > btScalar(0));
+
+ btScalar product = dot(q) / magnitude;
+ if (btFabs(product) != btScalar(1))
{
- btScalar d = btScalar(1.0) / btSin(theta);
- btScalar s0 = btSin((btScalar(1.0) - t) * theta);
- btScalar s1 = btSin(t * theta);
- if (dot(q) < 0) // Take care of long angle case see http://en.wikipedia.org/wiki/Slerp
- return btQuaternion((m_floats[0] * s0 + -q.x() * s1) * d,
- (m_floats[1] * s0 + -q.y() * s1) * d,
- (m_floats[2] * s0 + -q.z() * s1) * d,
- (m_floats[3] * s0 + -q.m_floats[3] * s1) * d);
- else
- return btQuaternion((m_floats[0] * s0 + q.x() * s1) * d,
- (m_floats[1] * s0 + q.y() * s1) * d,
- (m_floats[2] * s0 + q.z() * s1) * d,
- (m_floats[3] * s0 + q.m_floats[3] * s1) * d);
-
+ // Take care of long angle case see http://en.wikipedia.org/wiki/Slerp
+ const btScalar sign = (product < 0) ? btScalar(-1) : btScalar(1);
+
+ const btScalar theta = btAcos(sign * product);
+ const btScalar s1 = btSin(sign * t * theta);
+ const btScalar d = btScalar(1.0) / btSin(theta);
+ const btScalar s0 = btSin((btScalar(1.0) - t) * theta);
+
+ return btQuaternion(
+ (m_floats[0] * s0 + q.x() * s1) * d,
+ (m_floats[1] * s0 + q.y() * s1) * d,
+ (m_floats[2] * s0 + q.z() * s1) * d,
+ (m_floats[3] * s0 + q.m_floats[3] * s1) * d);
}
else
{
@@ -315,12 +318,6 @@ public:
};
-/**@brief Return the negative of a quaternion */
-SIMD_FORCE_INLINE btQuaternion
-operator-(const btQuaternion& q)
-{
- return btQuaternion(-q.x(), -q.y(), -q.z(), -q.w());
-}
@@ -426,7 +423,7 @@ shortestArcQuatNormalize2(btVector3& v0,btVector3& v1)
return shortestArcQuat(v0,v1);
}
-#endif
+#endif //BT_SIMD__QUATERNION_H_
diff --git a/extern/bullet2/src/LinearMath/btQuickprof.cpp b/extern/bullet2/src/LinearMath/btQuickprof.cpp
index 14534068a0d..544aee89d02 100644
--- a/extern/bullet2/src/LinearMath/btQuickprof.cpp
+++ b/extern/bullet2/src/LinearMath/btQuickprof.cpp
@@ -276,7 +276,8 @@ CProfileNode::CProfileNode( const char * name, CProfileNode * parent ) :
RecursionCounter( 0 ),
Parent( parent ),
Child( NULL ),
- Sibling( NULL )
+ Sibling( NULL ),
+ m_userPtr(0)
{
Reset();
}
diff --git a/extern/bullet2/src/LinearMath/btQuickprof.h b/extern/bullet2/src/LinearMath/btQuickprof.h
index adfbbe6149c..93f3f4a60fa 100644
--- a/extern/bullet2/src/LinearMath/btQuickprof.h
+++ b/extern/bullet2/src/LinearMath/btQuickprof.h
@@ -12,8 +12,8 @@
-#ifndef QUICK_PROF_H
-#define QUICK_PROF_H
+#ifndef BT_QUICK_PROF_H
+#define BT_QUICK_PROF_H
//To disable built-in profiling, please comment out next line
//#define BT_NO_PROFILE 1
@@ -82,7 +82,8 @@ public:
const char * Get_Name( void ) { return Name; }
int Get_Total_Calls( void ) { return TotalCalls; }
float Get_Total_Time( void ) { return TotalTime; }
-
+ void* GetUserPointer() const {return m_userPtr;}
+ void SetUserPointer(void* ptr) { m_userPtr = ptr;}
protected:
const char * Name;
@@ -94,6 +95,7 @@ protected:
CProfileNode * Parent;
CProfileNode * Child;
CProfileNode * Sibling;
+ void* m_userPtr;
};
///An iterator to navigate through the tree
@@ -115,15 +117,20 @@ public:
int Get_Current_Total_Calls( void ) { return CurrentChild->Get_Total_Calls(); }
float Get_Current_Total_Time( void ) { return CurrentChild->Get_Total_Time(); }
+ void* Get_Current_UserPointer( void ) { return CurrentChild->GetUserPointer(); }
+ void Set_Current_UserPointer(void* ptr) {CurrentChild->SetUserPointer(ptr);}
// Access the current parent
const char * Get_Current_Parent_Name( void ) { return CurrentParent->Get_Name(); }
int Get_Current_Parent_Total_Calls( void ) { return CurrentParent->Get_Total_Calls(); }
float Get_Current_Parent_Total_Time( void ) { return CurrentParent->Get_Total_Time(); }
+
+
protected:
CProfileNode * CurrentParent;
CProfileNode * CurrentChild;
+
CProfileIterator( CProfileNode * start );
friend class CProfileManager;
@@ -191,6 +198,6 @@ public:
-#endif //QUICK_PROF_H
+#endif //BT_QUICK_PROF_H
diff --git a/extern/bullet2/src/LinearMath/btRandom.h b/extern/bullet2/src/LinearMath/btRandom.h
index fdf65e01caf..4cbfc6bfe9f 100644
--- a/extern/bullet2/src/LinearMath/btRandom.h
+++ b/extern/bullet2/src/LinearMath/btRandom.h
@@ -14,8 +14,8 @@ subject to the following restrictions:
-#ifndef GEN_RANDOM_H
-#define GEN_RANDOM_H
+#ifndef BT_GEN_RANDOM_H
+#define BT_GEN_RANDOM_H
#ifdef MT19937
@@ -38,5 +38,5 @@ SIMD_FORCE_INLINE unsigned int GEN_rand() { return rand(); }
#endif
-#endif
+#endif //BT_GEN_RANDOM_H
diff --git a/extern/bullet2/src/LinearMath/btScalar.h b/extern/bullet2/src/LinearMath/btScalar.h
index 6ba6c5ad30d..ecae972243c 100644
--- a/extern/bullet2/src/LinearMath/btScalar.h
+++ b/extern/bullet2/src/LinearMath/btScalar.h
@@ -14,8 +14,8 @@ subject to the following restrictions:
-#ifndef SIMD___SCALAR_H
-#define SIMD___SCALAR_H
+#ifndef BT_SCALAR_H
+#define BT_SCALAR_H
#ifdef BT_MANAGED_CODE
//Aligned data types not supported in managed code
@@ -25,12 +25,10 @@ subject to the following restrictions:
#include <math.h>
#include <stdlib.h>//size_t for MSVC 6.0
-#include <cstdlib>
-#include <cfloat>
#include <float.h>
-/* SVN $Revision: 35500 $ on $Date: 2011-03-12 21:34:17 +0100 (Sat, 12 Mar 2011) $ from http://bullet.googlecode.com*/
-#define BT_BULLET_VERSION 278
+/* SVN $Revision$ on $Date$ from http://bullet.googlecode.com*/
+#define BT_BULLET_VERSION 280
inline int btGetVersion()
{
@@ -521,4 +519,29 @@ struct btTypedObject
return m_objectType;
}
};
-#endif //SIMD___SCALAR_H
+
+
+
+///align a pointer to the provided alignment, upwards
+template <typename T>T* btAlignPointer(T* unalignedPtr, size_t alignment)
+{
+
+ struct btConvertPointerSizeT
+ {
+ union
+ {
+ T* ptr;
+ size_t integer;
+ };
+ };
+ btConvertPointerSizeT converter;
+
+
+ const size_t bit_mask = ~(alignment - 1);
+ converter.ptr = unalignedPtr;
+ converter.integer += alignment-1;
+ converter.integer &= bit_mask;
+ return converter.ptr;
+}
+
+#endif //BT_SCALAR_H
diff --git a/extern/bullet2/src/LinearMath/btSerializer.cpp b/extern/bullet2/src/LinearMath/btSerializer.cpp
index c6d387e6133..49c25b7ea2a 100644
--- a/extern/bullet2/src/LinearMath/btSerializer.cpp
+++ b/extern/bullet2/src/LinearMath/btSerializer.cpp
@@ -1,5 +1,5 @@
-unsigned char sBulletDNAstr[]= {
-83,68,78,65,78,65,77,69,42,1,0,0,109,95,115,105,122,101,0,109,
+char sBulletDNAstr[]= {
+83,68,78,65,78,65,77,69,44,1,0,0,109,95,115,105,122,101,0,109,
95,99,97,112,97,99,105,116,121,0,42,109,95,100,97,116,97,0,109,95,
99,111,108,108,105,115,105,111,110,83,104,97,112,101,115,0,109,95,99,111,
108,108,105,115,105,111,110,79,98,106,101,99,116,115,0,109,95,99,111,110,
@@ -130,292 +130,297 @@ unsigned char sBulletDNAstr[]= {
112,108,105,101,100,73,109,112,117,108,115,101,0,109,95,100,98,103,68,114,
97,119,83,105,122,101,0,109,95,100,105,115,97,98,108,101,67,111,108,108,
105,115,105,111,110,115,66,101,116,119,101,101,110,76,105,110,107,101,100,66,
-111,100,105,101,115,0,109,95,112,97,100,52,91,52,93,0,109,95,116,121,
-112,101,67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,109,95,112,
-105,118,111,116,73,110,65,0,109,95,112,105,118,111,116,73,110,66,0,109,
-95,114,98,65,70,114,97,109,101,0,109,95,114,98,66,70,114,97,109,101,
-0,109,95,117,115,101,82,101,102,101,114,101,110,99,101,70,114,97,109,101,
-65,0,109,95,97,110,103,117,108,97,114,79,110,108,121,0,109,95,101,110,
-97,98,108,101,65,110,103,117,108,97,114,77,111,116,111,114,0,109,95,109,
-111,116,111,114,84,97,114,103,101,116,86,101,108,111,99,105,116,121,0,109,
-95,109,97,120,77,111,116,111,114,73,109,112,117,108,115,101,0,109,95,108,
-111,119,101,114,76,105,109,105,116,0,109,95,117,112,112,101,114,76,105,109,
-105,116,0,109,95,108,105,109,105,116,83,111,102,116,110,101,115,115,0,109,
-95,98,105,97,115,70,97,99,116,111,114,0,109,95,114,101,108,97,120,97,
-116,105,111,110,70,97,99,116,111,114,0,109,95,115,119,105,110,103,83,112,
-97,110,49,0,109,95,115,119,105,110,103,83,112,97,110,50,0,109,95,116,
-119,105,115,116,83,112,97,110,0,109,95,100,97,109,112,105,110,103,0,109,
-95,108,105,110,101,97,114,85,112,112,101,114,76,105,109,105,116,0,109,95,
-108,105,110,101,97,114,76,111,119,101,114,76,105,109,105,116,0,109,95,97,
-110,103,117,108,97,114,85,112,112,101,114,76,105,109,105,116,0,109,95,97,
-110,103,117,108,97,114,76,111,119,101,114,76,105,109,105,116,0,109,95,117,
-115,101,76,105,110,101,97,114,82,101,102,101,114,101,110,99,101,70,114,97,
-109,101,65,0,109,95,117,115,101,79,102,102,115,101,116,70,111,114,67,111,
-110,115,116,114,97,105,110,116,70,114,97,109,101,0,109,95,54,100,111,102,
-68,97,116,97,0,109,95,115,112,114,105,110,103,69,110,97,98,108,101,100,
-91,54,93,0,109,95,101,113,117,105,108,105,98,114,105,117,109,80,111,105,
-110,116,91,54,93,0,109,95,115,112,114,105,110,103,83,116,105,102,102,110,
-101,115,115,91,54,93,0,109,95,115,112,114,105,110,103,68,97,109,112,105,
-110,103,91,54,93,0,109,95,108,105,110,101,97,114,83,116,105,102,102,110,
-101,115,115,0,109,95,97,110,103,117,108,97,114,83,116,105,102,102,110,101,
-115,115,0,109,95,118,111,108,117,109,101,83,116,105,102,102,110,101,115,115,
-0,42,109,95,109,97,116,101,114,105,97,108,0,109,95,112,111,115,105,116,
-105,111,110,0,109,95,112,114,101,118,105,111,117,115,80,111,115,105,116,105,
-111,110,0,109,95,118,101,108,111,99,105,116,121,0,109,95,97,99,99,117,
-109,117,108,97,116,101,100,70,111,114,99,101,0,109,95,110,111,114,109,97,
-108,0,109,95,97,114,101,97,0,109,95,97,116,116,97,99,104,0,109,95,
-110,111,100,101,73,110,100,105,99,101,115,91,50,93,0,109,95,114,101,115,
-116,76,101,110,103,116,104,0,109,95,98,98,101,110,100,105,110,103,0,109,
-95,110,111,100,101,73,110,100,105,99,101,115,91,51,93,0,109,95,114,101,
-115,116,65,114,101,97,0,109,95,99,48,91,52,93,0,109,95,110,111,100,
-101,73,110,100,105,99,101,115,91,52,93,0,109,95,114,101,115,116,86,111,
-108,117,109,101,0,109,95,99,49,0,109,95,99,50,0,109,95,99,48,0,
-109,95,108,111,99,97,108,70,114,97,109,101,0,42,109,95,114,105,103,105,
-100,66,111,100,121,0,109,95,110,111,100,101,73,110,100,101,120,0,109,95,
-97,101,114,111,77,111,100,101,108,0,109,95,98,97,117,109,103,97,114,116,
-101,0,109,95,100,114,97,103,0,109,95,108,105,102,116,0,109,95,112,114,
-101,115,115,117,114,101,0,109,95,118,111,108,117,109,101,0,109,95,100,121,
-110,97,109,105,99,70,114,105,99,116,105,111,110,0,109,95,112,111,115,101,
-77,97,116,99,104,0,109,95,114,105,103,105,100,67,111,110,116,97,99,116,
-72,97,114,100,110,101,115,115,0,109,95,107,105,110,101,116,105,99,67,111,
-110,116,97,99,116,72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,
-67,111,110,116,97,99,116,72,97,114,100,110,101,115,115,0,109,95,97,110,
-99,104,111,114,72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,82,
-105,103,105,100,67,108,117,115,116,101,114,72,97,114,100,110,101,115,115,0,
-109,95,115,111,102,116,75,105,110,101,116,105,99,67,108,117,115,116,101,114,
-72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,83,111,102,116,67,
-108,117,115,116,101,114,72,97,114,100,110,101,115,115,0,109,95,115,111,102,
-116,82,105,103,105,100,67,108,117,115,116,101,114,73,109,112,117,108,115,101,
-83,112,108,105,116,0,109,95,115,111,102,116,75,105,110,101,116,105,99,67,
-108,117,115,116,101,114,73,109,112,117,108,115,101,83,112,108,105,116,0,109,
-95,115,111,102,116,83,111,102,116,67,108,117,115,116,101,114,73,109,112,117,
-108,115,101,83,112,108,105,116,0,109,95,109,97,120,86,111,108,117,109,101,
-0,109,95,116,105,109,101,83,99,97,108,101,0,109,95,118,101,108,111,99,
-105,116,121,73,116,101,114,97,116,105,111,110,115,0,109,95,112,111,115,105,
-116,105,111,110,73,116,101,114,97,116,105,111,110,115,0,109,95,100,114,105,
-102,116,73,116,101,114,97,116,105,111,110,115,0,109,95,99,108,117,115,116,
-101,114,73,116,101,114,97,116,105,111,110,115,0,109,95,114,111,116,0,109,
-95,115,99,97,108,101,0,109,95,97,113,113,0,109,95,99,111,109,0,42,
-109,95,112,111,115,105,116,105,111,110,115,0,42,109,95,119,101,105,103,104,
-116,115,0,109,95,110,117,109,80,111,115,105,116,105,111,110,115,0,109,95,
-110,117,109,87,101,105,103,116,115,0,109,95,98,118,111,108,117,109,101,0,
-109,95,98,102,114,97,109,101,0,109,95,102,114,97,109,101,120,102,111,114,
-109,0,109,95,108,111,99,105,105,0,109,95,105,110,118,119,105,0,109,95,
-118,105,109,112,117,108,115,101,115,91,50,93,0,109,95,100,105,109,112,117,
-108,115,101,115,91,50,93,0,109,95,108,118,0,109,95,97,118,0,42,109,
-95,102,114,97,109,101,114,101,102,115,0,42,109,95,110,111,100,101,73,110,
-100,105,99,101,115,0,42,109,95,109,97,115,115,101,115,0,109,95,110,117,
-109,70,114,97,109,101,82,101,102,115,0,109,95,110,117,109,78,111,100,101,
-115,0,109,95,110,117,109,77,97,115,115,101,115,0,109,95,105,100,109,97,
-115,115,0,109,95,105,109,97,115,115,0,109,95,110,118,105,109,112,117,108,
-115,101,115,0,109,95,110,100,105,109,112,117,108,115,101,115,0,109,95,110,
-100,97,109,112,105,110,103,0,109,95,108,100,97,109,112,105,110,103,0,109,
-95,97,100,97,109,112,105,110,103,0,109,95,109,97,116,99,104,105,110,103,
-0,109,95,109,97,120,83,101,108,102,67,111,108,108,105,115,105,111,110,73,
-109,112,117,108,115,101,0,109,95,115,101,108,102,67,111,108,108,105,115,105,
-111,110,73,109,112,117,108,115,101,70,97,99,116,111,114,0,109,95,99,111,
-110,116,97,105,110,115,65,110,99,104,111,114,0,109,95,99,111,108,108,105,
-100,101,0,109,95,99,108,117,115,116,101,114,73,110,100,101,120,0,42,109,
-95,98,111,100,121,65,0,42,109,95,98,111,100,121,66,0,109,95,114,101,
-102,115,91,50,93,0,109,95,99,102,109,0,109,95,101,114,112,0,109,95,
-115,112,108,105,116,0,109,95,100,101,108,101,116,101,0,109,95,114,101,108,
-80,111,115,105,116,105,111,110,91,50,93,0,109,95,98,111,100,121,65,116,
-121,112,101,0,109,95,98,111,100,121,66,116,121,112,101,0,109,95,106,111,
-105,110,116,84,121,112,101,0,42,109,95,112,111,115,101,0,42,42,109,95,
-109,97,116,101,114,105,97,108,115,0,42,109,95,110,111,100,101,115,0,42,
-109,95,108,105,110,107,115,0,42,109,95,102,97,99,101,115,0,42,109,95,
-116,101,116,114,97,104,101,100,114,97,0,42,109,95,97,110,99,104,111,114,
-115,0,42,109,95,99,108,117,115,116,101,114,115,0,42,109,95,106,111,105,
-110,116,115,0,109,95,110,117,109,77,97,116,101,114,105,97,108,115,0,109,
-95,110,117,109,76,105,110,107,115,0,109,95,110,117,109,70,97,99,101,115,
-0,109,95,110,117,109,84,101,116,114,97,104,101,100,114,97,0,109,95,110,
-117,109,65,110,99,104,111,114,115,0,109,95,110,117,109,67,108,117,115,116,
-101,114,115,0,109,95,110,117,109,74,111,105,110,116,115,0,109,95,99,111,
-110,102,105,103,0,0,0,0,84,89,80,69,72,0,0,0,99,104,97,114,
-0,117,99,104,97,114,0,115,104,111,114,116,0,117,115,104,111,114,116,0,
-105,110,116,0,108,111,110,103,0,117,108,111,110,103,0,102,108,111,97,116,
-0,100,111,117,98,108,101,0,118,111,105,100,0,80,111,105,110,116,101,114,
-65,114,114,97,121,0,98,116,80,104,121,115,105,99,115,83,121,115,116,101,
-109,0,76,105,115,116,66,97,115,101,0,98,116,86,101,99,116,111,114,51,
-70,108,111,97,116,68,97,116,97,0,98,116,86,101,99,116,111,114,51,68,
-111,117,98,108,101,68,97,116,97,0,98,116,77,97,116,114,105,120,51,120,
-51,70,108,111,97,116,68,97,116,97,0,98,116,77,97,116,114,105,120,51,
-120,51,68,111,117,98,108,101,68,97,116,97,0,98,116,84,114,97,110,115,
-102,111,114,109,70,108,111,97,116,68,97,116,97,0,98,116,84,114,97,110,
-115,102,111,114,109,68,111,117,98,108,101,68,97,116,97,0,98,116,66,118,
-104,83,117,98,116,114,101,101,73,110,102,111,68,97,116,97,0,98,116,79,
-112,116,105,109,105,122,101,100,66,118,104,78,111,100,101,70,108,111,97,116,
-68,97,116,97,0,98,116,79,112,116,105,109,105,122,101,100,66,118,104,78,
-111,100,101,68,111,117,98,108,101,68,97,116,97,0,98,116,81,117,97,110,
-116,105,122,101,100,66,118,104,78,111,100,101,68,97,116,97,0,98,116,81,
-117,97,110,116,105,122,101,100,66,118,104,70,108,111,97,116,68,97,116,97,
-0,98,116,81,117,97,110,116,105,122,101,100,66,118,104,68,111,117,98,108,
-101,68,97,116,97,0,98,116,67,111,108,108,105,115,105,111,110,83,104,97,
-112,101,68,97,116,97,0,98,116,83,116,97,116,105,99,80,108,97,110,101,
-83,104,97,112,101,68,97,116,97,0,98,116,67,111,110,118,101,120,73,110,
-116,101,114,110,97,108,83,104,97,112,101,68,97,116,97,0,98,116,80,111,
-115,105,116,105,111,110,65,110,100,82,97,100,105,117,115,0,98,116,77,117,
-108,116,105,83,112,104,101,114,101,83,104,97,112,101,68,97,116,97,0,98,
-116,73,110,116,73,110,100,101,120,68,97,116,97,0,98,116,83,104,111,114,
-116,73,110,116,73,110,100,101,120,68,97,116,97,0,98,116,83,104,111,114,
-116,73,110,116,73,110,100,101,120,84,114,105,112,108,101,116,68,97,116,97,
-0,98,116,67,104,97,114,73,110,100,101,120,84,114,105,112,108,101,116,68,
-97,116,97,0,98,116,77,101,115,104,80,97,114,116,68,97,116,97,0,98,
-116,83,116,114,105,100,105,110,103,77,101,115,104,73,110,116,101,114,102,97,
-99,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,101,77,101,115,
-104,83,104,97,112,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,
-101,73,110,102,111,77,97,112,68,97,116,97,0,98,116,83,99,97,108,101,
-100,84,114,105,97,110,103,108,101,77,101,115,104,83,104,97,112,101,68,97,
-116,97,0,98,116,67,111,109,112,111,117,110,100,83,104,97,112,101,67,104,
-105,108,100,68,97,116,97,0,98,116,67,111,109,112,111,117,110,100,83,104,
-97,112,101,68,97,116,97,0,98,116,67,121,108,105,110,100,101,114,83,104,
-97,112,101,68,97,116,97,0,98,116,67,97,112,115,117,108,101,83,104,97,
+111,100,105,101,115,0,109,95,111,118,101,114,114,105,100,101,78,117,109,83,
+111,108,118,101,114,73,116,101,114,97,116,105,111,110,115,0,109,95,98,114,
+101,97,107,105,110,103,73,109,112,117,108,115,101,84,104,114,101,115,104,111,
+108,100,0,109,95,105,115,69,110,97,98,108,101,100,0,109,95,116,121,112,
+101,67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,109,95,112,105,
+118,111,116,73,110,65,0,109,95,112,105,118,111,116,73,110,66,0,109,95,
+114,98,65,70,114,97,109,101,0,109,95,114,98,66,70,114,97,109,101,0,
+109,95,117,115,101,82,101,102,101,114,101,110,99,101,70,114,97,109,101,65,
+0,109,95,97,110,103,117,108,97,114,79,110,108,121,0,109,95,101,110,97,
+98,108,101,65,110,103,117,108,97,114,77,111,116,111,114,0,109,95,109,111,
+116,111,114,84,97,114,103,101,116,86,101,108,111,99,105,116,121,0,109,95,
+109,97,120,77,111,116,111,114,73,109,112,117,108,115,101,0,109,95,108,111,
+119,101,114,76,105,109,105,116,0,109,95,117,112,112,101,114,76,105,109,105,
+116,0,109,95,108,105,109,105,116,83,111,102,116,110,101,115,115,0,109,95,
+98,105,97,115,70,97,99,116,111,114,0,109,95,114,101,108,97,120,97,116,
+105,111,110,70,97,99,116,111,114,0,109,95,115,119,105,110,103,83,112,97,
+110,49,0,109,95,115,119,105,110,103,83,112,97,110,50,0,109,95,116,119,
+105,115,116,83,112,97,110,0,109,95,100,97,109,112,105,110,103,0,109,95,
+108,105,110,101,97,114,85,112,112,101,114,76,105,109,105,116,0,109,95,108,
+105,110,101,97,114,76,111,119,101,114,76,105,109,105,116,0,109,95,97,110,
+103,117,108,97,114,85,112,112,101,114,76,105,109,105,116,0,109,95,97,110,
+103,117,108,97,114,76,111,119,101,114,76,105,109,105,116,0,109,95,117,115,
+101,76,105,110,101,97,114,82,101,102,101,114,101,110,99,101,70,114,97,109,
+101,65,0,109,95,117,115,101,79,102,102,115,101,116,70,111,114,67,111,110,
+115,116,114,97,105,110,116,70,114,97,109,101,0,109,95,54,100,111,102,68,
+97,116,97,0,109,95,115,112,114,105,110,103,69,110,97,98,108,101,100,91,
+54,93,0,109,95,101,113,117,105,108,105,98,114,105,117,109,80,111,105,110,
+116,91,54,93,0,109,95,115,112,114,105,110,103,83,116,105,102,102,110,101,
+115,115,91,54,93,0,109,95,115,112,114,105,110,103,68,97,109,112,105,110,
+103,91,54,93,0,109,95,108,105,110,101,97,114,83,116,105,102,102,110,101,
+115,115,0,109,95,97,110,103,117,108,97,114,83,116,105,102,102,110,101,115,
+115,0,109,95,118,111,108,117,109,101,83,116,105,102,102,110,101,115,115,0,
+42,109,95,109,97,116,101,114,105,97,108,0,109,95,112,111,115,105,116,105,
+111,110,0,109,95,112,114,101,118,105,111,117,115,80,111,115,105,116,105,111,
+110,0,109,95,118,101,108,111,99,105,116,121,0,109,95,97,99,99,117,109,
+117,108,97,116,101,100,70,111,114,99,101,0,109,95,110,111,114,109,97,108,
+0,109,95,97,114,101,97,0,109,95,97,116,116,97,99,104,0,109,95,110,
+111,100,101,73,110,100,105,99,101,115,91,50,93,0,109,95,114,101,115,116,
+76,101,110,103,116,104,0,109,95,98,98,101,110,100,105,110,103,0,109,95,
+110,111,100,101,73,110,100,105,99,101,115,91,51,93,0,109,95,114,101,115,
+116,65,114,101,97,0,109,95,99,48,91,52,93,0,109,95,110,111,100,101,
+73,110,100,105,99,101,115,91,52,93,0,109,95,114,101,115,116,86,111,108,
+117,109,101,0,109,95,99,49,0,109,95,99,50,0,109,95,99,48,0,109,
+95,108,111,99,97,108,70,114,97,109,101,0,42,109,95,114,105,103,105,100,
+66,111,100,121,0,109,95,110,111,100,101,73,110,100,101,120,0,109,95,97,
+101,114,111,77,111,100,101,108,0,109,95,98,97,117,109,103,97,114,116,101,
+0,109,95,100,114,97,103,0,109,95,108,105,102,116,0,109,95,112,114,101,
+115,115,117,114,101,0,109,95,118,111,108,117,109,101,0,109,95,100,121,110,
+97,109,105,99,70,114,105,99,116,105,111,110,0,109,95,112,111,115,101,77,
+97,116,99,104,0,109,95,114,105,103,105,100,67,111,110,116,97,99,116,72,
+97,114,100,110,101,115,115,0,109,95,107,105,110,101,116,105,99,67,111,110,
+116,97,99,116,72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,67,
+111,110,116,97,99,116,72,97,114,100,110,101,115,115,0,109,95,97,110,99,
+104,111,114,72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,82,105,
+103,105,100,67,108,117,115,116,101,114,72,97,114,100,110,101,115,115,0,109,
+95,115,111,102,116,75,105,110,101,116,105,99,67,108,117,115,116,101,114,72,
+97,114,100,110,101,115,115,0,109,95,115,111,102,116,83,111,102,116,67,108,
+117,115,116,101,114,72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,
+82,105,103,105,100,67,108,117,115,116,101,114,73,109,112,117,108,115,101,83,
+112,108,105,116,0,109,95,115,111,102,116,75,105,110,101,116,105,99,67,108,
+117,115,116,101,114,73,109,112,117,108,115,101,83,112,108,105,116,0,109,95,
+115,111,102,116,83,111,102,116,67,108,117,115,116,101,114,73,109,112,117,108,
+115,101,83,112,108,105,116,0,109,95,109,97,120,86,111,108,117,109,101,0,
+109,95,116,105,109,101,83,99,97,108,101,0,109,95,118,101,108,111,99,105,
+116,121,73,116,101,114,97,116,105,111,110,115,0,109,95,112,111,115,105,116,
+105,111,110,73,116,101,114,97,116,105,111,110,115,0,109,95,100,114,105,102,
+116,73,116,101,114,97,116,105,111,110,115,0,109,95,99,108,117,115,116,101,
+114,73,116,101,114,97,116,105,111,110,115,0,109,95,114,111,116,0,109,95,
+115,99,97,108,101,0,109,95,97,113,113,0,109,95,99,111,109,0,42,109,
+95,112,111,115,105,116,105,111,110,115,0,42,109,95,119,101,105,103,104,116,
+115,0,109,95,110,117,109,80,111,115,105,116,105,111,110,115,0,109,95,110,
+117,109,87,101,105,103,116,115,0,109,95,98,118,111,108,117,109,101,0,109,
+95,98,102,114,97,109,101,0,109,95,102,114,97,109,101,120,102,111,114,109,
+0,109,95,108,111,99,105,105,0,109,95,105,110,118,119,105,0,109,95,118,
+105,109,112,117,108,115,101,115,91,50,93,0,109,95,100,105,109,112,117,108,
+115,101,115,91,50,93,0,109,95,108,118,0,109,95,97,118,0,42,109,95,
+102,114,97,109,101,114,101,102,115,0,42,109,95,110,111,100,101,73,110,100,
+105,99,101,115,0,42,109,95,109,97,115,115,101,115,0,109,95,110,117,109,
+70,114,97,109,101,82,101,102,115,0,109,95,110,117,109,78,111,100,101,115,
+0,109,95,110,117,109,77,97,115,115,101,115,0,109,95,105,100,109,97,115,
+115,0,109,95,105,109,97,115,115,0,109,95,110,118,105,109,112,117,108,115,
+101,115,0,109,95,110,100,105,109,112,117,108,115,101,115,0,109,95,110,100,
+97,109,112,105,110,103,0,109,95,108,100,97,109,112,105,110,103,0,109,95,
+97,100,97,109,112,105,110,103,0,109,95,109,97,116,99,104,105,110,103,0,
+109,95,109,97,120,83,101,108,102,67,111,108,108,105,115,105,111,110,73,109,
+112,117,108,115,101,0,109,95,115,101,108,102,67,111,108,108,105,115,105,111,
+110,73,109,112,117,108,115,101,70,97,99,116,111,114,0,109,95,99,111,110,
+116,97,105,110,115,65,110,99,104,111,114,0,109,95,99,111,108,108,105,100,
+101,0,109,95,99,108,117,115,116,101,114,73,110,100,101,120,0,42,109,95,
+98,111,100,121,65,0,42,109,95,98,111,100,121,66,0,109,95,114,101,102,
+115,91,50,93,0,109,95,99,102,109,0,109,95,101,114,112,0,109,95,115,
+112,108,105,116,0,109,95,100,101,108,101,116,101,0,109,95,114,101,108,80,
+111,115,105,116,105,111,110,91,50,93,0,109,95,98,111,100,121,65,116,121,
+112,101,0,109,95,98,111,100,121,66,116,121,112,101,0,109,95,106,111,105,
+110,116,84,121,112,101,0,42,109,95,112,111,115,101,0,42,42,109,95,109,
+97,116,101,114,105,97,108,115,0,42,109,95,110,111,100,101,115,0,42,109,
+95,108,105,110,107,115,0,42,109,95,102,97,99,101,115,0,42,109,95,116,
+101,116,114,97,104,101,100,114,97,0,42,109,95,97,110,99,104,111,114,115,
+0,42,109,95,99,108,117,115,116,101,114,115,0,42,109,95,106,111,105,110,
+116,115,0,109,95,110,117,109,77,97,116,101,114,105,97,108,115,0,109,95,
+110,117,109,76,105,110,107,115,0,109,95,110,117,109,70,97,99,101,115,0,
+109,95,110,117,109,84,101,116,114,97,104,101,100,114,97,0,109,95,110,117,
+109,65,110,99,104,111,114,115,0,109,95,110,117,109,67,108,117,115,116,101,
+114,115,0,109,95,110,117,109,74,111,105,110,116,115,0,109,95,99,111,110,
+102,105,103,0,84,89,80,69,72,0,0,0,99,104,97,114,0,117,99,104,
+97,114,0,115,104,111,114,116,0,117,115,104,111,114,116,0,105,110,116,0,
+108,111,110,103,0,117,108,111,110,103,0,102,108,111,97,116,0,100,111,117,
+98,108,101,0,118,111,105,100,0,80,111,105,110,116,101,114,65,114,114,97,
+121,0,98,116,80,104,121,115,105,99,115,83,121,115,116,101,109,0,76,105,
+115,116,66,97,115,101,0,98,116,86,101,99,116,111,114,51,70,108,111,97,
+116,68,97,116,97,0,98,116,86,101,99,116,111,114,51,68,111,117,98,108,
+101,68,97,116,97,0,98,116,77,97,116,114,105,120,51,120,51,70,108,111,
+97,116,68,97,116,97,0,98,116,77,97,116,114,105,120,51,120,51,68,111,
+117,98,108,101,68,97,116,97,0,98,116,84,114,97,110,115,102,111,114,109,
+70,108,111,97,116,68,97,116,97,0,98,116,84,114,97,110,115,102,111,114,
+109,68,111,117,98,108,101,68,97,116,97,0,98,116,66,118,104,83,117,98,
+116,114,101,101,73,110,102,111,68,97,116,97,0,98,116,79,112,116,105,109,
+105,122,101,100,66,118,104,78,111,100,101,70,108,111,97,116,68,97,116,97,
+0,98,116,79,112,116,105,109,105,122,101,100,66,118,104,78,111,100,101,68,
+111,117,98,108,101,68,97,116,97,0,98,116,81,117,97,110,116,105,122,101,
+100,66,118,104,78,111,100,101,68,97,116,97,0,98,116,81,117,97,110,116,
+105,122,101,100,66,118,104,70,108,111,97,116,68,97,116,97,0,98,116,81,
+117,97,110,116,105,122,101,100,66,118,104,68,111,117,98,108,101,68,97,116,
+97,0,98,116,67,111,108,108,105,115,105,111,110,83,104,97,112,101,68,97,
+116,97,0,98,116,83,116,97,116,105,99,80,108,97,110,101,83,104,97,112,
+101,68,97,116,97,0,98,116,67,111,110,118,101,120,73,110,116,101,114,110,
+97,108,83,104,97,112,101,68,97,116,97,0,98,116,80,111,115,105,116,105,
+111,110,65,110,100,82,97,100,105,117,115,0,98,116,77,117,108,116,105,83,
+112,104,101,114,101,83,104,97,112,101,68,97,116,97,0,98,116,73,110,116,
+73,110,100,101,120,68,97,116,97,0,98,116,83,104,111,114,116,73,110,116,
+73,110,100,101,120,68,97,116,97,0,98,116,83,104,111,114,116,73,110,116,
+73,110,100,101,120,84,114,105,112,108,101,116,68,97,116,97,0,98,116,67,
+104,97,114,73,110,100,101,120,84,114,105,112,108,101,116,68,97,116,97,0,
+98,116,77,101,115,104,80,97,114,116,68,97,116,97,0,98,116,83,116,114,
+105,100,105,110,103,77,101,115,104,73,110,116,101,114,102,97,99,101,68,97,
+116,97,0,98,116,84,114,105,97,110,103,108,101,77,101,115,104,83,104,97,
112,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,101,73,110,102,
-111,68,97,116,97,0,98,116,71,73,109,112,97,99,116,77,101,115,104,83,
-104,97,112,101,68,97,116,97,0,98,116,67,111,110,118,101,120,72,117,108,
-108,83,104,97,112,101,68,97,116,97,0,98,116,67,111,108,108,105,115,105,
-111,110,79,98,106,101,99,116,68,111,117,98,108,101,68,97,116,97,0,98,
-116,67,111,108,108,105,115,105,111,110,79,98,106,101,99,116,70,108,111,97,
-116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,70,108,111,
-97,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,68,111,
-117,98,108,101,68,97,116,97,0,98,116,67,111,110,115,116,114,97,105,110,
-116,73,110,102,111,49,0,98,116,84,121,112,101,100,67,111,110,115,116,114,
-97,105,110,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,
-68,97,116,97,0,98,116,80,111,105,110,116,50,80,111,105,110,116,67,111,
-110,115,116,114,97,105,110,116,70,108,111,97,116,68,97,116,97,0,98,116,
-80,111,105,110,116,50,80,111,105,110,116,67,111,110,115,116,114,97,105,110,
-116,68,111,117,98,108,101,68,97,116,97,0,98,116,72,105,110,103,101,67,
-111,110,115,116,114,97,105,110,116,68,111,117,98,108,101,68,97,116,97,0,
-98,116,72,105,110,103,101,67,111,110,115,116,114,97,105,110,116,70,108,111,
-97,116,68,97,116,97,0,98,116,67,111,110,101,84,119,105,115,116,67,111,
-110,115,116,114,97,105,110,116,68,97,116,97,0,98,116,71,101,110,101,114,
-105,99,54,68,111,102,67,111,110,115,116,114,97,105,110,116,68,97,116,97,
-0,98,116,71,101,110,101,114,105,99,54,68,111,102,83,112,114,105,110,103,
-67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,98,116,83,108,105,
-100,101,114,67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,83,111,
-102,116,66,111,100,121,77,97,116,101,114,105,97,108,68,97,116,97,0,83,
-111,102,116,66,111,100,121,78,111,100,101,68,97,116,97,0,83,111,102,116,
-66,111,100,121,76,105,110,107,68,97,116,97,0,83,111,102,116,66,111,100,
-121,70,97,99,101,68,97,116,97,0,83,111,102,116,66,111,100,121,84,101,
-116,114,97,68,97,116,97,0,83,111,102,116,82,105,103,105,100,65,110,99,
-104,111,114,68,97,116,97,0,83,111,102,116,66,111,100,121,67,111,110,102,
-105,103,68,97,116,97,0,83,111,102,116,66,111,100,121,80,111,115,101,68,
-97,116,97,0,83,111,102,116,66,111,100,121,67,108,117,115,116,101,114,68,
-97,116,97,0,98,116,83,111,102,116,66,111,100,121,74,111,105,110,116,68,
-97,116,97,0,98,116,83,111,102,116,66,111,100,121,70,108,111,97,116,68,
-97,116,97,0,84,76,69,78,1,0,1,0,2,0,2,0,4,0,4,0,
-4,0,4,0,8,0,0,0,12,0,36,0,8,0,16,0,32,0,48,0,
-96,0,64,0,-128,0,20,0,48,0,80,0,16,0,84,0,-124,0,12,0,
-52,0,52,0,20,0,64,0,4,0,4,0,8,0,4,0,32,0,28,0,
-60,0,56,0,76,0,76,0,24,0,60,0,60,0,16,0,64,0,68,0,
--56,1,-8,0,-32,1,-104,3,8,0,44,0,0,0,76,0,108,0,84,1,
--44,0,-52,0,-12,0,84,1,-60,0,16,0,100,0,20,0,36,0,100,0,
-92,0,104,0,-64,0,92,1,104,0,-92,1,83,84,82,67,61,0,0,0,
-10,0,3,0,4,0,0,0,4,0,1,0,9,0,2,0,11,0,3,0,
-10,0,3,0,10,0,4,0,10,0,5,0,12,0,2,0,9,0,6,0,
-9,0,7,0,13,0,1,0,7,0,8,0,14,0,1,0,8,0,8,0,
-15,0,1,0,13,0,9,0,16,0,1,0,14,0,9,0,17,0,2,0,
-15,0,10,0,13,0,11,0,18,0,2,0,16,0,10,0,14,0,11,0,
-19,0,4,0,4,0,12,0,4,0,13,0,2,0,14,0,2,0,15,0,
-20,0,6,0,13,0,16,0,13,0,17,0,4,0,18,0,4,0,19,0,
-4,0,20,0,0,0,21,0,21,0,6,0,14,0,16,0,14,0,17,0,
-4,0,18,0,4,0,19,0,4,0,20,0,0,0,21,0,22,0,3,0,
-2,0,14,0,2,0,15,0,4,0,22,0,23,0,12,0,13,0,23,0,
-13,0,24,0,13,0,25,0,4,0,26,0,4,0,27,0,4,0,28,0,
-4,0,29,0,20,0,30,0,22,0,31,0,19,0,32,0,4,0,33,0,
-4,0,34,0,24,0,12,0,14,0,23,0,14,0,24,0,14,0,25,0,
-4,0,26,0,4,0,27,0,4,0,28,0,4,0,29,0,21,0,30,0,
-22,0,31,0,4,0,33,0,4,0,34,0,19,0,32,0,25,0,3,0,
-0,0,35,0,4,0,36,0,0,0,37,0,26,0,5,0,25,0,38,0,
-13,0,39,0,13,0,40,0,7,0,41,0,0,0,21,0,27,0,5,0,
-25,0,38,0,13,0,39,0,13,0,42,0,7,0,43,0,4,0,44,0,
-28,0,2,0,13,0,45,0,7,0,46,0,29,0,4,0,27,0,47,0,
-28,0,48,0,4,0,49,0,0,0,37,0,30,0,1,0,4,0,50,0,
-31,0,2,0,2,0,50,0,0,0,51,0,32,0,2,0,2,0,52,0,
-0,0,51,0,33,0,2,0,0,0,52,0,0,0,53,0,34,0,8,0,
-13,0,54,0,14,0,55,0,30,0,56,0,32,0,57,0,33,0,58,0,
-31,0,59,0,4,0,60,0,4,0,61,0,35,0,4,0,34,0,62,0,
-13,0,63,0,4,0,64,0,0,0,37,0,36,0,7,0,25,0,38,0,
-35,0,65,0,23,0,66,0,24,0,67,0,37,0,68,0,7,0,43,0,
-0,0,69,0,38,0,2,0,36,0,70,0,13,0,39,0,39,0,4,0,
-17,0,71,0,25,0,72,0,4,0,73,0,7,0,74,0,40,0,4,0,
-25,0,38,0,39,0,75,0,4,0,76,0,7,0,43,0,41,0,3,0,
-27,0,47,0,4,0,77,0,0,0,37,0,42,0,3,0,27,0,47,0,
-4,0,77,0,0,0,37,0,43,0,4,0,4,0,78,0,7,0,79,0,
-7,0,80,0,7,0,81,0,37,0,14,0,4,0,82,0,4,0,83,0,
-43,0,84,0,4,0,85,0,7,0,86,0,7,0,87,0,7,0,88,0,
-7,0,89,0,7,0,90,0,4,0,91,0,4,0,92,0,4,0,93,0,
-4,0,94,0,0,0,37,0,44,0,5,0,25,0,38,0,35,0,65,0,
-13,0,39,0,7,0,43,0,4,0,95,0,45,0,5,0,27,0,47,0,
-13,0,96,0,14,0,97,0,4,0,98,0,0,0,99,0,46,0,24,0,
-9,0,100,0,9,0,101,0,25,0,102,0,0,0,35,0,18,0,103,0,
-18,0,104,0,14,0,105,0,14,0,106,0,14,0,107,0,8,0,108,0,
-8,0,109,0,8,0,110,0,8,0,111,0,8,0,112,0,8,0,113,0,
-8,0,114,0,4,0,115,0,4,0,116,0,4,0,117,0,4,0,118,0,
-4,0,119,0,4,0,120,0,4,0,121,0,0,0,37,0,47,0,23,0,
-9,0,100,0,9,0,101,0,25,0,102,0,0,0,35,0,17,0,103,0,
-17,0,104,0,13,0,105,0,13,0,106,0,13,0,107,0,7,0,108,0,
-7,0,109,0,7,0,110,0,7,0,111,0,7,0,112,0,7,0,113,0,
-7,0,114,0,4,0,115,0,4,0,116,0,4,0,117,0,4,0,118,0,
-4,0,119,0,4,0,120,0,4,0,121,0,48,0,21,0,47,0,122,0,
-15,0,123,0,13,0,124,0,13,0,125,0,13,0,126,0,13,0,127,0,
-13,0,-128,0,13,0,-127,0,13,0,-126,0,13,0,-125,0,13,0,-124,0,
-7,0,-123,0,7,0,-122,0,7,0,-121,0,7,0,-120,0,7,0,-119,0,
-7,0,-118,0,7,0,-117,0,7,0,-116,0,7,0,-115,0,4,0,-114,0,
-49,0,22,0,46,0,122,0,16,0,123,0,14,0,124,0,14,0,125,0,
-14,0,126,0,14,0,127,0,14,0,-128,0,14,0,-127,0,14,0,-126,0,
-14,0,-125,0,14,0,-124,0,8,0,-123,0,8,0,-122,0,8,0,-121,0,
-8,0,-120,0,8,0,-119,0,8,0,-118,0,8,0,-117,0,8,0,-116,0,
-8,0,-115,0,4,0,-114,0,0,0,37,0,50,0,2,0,4,0,-113,0,
-4,0,-112,0,51,0,11,0,52,0,-111,0,52,0,-110,0,0,0,35,0,
-4,0,-109,0,4,0,-108,0,4,0,-107,0,4,0,-106,0,7,0,-105,0,
-7,0,-104,0,4,0,-103,0,0,0,-102,0,53,0,3,0,51,0,-101,0,
-13,0,-100,0,13,0,-99,0,54,0,3,0,51,0,-101,0,14,0,-100,0,
-14,0,-99,0,55,0,13,0,51,0,-101,0,18,0,-98,0,18,0,-97,0,
-4,0,-96,0,4,0,-95,0,4,0,-94,0,7,0,-93,0,7,0,-92,0,
-7,0,-91,0,7,0,-90,0,7,0,-89,0,7,0,-88,0,7,0,-87,0,
-56,0,13,0,51,0,-101,0,17,0,-98,0,17,0,-97,0,4,0,-96,0,
-4,0,-95,0,4,0,-94,0,7,0,-93,0,7,0,-92,0,7,0,-91,0,
-7,0,-90,0,7,0,-89,0,7,0,-88,0,7,0,-87,0,57,0,11,0,
-51,0,-101,0,17,0,-98,0,17,0,-97,0,7,0,-86,0,7,0,-85,0,
-7,0,-84,0,7,0,-89,0,7,0,-88,0,7,0,-87,0,7,0,-83,0,
-0,0,21,0,58,0,9,0,51,0,-101,0,17,0,-98,0,17,0,-97,0,
-13,0,-82,0,13,0,-81,0,13,0,-80,0,13,0,-79,0,4,0,-78,0,
-4,0,-77,0,59,0,5,0,58,0,-76,0,4,0,-75,0,7,0,-74,0,
-7,0,-73,0,7,0,-72,0,60,0,9,0,51,0,-101,0,17,0,-98,0,
-17,0,-97,0,7,0,-82,0,7,0,-81,0,7,0,-80,0,7,0,-79,0,
-4,0,-78,0,4,0,-77,0,61,0,4,0,7,0,-71,0,7,0,-70,0,
-7,0,-69,0,4,0,78,0,62,0,10,0,61,0,-68,0,13,0,-67,0,
-13,0,-66,0,13,0,-65,0,13,0,-64,0,13,0,-63,0,7,0,-123,0,
-7,0,-62,0,4,0,-61,0,4,0,53,0,63,0,4,0,61,0,-68,0,
-4,0,-60,0,7,0,-59,0,4,0,-58,0,64,0,4,0,13,0,-63,0,
-61,0,-68,0,4,0,-57,0,7,0,-56,0,65,0,7,0,13,0,-55,0,
-61,0,-68,0,4,0,-54,0,7,0,-53,0,7,0,-52,0,7,0,-51,0,
-4,0,53,0,66,0,6,0,15,0,-50,0,13,0,-52,0,13,0,-49,0,
-52,0,-48,0,4,0,-47,0,7,0,-51,0,67,0,26,0,4,0,-46,0,
-7,0,-45,0,7,0,-83,0,7,0,-44,0,7,0,-43,0,7,0,-42,0,
-7,0,-41,0,7,0,-40,0,7,0,-39,0,7,0,-38,0,7,0,-37,0,
-7,0,-36,0,7,0,-35,0,7,0,-34,0,7,0,-33,0,7,0,-32,0,
-7,0,-31,0,7,0,-30,0,7,0,-29,0,7,0,-28,0,7,0,-27,0,
-4,0,-26,0,4,0,-25,0,4,0,-24,0,4,0,-23,0,4,0,116,0,
-68,0,12,0,15,0,-22,0,15,0,-21,0,15,0,-20,0,13,0,-19,0,
-13,0,-18,0,7,0,-17,0,4,0,-16,0,4,0,-15,0,4,0,-14,0,
-4,0,-13,0,7,0,-53,0,4,0,53,0,69,0,27,0,17,0,-12,0,
-15,0,-11,0,15,0,-10,0,13,0,-19,0,13,0,-9,0,13,0,-8,0,
-13,0,-7,0,13,0,-6,0,13,0,-5,0,4,0,-4,0,7,0,-3,0,
-4,0,-2,0,4,0,-1,0,4,0,0,1,7,0,1,1,7,0,2,1,
-4,0,3,1,4,0,4,1,7,0,5,1,7,0,6,1,7,0,7,1,
-7,0,8,1,7,0,9,1,7,0,10,1,4,0,11,1,4,0,12,1,
-4,0,13,1,70,0,12,0,9,0,14,1,9,0,15,1,13,0,16,1,
-7,0,17,1,7,0,18,1,7,0,19,1,4,0,20,1,13,0,21,1,
-4,0,22,1,4,0,23,1,4,0,24,1,4,0,53,0,71,0,19,0,
-47,0,122,0,68,0,25,1,61,0,26,1,62,0,27,1,63,0,28,1,
-64,0,29,1,65,0,30,1,66,0,31,1,69,0,32,1,70,0,33,1,
-4,0,34,1,4,0,-1,0,4,0,35,1,4,0,36,1,4,0,37,1,
-4,0,38,1,4,0,39,1,4,0,40,1,67,0,41,1,};
+111,77,97,112,68,97,116,97,0,98,116,83,99,97,108,101,100,84,114,105,
+97,110,103,108,101,77,101,115,104,83,104,97,112,101,68,97,116,97,0,98,
+116,67,111,109,112,111,117,110,100,83,104,97,112,101,67,104,105,108,100,68,
+97,116,97,0,98,116,67,111,109,112,111,117,110,100,83,104,97,112,101,68,
+97,116,97,0,98,116,67,121,108,105,110,100,101,114,83,104,97,112,101,68,
+97,116,97,0,98,116,67,97,112,115,117,108,101,83,104,97,112,101,68,97,
+116,97,0,98,116,84,114,105,97,110,103,108,101,73,110,102,111,68,97,116,
+97,0,98,116,71,73,109,112,97,99,116,77,101,115,104,83,104,97,112,101,
+68,97,116,97,0,98,116,67,111,110,118,101,120,72,117,108,108,83,104,97,
+112,101,68,97,116,97,0,98,116,67,111,108,108,105,115,105,111,110,79,98,
+106,101,99,116,68,111,117,98,108,101,68,97,116,97,0,98,116,67,111,108,
+108,105,115,105,111,110,79,98,106,101,99,116,70,108,111,97,116,68,97,116,
+97,0,98,116,82,105,103,105,100,66,111,100,121,70,108,111,97,116,68,97,
+116,97,0,98,116,82,105,103,105,100,66,111,100,121,68,111,117,98,108,101,
+68,97,116,97,0,98,116,67,111,110,115,116,114,97,105,110,116,73,110,102,
+111,49,0,98,116,84,121,112,101,100,67,111,110,115,116,114,97,105,110,116,
+68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,68,97,116,97,
+0,98,116,80,111,105,110,116,50,80,111,105,110,116,67,111,110,115,116,114,
+97,105,110,116,70,108,111,97,116,68,97,116,97,0,98,116,80,111,105,110,
+116,50,80,111,105,110,116,67,111,110,115,116,114,97,105,110,116,68,111,117,
+98,108,101,68,97,116,97,0,98,116,72,105,110,103,101,67,111,110,115,116,
+114,97,105,110,116,68,111,117,98,108,101,68,97,116,97,0,98,116,72,105,
+110,103,101,67,111,110,115,116,114,97,105,110,116,70,108,111,97,116,68,97,
+116,97,0,98,116,67,111,110,101,84,119,105,115,116,67,111,110,115,116,114,
+97,105,110,116,68,97,116,97,0,98,116,71,101,110,101,114,105,99,54,68,
+111,102,67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,98,116,71,
+101,110,101,114,105,99,54,68,111,102,83,112,114,105,110,103,67,111,110,115,
+116,114,97,105,110,116,68,97,116,97,0,98,116,83,108,105,100,101,114,67,
+111,110,115,116,114,97,105,110,116,68,97,116,97,0,83,111,102,116,66,111,
+100,121,77,97,116,101,114,105,97,108,68,97,116,97,0,83,111,102,116,66,
+111,100,121,78,111,100,101,68,97,116,97,0,83,111,102,116,66,111,100,121,
+76,105,110,107,68,97,116,97,0,83,111,102,116,66,111,100,121,70,97,99,
+101,68,97,116,97,0,83,111,102,116,66,111,100,121,84,101,116,114,97,68,
+97,116,97,0,83,111,102,116,82,105,103,105,100,65,110,99,104,111,114,68,
+97,116,97,0,83,111,102,116,66,111,100,121,67,111,110,102,105,103,68,97,
+116,97,0,83,111,102,116,66,111,100,121,80,111,115,101,68,97,116,97,0,
+83,111,102,116,66,111,100,121,67,108,117,115,116,101,114,68,97,116,97,0,
+98,116,83,111,102,116,66,111,100,121,74,111,105,110,116,68,97,116,97,0,
+98,116,83,111,102,116,66,111,100,121,70,108,111,97,116,68,97,116,97,0,
+84,76,69,78,1,0,1,0,2,0,2,0,4,0,4,0,4,0,4,0,
+8,0,0,0,12,0,36,0,8,0,16,0,32,0,48,0,96,0,64,0,
+-128,0,20,0,48,0,80,0,16,0,84,0,-124,0,12,0,52,0,52,0,
+20,0,64,0,4,0,4,0,8,0,4,0,32,0,28,0,60,0,56,0,
+76,0,76,0,24,0,60,0,60,0,16,0,64,0,68,0,-56,1,-8,0,
+-32,1,-104,3,8,0,52,0,0,0,84,0,116,0,92,1,-36,0,-44,0,
+-4,0,92,1,-52,0,16,0,100,0,20,0,36,0,100,0,92,0,104,0,
+-64,0,92,1,104,0,-92,1,83,84,82,67,61,0,0,0,10,0,3,0,
+4,0,0,0,4,0,1,0,9,0,2,0,11,0,3,0,10,0,3,0,
+10,0,4,0,10,0,5,0,12,0,2,0,9,0,6,0,9,0,7,0,
+13,0,1,0,7,0,8,0,14,0,1,0,8,0,8,0,15,0,1,0,
+13,0,9,0,16,0,1,0,14,0,9,0,17,0,2,0,15,0,10,0,
+13,0,11,0,18,0,2,0,16,0,10,0,14,0,11,0,19,0,4,0,
+4,0,12,0,4,0,13,0,2,0,14,0,2,0,15,0,20,0,6,0,
+13,0,16,0,13,0,17,0,4,0,18,0,4,0,19,0,4,0,20,0,
+0,0,21,0,21,0,6,0,14,0,16,0,14,0,17,0,4,0,18,0,
+4,0,19,0,4,0,20,0,0,0,21,0,22,0,3,0,2,0,14,0,
+2,0,15,0,4,0,22,0,23,0,12,0,13,0,23,0,13,0,24,0,
+13,0,25,0,4,0,26,0,4,0,27,0,4,0,28,0,4,0,29,0,
+20,0,30,0,22,0,31,0,19,0,32,0,4,0,33,0,4,0,34,0,
+24,0,12,0,14,0,23,0,14,0,24,0,14,0,25,0,4,0,26,0,
+4,0,27,0,4,0,28,0,4,0,29,0,21,0,30,0,22,0,31,0,
+4,0,33,0,4,0,34,0,19,0,32,0,25,0,3,0,0,0,35,0,
+4,0,36,0,0,0,37,0,26,0,5,0,25,0,38,0,13,0,39,0,
+13,0,40,0,7,0,41,0,0,0,21,0,27,0,5,0,25,0,38,0,
+13,0,39,0,13,0,42,0,7,0,43,0,4,0,44,0,28,0,2,0,
+13,0,45,0,7,0,46,0,29,0,4,0,27,0,47,0,28,0,48,0,
+4,0,49,0,0,0,37,0,30,0,1,0,4,0,50,0,31,0,2,0,
+2,0,50,0,0,0,51,0,32,0,2,0,2,0,52,0,0,0,51,0,
+33,0,2,0,0,0,52,0,0,0,53,0,34,0,8,0,13,0,54,0,
+14,0,55,0,30,0,56,0,32,0,57,0,33,0,58,0,31,0,59,0,
+4,0,60,0,4,0,61,0,35,0,4,0,34,0,62,0,13,0,63,0,
+4,0,64,0,0,0,37,0,36,0,7,0,25,0,38,0,35,0,65,0,
+23,0,66,0,24,0,67,0,37,0,68,0,7,0,43,0,0,0,69,0,
+38,0,2,0,36,0,70,0,13,0,39,0,39,0,4,0,17,0,71,0,
+25,0,72,0,4,0,73,0,7,0,74,0,40,0,4,0,25,0,38,0,
+39,0,75,0,4,0,76,0,7,0,43,0,41,0,3,0,27,0,47,0,
+4,0,77,0,0,0,37,0,42,0,3,0,27,0,47,0,4,0,77,0,
+0,0,37,0,43,0,4,0,4,0,78,0,7,0,79,0,7,0,80,0,
+7,0,81,0,37,0,14,0,4,0,82,0,4,0,83,0,43,0,84,0,
+4,0,85,0,7,0,86,0,7,0,87,0,7,0,88,0,7,0,89,0,
+7,0,90,0,4,0,91,0,4,0,92,0,4,0,93,0,4,0,94,0,
+0,0,37,0,44,0,5,0,25,0,38,0,35,0,65,0,13,0,39,0,
+7,0,43,0,4,0,95,0,45,0,5,0,27,0,47,0,13,0,96,0,
+14,0,97,0,4,0,98,0,0,0,99,0,46,0,24,0,9,0,100,0,
+9,0,101,0,25,0,102,0,0,0,35,0,18,0,103,0,18,0,104,0,
+14,0,105,0,14,0,106,0,14,0,107,0,8,0,108,0,8,0,109,0,
+8,0,110,0,8,0,111,0,8,0,112,0,8,0,113,0,8,0,114,0,
+4,0,115,0,4,0,116,0,4,0,117,0,4,0,118,0,4,0,119,0,
+4,0,120,0,4,0,121,0,0,0,37,0,47,0,23,0,9,0,100,0,
+9,0,101,0,25,0,102,0,0,0,35,0,17,0,103,0,17,0,104,0,
+13,0,105,0,13,0,106,0,13,0,107,0,7,0,108,0,7,0,109,0,
+7,0,110,0,7,0,111,0,7,0,112,0,7,0,113,0,7,0,114,0,
+4,0,115,0,4,0,116,0,4,0,117,0,4,0,118,0,4,0,119,0,
+4,0,120,0,4,0,121,0,48,0,21,0,47,0,122,0,15,0,123,0,
+13,0,124,0,13,0,125,0,13,0,126,0,13,0,127,0,13,0,-128,0,
+13,0,-127,0,13,0,-126,0,13,0,-125,0,13,0,-124,0,7,0,-123,0,
+7,0,-122,0,7,0,-121,0,7,0,-120,0,7,0,-119,0,7,0,-118,0,
+7,0,-117,0,7,0,-116,0,7,0,-115,0,4,0,-114,0,49,0,22,0,
+46,0,122,0,16,0,123,0,14,0,124,0,14,0,125,0,14,0,126,0,
+14,0,127,0,14,0,-128,0,14,0,-127,0,14,0,-126,0,14,0,-125,0,
+14,0,-124,0,8,0,-123,0,8,0,-122,0,8,0,-121,0,8,0,-120,0,
+8,0,-119,0,8,0,-118,0,8,0,-117,0,8,0,-116,0,8,0,-115,0,
+4,0,-114,0,0,0,37,0,50,0,2,0,4,0,-113,0,4,0,-112,0,
+51,0,13,0,52,0,-111,0,52,0,-110,0,0,0,35,0,4,0,-109,0,
+4,0,-108,0,4,0,-107,0,4,0,-106,0,7,0,-105,0,7,0,-104,0,
+4,0,-103,0,4,0,-102,0,7,0,-101,0,4,0,-100,0,53,0,3,0,
+51,0,-99,0,13,0,-98,0,13,0,-97,0,54,0,3,0,51,0,-99,0,
+14,0,-98,0,14,0,-97,0,55,0,13,0,51,0,-99,0,18,0,-96,0,
+18,0,-95,0,4,0,-94,0,4,0,-93,0,4,0,-92,0,7,0,-91,0,
+7,0,-90,0,7,0,-89,0,7,0,-88,0,7,0,-87,0,7,0,-86,0,
+7,0,-85,0,56,0,13,0,51,0,-99,0,17,0,-96,0,17,0,-95,0,
+4,0,-94,0,4,0,-93,0,4,0,-92,0,7,0,-91,0,7,0,-90,0,
+7,0,-89,0,7,0,-88,0,7,0,-87,0,7,0,-86,0,7,0,-85,0,
+57,0,11,0,51,0,-99,0,17,0,-96,0,17,0,-95,0,7,0,-84,0,
+7,0,-83,0,7,0,-82,0,7,0,-87,0,7,0,-86,0,7,0,-85,0,
+7,0,-81,0,0,0,21,0,58,0,9,0,51,0,-99,0,17,0,-96,0,
+17,0,-95,0,13,0,-80,0,13,0,-79,0,13,0,-78,0,13,0,-77,0,
+4,0,-76,0,4,0,-75,0,59,0,5,0,58,0,-74,0,4,0,-73,0,
+7,0,-72,0,7,0,-71,0,7,0,-70,0,60,0,9,0,51,0,-99,0,
+17,0,-96,0,17,0,-95,0,7,0,-80,0,7,0,-79,0,7,0,-78,0,
+7,0,-77,0,4,0,-76,0,4,0,-75,0,61,0,4,0,7,0,-69,0,
+7,0,-68,0,7,0,-67,0,4,0,78,0,62,0,10,0,61,0,-66,0,
+13,0,-65,0,13,0,-64,0,13,0,-63,0,13,0,-62,0,13,0,-61,0,
+7,0,-123,0,7,0,-60,0,4,0,-59,0,4,0,53,0,63,0,4,0,
+61,0,-66,0,4,0,-58,0,7,0,-57,0,4,0,-56,0,64,0,4,0,
+13,0,-61,0,61,0,-66,0,4,0,-55,0,7,0,-54,0,65,0,7,0,
+13,0,-53,0,61,0,-66,0,4,0,-52,0,7,0,-51,0,7,0,-50,0,
+7,0,-49,0,4,0,53,0,66,0,6,0,15,0,-48,0,13,0,-50,0,
+13,0,-47,0,52,0,-46,0,4,0,-45,0,7,0,-49,0,67,0,26,0,
+4,0,-44,0,7,0,-43,0,7,0,-81,0,7,0,-42,0,7,0,-41,0,
+7,0,-40,0,7,0,-39,0,7,0,-38,0,7,0,-37,0,7,0,-36,0,
+7,0,-35,0,7,0,-34,0,7,0,-33,0,7,0,-32,0,7,0,-31,0,
+7,0,-30,0,7,0,-29,0,7,0,-28,0,7,0,-27,0,7,0,-26,0,
+7,0,-25,0,4,0,-24,0,4,0,-23,0,4,0,-22,0,4,0,-21,0,
+4,0,116,0,68,0,12,0,15,0,-20,0,15,0,-19,0,15,0,-18,0,
+13,0,-17,0,13,0,-16,0,7,0,-15,0,4,0,-14,0,4,0,-13,0,
+4,0,-12,0,4,0,-11,0,7,0,-51,0,4,0,53,0,69,0,27,0,
+17,0,-10,0,15,0,-9,0,15,0,-8,0,13,0,-17,0,13,0,-7,0,
+13,0,-6,0,13,0,-5,0,13,0,-4,0,13,0,-3,0,4,0,-2,0,
+7,0,-1,0,4,0,0,1,4,0,1,1,4,0,2,1,7,0,3,1,
+7,0,4,1,4,0,5,1,4,0,6,1,7,0,7,1,7,0,8,1,
+7,0,9,1,7,0,10,1,7,0,11,1,7,0,12,1,4,0,13,1,
+4,0,14,1,4,0,15,1,70,0,12,0,9,0,16,1,9,0,17,1,
+13,0,18,1,7,0,19,1,7,0,20,1,7,0,21,1,4,0,22,1,
+13,0,23,1,4,0,24,1,4,0,25,1,4,0,26,1,4,0,53,0,
+71,0,19,0,47,0,122,0,68,0,27,1,61,0,28,1,62,0,29,1,
+63,0,30,1,64,0,31,1,65,0,32,1,66,0,33,1,69,0,34,1,
+70,0,35,1,4,0,36,1,4,0,1,1,4,0,37,1,4,0,38,1,
+4,0,39,1,4,0,40,1,4,0,41,1,4,0,42,1,67,0,43,1,
+};
int sBulletDNAlen= sizeof(sBulletDNAstr);
-unsigned char sBulletDNAstr64[]= {
-83,68,78,65,78,65,77,69,42,1,0,0,109,95,115,105,122,101,0,109,
+
+ char sBulletDNAstr64[]= {
+83,68,78,65,78,65,77,69,44,1,0,0,109,95,115,105,122,101,0,109,
95,99,97,112,97,99,105,116,121,0,42,109,95,100,97,116,97,0,109,95,
99,111,108,108,105,115,105,111,110,83,104,97,112,101,115,0,109,95,99,111,
108,108,105,115,105,111,110,79,98,106,101,99,116,115,0,109,95,99,111,110,
@@ -546,287 +551,291 @@ unsigned char sBulletDNAstr64[]= {
112,108,105,101,100,73,109,112,117,108,115,101,0,109,95,100,98,103,68,114,
97,119,83,105,122,101,0,109,95,100,105,115,97,98,108,101,67,111,108,108,
105,115,105,111,110,115,66,101,116,119,101,101,110,76,105,110,107,101,100,66,
-111,100,105,101,115,0,109,95,112,97,100,52,91,52,93,0,109,95,116,121,
-112,101,67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,109,95,112,
-105,118,111,116,73,110,65,0,109,95,112,105,118,111,116,73,110,66,0,109,
-95,114,98,65,70,114,97,109,101,0,109,95,114,98,66,70,114,97,109,101,
-0,109,95,117,115,101,82,101,102,101,114,101,110,99,101,70,114,97,109,101,
-65,0,109,95,97,110,103,117,108,97,114,79,110,108,121,0,109,95,101,110,
-97,98,108,101,65,110,103,117,108,97,114,77,111,116,111,114,0,109,95,109,
-111,116,111,114,84,97,114,103,101,116,86,101,108,111,99,105,116,121,0,109,
-95,109,97,120,77,111,116,111,114,73,109,112,117,108,115,101,0,109,95,108,
-111,119,101,114,76,105,109,105,116,0,109,95,117,112,112,101,114,76,105,109,
-105,116,0,109,95,108,105,109,105,116,83,111,102,116,110,101,115,115,0,109,
-95,98,105,97,115,70,97,99,116,111,114,0,109,95,114,101,108,97,120,97,
-116,105,111,110,70,97,99,116,111,114,0,109,95,115,119,105,110,103,83,112,
-97,110,49,0,109,95,115,119,105,110,103,83,112,97,110,50,0,109,95,116,
-119,105,115,116,83,112,97,110,0,109,95,100,97,109,112,105,110,103,0,109,
-95,108,105,110,101,97,114,85,112,112,101,114,76,105,109,105,116,0,109,95,
-108,105,110,101,97,114,76,111,119,101,114,76,105,109,105,116,0,109,95,97,
-110,103,117,108,97,114,85,112,112,101,114,76,105,109,105,116,0,109,95,97,
-110,103,117,108,97,114,76,111,119,101,114,76,105,109,105,116,0,109,95,117,
-115,101,76,105,110,101,97,114,82,101,102,101,114,101,110,99,101,70,114,97,
-109,101,65,0,109,95,117,115,101,79,102,102,115,101,116,70,111,114,67,111,
-110,115,116,114,97,105,110,116,70,114,97,109,101,0,109,95,54,100,111,102,
-68,97,116,97,0,109,95,115,112,114,105,110,103,69,110,97,98,108,101,100,
-91,54,93,0,109,95,101,113,117,105,108,105,98,114,105,117,109,80,111,105,
-110,116,91,54,93,0,109,95,115,112,114,105,110,103,83,116,105,102,102,110,
-101,115,115,91,54,93,0,109,95,115,112,114,105,110,103,68,97,109,112,105,
-110,103,91,54,93,0,109,95,108,105,110,101,97,114,83,116,105,102,102,110,
-101,115,115,0,109,95,97,110,103,117,108,97,114,83,116,105,102,102,110,101,
-115,115,0,109,95,118,111,108,117,109,101,83,116,105,102,102,110,101,115,115,
-0,42,109,95,109,97,116,101,114,105,97,108,0,109,95,112,111,115,105,116,
-105,111,110,0,109,95,112,114,101,118,105,111,117,115,80,111,115,105,116,105,
-111,110,0,109,95,118,101,108,111,99,105,116,121,0,109,95,97,99,99,117,
-109,117,108,97,116,101,100,70,111,114,99,101,0,109,95,110,111,114,109,97,
-108,0,109,95,97,114,101,97,0,109,95,97,116,116,97,99,104,0,109,95,
-110,111,100,101,73,110,100,105,99,101,115,91,50,93,0,109,95,114,101,115,
-116,76,101,110,103,116,104,0,109,95,98,98,101,110,100,105,110,103,0,109,
-95,110,111,100,101,73,110,100,105,99,101,115,91,51,93,0,109,95,114,101,
-115,116,65,114,101,97,0,109,95,99,48,91,52,93,0,109,95,110,111,100,
-101,73,110,100,105,99,101,115,91,52,93,0,109,95,114,101,115,116,86,111,
-108,117,109,101,0,109,95,99,49,0,109,95,99,50,0,109,95,99,48,0,
-109,95,108,111,99,97,108,70,114,97,109,101,0,42,109,95,114,105,103,105,
-100,66,111,100,121,0,109,95,110,111,100,101,73,110,100,101,120,0,109,95,
-97,101,114,111,77,111,100,101,108,0,109,95,98,97,117,109,103,97,114,116,
-101,0,109,95,100,114,97,103,0,109,95,108,105,102,116,0,109,95,112,114,
-101,115,115,117,114,101,0,109,95,118,111,108,117,109,101,0,109,95,100,121,
-110,97,109,105,99,70,114,105,99,116,105,111,110,0,109,95,112,111,115,101,
-77,97,116,99,104,0,109,95,114,105,103,105,100,67,111,110,116,97,99,116,
-72,97,114,100,110,101,115,115,0,109,95,107,105,110,101,116,105,99,67,111,
-110,116,97,99,116,72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,
-67,111,110,116,97,99,116,72,97,114,100,110,101,115,115,0,109,95,97,110,
-99,104,111,114,72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,82,
-105,103,105,100,67,108,117,115,116,101,114,72,97,114,100,110,101,115,115,0,
-109,95,115,111,102,116,75,105,110,101,116,105,99,67,108,117,115,116,101,114,
-72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,83,111,102,116,67,
-108,117,115,116,101,114,72,97,114,100,110,101,115,115,0,109,95,115,111,102,
-116,82,105,103,105,100,67,108,117,115,116,101,114,73,109,112,117,108,115,101,
-83,112,108,105,116,0,109,95,115,111,102,116,75,105,110,101,116,105,99,67,
-108,117,115,116,101,114,73,109,112,117,108,115,101,83,112,108,105,116,0,109,
-95,115,111,102,116,83,111,102,116,67,108,117,115,116,101,114,73,109,112,117,
-108,115,101,83,112,108,105,116,0,109,95,109,97,120,86,111,108,117,109,101,
-0,109,95,116,105,109,101,83,99,97,108,101,0,109,95,118,101,108,111,99,
-105,116,121,73,116,101,114,97,116,105,111,110,115,0,109,95,112,111,115,105,
-116,105,111,110,73,116,101,114,97,116,105,111,110,115,0,109,95,100,114,105,
-102,116,73,116,101,114,97,116,105,111,110,115,0,109,95,99,108,117,115,116,
-101,114,73,116,101,114,97,116,105,111,110,115,0,109,95,114,111,116,0,109,
-95,115,99,97,108,101,0,109,95,97,113,113,0,109,95,99,111,109,0,42,
-109,95,112,111,115,105,116,105,111,110,115,0,42,109,95,119,101,105,103,104,
-116,115,0,109,95,110,117,109,80,111,115,105,116,105,111,110,115,0,109,95,
-110,117,109,87,101,105,103,116,115,0,109,95,98,118,111,108,117,109,101,0,
-109,95,98,102,114,97,109,101,0,109,95,102,114,97,109,101,120,102,111,114,
-109,0,109,95,108,111,99,105,105,0,109,95,105,110,118,119,105,0,109,95,
-118,105,109,112,117,108,115,101,115,91,50,93,0,109,95,100,105,109,112,117,
-108,115,101,115,91,50,93,0,109,95,108,118,0,109,95,97,118,0,42,109,
-95,102,114,97,109,101,114,101,102,115,0,42,109,95,110,111,100,101,73,110,
-100,105,99,101,115,0,42,109,95,109,97,115,115,101,115,0,109,95,110,117,
-109,70,114,97,109,101,82,101,102,115,0,109,95,110,117,109,78,111,100,101,
-115,0,109,95,110,117,109,77,97,115,115,101,115,0,109,95,105,100,109,97,
-115,115,0,109,95,105,109,97,115,115,0,109,95,110,118,105,109,112,117,108,
-115,101,115,0,109,95,110,100,105,109,112,117,108,115,101,115,0,109,95,110,
-100,97,109,112,105,110,103,0,109,95,108,100,97,109,112,105,110,103,0,109,
-95,97,100,97,109,112,105,110,103,0,109,95,109,97,116,99,104,105,110,103,
-0,109,95,109,97,120,83,101,108,102,67,111,108,108,105,115,105,111,110,73,
-109,112,117,108,115,101,0,109,95,115,101,108,102,67,111,108,108,105,115,105,
-111,110,73,109,112,117,108,115,101,70,97,99,116,111,114,0,109,95,99,111,
-110,116,97,105,110,115,65,110,99,104,111,114,0,109,95,99,111,108,108,105,
-100,101,0,109,95,99,108,117,115,116,101,114,73,110,100,101,120,0,42,109,
-95,98,111,100,121,65,0,42,109,95,98,111,100,121,66,0,109,95,114,101,
-102,115,91,50,93,0,109,95,99,102,109,0,109,95,101,114,112,0,109,95,
-115,112,108,105,116,0,109,95,100,101,108,101,116,101,0,109,95,114,101,108,
-80,111,115,105,116,105,111,110,91,50,93,0,109,95,98,111,100,121,65,116,
-121,112,101,0,109,95,98,111,100,121,66,116,121,112,101,0,109,95,106,111,
-105,110,116,84,121,112,101,0,42,109,95,112,111,115,101,0,42,42,109,95,
-109,97,116,101,114,105,97,108,115,0,42,109,95,110,111,100,101,115,0,42,
-109,95,108,105,110,107,115,0,42,109,95,102,97,99,101,115,0,42,109,95,
-116,101,116,114,97,104,101,100,114,97,0,42,109,95,97,110,99,104,111,114,
-115,0,42,109,95,99,108,117,115,116,101,114,115,0,42,109,95,106,111,105,
-110,116,115,0,109,95,110,117,109,77,97,116,101,114,105,97,108,115,0,109,
-95,110,117,109,76,105,110,107,115,0,109,95,110,117,109,70,97,99,101,115,
-0,109,95,110,117,109,84,101,116,114,97,104,101,100,114,97,0,109,95,110,
-117,109,65,110,99,104,111,114,115,0,109,95,110,117,109,67,108,117,115,116,
-101,114,115,0,109,95,110,117,109,74,111,105,110,116,115,0,109,95,99,111,
-110,102,105,103,0,0,0,0,84,89,80,69,72,0,0,0,99,104,97,114,
-0,117,99,104,97,114,0,115,104,111,114,116,0,117,115,104,111,114,116,0,
-105,110,116,0,108,111,110,103,0,117,108,111,110,103,0,102,108,111,97,116,
-0,100,111,117,98,108,101,0,118,111,105,100,0,80,111,105,110,116,101,114,
-65,114,114,97,121,0,98,116,80,104,121,115,105,99,115,83,121,115,116,101,
-109,0,76,105,115,116,66,97,115,101,0,98,116,86,101,99,116,111,114,51,
-70,108,111,97,116,68,97,116,97,0,98,116,86,101,99,116,111,114,51,68,
-111,117,98,108,101,68,97,116,97,0,98,116,77,97,116,114,105,120,51,120,
-51,70,108,111,97,116,68,97,116,97,0,98,116,77,97,116,114,105,120,51,
-120,51,68,111,117,98,108,101,68,97,116,97,0,98,116,84,114,97,110,115,
-102,111,114,109,70,108,111,97,116,68,97,116,97,0,98,116,84,114,97,110,
-115,102,111,114,109,68,111,117,98,108,101,68,97,116,97,0,98,116,66,118,
-104,83,117,98,116,114,101,101,73,110,102,111,68,97,116,97,0,98,116,79,
-112,116,105,109,105,122,101,100,66,118,104,78,111,100,101,70,108,111,97,116,
-68,97,116,97,0,98,116,79,112,116,105,109,105,122,101,100,66,118,104,78,
-111,100,101,68,111,117,98,108,101,68,97,116,97,0,98,116,81,117,97,110,
-116,105,122,101,100,66,118,104,78,111,100,101,68,97,116,97,0,98,116,81,
-117,97,110,116,105,122,101,100,66,118,104,70,108,111,97,116,68,97,116,97,
-0,98,116,81,117,97,110,116,105,122,101,100,66,118,104,68,111,117,98,108,
-101,68,97,116,97,0,98,116,67,111,108,108,105,115,105,111,110,83,104,97,
-112,101,68,97,116,97,0,98,116,83,116,97,116,105,99,80,108,97,110,101,
-83,104,97,112,101,68,97,116,97,0,98,116,67,111,110,118,101,120,73,110,
-116,101,114,110,97,108,83,104,97,112,101,68,97,116,97,0,98,116,80,111,
-115,105,116,105,111,110,65,110,100,82,97,100,105,117,115,0,98,116,77,117,
-108,116,105,83,112,104,101,114,101,83,104,97,112,101,68,97,116,97,0,98,
-116,73,110,116,73,110,100,101,120,68,97,116,97,0,98,116,83,104,111,114,
-116,73,110,116,73,110,100,101,120,68,97,116,97,0,98,116,83,104,111,114,
-116,73,110,116,73,110,100,101,120,84,114,105,112,108,101,116,68,97,116,97,
-0,98,116,67,104,97,114,73,110,100,101,120,84,114,105,112,108,101,116,68,
-97,116,97,0,98,116,77,101,115,104,80,97,114,116,68,97,116,97,0,98,
-116,83,116,114,105,100,105,110,103,77,101,115,104,73,110,116,101,114,102,97,
-99,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,101,77,101,115,
-104,83,104,97,112,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,
-101,73,110,102,111,77,97,112,68,97,116,97,0,98,116,83,99,97,108,101,
-100,84,114,105,97,110,103,108,101,77,101,115,104,83,104,97,112,101,68,97,
-116,97,0,98,116,67,111,109,112,111,117,110,100,83,104,97,112,101,67,104,
-105,108,100,68,97,116,97,0,98,116,67,111,109,112,111,117,110,100,83,104,
-97,112,101,68,97,116,97,0,98,116,67,121,108,105,110,100,101,114,83,104,
-97,112,101,68,97,116,97,0,98,116,67,97,112,115,117,108,101,83,104,97,
+111,100,105,101,115,0,109,95,111,118,101,114,114,105,100,101,78,117,109,83,
+111,108,118,101,114,73,116,101,114,97,116,105,111,110,115,0,109,95,98,114,
+101,97,107,105,110,103,73,109,112,117,108,115,101,84,104,114,101,115,104,111,
+108,100,0,109,95,105,115,69,110,97,98,108,101,100,0,109,95,116,121,112,
+101,67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,109,95,112,105,
+118,111,116,73,110,65,0,109,95,112,105,118,111,116,73,110,66,0,109,95,
+114,98,65,70,114,97,109,101,0,109,95,114,98,66,70,114,97,109,101,0,
+109,95,117,115,101,82,101,102,101,114,101,110,99,101,70,114,97,109,101,65,
+0,109,95,97,110,103,117,108,97,114,79,110,108,121,0,109,95,101,110,97,
+98,108,101,65,110,103,117,108,97,114,77,111,116,111,114,0,109,95,109,111,
+116,111,114,84,97,114,103,101,116,86,101,108,111,99,105,116,121,0,109,95,
+109,97,120,77,111,116,111,114,73,109,112,117,108,115,101,0,109,95,108,111,
+119,101,114,76,105,109,105,116,0,109,95,117,112,112,101,114,76,105,109,105,
+116,0,109,95,108,105,109,105,116,83,111,102,116,110,101,115,115,0,109,95,
+98,105,97,115,70,97,99,116,111,114,0,109,95,114,101,108,97,120,97,116,
+105,111,110,70,97,99,116,111,114,0,109,95,115,119,105,110,103,83,112,97,
+110,49,0,109,95,115,119,105,110,103,83,112,97,110,50,0,109,95,116,119,
+105,115,116,83,112,97,110,0,109,95,100,97,109,112,105,110,103,0,109,95,
+108,105,110,101,97,114,85,112,112,101,114,76,105,109,105,116,0,109,95,108,
+105,110,101,97,114,76,111,119,101,114,76,105,109,105,116,0,109,95,97,110,
+103,117,108,97,114,85,112,112,101,114,76,105,109,105,116,0,109,95,97,110,
+103,117,108,97,114,76,111,119,101,114,76,105,109,105,116,0,109,95,117,115,
+101,76,105,110,101,97,114,82,101,102,101,114,101,110,99,101,70,114,97,109,
+101,65,0,109,95,117,115,101,79,102,102,115,101,116,70,111,114,67,111,110,
+115,116,114,97,105,110,116,70,114,97,109,101,0,109,95,54,100,111,102,68,
+97,116,97,0,109,95,115,112,114,105,110,103,69,110,97,98,108,101,100,91,
+54,93,0,109,95,101,113,117,105,108,105,98,114,105,117,109,80,111,105,110,
+116,91,54,93,0,109,95,115,112,114,105,110,103,83,116,105,102,102,110,101,
+115,115,91,54,93,0,109,95,115,112,114,105,110,103,68,97,109,112,105,110,
+103,91,54,93,0,109,95,108,105,110,101,97,114,83,116,105,102,102,110,101,
+115,115,0,109,95,97,110,103,117,108,97,114,83,116,105,102,102,110,101,115,
+115,0,109,95,118,111,108,117,109,101,83,116,105,102,102,110,101,115,115,0,
+42,109,95,109,97,116,101,114,105,97,108,0,109,95,112,111,115,105,116,105,
+111,110,0,109,95,112,114,101,118,105,111,117,115,80,111,115,105,116,105,111,
+110,0,109,95,118,101,108,111,99,105,116,121,0,109,95,97,99,99,117,109,
+117,108,97,116,101,100,70,111,114,99,101,0,109,95,110,111,114,109,97,108,
+0,109,95,97,114,101,97,0,109,95,97,116,116,97,99,104,0,109,95,110,
+111,100,101,73,110,100,105,99,101,115,91,50,93,0,109,95,114,101,115,116,
+76,101,110,103,116,104,0,109,95,98,98,101,110,100,105,110,103,0,109,95,
+110,111,100,101,73,110,100,105,99,101,115,91,51,93,0,109,95,114,101,115,
+116,65,114,101,97,0,109,95,99,48,91,52,93,0,109,95,110,111,100,101,
+73,110,100,105,99,101,115,91,52,93,0,109,95,114,101,115,116,86,111,108,
+117,109,101,0,109,95,99,49,0,109,95,99,50,0,109,95,99,48,0,109,
+95,108,111,99,97,108,70,114,97,109,101,0,42,109,95,114,105,103,105,100,
+66,111,100,121,0,109,95,110,111,100,101,73,110,100,101,120,0,109,95,97,
+101,114,111,77,111,100,101,108,0,109,95,98,97,117,109,103,97,114,116,101,
+0,109,95,100,114,97,103,0,109,95,108,105,102,116,0,109,95,112,114,101,
+115,115,117,114,101,0,109,95,118,111,108,117,109,101,0,109,95,100,121,110,
+97,109,105,99,70,114,105,99,116,105,111,110,0,109,95,112,111,115,101,77,
+97,116,99,104,0,109,95,114,105,103,105,100,67,111,110,116,97,99,116,72,
+97,114,100,110,101,115,115,0,109,95,107,105,110,101,116,105,99,67,111,110,
+116,97,99,116,72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,67,
+111,110,116,97,99,116,72,97,114,100,110,101,115,115,0,109,95,97,110,99,
+104,111,114,72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,82,105,
+103,105,100,67,108,117,115,116,101,114,72,97,114,100,110,101,115,115,0,109,
+95,115,111,102,116,75,105,110,101,116,105,99,67,108,117,115,116,101,114,72,
+97,114,100,110,101,115,115,0,109,95,115,111,102,116,83,111,102,116,67,108,
+117,115,116,101,114,72,97,114,100,110,101,115,115,0,109,95,115,111,102,116,
+82,105,103,105,100,67,108,117,115,116,101,114,73,109,112,117,108,115,101,83,
+112,108,105,116,0,109,95,115,111,102,116,75,105,110,101,116,105,99,67,108,
+117,115,116,101,114,73,109,112,117,108,115,101,83,112,108,105,116,0,109,95,
+115,111,102,116,83,111,102,116,67,108,117,115,116,101,114,73,109,112,117,108,
+115,101,83,112,108,105,116,0,109,95,109,97,120,86,111,108,117,109,101,0,
+109,95,116,105,109,101,83,99,97,108,101,0,109,95,118,101,108,111,99,105,
+116,121,73,116,101,114,97,116,105,111,110,115,0,109,95,112,111,115,105,116,
+105,111,110,73,116,101,114,97,116,105,111,110,115,0,109,95,100,114,105,102,
+116,73,116,101,114,97,116,105,111,110,115,0,109,95,99,108,117,115,116,101,
+114,73,116,101,114,97,116,105,111,110,115,0,109,95,114,111,116,0,109,95,
+115,99,97,108,101,0,109,95,97,113,113,0,109,95,99,111,109,0,42,109,
+95,112,111,115,105,116,105,111,110,115,0,42,109,95,119,101,105,103,104,116,
+115,0,109,95,110,117,109,80,111,115,105,116,105,111,110,115,0,109,95,110,
+117,109,87,101,105,103,116,115,0,109,95,98,118,111,108,117,109,101,0,109,
+95,98,102,114,97,109,101,0,109,95,102,114,97,109,101,120,102,111,114,109,
+0,109,95,108,111,99,105,105,0,109,95,105,110,118,119,105,0,109,95,118,
+105,109,112,117,108,115,101,115,91,50,93,0,109,95,100,105,109,112,117,108,
+115,101,115,91,50,93,0,109,95,108,118,0,109,95,97,118,0,42,109,95,
+102,114,97,109,101,114,101,102,115,0,42,109,95,110,111,100,101,73,110,100,
+105,99,101,115,0,42,109,95,109,97,115,115,101,115,0,109,95,110,117,109,
+70,114,97,109,101,82,101,102,115,0,109,95,110,117,109,78,111,100,101,115,
+0,109,95,110,117,109,77,97,115,115,101,115,0,109,95,105,100,109,97,115,
+115,0,109,95,105,109,97,115,115,0,109,95,110,118,105,109,112,117,108,115,
+101,115,0,109,95,110,100,105,109,112,117,108,115,101,115,0,109,95,110,100,
+97,109,112,105,110,103,0,109,95,108,100,97,109,112,105,110,103,0,109,95,
+97,100,97,109,112,105,110,103,0,109,95,109,97,116,99,104,105,110,103,0,
+109,95,109,97,120,83,101,108,102,67,111,108,108,105,115,105,111,110,73,109,
+112,117,108,115,101,0,109,95,115,101,108,102,67,111,108,108,105,115,105,111,
+110,73,109,112,117,108,115,101,70,97,99,116,111,114,0,109,95,99,111,110,
+116,97,105,110,115,65,110,99,104,111,114,0,109,95,99,111,108,108,105,100,
+101,0,109,95,99,108,117,115,116,101,114,73,110,100,101,120,0,42,109,95,
+98,111,100,121,65,0,42,109,95,98,111,100,121,66,0,109,95,114,101,102,
+115,91,50,93,0,109,95,99,102,109,0,109,95,101,114,112,0,109,95,115,
+112,108,105,116,0,109,95,100,101,108,101,116,101,0,109,95,114,101,108,80,
+111,115,105,116,105,111,110,91,50,93,0,109,95,98,111,100,121,65,116,121,
+112,101,0,109,95,98,111,100,121,66,116,121,112,101,0,109,95,106,111,105,
+110,116,84,121,112,101,0,42,109,95,112,111,115,101,0,42,42,109,95,109,
+97,116,101,114,105,97,108,115,0,42,109,95,110,111,100,101,115,0,42,109,
+95,108,105,110,107,115,0,42,109,95,102,97,99,101,115,0,42,109,95,116,
+101,116,114,97,104,101,100,114,97,0,42,109,95,97,110,99,104,111,114,115,
+0,42,109,95,99,108,117,115,116,101,114,115,0,42,109,95,106,111,105,110,
+116,115,0,109,95,110,117,109,77,97,116,101,114,105,97,108,115,0,109,95,
+110,117,109,76,105,110,107,115,0,109,95,110,117,109,70,97,99,101,115,0,
+109,95,110,117,109,84,101,116,114,97,104,101,100,114,97,0,109,95,110,117,
+109,65,110,99,104,111,114,115,0,109,95,110,117,109,67,108,117,115,116,101,
+114,115,0,109,95,110,117,109,74,111,105,110,116,115,0,109,95,99,111,110,
+102,105,103,0,84,89,80,69,72,0,0,0,99,104,97,114,0,117,99,104,
+97,114,0,115,104,111,114,116,0,117,115,104,111,114,116,0,105,110,116,0,
+108,111,110,103,0,117,108,111,110,103,0,102,108,111,97,116,0,100,111,117,
+98,108,101,0,118,111,105,100,0,80,111,105,110,116,101,114,65,114,114,97,
+121,0,98,116,80,104,121,115,105,99,115,83,121,115,116,101,109,0,76,105,
+115,116,66,97,115,101,0,98,116,86,101,99,116,111,114,51,70,108,111,97,
+116,68,97,116,97,0,98,116,86,101,99,116,111,114,51,68,111,117,98,108,
+101,68,97,116,97,0,98,116,77,97,116,114,105,120,51,120,51,70,108,111,
+97,116,68,97,116,97,0,98,116,77,97,116,114,105,120,51,120,51,68,111,
+117,98,108,101,68,97,116,97,0,98,116,84,114,97,110,115,102,111,114,109,
+70,108,111,97,116,68,97,116,97,0,98,116,84,114,97,110,115,102,111,114,
+109,68,111,117,98,108,101,68,97,116,97,0,98,116,66,118,104,83,117,98,
+116,114,101,101,73,110,102,111,68,97,116,97,0,98,116,79,112,116,105,109,
+105,122,101,100,66,118,104,78,111,100,101,70,108,111,97,116,68,97,116,97,
+0,98,116,79,112,116,105,109,105,122,101,100,66,118,104,78,111,100,101,68,
+111,117,98,108,101,68,97,116,97,0,98,116,81,117,97,110,116,105,122,101,
+100,66,118,104,78,111,100,101,68,97,116,97,0,98,116,81,117,97,110,116,
+105,122,101,100,66,118,104,70,108,111,97,116,68,97,116,97,0,98,116,81,
+117,97,110,116,105,122,101,100,66,118,104,68,111,117,98,108,101,68,97,116,
+97,0,98,116,67,111,108,108,105,115,105,111,110,83,104,97,112,101,68,97,
+116,97,0,98,116,83,116,97,116,105,99,80,108,97,110,101,83,104,97,112,
+101,68,97,116,97,0,98,116,67,111,110,118,101,120,73,110,116,101,114,110,
+97,108,83,104,97,112,101,68,97,116,97,0,98,116,80,111,115,105,116,105,
+111,110,65,110,100,82,97,100,105,117,115,0,98,116,77,117,108,116,105,83,
+112,104,101,114,101,83,104,97,112,101,68,97,116,97,0,98,116,73,110,116,
+73,110,100,101,120,68,97,116,97,0,98,116,83,104,111,114,116,73,110,116,
+73,110,100,101,120,68,97,116,97,0,98,116,83,104,111,114,116,73,110,116,
+73,110,100,101,120,84,114,105,112,108,101,116,68,97,116,97,0,98,116,67,
+104,97,114,73,110,100,101,120,84,114,105,112,108,101,116,68,97,116,97,0,
+98,116,77,101,115,104,80,97,114,116,68,97,116,97,0,98,116,83,116,114,
+105,100,105,110,103,77,101,115,104,73,110,116,101,114,102,97,99,101,68,97,
+116,97,0,98,116,84,114,105,97,110,103,108,101,77,101,115,104,83,104,97,
112,101,68,97,116,97,0,98,116,84,114,105,97,110,103,108,101,73,110,102,
-111,68,97,116,97,0,98,116,71,73,109,112,97,99,116,77,101,115,104,83,
-104,97,112,101,68,97,116,97,0,98,116,67,111,110,118,101,120,72,117,108,
-108,83,104,97,112,101,68,97,116,97,0,98,116,67,111,108,108,105,115,105,
-111,110,79,98,106,101,99,116,68,111,117,98,108,101,68,97,116,97,0,98,
-116,67,111,108,108,105,115,105,111,110,79,98,106,101,99,116,70,108,111,97,
-116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,70,108,111,
-97,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,68,111,
-117,98,108,101,68,97,116,97,0,98,116,67,111,110,115,116,114,97,105,110,
-116,73,110,102,111,49,0,98,116,84,121,112,101,100,67,111,110,115,116,114,
-97,105,110,116,68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,
-68,97,116,97,0,98,116,80,111,105,110,116,50,80,111,105,110,116,67,111,
-110,115,116,114,97,105,110,116,70,108,111,97,116,68,97,116,97,0,98,116,
-80,111,105,110,116,50,80,111,105,110,116,67,111,110,115,116,114,97,105,110,
-116,68,111,117,98,108,101,68,97,116,97,0,98,116,72,105,110,103,101,67,
-111,110,115,116,114,97,105,110,116,68,111,117,98,108,101,68,97,116,97,0,
-98,116,72,105,110,103,101,67,111,110,115,116,114,97,105,110,116,70,108,111,
-97,116,68,97,116,97,0,98,116,67,111,110,101,84,119,105,115,116,67,111,
-110,115,116,114,97,105,110,116,68,97,116,97,0,98,116,71,101,110,101,114,
-105,99,54,68,111,102,67,111,110,115,116,114,97,105,110,116,68,97,116,97,
-0,98,116,71,101,110,101,114,105,99,54,68,111,102,83,112,114,105,110,103,
-67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,98,116,83,108,105,
-100,101,114,67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,83,111,
-102,116,66,111,100,121,77,97,116,101,114,105,97,108,68,97,116,97,0,83,
-111,102,116,66,111,100,121,78,111,100,101,68,97,116,97,0,83,111,102,116,
-66,111,100,121,76,105,110,107,68,97,116,97,0,83,111,102,116,66,111,100,
-121,70,97,99,101,68,97,116,97,0,83,111,102,116,66,111,100,121,84,101,
-116,114,97,68,97,116,97,0,83,111,102,116,82,105,103,105,100,65,110,99,
-104,111,114,68,97,116,97,0,83,111,102,116,66,111,100,121,67,111,110,102,
-105,103,68,97,116,97,0,83,111,102,116,66,111,100,121,80,111,115,101,68,
-97,116,97,0,83,111,102,116,66,111,100,121,67,108,117,115,116,101,114,68,
-97,116,97,0,98,116,83,111,102,116,66,111,100,121,74,111,105,110,116,68,
-97,116,97,0,98,116,83,111,102,116,66,111,100,121,70,108,111,97,116,68,
-97,116,97,0,84,76,69,78,1,0,1,0,2,0,2,0,4,0,4,0,
-4,0,4,0,8,0,0,0,16,0,48,0,16,0,16,0,32,0,48,0,
-96,0,64,0,-128,0,20,0,48,0,80,0,16,0,96,0,-112,0,16,0,
-56,0,56,0,20,0,72,0,4,0,4,0,8,0,4,0,56,0,32,0,
-80,0,72,0,96,0,80,0,32,0,64,0,64,0,16,0,72,0,80,0,
--40,1,8,1,-16,1,-88,3,8,0,56,0,0,0,88,0,120,0,96,1,
--32,0,-40,0,0,1,96,1,-48,0,16,0,104,0,24,0,40,0,104,0,
-96,0,104,0,-56,0,104,1,112,0,-40,1,83,84,82,67,61,0,0,0,
-10,0,3,0,4,0,0,0,4,0,1,0,9,0,2,0,11,0,3,0,
-10,0,3,0,10,0,4,0,10,0,5,0,12,0,2,0,9,0,6,0,
-9,0,7,0,13,0,1,0,7,0,8,0,14,0,1,0,8,0,8,0,
-15,0,1,0,13,0,9,0,16,0,1,0,14,0,9,0,17,0,2,0,
-15,0,10,0,13,0,11,0,18,0,2,0,16,0,10,0,14,0,11,0,
-19,0,4,0,4,0,12,0,4,0,13,0,2,0,14,0,2,0,15,0,
-20,0,6,0,13,0,16,0,13,0,17,0,4,0,18,0,4,0,19,0,
-4,0,20,0,0,0,21,0,21,0,6,0,14,0,16,0,14,0,17,0,
-4,0,18,0,4,0,19,0,4,0,20,0,0,0,21,0,22,0,3,0,
-2,0,14,0,2,0,15,0,4,0,22,0,23,0,12,0,13,0,23,0,
-13,0,24,0,13,0,25,0,4,0,26,0,4,0,27,0,4,0,28,0,
-4,0,29,0,20,0,30,0,22,0,31,0,19,0,32,0,4,0,33,0,
-4,0,34,0,24,0,12,0,14,0,23,0,14,0,24,0,14,0,25,0,
-4,0,26,0,4,0,27,0,4,0,28,0,4,0,29,0,21,0,30,0,
-22,0,31,0,4,0,33,0,4,0,34,0,19,0,32,0,25,0,3,0,
-0,0,35,0,4,0,36,0,0,0,37,0,26,0,5,0,25,0,38,0,
-13,0,39,0,13,0,40,0,7,0,41,0,0,0,21,0,27,0,5,0,
-25,0,38,0,13,0,39,0,13,0,42,0,7,0,43,0,4,0,44,0,
-28,0,2,0,13,0,45,0,7,0,46,0,29,0,4,0,27,0,47,0,
-28,0,48,0,4,0,49,0,0,0,37,0,30,0,1,0,4,0,50,0,
-31,0,2,0,2,0,50,0,0,0,51,0,32,0,2,0,2,0,52,0,
-0,0,51,0,33,0,2,0,0,0,52,0,0,0,53,0,34,0,8,0,
-13,0,54,0,14,0,55,0,30,0,56,0,32,0,57,0,33,0,58,0,
-31,0,59,0,4,0,60,0,4,0,61,0,35,0,4,0,34,0,62,0,
-13,0,63,0,4,0,64,0,0,0,37,0,36,0,7,0,25,0,38,0,
-35,0,65,0,23,0,66,0,24,0,67,0,37,0,68,0,7,0,43,0,
-0,0,69,0,38,0,2,0,36,0,70,0,13,0,39,0,39,0,4,0,
-17,0,71,0,25,0,72,0,4,0,73,0,7,0,74,0,40,0,4,0,
-25,0,38,0,39,0,75,0,4,0,76,0,7,0,43,0,41,0,3,0,
-27,0,47,0,4,0,77,0,0,0,37,0,42,0,3,0,27,0,47,0,
-4,0,77,0,0,0,37,0,43,0,4,0,4,0,78,0,7,0,79,0,
-7,0,80,0,7,0,81,0,37,0,14,0,4,0,82,0,4,0,83,0,
-43,0,84,0,4,0,85,0,7,0,86,0,7,0,87,0,7,0,88,0,
-7,0,89,0,7,0,90,0,4,0,91,0,4,0,92,0,4,0,93,0,
-4,0,94,0,0,0,37,0,44,0,5,0,25,0,38,0,35,0,65,0,
-13,0,39,0,7,0,43,0,4,0,95,0,45,0,5,0,27,0,47,0,
-13,0,96,0,14,0,97,0,4,0,98,0,0,0,99,0,46,0,24,0,
-9,0,100,0,9,0,101,0,25,0,102,0,0,0,35,0,18,0,103,0,
-18,0,104,0,14,0,105,0,14,0,106,0,14,0,107,0,8,0,108,0,
-8,0,109,0,8,0,110,0,8,0,111,0,8,0,112,0,8,0,113,0,
-8,0,114,0,4,0,115,0,4,0,116,0,4,0,117,0,4,0,118,0,
-4,0,119,0,4,0,120,0,4,0,121,0,0,0,37,0,47,0,23,0,
-9,0,100,0,9,0,101,0,25,0,102,0,0,0,35,0,17,0,103,0,
-17,0,104,0,13,0,105,0,13,0,106,0,13,0,107,0,7,0,108,0,
-7,0,109,0,7,0,110,0,7,0,111,0,7,0,112,0,7,0,113,0,
-7,0,114,0,4,0,115,0,4,0,116,0,4,0,117,0,4,0,118,0,
-4,0,119,0,4,0,120,0,4,0,121,0,48,0,21,0,47,0,122,0,
-15,0,123,0,13,0,124,0,13,0,125,0,13,0,126,0,13,0,127,0,
-13,0,-128,0,13,0,-127,0,13,0,-126,0,13,0,-125,0,13,0,-124,0,
-7,0,-123,0,7,0,-122,0,7,0,-121,0,7,0,-120,0,7,0,-119,0,
-7,0,-118,0,7,0,-117,0,7,0,-116,0,7,0,-115,0,4,0,-114,0,
-49,0,22,0,46,0,122,0,16,0,123,0,14,0,124,0,14,0,125,0,
-14,0,126,0,14,0,127,0,14,0,-128,0,14,0,-127,0,14,0,-126,0,
-14,0,-125,0,14,0,-124,0,8,0,-123,0,8,0,-122,0,8,0,-121,0,
-8,0,-120,0,8,0,-119,0,8,0,-118,0,8,0,-117,0,8,0,-116,0,
-8,0,-115,0,4,0,-114,0,0,0,37,0,50,0,2,0,4,0,-113,0,
-4,0,-112,0,51,0,11,0,52,0,-111,0,52,0,-110,0,0,0,35,0,
-4,0,-109,0,4,0,-108,0,4,0,-107,0,4,0,-106,0,7,0,-105,0,
-7,0,-104,0,4,0,-103,0,0,0,-102,0,53,0,3,0,51,0,-101,0,
-13,0,-100,0,13,0,-99,0,54,0,3,0,51,0,-101,0,14,0,-100,0,
-14,0,-99,0,55,0,13,0,51,0,-101,0,18,0,-98,0,18,0,-97,0,
-4,0,-96,0,4,0,-95,0,4,0,-94,0,7,0,-93,0,7,0,-92,0,
-7,0,-91,0,7,0,-90,0,7,0,-89,0,7,0,-88,0,7,0,-87,0,
-56,0,13,0,51,0,-101,0,17,0,-98,0,17,0,-97,0,4,0,-96,0,
-4,0,-95,0,4,0,-94,0,7,0,-93,0,7,0,-92,0,7,0,-91,0,
-7,0,-90,0,7,0,-89,0,7,0,-88,0,7,0,-87,0,57,0,11,0,
-51,0,-101,0,17,0,-98,0,17,0,-97,0,7,0,-86,0,7,0,-85,0,
-7,0,-84,0,7,0,-89,0,7,0,-88,0,7,0,-87,0,7,0,-83,0,
-0,0,21,0,58,0,9,0,51,0,-101,0,17,0,-98,0,17,0,-97,0,
-13,0,-82,0,13,0,-81,0,13,0,-80,0,13,0,-79,0,4,0,-78,0,
-4,0,-77,0,59,0,5,0,58,0,-76,0,4,0,-75,0,7,0,-74,0,
-7,0,-73,0,7,0,-72,0,60,0,9,0,51,0,-101,0,17,0,-98,0,
-17,0,-97,0,7,0,-82,0,7,0,-81,0,7,0,-80,0,7,0,-79,0,
-4,0,-78,0,4,0,-77,0,61,0,4,0,7,0,-71,0,7,0,-70,0,
-7,0,-69,0,4,0,78,0,62,0,10,0,61,0,-68,0,13,0,-67,0,
-13,0,-66,0,13,0,-65,0,13,0,-64,0,13,0,-63,0,7,0,-123,0,
-7,0,-62,0,4,0,-61,0,4,0,53,0,63,0,4,0,61,0,-68,0,
-4,0,-60,0,7,0,-59,0,4,0,-58,0,64,0,4,0,13,0,-63,0,
-61,0,-68,0,4,0,-57,0,7,0,-56,0,65,0,7,0,13,0,-55,0,
-61,0,-68,0,4,0,-54,0,7,0,-53,0,7,0,-52,0,7,0,-51,0,
-4,0,53,0,66,0,6,0,15,0,-50,0,13,0,-52,0,13,0,-49,0,
-52,0,-48,0,4,0,-47,0,7,0,-51,0,67,0,26,0,4,0,-46,0,
-7,0,-45,0,7,0,-83,0,7,0,-44,0,7,0,-43,0,7,0,-42,0,
-7,0,-41,0,7,0,-40,0,7,0,-39,0,7,0,-38,0,7,0,-37,0,
-7,0,-36,0,7,0,-35,0,7,0,-34,0,7,0,-33,0,7,0,-32,0,
-7,0,-31,0,7,0,-30,0,7,0,-29,0,7,0,-28,0,7,0,-27,0,
-4,0,-26,0,4,0,-25,0,4,0,-24,0,4,0,-23,0,4,0,116,0,
-68,0,12,0,15,0,-22,0,15,0,-21,0,15,0,-20,0,13,0,-19,0,
-13,0,-18,0,7,0,-17,0,4,0,-16,0,4,0,-15,0,4,0,-14,0,
-4,0,-13,0,7,0,-53,0,4,0,53,0,69,0,27,0,17,0,-12,0,
-15,0,-11,0,15,0,-10,0,13,0,-19,0,13,0,-9,0,13,0,-8,0,
-13,0,-7,0,13,0,-6,0,13,0,-5,0,4,0,-4,0,7,0,-3,0,
-4,0,-2,0,4,0,-1,0,4,0,0,1,7,0,1,1,7,0,2,1,
-4,0,3,1,4,0,4,1,7,0,5,1,7,0,6,1,7,0,7,1,
-7,0,8,1,7,0,9,1,7,0,10,1,4,0,11,1,4,0,12,1,
-4,0,13,1,70,0,12,0,9,0,14,1,9,0,15,1,13,0,16,1,
-7,0,17,1,7,0,18,1,7,0,19,1,4,0,20,1,13,0,21,1,
-4,0,22,1,4,0,23,1,4,0,24,1,4,0,53,0,71,0,19,0,
-47,0,122,0,68,0,25,1,61,0,26,1,62,0,27,1,63,0,28,1,
-64,0,29,1,65,0,30,1,66,0,31,1,69,0,32,1,70,0,33,1,
-4,0,34,1,4,0,-1,0,4,0,35,1,4,0,36,1,4,0,37,1,
-4,0,38,1,4,0,39,1,4,0,40,1,67,0,41,1,};
+111,77,97,112,68,97,116,97,0,98,116,83,99,97,108,101,100,84,114,105,
+97,110,103,108,101,77,101,115,104,83,104,97,112,101,68,97,116,97,0,98,
+116,67,111,109,112,111,117,110,100,83,104,97,112,101,67,104,105,108,100,68,
+97,116,97,0,98,116,67,111,109,112,111,117,110,100,83,104,97,112,101,68,
+97,116,97,0,98,116,67,121,108,105,110,100,101,114,83,104,97,112,101,68,
+97,116,97,0,98,116,67,97,112,115,117,108,101,83,104,97,112,101,68,97,
+116,97,0,98,116,84,114,105,97,110,103,108,101,73,110,102,111,68,97,116,
+97,0,98,116,71,73,109,112,97,99,116,77,101,115,104,83,104,97,112,101,
+68,97,116,97,0,98,116,67,111,110,118,101,120,72,117,108,108,83,104,97,
+112,101,68,97,116,97,0,98,116,67,111,108,108,105,115,105,111,110,79,98,
+106,101,99,116,68,111,117,98,108,101,68,97,116,97,0,98,116,67,111,108,
+108,105,115,105,111,110,79,98,106,101,99,116,70,108,111,97,116,68,97,116,
+97,0,98,116,82,105,103,105,100,66,111,100,121,70,108,111,97,116,68,97,
+116,97,0,98,116,82,105,103,105,100,66,111,100,121,68,111,117,98,108,101,
+68,97,116,97,0,98,116,67,111,110,115,116,114,97,105,110,116,73,110,102,
+111,49,0,98,116,84,121,112,101,100,67,111,110,115,116,114,97,105,110,116,
+68,97,116,97,0,98,116,82,105,103,105,100,66,111,100,121,68,97,116,97,
+0,98,116,80,111,105,110,116,50,80,111,105,110,116,67,111,110,115,116,114,
+97,105,110,116,70,108,111,97,116,68,97,116,97,0,98,116,80,111,105,110,
+116,50,80,111,105,110,116,67,111,110,115,116,114,97,105,110,116,68,111,117,
+98,108,101,68,97,116,97,0,98,116,72,105,110,103,101,67,111,110,115,116,
+114,97,105,110,116,68,111,117,98,108,101,68,97,116,97,0,98,116,72,105,
+110,103,101,67,111,110,115,116,114,97,105,110,116,70,108,111,97,116,68,97,
+116,97,0,98,116,67,111,110,101,84,119,105,115,116,67,111,110,115,116,114,
+97,105,110,116,68,97,116,97,0,98,116,71,101,110,101,114,105,99,54,68,
+111,102,67,111,110,115,116,114,97,105,110,116,68,97,116,97,0,98,116,71,
+101,110,101,114,105,99,54,68,111,102,83,112,114,105,110,103,67,111,110,115,
+116,114,97,105,110,116,68,97,116,97,0,98,116,83,108,105,100,101,114,67,
+111,110,115,116,114,97,105,110,116,68,97,116,97,0,83,111,102,116,66,111,
+100,121,77,97,116,101,114,105,97,108,68,97,116,97,0,83,111,102,116,66,
+111,100,121,78,111,100,101,68,97,116,97,0,83,111,102,116,66,111,100,121,
+76,105,110,107,68,97,116,97,0,83,111,102,116,66,111,100,121,70,97,99,
+101,68,97,116,97,0,83,111,102,116,66,111,100,121,84,101,116,114,97,68,
+97,116,97,0,83,111,102,116,82,105,103,105,100,65,110,99,104,111,114,68,
+97,116,97,0,83,111,102,116,66,111,100,121,67,111,110,102,105,103,68,97,
+116,97,0,83,111,102,116,66,111,100,121,80,111,115,101,68,97,116,97,0,
+83,111,102,116,66,111,100,121,67,108,117,115,116,101,114,68,97,116,97,0,
+98,116,83,111,102,116,66,111,100,121,74,111,105,110,116,68,97,116,97,0,
+98,116,83,111,102,116,66,111,100,121,70,108,111,97,116,68,97,116,97,0,
+84,76,69,78,1,0,1,0,2,0,2,0,4,0,4,0,4,0,4,0,
+8,0,0,0,16,0,48,0,16,0,16,0,32,0,48,0,96,0,64,0,
+-128,0,20,0,48,0,80,0,16,0,96,0,-112,0,16,0,56,0,56,0,
+20,0,72,0,4,0,4,0,8,0,4,0,56,0,32,0,80,0,72,0,
+96,0,80,0,32,0,64,0,64,0,16,0,72,0,80,0,-40,1,8,1,
+-16,1,-88,3,8,0,64,0,0,0,96,0,-128,0,104,1,-24,0,-32,0,
+8,1,104,1,-40,0,16,0,104,0,24,0,40,0,104,0,96,0,104,0,
+-56,0,104,1,112,0,-40,1,83,84,82,67,61,0,0,0,10,0,3,0,
+4,0,0,0,4,0,1,0,9,0,2,0,11,0,3,0,10,0,3,0,
+10,0,4,0,10,0,5,0,12,0,2,0,9,0,6,0,9,0,7,0,
+13,0,1,0,7,0,8,0,14,0,1,0,8,0,8,0,15,0,1,0,
+13,0,9,0,16,0,1,0,14,0,9,0,17,0,2,0,15,0,10,0,
+13,0,11,0,18,0,2,0,16,0,10,0,14,0,11,0,19,0,4,0,
+4,0,12,0,4,0,13,0,2,0,14,0,2,0,15,0,20,0,6,0,
+13,0,16,0,13,0,17,0,4,0,18,0,4,0,19,0,4,0,20,0,
+0,0,21,0,21,0,6,0,14,0,16,0,14,0,17,0,4,0,18,0,
+4,0,19,0,4,0,20,0,0,0,21,0,22,0,3,0,2,0,14,0,
+2,0,15,0,4,0,22,0,23,0,12,0,13,0,23,0,13,0,24,0,
+13,0,25,0,4,0,26,0,4,0,27,0,4,0,28,0,4,0,29,0,
+20,0,30,0,22,0,31,0,19,0,32,0,4,0,33,0,4,0,34,0,
+24,0,12,0,14,0,23,0,14,0,24,0,14,0,25,0,4,0,26,0,
+4,0,27,0,4,0,28,0,4,0,29,0,21,0,30,0,22,0,31,0,
+4,0,33,0,4,0,34,0,19,0,32,0,25,0,3,0,0,0,35,0,
+4,0,36,0,0,0,37,0,26,0,5,0,25,0,38,0,13,0,39,0,
+13,0,40,0,7,0,41,0,0,0,21,0,27,0,5,0,25,0,38,0,
+13,0,39,0,13,0,42,0,7,0,43,0,4,0,44,0,28,0,2,0,
+13,0,45,0,7,0,46,0,29,0,4,0,27,0,47,0,28,0,48,0,
+4,0,49,0,0,0,37,0,30,0,1,0,4,0,50,0,31,0,2,0,
+2,0,50,0,0,0,51,0,32,0,2,0,2,0,52,0,0,0,51,0,
+33,0,2,0,0,0,52,0,0,0,53,0,34,0,8,0,13,0,54,0,
+14,0,55,0,30,0,56,0,32,0,57,0,33,0,58,0,31,0,59,0,
+4,0,60,0,4,0,61,0,35,0,4,0,34,0,62,0,13,0,63,0,
+4,0,64,0,0,0,37,0,36,0,7,0,25,0,38,0,35,0,65,0,
+23,0,66,0,24,0,67,0,37,0,68,0,7,0,43,0,0,0,69,0,
+38,0,2,0,36,0,70,0,13,0,39,0,39,0,4,0,17,0,71,0,
+25,0,72,0,4,0,73,0,7,0,74,0,40,0,4,0,25,0,38,0,
+39,0,75,0,4,0,76,0,7,0,43,0,41,0,3,0,27,0,47,0,
+4,0,77,0,0,0,37,0,42,0,3,0,27,0,47,0,4,0,77,0,
+0,0,37,0,43,0,4,0,4,0,78,0,7,0,79,0,7,0,80,0,
+7,0,81,0,37,0,14,0,4,0,82,0,4,0,83,0,43,0,84,0,
+4,0,85,0,7,0,86,0,7,0,87,0,7,0,88,0,7,0,89,0,
+7,0,90,0,4,0,91,0,4,0,92,0,4,0,93,0,4,0,94,0,
+0,0,37,0,44,0,5,0,25,0,38,0,35,0,65,0,13,0,39,0,
+7,0,43,0,4,0,95,0,45,0,5,0,27,0,47,0,13,0,96,0,
+14,0,97,0,4,0,98,0,0,0,99,0,46,0,24,0,9,0,100,0,
+9,0,101,0,25,0,102,0,0,0,35,0,18,0,103,0,18,0,104,0,
+14,0,105,0,14,0,106,0,14,0,107,0,8,0,108,0,8,0,109,0,
+8,0,110,0,8,0,111,0,8,0,112,0,8,0,113,0,8,0,114,0,
+4,0,115,0,4,0,116,0,4,0,117,0,4,0,118,0,4,0,119,0,
+4,0,120,0,4,0,121,0,0,0,37,0,47,0,23,0,9,0,100,0,
+9,0,101,0,25,0,102,0,0,0,35,0,17,0,103,0,17,0,104,0,
+13,0,105,0,13,0,106,0,13,0,107,0,7,0,108,0,7,0,109,0,
+7,0,110,0,7,0,111,0,7,0,112,0,7,0,113,0,7,0,114,0,
+4,0,115,0,4,0,116,0,4,0,117,0,4,0,118,0,4,0,119,0,
+4,0,120,0,4,0,121,0,48,0,21,0,47,0,122,0,15,0,123,0,
+13,0,124,0,13,0,125,0,13,0,126,0,13,0,127,0,13,0,-128,0,
+13,0,-127,0,13,0,-126,0,13,0,-125,0,13,0,-124,0,7,0,-123,0,
+7,0,-122,0,7,0,-121,0,7,0,-120,0,7,0,-119,0,7,0,-118,0,
+7,0,-117,0,7,0,-116,0,7,0,-115,0,4,0,-114,0,49,0,22,0,
+46,0,122,0,16,0,123,0,14,0,124,0,14,0,125,0,14,0,126,0,
+14,0,127,0,14,0,-128,0,14,0,-127,0,14,0,-126,0,14,0,-125,0,
+14,0,-124,0,8,0,-123,0,8,0,-122,0,8,0,-121,0,8,0,-120,0,
+8,0,-119,0,8,0,-118,0,8,0,-117,0,8,0,-116,0,8,0,-115,0,
+4,0,-114,0,0,0,37,0,50,0,2,0,4,0,-113,0,4,0,-112,0,
+51,0,13,0,52,0,-111,0,52,0,-110,0,0,0,35,0,4,0,-109,0,
+4,0,-108,0,4,0,-107,0,4,0,-106,0,7,0,-105,0,7,0,-104,0,
+4,0,-103,0,4,0,-102,0,7,0,-101,0,4,0,-100,0,53,0,3,0,
+51,0,-99,0,13,0,-98,0,13,0,-97,0,54,0,3,0,51,0,-99,0,
+14,0,-98,0,14,0,-97,0,55,0,13,0,51,0,-99,0,18,0,-96,0,
+18,0,-95,0,4,0,-94,0,4,0,-93,0,4,0,-92,0,7,0,-91,0,
+7,0,-90,0,7,0,-89,0,7,0,-88,0,7,0,-87,0,7,0,-86,0,
+7,0,-85,0,56,0,13,0,51,0,-99,0,17,0,-96,0,17,0,-95,0,
+4,0,-94,0,4,0,-93,0,4,0,-92,0,7,0,-91,0,7,0,-90,0,
+7,0,-89,0,7,0,-88,0,7,0,-87,0,7,0,-86,0,7,0,-85,0,
+57,0,11,0,51,0,-99,0,17,0,-96,0,17,0,-95,0,7,0,-84,0,
+7,0,-83,0,7,0,-82,0,7,0,-87,0,7,0,-86,0,7,0,-85,0,
+7,0,-81,0,0,0,21,0,58,0,9,0,51,0,-99,0,17,0,-96,0,
+17,0,-95,0,13,0,-80,0,13,0,-79,0,13,0,-78,0,13,0,-77,0,
+4,0,-76,0,4,0,-75,0,59,0,5,0,58,0,-74,0,4,0,-73,0,
+7,0,-72,0,7,0,-71,0,7,0,-70,0,60,0,9,0,51,0,-99,0,
+17,0,-96,0,17,0,-95,0,7,0,-80,0,7,0,-79,0,7,0,-78,0,
+7,0,-77,0,4,0,-76,0,4,0,-75,0,61,0,4,0,7,0,-69,0,
+7,0,-68,0,7,0,-67,0,4,0,78,0,62,0,10,0,61,0,-66,0,
+13,0,-65,0,13,0,-64,0,13,0,-63,0,13,0,-62,0,13,0,-61,0,
+7,0,-123,0,7,0,-60,0,4,0,-59,0,4,0,53,0,63,0,4,0,
+61,0,-66,0,4,0,-58,0,7,0,-57,0,4,0,-56,0,64,0,4,0,
+13,0,-61,0,61,0,-66,0,4,0,-55,0,7,0,-54,0,65,0,7,0,
+13,0,-53,0,61,0,-66,0,4,0,-52,0,7,0,-51,0,7,0,-50,0,
+7,0,-49,0,4,0,53,0,66,0,6,0,15,0,-48,0,13,0,-50,0,
+13,0,-47,0,52,0,-46,0,4,0,-45,0,7,0,-49,0,67,0,26,0,
+4,0,-44,0,7,0,-43,0,7,0,-81,0,7,0,-42,0,7,0,-41,0,
+7,0,-40,0,7,0,-39,0,7,0,-38,0,7,0,-37,0,7,0,-36,0,
+7,0,-35,0,7,0,-34,0,7,0,-33,0,7,0,-32,0,7,0,-31,0,
+7,0,-30,0,7,0,-29,0,7,0,-28,0,7,0,-27,0,7,0,-26,0,
+7,0,-25,0,4,0,-24,0,4,0,-23,0,4,0,-22,0,4,0,-21,0,
+4,0,116,0,68,0,12,0,15,0,-20,0,15,0,-19,0,15,0,-18,0,
+13,0,-17,0,13,0,-16,0,7,0,-15,0,4,0,-14,0,4,0,-13,0,
+4,0,-12,0,4,0,-11,0,7,0,-51,0,4,0,53,0,69,0,27,0,
+17,0,-10,0,15,0,-9,0,15,0,-8,0,13,0,-17,0,13,0,-7,0,
+13,0,-6,0,13,0,-5,0,13,0,-4,0,13,0,-3,0,4,0,-2,0,
+7,0,-1,0,4,0,0,1,4,0,1,1,4,0,2,1,7,0,3,1,
+7,0,4,1,4,0,5,1,4,0,6,1,7,0,7,1,7,0,8,1,
+7,0,9,1,7,0,10,1,7,0,11,1,7,0,12,1,4,0,13,1,
+4,0,14,1,4,0,15,1,70,0,12,0,9,0,16,1,9,0,17,1,
+13,0,18,1,7,0,19,1,7,0,20,1,7,0,21,1,4,0,22,1,
+13,0,23,1,4,0,24,1,4,0,25,1,4,0,26,1,4,0,53,0,
+71,0,19,0,47,0,122,0,68,0,27,1,61,0,28,1,62,0,29,1,
+63,0,30,1,64,0,31,1,65,0,32,1,66,0,33,1,69,0,34,1,
+70,0,35,1,4,0,36,1,4,0,1,1,4,0,37,1,4,0,38,1,
+4,0,39,1,4,0,40,1,4,0,41,1,4,0,42,1,67,0,43,1,
+};
int sBulletDNAlen64= sizeof(sBulletDNAstr64);
diff --git a/extern/bullet2/src/LinearMath/btSerializer.h b/extern/bullet2/src/LinearMath/btSerializer.h
index 52520d72b9e..76f3cf32f8e 100644
--- a/extern/bullet2/src/LinearMath/btSerializer.h
+++ b/extern/bullet2/src/LinearMath/btSerializer.h
@@ -28,9 +28,9 @@ subject to the following restrictions:
///only the 32bit versions for now
-extern unsigned char sBulletDNAstr[];
+extern char sBulletDNAstr[];
extern int sBulletDNAlen;
-extern unsigned char sBulletDNAstr64[];
+extern char sBulletDNAstr64[];
extern int sBulletDNAlen64;
SIMD_FORCE_INLINE int btStrLen(const char* str)
@@ -213,7 +213,7 @@ protected:
int *intPtr=0;
short *shtPtr=0;
- char *cp = 0;int dataLen =0;long nr=0;
+ char *cp = 0;int dataLen =0;
intPtr = (int*)m_dna;
/*
@@ -246,15 +246,7 @@ protected:
while (*cp)cp++;
cp++;
}
- {
- nr= (long)cp;
- // long mask=3;
- nr= ((nr+3)&~3)-nr;
- while (nr--)
- {
- cp++;
- }
- }
+ cp = btAlignPointer(cp,4);
/*
TYPE (4 bytes)
@@ -281,15 +273,7 @@ protected:
cp++;
}
- {
- nr= (long)cp;
- // long mask=3;
- nr= ((nr+3)&~3)-nr;
- while (nr--)
- {
- cp++;
- }
- }
+ cp = btAlignPointer(cp,4);
/*
@@ -453,8 +437,8 @@ public:
buffer[9] = '2';
- buffer[10] = '7';
- buffer[11] = '8';
+ buffer[10] = '8';
+ buffer[11] = '0';
}
diff --git a/extern/bullet2/src/LinearMath/btSimdMinMax.h b/extern/bullet2/src/LinearMath/btSimdMinMax.h
deleted file mode 100644
index 75e83f3c53f..00000000000
--- a/extern/bullet2/src/LinearMath/btSimdMinMax.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
-Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans http://continuousphysics.com/Bullet/
-
-This software is provided 'as-is', without any express or implied warranty.
-In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it freely,
-subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution.
-*/
-
-
-
-#ifndef SIMD_MINMAX_H
-#define SIMD_MINMAX_H
-#include "btScalar.h"
-
-template <class T>
-SIMD_FORCE_INLINE const T& btMin(const T& a, const T& b) {
- return b < a ? b : a;
-}
-
-template <class T>
-SIMD_FORCE_INLINE const T& btMax(const T& a, const T& b) {
- return a < b ? b : a;
-}
-
-template <class T>
-SIMD_FORCE_INLINE void btSetMin(T& a, const T& b) {
- if (a > b) a = b;
-}
-
-template <class T>
-SIMD_FORCE_INLINE void btSetMax(T& a, const T& b) {
- if (a < b) a = b;
-}
-
-#endif
diff --git a/extern/bullet2/src/LinearMath/btTransform.h b/extern/bullet2/src/LinearMath/btTransform.h
index 187b09116cc..5e52d183acb 100644
--- a/extern/bullet2/src/LinearMath/btTransform.h
+++ b/extern/bullet2/src/LinearMath/btTransform.h
@@ -14,8 +14,8 @@ subject to the following restrictions:
-#ifndef btTransform_H
-#define btTransform_H
+#ifndef BT_TRANSFORM_H
+#define BT_TRANSFORM_H
#include "btMatrix3x3.h"
@@ -298,7 +298,7 @@ SIMD_FORCE_INLINE void btTransform::deSerializeDouble(const btTransformDoubleDat
}
-#endif
+#endif //BT_TRANSFORM_H
diff --git a/extern/bullet2/src/LinearMath/btTransformUtil.h b/extern/bullet2/src/LinearMath/btTransformUtil.h
index 626110ce4ee..2303c274275 100644
--- a/extern/bullet2/src/LinearMath/btTransformUtil.h
+++ b/extern/bullet2/src/LinearMath/btTransformUtil.h
@@ -13,8 +13,8 @@ subject to the following restrictions:
*/
-#ifndef SIMD_TRANSFORM_UTIL_H
-#define SIMD_TRANSFORM_UTIL_H
+#ifndef BT_TRANSFORM_UTIL_H
+#define BT_TRANSFORM_UTIL_H
#include "btTransform.h"
#define ANGULAR_MOTION_THRESHOLD btScalar(0.5)*SIMD_HALF_PI
@@ -224,5 +224,5 @@ public:
};
-#endif //SIMD_TRANSFORM_UTIL_H
+#endif //BT_TRANSFORM_UTIL_H
diff --git a/extern/bullet2/src/LinearMath/btVector3.h b/extern/bullet2/src/LinearMath/btVector3.h
index 068e87c94ab..d99b7c83ae3 100644
--- a/extern/bullet2/src/LinearMath/btVector3.h
+++ b/extern/bullet2/src/LinearMath/btVector3.h
@@ -14,8 +14,8 @@ subject to the following restrictions:
-#ifndef SIMD__VECTOR3_H
-#define SIMD__VECTOR3_H
+#ifndef BT_VECTOR3_H
+#define BT_VECTOR3_H
#include "btScalar.h"
@@ -763,4 +763,4 @@ SIMD_FORCE_INLINE void btVector3::deSerialize(const struct btVector3Data& dataIn
}
-#endif //SIMD__VECTOR3_H
+#endif //BT_VECTOR3_H