some doxygen updates, added some comments to classes, fix broken links, rename some prefix some internal GIMPACT collision structures using (for example use GIM_AABB instead of BT_AAABB),
removed obsolete btGjkEpa (it was replaced by btGjkEpa2 ages ago)
This commit is contained in:
@@ -26,9 +26,6 @@ subject to the following restrictions:
|
||||
|
||||
#include "LinearMath/btTransform.h"
|
||||
|
||||
/*! \defgroup BOUND_AABB_OPERATIONS
|
||||
*/
|
||||
//! @{
|
||||
|
||||
///Swap numbers
|
||||
#define BT_SWAP_NUMBERS(a,b){ \
|
||||
@@ -646,6 +643,5 @@ SIMD_FORCE_INLINE bool btCompareTransformsEqual(const btTransform & t1,const btT
|
||||
}
|
||||
|
||||
|
||||
//! @}
|
||||
|
||||
#endif // GIM_BOX_COLLISION_H_INCLUDED
|
||||
|
||||
@@ -27,9 +27,6 @@ subject to the following restrictions:
|
||||
#include "LinearMath/btTransform.h"
|
||||
#include "LinearMath/btGeometryUtil.h"
|
||||
|
||||
/*! \addtogroup GEOMETRIC_OPERATIONS
|
||||
*/
|
||||
//! @{
|
||||
|
||||
SIMD_FORCE_INLINE btScalar bt_distance_point_plane(const btVector4 & plane,const btVector3 &point)
|
||||
{
|
||||
@@ -181,6 +178,5 @@ SIMD_FORCE_INLINE int bt_plane_clip_triangle(
|
||||
|
||||
|
||||
|
||||
//! @}
|
||||
|
||||
#endif // GIM_TRI_COLLISION_H_INCLUDED
|
||||
|
||||
@@ -103,12 +103,12 @@ void btContactArray::merge_contacts(
|
||||
|
||||
push_back(contacts[keycontacts[0].m_value]);
|
||||
|
||||
BT_CONTACT * pcontact = &(*this)[0];
|
||||
GIM_CONTACT * pcontact = &(*this)[0];
|
||||
|
||||
for( i=1;i<keycontacts.size();i++)
|
||||
{
|
||||
key = keycontacts[i].m_key;
|
||||
const BT_CONTACT * scontact = &contacts[keycontacts[i].m_value];
|
||||
const GIM_CONTACT * scontact = &contacts[keycontacts[i].m_value];
|
||||
|
||||
if(last_key == key)//same points
|
||||
{
|
||||
@@ -158,7 +158,7 @@ void btContactArray::merge_contacts_unique(const btContactArray & contacts)
|
||||
return;
|
||||
}
|
||||
|
||||
BT_CONTACT average_contact = contacts[0];
|
||||
GIM_CONTACT average_contact = contacts[0];
|
||||
|
||||
for (int i=1;i<contacts.size() ;i++ )
|
||||
{
|
||||
|
||||
@@ -29,11 +29,6 @@ subject to the following restrictions:
|
||||
#include "btTriangleShapeEx.h"
|
||||
|
||||
|
||||
/*! \defgroup CONTACTS
|
||||
\brief
|
||||
Functions for managing and sorting contacts resulting from a collision query.
|
||||
*/
|
||||
//! @{
|
||||
|
||||
/**
|
||||
Configuration var for applying interpolation of contact normals
|
||||
@@ -42,8 +37,9 @@ Configuration var for applying interpolation of contact normals
|
||||
|
||||
#define CONTACT_DIFF_EPSILON 0.00001f
|
||||
|
||||
/// Structure for collision results
|
||||
class BT_CONTACT
|
||||
///The GIM_CONTACT is an internal GIMPACT structure, similar to btManifoldPoint.
|
||||
///@todo: remove and replace GIM_CONTACT by btManifoldPoint.
|
||||
class GIM_CONTACT
|
||||
{
|
||||
public:
|
||||
btVector3 m_point;
|
||||
@@ -53,11 +49,11 @@ public:
|
||||
int m_feature1;//Face number
|
||||
int m_feature2;//Face number
|
||||
public:
|
||||
BT_CONTACT()
|
||||
GIM_CONTACT()
|
||||
{
|
||||
}
|
||||
|
||||
BT_CONTACT(const BT_CONTACT & contact):
|
||||
GIM_CONTACT(const GIM_CONTACT & contact):
|
||||
m_point(contact.m_point),
|
||||
m_normal(contact.m_normal),
|
||||
m_depth(contact.m_depth),
|
||||
@@ -66,7 +62,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
BT_CONTACT(const btVector3 &point,const btVector3 & normal,
|
||||
GIM_CONTACT(const btVector3 &point,const btVector3 & normal,
|
||||
btScalar depth, int feature1, int feature2):
|
||||
m_point(point),
|
||||
m_normal(normal),
|
||||
@@ -112,7 +108,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
class btContactArray:public btAlignedObjectArray<BT_CONTACT>
|
||||
class btContactArray:public btAlignedObjectArray<GIM_CONTACT>
|
||||
{
|
||||
public:
|
||||
btContactArray()
|
||||
@@ -124,11 +120,11 @@ public:
|
||||
const btVector3 &point,const btVector3 & normal,
|
||||
btScalar depth, int feature1, int feature2)
|
||||
{
|
||||
push_back( BT_CONTACT(point,normal,depth,feature1,feature2) );
|
||||
push_back( GIM_CONTACT(point,normal,depth,feature1,feature2) );
|
||||
}
|
||||
|
||||
SIMD_FORCE_INLINE void push_triangle_contacts(
|
||||
const BT_TRIANGLE_CONTACT & tricontact,
|
||||
const GIM_TRIANGLE_CONTACT & tricontact,
|
||||
int feature1,int feature2)
|
||||
{
|
||||
for(int i = 0;i<tricontact.m_point_count ;i++ )
|
||||
@@ -145,5 +141,5 @@ public:
|
||||
void merge_contacts_unique(const btContactArray & contacts);
|
||||
};
|
||||
|
||||
//! @}
|
||||
|
||||
#endif // GIM_CONTACT_H_INCLUDED
|
||||
|
||||
@@ -65,7 +65,7 @@ float btGImpactBvh::getAverageTreeCollisionTime()
|
||||
/////////////////////// btBvhTree /////////////////////////////////
|
||||
|
||||
int btBvhTree::_calc_splitting_axis(
|
||||
BT_BVH_DATA_ARRAY & primitive_boxes, int startIndex, int endIndex)
|
||||
GIM_BVH_DATA_ARRAY & primitive_boxes, int startIndex, int endIndex)
|
||||
{
|
||||
|
||||
int i;
|
||||
@@ -97,7 +97,7 @@ int btBvhTree::_calc_splitting_axis(
|
||||
|
||||
|
||||
int btBvhTree::_sort_and_calc_splitting_index(
|
||||
BT_BVH_DATA_ARRAY & primitive_boxes, int startIndex,
|
||||
GIM_BVH_DATA_ARRAY & primitive_boxes, int startIndex,
|
||||
int endIndex, int splitAxis)
|
||||
{
|
||||
int i;
|
||||
@@ -158,7 +158,7 @@ int btBvhTree::_sort_and_calc_splitting_index(
|
||||
}
|
||||
|
||||
|
||||
void btBvhTree::_build_sub_tree(BT_BVH_DATA_ARRAY & primitive_boxes, int startIndex, int endIndex)
|
||||
void btBvhTree::_build_sub_tree(GIM_BVH_DATA_ARRAY & primitive_boxes, int startIndex, int endIndex)
|
||||
{
|
||||
int curIndex = m_num_nodes;
|
||||
m_num_nodes++;
|
||||
@@ -211,7 +211,7 @@ void btBvhTree::_build_sub_tree(BT_BVH_DATA_ARRAY & primitive_boxes, int startIn
|
||||
|
||||
//! stackless build tree
|
||||
void btBvhTree::build_tree(
|
||||
BT_BVH_DATA_ARRAY & primitive_boxes)
|
||||
GIM_BVH_DATA_ARRAY & primitive_boxes)
|
||||
{
|
||||
// initialize node count to 0
|
||||
m_num_nodes = 0;
|
||||
@@ -236,7 +236,7 @@ void btGImpactBvh::refit()
|
||||
}
|
||||
else
|
||||
{
|
||||
//const BT_BVH_TREE_NODE * nodepointer = get_node_pointer(nodecount);
|
||||
//const GIM_BVH_TREE_NODE * nodepointer = get_node_pointer(nodecount);
|
||||
//get left bound
|
||||
btAABB bound;
|
||||
bound.invalidate();
|
||||
@@ -266,7 +266,7 @@ void btGImpactBvh::refit()
|
||||
void btGImpactBvh::buildSet()
|
||||
{
|
||||
//obtain primitive boxes
|
||||
BT_BVH_DATA_ARRAY primitive_boxes;
|
||||
GIM_BVH_DATA_ARRAY primitive_boxes;
|
||||
primitive_boxes.resize(m_primitive_manager->get_primitive_count());
|
||||
|
||||
for (int i = 0;i<primitive_boxes.size() ;i++ )
|
||||
|
||||
@@ -32,29 +32,23 @@ subject to the following restrictions:
|
||||
|
||||
|
||||
|
||||
/*! \defgroup BOX_TREES
|
||||
|
||||
|
||||
|
||||
*/
|
||||
//! @{
|
||||
|
||||
|
||||
//! Overlapping pair
|
||||
struct BT_PAIR
|
||||
struct GIM_PAIR
|
||||
{
|
||||
int m_index1;
|
||||
int m_index2;
|
||||
BT_PAIR()
|
||||
GIM_PAIR()
|
||||
{}
|
||||
|
||||
BT_PAIR(const BT_PAIR & p)
|
||||
GIM_PAIR(const GIM_PAIR & p)
|
||||
{
|
||||
m_index1 = p.m_index1;
|
||||
m_index2 = p.m_index2;
|
||||
}
|
||||
|
||||
BT_PAIR(int index1, int index2)
|
||||
GIM_PAIR(int index1, int index2)
|
||||
{
|
||||
m_index1 = index1;
|
||||
m_index2 = index2;
|
||||
@@ -62,7 +56,7 @@ struct BT_PAIR
|
||||
};
|
||||
|
||||
//! A pairset array
|
||||
class btPairSet: public btAlignedObjectArray<BT_PAIR>
|
||||
class btPairSet: public btAlignedObjectArray<GIM_PAIR>
|
||||
{
|
||||
public:
|
||||
btPairSet()
|
||||
@@ -71,32 +65,32 @@ public:
|
||||
}
|
||||
inline void push_pair(int index1,int index2)
|
||||
{
|
||||
push_back(BT_PAIR(index1,index2));
|
||||
push_back(GIM_PAIR(index1,index2));
|
||||
}
|
||||
|
||||
inline void push_pair_inv(int index1,int index2)
|
||||
{
|
||||
push_back(BT_PAIR(index2,index1));
|
||||
push_back(GIM_PAIR(index2,index1));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct BT_BVH_DATA
|
||||
///GIM_BVH_DATA is an internal GIMPACT collision structure to contain axis aligned bounding box
|
||||
struct GIM_BVH_DATA
|
||||
{
|
||||
btAABB m_bound;
|
||||
int m_data;
|
||||
};
|
||||
|
||||
//! Node Structure for trees
|
||||
class BT_BVH_TREE_NODE
|
||||
class GIM_BVH_TREE_NODE
|
||||
{
|
||||
public:
|
||||
btAABB m_bound;
|
||||
protected:
|
||||
int m_escapeIndexOrDataIndex;
|
||||
public:
|
||||
BT_BVH_TREE_NODE()
|
||||
GIM_BVH_TREE_NODE()
|
||||
{
|
||||
m_escapeIndexOrDataIndex = 0;
|
||||
}
|
||||
@@ -133,12 +127,12 @@ public:
|
||||
};
|
||||
|
||||
|
||||
class BT_BVH_DATA_ARRAY:public btAlignedObjectArray<BT_BVH_DATA>
|
||||
class GIM_BVH_DATA_ARRAY:public btAlignedObjectArray<GIM_BVH_DATA>
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
class BT_BVH_TREE_NODE_ARRAY:public btAlignedObjectArray<BT_BVH_TREE_NODE>
|
||||
class GIM_BVH_TREE_NODE_ARRAY:public btAlignedObjectArray<GIM_BVH_TREE_NODE>
|
||||
{
|
||||
};
|
||||
|
||||
@@ -150,15 +144,15 @@ class btBvhTree
|
||||
{
|
||||
protected:
|
||||
int m_num_nodes;
|
||||
BT_BVH_TREE_NODE_ARRAY m_node_array;
|
||||
GIM_BVH_TREE_NODE_ARRAY m_node_array;
|
||||
protected:
|
||||
int _sort_and_calc_splitting_index(
|
||||
BT_BVH_DATA_ARRAY & primitive_boxes,
|
||||
GIM_BVH_DATA_ARRAY & primitive_boxes,
|
||||
int startIndex, int endIndex, int splitAxis);
|
||||
|
||||
int _calc_splitting_axis(BT_BVH_DATA_ARRAY & primitive_boxes, int startIndex, int endIndex);
|
||||
int _calc_splitting_axis(GIM_BVH_DATA_ARRAY & primitive_boxes, int startIndex, int endIndex);
|
||||
|
||||
void _build_sub_tree(BT_BVH_DATA_ARRAY & primitive_boxes, int startIndex, int endIndex);
|
||||
void _build_sub_tree(GIM_BVH_DATA_ARRAY & primitive_boxes, int startIndex, int endIndex);
|
||||
public:
|
||||
btBvhTree()
|
||||
{
|
||||
@@ -167,7 +161,7 @@ public:
|
||||
|
||||
//! prototype functions for box tree management
|
||||
//!@{
|
||||
void build_tree(BT_BVH_DATA_ARRAY & primitive_boxes);
|
||||
void build_tree(GIM_BVH_DATA_ARRAY & primitive_boxes);
|
||||
|
||||
SIMD_FORCE_INLINE void clearNodes()
|
||||
{
|
||||
@@ -218,7 +212,7 @@ public:
|
||||
return m_node_array[nodeindex].getEscapeIndex();
|
||||
}
|
||||
|
||||
SIMD_FORCE_INLINE const BT_BVH_TREE_NODE * get_node_pointer(int index = 0) const
|
||||
SIMD_FORCE_INLINE const GIM_BVH_TREE_NODE * get_node_pointer(int index = 0) const
|
||||
{
|
||||
return &m_node_array[index];
|
||||
}
|
||||
@@ -382,12 +376,11 @@ public:
|
||||
}
|
||||
|
||||
|
||||
SIMD_FORCE_INLINE const BT_BVH_TREE_NODE * get_node_pointer(int index = 0) const
|
||||
SIMD_FORCE_INLINE const GIM_BVH_TREE_NODE * get_node_pointer(int index = 0) const
|
||||
{
|
||||
return m_box_tree.get_node_pointer(index);
|
||||
}
|
||||
|
||||
//! @}
|
||||
|
||||
static float getAverageTreeCollisionTime();
|
||||
|
||||
|
||||
@@ -404,7 +404,7 @@ void btGImpactCollisionAlgorithm::collide_sat_triangles(btCollisionObject * body
|
||||
|
||||
btPrimitiveTriangle ptri0;
|
||||
btPrimitiveTriangle ptri1;
|
||||
BT_TRIANGLE_CONTACT contact_data;
|
||||
GIM_TRIANGLE_CONTACT contact_data;
|
||||
|
||||
shape0->lockChildShapes();
|
||||
shape1->lockChildShapes();
|
||||
@@ -540,7 +540,7 @@ void btGImpactCollisionAlgorithm::gimpact_vs_gimpact(
|
||||
int i = pairset.size();
|
||||
while(i--)
|
||||
{
|
||||
BT_PAIR * pair = &pairset[i];
|
||||
GIM_PAIR * pair = &pairset[i];
|
||||
m_triface0 = pair->m_index1;
|
||||
m_triface1 = pair->m_index2;
|
||||
btCollisionShape * colshape0 = retriever0.getChildShape(m_triface0);
|
||||
|
||||
@@ -67,7 +67,7 @@ float btGImpactQuantizedBvh::getAverageTreeCollisionTime()
|
||||
/////////////////////// btQuantizedBvhTree /////////////////////////////////
|
||||
|
||||
void btQuantizedBvhTree::calc_quantization(
|
||||
BT_BVH_DATA_ARRAY & primitive_boxes, btScalar boundMargin)
|
||||
GIM_BVH_DATA_ARRAY & primitive_boxes, btScalar boundMargin)
|
||||
{
|
||||
//calc globa box
|
||||
btAABB global_bound;
|
||||
@@ -86,7 +86,7 @@ void btQuantizedBvhTree::calc_quantization(
|
||||
|
||||
|
||||
int btQuantizedBvhTree::_calc_splitting_axis(
|
||||
BT_BVH_DATA_ARRAY & primitive_boxes, int startIndex, int endIndex)
|
||||
GIM_BVH_DATA_ARRAY & primitive_boxes, int startIndex, int endIndex)
|
||||
{
|
||||
|
||||
int i;
|
||||
@@ -118,7 +118,7 @@ int btQuantizedBvhTree::_calc_splitting_axis(
|
||||
|
||||
|
||||
int btQuantizedBvhTree::_sort_and_calc_splitting_index(
|
||||
BT_BVH_DATA_ARRAY & primitive_boxes, int startIndex,
|
||||
GIM_BVH_DATA_ARRAY & primitive_boxes, int startIndex,
|
||||
int endIndex, int splitAxis)
|
||||
{
|
||||
int i;
|
||||
@@ -179,7 +179,7 @@ int btQuantizedBvhTree::_sort_and_calc_splitting_index(
|
||||
}
|
||||
|
||||
|
||||
void btQuantizedBvhTree::_build_sub_tree(BT_BVH_DATA_ARRAY & primitive_boxes, int startIndex, int endIndex)
|
||||
void btQuantizedBvhTree::_build_sub_tree(GIM_BVH_DATA_ARRAY & primitive_boxes, int startIndex, int endIndex)
|
||||
{
|
||||
int curIndex = m_num_nodes;
|
||||
m_num_nodes++;
|
||||
@@ -232,7 +232,7 @@ void btQuantizedBvhTree::_build_sub_tree(BT_BVH_DATA_ARRAY & primitive_boxes, in
|
||||
|
||||
//! stackless build tree
|
||||
void btQuantizedBvhTree::build_tree(
|
||||
BT_BVH_DATA_ARRAY & primitive_boxes)
|
||||
GIM_BVH_DATA_ARRAY & primitive_boxes)
|
||||
{
|
||||
calc_quantization(primitive_boxes);
|
||||
// initialize node count to 0
|
||||
@@ -258,7 +258,7 @@ void btGImpactQuantizedBvh::refit()
|
||||
}
|
||||
else
|
||||
{
|
||||
//const BT_BVH_TREE_NODE * nodepointer = get_node_pointer(nodecount);
|
||||
//const GIM_BVH_TREE_NODE * nodepointer = get_node_pointer(nodecount);
|
||||
//get left bound
|
||||
btAABB bound;
|
||||
bound.invalidate();
|
||||
@@ -288,7 +288,7 @@ void btGImpactQuantizedBvh::refit()
|
||||
void btGImpactQuantizedBvh::buildSet()
|
||||
{
|
||||
//obtain primitive boxes
|
||||
BT_BVH_DATA_ARRAY primitive_boxes;
|
||||
GIM_BVH_DATA_ARRAY primitive_boxes;
|
||||
primitive_boxes.resize(m_primitive_manager->get_primitive_count());
|
||||
|
||||
for (int i = 0;i<primitive_boxes.size() ;i++ )
|
||||
|
||||
@@ -29,12 +29,6 @@ subject to the following restrictions:
|
||||
|
||||
|
||||
|
||||
/*! \defgroup BOX_TREES
|
||||
|
||||
|
||||
|
||||
*/
|
||||
//! @{
|
||||
|
||||
|
||||
///btQuantizedBvhNode is a compressed aabb node, 16 bytes.
|
||||
@@ -100,7 +94,7 @@ ATTRIBUTE_ALIGNED16 (struct) BT_QUANTIZED_BVH_NODE
|
||||
|
||||
|
||||
|
||||
class BT_QUANTIZED_BVH_NODE_ARRAY:public btAlignedObjectArray<BT_QUANTIZED_BVH_NODE>
|
||||
class GIM_QUANTIZED_BVH_NODE_ARRAY:public btAlignedObjectArray<BT_QUANTIZED_BVH_NODE>
|
||||
{
|
||||
};
|
||||
|
||||
@@ -112,19 +106,19 @@ class btQuantizedBvhTree
|
||||
{
|
||||
protected:
|
||||
int m_num_nodes;
|
||||
BT_QUANTIZED_BVH_NODE_ARRAY m_node_array;
|
||||
GIM_QUANTIZED_BVH_NODE_ARRAY m_node_array;
|
||||
btAABB m_global_bound;
|
||||
btVector3 m_bvhQuantization;
|
||||
protected:
|
||||
void calc_quantization(BT_BVH_DATA_ARRAY & primitive_boxes, btScalar boundMargin = btScalar(1.0) );
|
||||
void calc_quantization(GIM_BVH_DATA_ARRAY & primitive_boxes, btScalar boundMargin = btScalar(1.0) );
|
||||
|
||||
int _sort_and_calc_splitting_index(
|
||||
BT_BVH_DATA_ARRAY & primitive_boxes,
|
||||
GIM_BVH_DATA_ARRAY & primitive_boxes,
|
||||
int startIndex, int endIndex, int splitAxis);
|
||||
|
||||
int _calc_splitting_axis(BT_BVH_DATA_ARRAY & primitive_boxes, int startIndex, int endIndex);
|
||||
int _calc_splitting_axis(GIM_BVH_DATA_ARRAY & primitive_boxes, int startIndex, int endIndex);
|
||||
|
||||
void _build_sub_tree(BT_BVH_DATA_ARRAY & primitive_boxes, int startIndex, int endIndex);
|
||||
void _build_sub_tree(GIM_BVH_DATA_ARRAY & primitive_boxes, int startIndex, int endIndex);
|
||||
public:
|
||||
btQuantizedBvhTree()
|
||||
{
|
||||
@@ -133,7 +127,7 @@ public:
|
||||
|
||||
//! prototype functions for box tree management
|
||||
//!@{
|
||||
void build_tree(BT_BVH_DATA_ARRAY & primitive_boxes);
|
||||
void build_tree(GIM_BVH_DATA_ARRAY & primitive_boxes);
|
||||
|
||||
SIMD_FORCE_INLINE void quantizePoint(
|
||||
unsigned short * quantizedpoint, const btVector3 & point) const
|
||||
@@ -365,7 +359,6 @@ public:
|
||||
return m_box_tree.get_node_pointer(index);
|
||||
}
|
||||
|
||||
//! @}
|
||||
|
||||
static float getAverageTreeCollisionTime();
|
||||
|
||||
|
||||
@@ -251,16 +251,16 @@ bool btGenericPoolAllocator::freeMemory(void * pointer)
|
||||
#define BT_DEFAULT_POOL_ELEMENT_SIZE 8
|
||||
|
||||
// main allocator
|
||||
class BT_STANDARD_ALLOCATOR: public btGenericPoolAllocator
|
||||
class GIM_STANDARD_ALLOCATOR: public btGenericPoolAllocator
|
||||
{
|
||||
public:
|
||||
BT_STANDARD_ALLOCATOR():btGenericPoolAllocator(BT_DEFAULT_POOL_ELEMENT_SIZE,BT_DEFAULT_POOL_SIZE)
|
||||
GIM_STANDARD_ALLOCATOR():btGenericPoolAllocator(BT_DEFAULT_POOL_ELEMENT_SIZE,BT_DEFAULT_POOL_SIZE)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
// global allocator
|
||||
BT_STANDARD_ALLOCATOR g_main_allocator;
|
||||
GIM_STANDARD_ALLOCATOR g_main_allocator;
|
||||
|
||||
|
||||
void * btPoolAlloc(size_t size)
|
||||
|
||||
@@ -155,14 +155,9 @@ public:
|
||||
|
||||
|
||||
|
||||
/*! \defgroup POOL_MEMORY_FUNCTIONS
|
||||
standar managed Memory functions. Memory pools are used.
|
||||
*/
|
||||
//! @{
|
||||
void * btPoolAlloc(size_t size);
|
||||
void * btPoolRealloc(void *ptr, size_t oldsize, size_t newsize);
|
||||
void btPoolFree(void *ptr);
|
||||
//! @}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -29,9 +29,6 @@ subject to the following restrictions:
|
||||
|
||||
|
||||
|
||||
/*! \defgroup GEOMETRIC_OPERATIONS
|
||||
*/
|
||||
//! @{
|
||||
|
||||
|
||||
#define PLANEDIREPSILON 0.0000001f
|
||||
@@ -210,7 +207,6 @@ SIMD_FORCE_INLINE void bt_segment_collision(
|
||||
|
||||
|
||||
|
||||
//! @}
|
||||
|
||||
|
||||
#endif // GIM_VECTOR_H_INCLUDED
|
||||
|
||||
@@ -29,9 +29,6 @@ subject to the following restrictions:
|
||||
|
||||
|
||||
|
||||
/*! \defgroup GEOMETRIC_OPERATIONS
|
||||
*/
|
||||
//! @{
|
||||
|
||||
|
||||
|
||||
@@ -86,7 +83,6 @@ SIMD_FORCE_INLINE btVector3 bt_unquantize(
|
||||
return vecOut;
|
||||
}
|
||||
|
||||
//! @}
|
||||
|
||||
|
||||
#endif // GIM_VECTOR_H_INCLUDED
|
||||
|
||||
@@ -25,7 +25,7 @@ subject to the following restrictions:
|
||||
|
||||
|
||||
|
||||
void BT_TRIANGLE_CONTACT::merge_points(const btVector4 & plane,
|
||||
void GIM_TRIANGLE_CONTACT::merge_points(const btVector4 & plane,
|
||||
btScalar margin, const btVector3 * points, int point_count)
|
||||
{
|
||||
m_point_count = 0;
|
||||
@@ -123,7 +123,7 @@ int btPrimitiveTriangle::clip_triangle(btPrimitiveTriangle & other, btVector3 *
|
||||
return clipped_count;
|
||||
}
|
||||
|
||||
bool btPrimitiveTriangle::find_triangle_collision_clip_method(btPrimitiveTriangle & other, BT_TRIANGLE_CONTACT & contacts)
|
||||
bool btPrimitiveTriangle::find_triangle_collision_clip_method(btPrimitiveTriangle & other, GIM_TRIANGLE_CONTACT & contacts)
|
||||
{
|
||||
btScalar margin = m_margin + other.m_margin;
|
||||
|
||||
@@ -132,7 +132,7 @@ bool btPrimitiveTriangle::find_triangle_collision_clip_method(btPrimitiveTriangl
|
||||
//create planes
|
||||
// plane v vs U points
|
||||
|
||||
BT_TRIANGLE_CONTACT contacts1;
|
||||
GIM_TRIANGLE_CONTACT contacts1;
|
||||
|
||||
contacts1.m_separating_normal = m_plane;
|
||||
|
||||
@@ -152,7 +152,7 @@ bool btPrimitiveTriangle::find_triangle_collision_clip_method(btPrimitiveTriangl
|
||||
|
||||
|
||||
//Clip tri1 by tri2 edges
|
||||
BT_TRIANGLE_CONTACT contacts2;
|
||||
GIM_TRIANGLE_CONTACT contacts2;
|
||||
contacts2.m_separating_normal = other.m_plane;
|
||||
|
||||
clipped_count = other.clip_triangle(*this,clipped_points);
|
||||
|
||||
@@ -35,14 +35,14 @@ subject to the following restrictions:
|
||||
#define MAX_TRI_CLIPPING 16
|
||||
|
||||
//! Structure for collision
|
||||
struct BT_TRIANGLE_CONTACT
|
||||
struct GIM_TRIANGLE_CONTACT
|
||||
{
|
||||
btScalar m_penetration_depth;
|
||||
int m_point_count;
|
||||
btVector4 m_separating_normal;
|
||||
btVector3 m_points[MAX_TRI_CLIPPING];
|
||||
|
||||
SIMD_FORCE_INLINE void copy_from(const BT_TRIANGLE_CONTACT& other)
|
||||
SIMD_FORCE_INLINE void copy_from(const GIM_TRIANGLE_CONTACT& other)
|
||||
{
|
||||
m_penetration_depth = other.m_penetration_depth;
|
||||
m_separating_normal = other.m_separating_normal;
|
||||
@@ -54,11 +54,11 @@ struct BT_TRIANGLE_CONTACT
|
||||
}
|
||||
}
|
||||
|
||||
BT_TRIANGLE_CONTACT()
|
||||
GIM_TRIANGLE_CONTACT()
|
||||
{
|
||||
}
|
||||
|
||||
BT_TRIANGLE_CONTACT(const BT_TRIANGLE_CONTACT& other)
|
||||
GIM_TRIANGLE_CONTACT(const GIM_TRIANGLE_CONTACT& other)
|
||||
{
|
||||
copy_from(other);
|
||||
}
|
||||
@@ -123,7 +123,7 @@ public:
|
||||
/*!
|
||||
\pre this triangle and other must have their triangles calculated
|
||||
*/
|
||||
bool find_triangle_collision_clip_method(btPrimitiveTriangle & other, BT_TRIANGLE_CONTACT & contacts);
|
||||
bool find_triangle_collision_clip_method(btPrimitiveTriangle & other, GIM_TRIANGLE_CONTACT & contacts);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -34,11 +34,6 @@ email: projectileman@yahoo.com
|
||||
|
||||
#include "gim_memory.h"
|
||||
|
||||
/*! \addtogroup CONTAINERS
|
||||
\brief
|
||||
Abstract class for template containers
|
||||
*/
|
||||
//! @{
|
||||
|
||||
#define GIM_ARRAY_GROW_INCREMENT 2
|
||||
#define GIM_ARRAY_GROW_FACTOR 2
|
||||
@@ -321,11 +316,10 @@ public:
|
||||
{
|
||||
resizeData(m_size);
|
||||
}
|
||||
//!@}
|
||||
|
||||
};
|
||||
|
||||
|
||||
//! @}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -40,9 +40,6 @@ email: projectileman@yahoo.com
|
||||
|
||||
|
||||
|
||||
/*! \defgroup GEOMETRIC_OPERATIONS
|
||||
*/
|
||||
//! @{
|
||||
|
||||
|
||||
#define PLANEDIREPSILON 0.0000001f
|
||||
@@ -541,7 +538,6 @@ SIMD_FORCE_INLINE void SORT_3_INDICES(
|
||||
|
||||
|
||||
|
||||
//! @}
|
||||
|
||||
|
||||
#endif // GIM_VECTOR_H_INCLUDED
|
||||
|
||||
@@ -34,11 +34,6 @@ email: projectileman@yahoo.com
|
||||
|
||||
#include "gim_array.h"
|
||||
|
||||
/*! \addtogroup CONTAINERS
|
||||
\brief
|
||||
Abstract class for template containers
|
||||
*/
|
||||
//! @{
|
||||
|
||||
#define GUINT_BIT_COUNT 32
|
||||
#define GUINT_EXPONENT 5
|
||||
@@ -122,7 +117,6 @@ public:
|
||||
};
|
||||
|
||||
|
||||
//! @}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -35,9 +35,6 @@ email: projectileman@yahoo.com
|
||||
#include "gim_basic_geometry_operations.h"
|
||||
#include "LinearMath/btTransform.h"
|
||||
|
||||
/*! \defgroup BOUND_AABB_OPERATIONS
|
||||
*/
|
||||
//! @{
|
||||
|
||||
|
||||
//SIMD_FORCE_INLINE bool test_cross_edge_box(
|
||||
@@ -589,6 +586,5 @@ SIMD_FORCE_INLINE bool btCompareTransformsEqual(const btTransform & t1,const btT
|
||||
}
|
||||
|
||||
|
||||
//! @}
|
||||
|
||||
#endif // GIM_BOX_COLLISION_H_INCLUDED
|
||||
|
||||
@@ -40,12 +40,6 @@ email: projectileman@yahoo.com
|
||||
#include "gim_tri_collision.h"
|
||||
|
||||
|
||||
/*! \defgroup BOX_PRUNNING
|
||||
|
||||
|
||||
|
||||
*/
|
||||
//! @{
|
||||
|
||||
//! Overlapping pair
|
||||
struct GIM_PAIR
|
||||
@@ -446,7 +440,6 @@ public:
|
||||
m_primitive_manager.get_primitive_triangle(getNodeData(nodeindex),triangle);
|
||||
}
|
||||
|
||||
//! @}
|
||||
};
|
||||
|
||||
//! Class for Box Tree Sets
|
||||
|
||||
@@ -33,9 +33,6 @@ email: projectileman@yahoo.com
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*! \addtogroup GEOMETRIC_OPERATIONS
|
||||
*/
|
||||
//! @{
|
||||
|
||||
//! This function calcs the distance from a 3D plane
|
||||
class DISTANCE_PLANE_3D_FUNC
|
||||
@@ -209,6 +206,5 @@ SIMD_FORCE_INLINE GUINT PLANE_CLIP_TRIANGLE3D(
|
||||
}
|
||||
|
||||
|
||||
//! @}
|
||||
|
||||
#endif // GIM_TRI_COLLISION_H_INCLUDED
|
||||
|
||||
@@ -36,17 +36,6 @@ email: projectileman@yahoo.com
|
||||
#include "gim_radixsort.h"
|
||||
#include "gim_array.h"
|
||||
|
||||
/*! \defgroup CONTACTS
|
||||
\brief
|
||||
Functions for managing and sorting contacts resulting from a collision query.
|
||||
<ul>
|
||||
<li> Contact lists must be create by calling \ref GIM_CREATE_CONTACT_LIST
|
||||
<li> After querys, contact lists must be destroy by calling \ref GIM_DYNARRAY_DESTROY
|
||||
<li> Contacts can be merge for avoid duplicate results by calling \ref gim_merge_contacts
|
||||
</ul>
|
||||
|
||||
*/
|
||||
//! @{
|
||||
|
||||
/**
|
||||
Configuration var for applying interpolation of contact normals
|
||||
@@ -55,6 +44,10 @@ Configuration var for applying interpolation of contact normals
|
||||
#define CONTACT_DIFF_EPSILON 0.00001f
|
||||
|
||||
/// Structure for collision results
|
||||
///Functions for managing and sorting contacts resulting from a collision query.
|
||||
///Contact lists must be create by calling \ref GIM_CREATE_CONTACT_LIST
|
||||
///After querys, contact lists must be destroy by calling \ref GIM_DYNARRAY_DESTROY
|
||||
///Contacts can be merge for avoid duplicate results by calling \ref gim_merge_contacts
|
||||
class GIM_CONTACT
|
||||
{
|
||||
public:
|
||||
@@ -168,5 +161,4 @@ public:
|
||||
void merge_contacts_unique(const gim_contact_array & contacts);
|
||||
};
|
||||
|
||||
//! @}
|
||||
#endif // GIM_CONTACT_H_INCLUDED
|
||||
|
||||
@@ -36,11 +36,7 @@ email: projectileman@yahoo.com
|
||||
|
||||
#include "gim_math.h"
|
||||
|
||||
/*! \defgroup GEOMETRIC_TYPES
|
||||
\brief
|
||||
Basic types and constants for geometry
|
||||
*/
|
||||
//! @{
|
||||
|
||||
|
||||
//! Short Integer vector 2D
|
||||
typedef GSHORT vec2s[2];
|
||||
@@ -95,7 +91,6 @@ typedef GREAL mat4f[4][4];
|
||||
typedef GREAL quatf[4];
|
||||
|
||||
//typedef struct _aabb3f aabb3f;
|
||||
//! @}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -34,11 +34,6 @@ email: projectileman@yahoo.com
|
||||
|
||||
#include "gim_radixsort.h"
|
||||
|
||||
/*! \addtogroup CONTAINERS
|
||||
\brief
|
||||
Abstract class for collision objects
|
||||
*/
|
||||
//! @{
|
||||
|
||||
#define GIM_INVALID_HASH 0xffffffff //!< A very very high value
|
||||
#define GIM_DEFAULT_HASH_TABLE_SIZE 380
|
||||
@@ -204,12 +199,7 @@ protected:
|
||||
//SuperBufferedArray< _node_type > m_nodes;
|
||||
bool m_sorted;
|
||||
|
||||
/*! \defgroup HASH_TABLE_STRUCTURES
|
||||
\brief
|
||||
Hash table data management. The hash table has the indices to the corresponding m_nodes array
|
||||
*/
|
||||
//! @{
|
||||
|
||||
///Hash table data management. The hash table has the indices to the corresponding m_nodes array
|
||||
GUINT * m_hash_table;//!<
|
||||
GUINT m_table_size;//!<
|
||||
GUINT m_node_size;//!<
|
||||
@@ -459,13 +449,8 @@ protected:
|
||||
|
||||
}
|
||||
|
||||
//! @}
|
||||
|
||||
/*! \defgroup SORTED_ARRAY_STRUCTURES
|
||||
\brief
|
||||
Sorted array data management. The hash table has the indices to the corresponding m_nodes array
|
||||
*/
|
||||
//! @{
|
||||
|
||||
///Sorted array data management. The hash table has the indices to the corresponding m_nodes array
|
||||
inline bool _erase_sorted(GUINT index)
|
||||
{
|
||||
if(index>=(GUINT)m_nodes.size()) return false;
|
||||
@@ -575,8 +560,7 @@ protected:
|
||||
return GIM_INVALID_HASH;
|
||||
}
|
||||
|
||||
//! @}
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@@ -913,8 +897,6 @@ public:
|
||||
|
||||
};
|
||||
|
||||
//! @}
|
||||
|
||||
|
||||
|
||||
#endif // GIM_CONTAINERS_H_INCLUDED
|
||||
|
||||
@@ -40,11 +40,6 @@ email: projectileman@yahoo.com
|
||||
|
||||
|
||||
|
||||
/*! \defgroup VECTOR_OPERATIONS
|
||||
T
|
||||
Operations for vectors : vec2f,vec3f and vec4f
|
||||
*/
|
||||
//! @{
|
||||
|
||||
//! Zero out a 2D vector
|
||||
#define VEC_ZERO_2(a) \
|
||||
@@ -446,13 +441,8 @@ Takes two vectors a, b, blends them together with s <=1 */
|
||||
|
||||
|
||||
|
||||
//! @}
|
||||
|
||||
|
||||
/*! \defgroup MATRIX_OPERATIONS
|
||||
Operations for matrices : mat2f, mat3f and mat4f
|
||||
*/
|
||||
//! @{
|
||||
|
||||
/// initialize matrix
|
||||
#define IDENTIFY_MATRIX_3X3(m) \
|
||||
@@ -1579,6 +1569,5 @@ and m is a mat4f<br>
|
||||
}\
|
||||
|
||||
|
||||
//! @}
|
||||
|
||||
#endif // GIM_VECTOR_H_INCLUDED
|
||||
|
||||
@@ -35,13 +35,6 @@ email: projectileman@yahoo.com
|
||||
#include "LinearMath/btScalar.h"
|
||||
|
||||
|
||||
/*! \defgroup BASIC_TYPES
|
||||
Basic types and constants
|
||||
Conventions:
|
||||
Types starting with G
|
||||
Constants starting with G_
|
||||
*/
|
||||
//! @{
|
||||
|
||||
#define GREAL btScalar
|
||||
#define GREAL2 double
|
||||
@@ -52,15 +45,7 @@ Constants starting with G_
|
||||
#define GINT64 long long
|
||||
#define GUINT64 unsigned long long
|
||||
|
||||
//! @}
|
||||
|
||||
/*! \defgroup BASIC_CONSTANTS
|
||||
Basic constants
|
||||
Conventions:
|
||||
Types starting with G
|
||||
Constants starting with G_
|
||||
*/
|
||||
//! @{
|
||||
|
||||
#define G_PI 3.14159265358979f
|
||||
#define G_HALF_PI 1.5707963f
|
||||
@@ -73,14 +58,9 @@ Constants starting with G_
|
||||
#define G_REAL_INFINITY FLT_MAX
|
||||
#define G_SIGN_BITMASK 0x80000000
|
||||
#define G_EPSILON SIMD_EPSILON
|
||||
//! @}
|
||||
|
||||
|
||||
/*! \defgroup SCALAR_TYPES
|
||||
\brief
|
||||
Precision type constants
|
||||
*/
|
||||
//! @{
|
||||
|
||||
enum GIM_SCALAR_TYPES
|
||||
{
|
||||
G_STYPE_REAL =0,
|
||||
@@ -92,12 +72,8 @@ enum GIM_SCALAR_TYPES
|
||||
G_STYPE_INT64,
|
||||
G_STYPE_UINT64
|
||||
};
|
||||
//! @}
|
||||
|
||||
/*! \defgroup MATH_FUNCTIONS
|
||||
mathematical functions
|
||||
*/
|
||||
//! @{
|
||||
|
||||
|
||||
#define G_DEGTORAD(X) ((X)*3.1415926f/180.0f)
|
||||
#define G_RADTODEG(X) ((X)*180.0f/3.1415926f)
|
||||
@@ -176,6 +152,6 @@ inline GREAL gim_sqrt(GREAL f)
|
||||
return r;
|
||||
}
|
||||
|
||||
//! @}
|
||||
|
||||
|
||||
#endif // GIM_MATH_H_INCLUDED
|
||||
|
||||
@@ -36,9 +36,6 @@ email: projectileman@yahoo.com
|
||||
#include "gim_math.h"
|
||||
#include <memory.h>
|
||||
|
||||
//#define PREFETCH 1
|
||||
//! \defgroup PREFETCH
|
||||
//! @{
|
||||
#ifdef PREFETCH
|
||||
#include <xmmintrin.h> // for prefetch
|
||||
#define pfval 64
|
||||
@@ -53,13 +50,9 @@ email: projectileman@yahoo.com
|
||||
//! Prefetch 128
|
||||
#define pf2(_x,_i)
|
||||
#endif
|
||||
//! @}
|
||||
|
||||
/*! \defgroup ARRAY_UTILITIES
|
||||
\brief
|
||||
Functions for manip packed arrays of numbers
|
||||
*/
|
||||
//! @{
|
||||
|
||||
///Functions for manip packed arrays of numbers
|
||||
#define GIM_COPY_ARRAYS(dest_array,source_array,element_count)\
|
||||
{\
|
||||
for (GUINT _i_=0;_i_<element_count ;++_i_)\
|
||||
@@ -92,50 +85,36 @@ Functions for manip packed arrays of numbers
|
||||
array[_i_] = constant;\
|
||||
}\
|
||||
}\
|
||||
//! @}
|
||||
|
||||
/*! \defgroup MEMORY_FUNCTION_PROTOTYPES
|
||||
Function prototypes to allocate and free memory.
|
||||
*/
|
||||
//! @{
|
||||
|
||||
///Function prototypes to allocate and free memory.
|
||||
typedef void * gim_alloc_function (size_t size);
|
||||
typedef void * gim_alloca_function (size_t size);//Allocs on the heap
|
||||
typedef void * gim_realloc_function (void *ptr, size_t oldsize, size_t newsize);
|
||||
typedef void gim_free_function (void *ptr);
|
||||
//! @}
|
||||
|
||||
/*! \defgroup MEMORY_FUNCTION_HANDLERS
|
||||
\brief
|
||||
Memory Function Handlers
|
||||
set new memory management functions. if fn is 0, the default handlers are
|
||||
used. */
|
||||
//! @{
|
||||
|
||||
///Memory Function Handlers
|
||||
///set new memory management functions. if fn is 0, the default handlers are used.
|
||||
void gim_set_alloc_handler (gim_alloc_function *fn);
|
||||
void gim_set_alloca_handler (gim_alloca_function *fn);
|
||||
void gim_set_realloc_handler (gim_realloc_function *fn);
|
||||
void gim_set_free_handler (gim_free_function *fn);
|
||||
//! @}
|
||||
|
||||
/*! \defgroup MEMORY_FUNCTION_GET_HANDLERS
|
||||
\brief
|
||||
get current memory management functions.
|
||||
*/
|
||||
//! @{
|
||||
|
||||
///get current memory management functions.
|
||||
gim_alloc_function *gim_get_alloc_handler (void);
|
||||
gim_alloca_function *gim_get_alloca_handler(void);
|
||||
gim_realloc_function *gim_get_realloc_handler (void);
|
||||
gim_free_function *gim_get_free_handler (void);
|
||||
//! @}
|
||||
|
||||
/*! \defgroup MEMORY_FUNCTIONS
|
||||
Standar Memory functions
|
||||
*/
|
||||
//! @{
|
||||
|
||||
///Standar Memory functions
|
||||
void * gim_alloc(size_t size);
|
||||
void * gim_alloca(size_t size);
|
||||
void * gim_realloc(void *ptr, size_t oldsize, size_t newsize);
|
||||
void gim_free(void *ptr);
|
||||
//! @}
|
||||
|
||||
|
||||
|
||||
#if defined (WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__)
|
||||
|
||||
@@ -36,11 +36,7 @@ email: projectileman@yahoo.com
|
||||
|
||||
#include "gim_memory.h"
|
||||
|
||||
/*! \defgroup SORTING
|
||||
\brief
|
||||
Macros for sorting.
|
||||
*/
|
||||
|
||||
///Macros for sorting.
|
||||
//! Prototype for comparators
|
||||
class less_comparator
|
||||
{
|
||||
@@ -406,5 +402,5 @@ void gim_heap_sort(T *pArr, GUINT element_count, COMP_CLASS CompareFunc)
|
||||
|
||||
|
||||
|
||||
//! @}
|
||||
|
||||
#endif // GIM_RADIXSORT_H_INCLUDED
|
||||
|
||||
@@ -38,7 +38,7 @@ email: projectileman@yahoo.com
|
||||
#define MIN_EDGE_EDGE_DIS 0.00001f
|
||||
|
||||
|
||||
class _GIM_TRIANGLE_CALCULATION_CACHE
|
||||
class GIM_TRIANGLE_CALCULATION_CACHE
|
||||
{
|
||||
public:
|
||||
GREAL margin;
|
||||
@@ -489,7 +489,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
/*class _GIM_TRIANGLE_CALCULATION_CACHE
|
||||
/*class GIM_TRIANGLE_CALCULATION_CACHE
|
||||
{
|
||||
public:
|
||||
GREAL margin;
|
||||
@@ -627,7 +627,7 @@ bool GIM_TRIANGLE::collide_triangle_hard_test(
|
||||
const GIM_TRIANGLE & other,
|
||||
GIM_TRIANGLE_CONTACT_DATA & contact_data) const
|
||||
{
|
||||
_GIM_TRIANGLE_CALCULATION_CACHE calc_cache;
|
||||
GIM_TRIANGLE_CALCULATION_CACHE calc_cache;
|
||||
return calc_cache.triangle_collision(
|
||||
m_vertices[0],m_vertices[1],m_vertices[2],m_margin,
|
||||
other.m_vertices[0],other.m_vertices[1],other.m_vertices[2],other.m_margin,
|
||||
|
||||
@@ -36,9 +36,6 @@ email: projectileman@yahoo.com
|
||||
#include "gim_box_collision.h"
|
||||
#include "gim_clip_polygon.h"
|
||||
|
||||
/*! \addtogroup GEOMETRIC_OPERATIONS
|
||||
*/
|
||||
//! @{
|
||||
|
||||
|
||||
|
||||
@@ -378,6 +375,5 @@ if 0.0<= u+v <=1.0 then they are inside of triangle
|
||||
|
||||
|
||||
|
||||
//! @}
|
||||
|
||||
#endif // GIM_TRI_COLLISION_H_INCLUDED
|
||||
|
||||
Reference in New Issue
Block a user