mirror of
https://github.com/mangosfour/server.git
synced 2025-12-19 22:37:05 +00:00
[10097] Update G3D up to v8.0b4
+ Got rid of zip lib requirement in G3D...
Still can re-enable code by defining _HAVE_ZIP...
+ Remove silly X11 lib dependency from G3D
Code doesn't seem to do anything yet anyway, and even if, we don't want it :p
+ Fix another weird G3D build problem...
+ Remove some __asm usage in g3d, which is not available on Win64
My editor also decided to remove a ton of trailing white spaces...tss...
+ Reapply G3D fixes for 64bit VC
+ not use SSE specific header when SSE not enabled in *nix
+ Updated project files
+ New vmap_assembler VC90/VC80 Project
+ vmap assembler binaries updates
NOTE: Old vmap fikes expected work (as tests show) with new library version.
But better use new generated versions. Its different in small parts to bad or good...
(based on Lynx3d's repo commit 44798d3)
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
2f3c518935
commit
ae3ad10bcf
235 changed files with 58189 additions and 4547 deletions
|
|
@ -102,7 +102,7 @@ namespace G3D {
|
|||
inline Indirector() : handle(NULL) {}
|
||||
|
||||
/** Returns true iff the values referenced by the handles are equivalent. */
|
||||
inline bool operator==(const Indirector& m) {
|
||||
inline bool operator==(const Indirector& m) const {
|
||||
return *handle == *(m.handle);
|
||||
}
|
||||
|
||||
|
|
@ -117,10 +117,13 @@ namespace G3D {
|
|||
} // namespace internal
|
||||
} // namespace G3D
|
||||
|
||||
template <class Handle>
|
||||
/* template <class Handle>
|
||||
struct GHashCode< G3D::_internal::Indirector<Handle> >
|
||||
{
|
||||
size_t operator()(const G3D::_internal::Indirector<Handle>& key) const { return key.hashCode(); }
|
||||
}; */
|
||||
template <class Handle> struct HashTrait<typename G3D::_internal::Indirector<Handle> > {
|
||||
static size_t hashCode(const G3D::_internal::Indirector<Handle>& key) { return key.hashCode(); }
|
||||
};
|
||||
|
||||
namespace G3D {
|
||||
|
|
@ -330,7 +333,6 @@ public:
|
|||
|
||||
inline int operator()(_AABSPTree::Handle<T>* /*ignore*/, const _AABSPTree::Handle<T>* handle) const {
|
||||
const AABox& box = handle->bounds;
|
||||
debugAssert(ignore == NULL);
|
||||
|
||||
if (box.high()[sortAxis] < sortLocation) {
|
||||
// Box is strictly below the sort location
|
||||
|
|
@ -606,10 +608,10 @@ public:
|
|||
bool alreadyInsideBounds = false;
|
||||
bool rayWillHitBounds =
|
||||
VMAP::MyCollisionDetection::collisionLocationForMovingPointFixedAABox(
|
||||
ray.origin, ray.direction, splitBounds, location, alreadyInsideBounds);
|
||||
ray.origin(), ray.direction(), splitBounds, location, alreadyInsideBounds);
|
||||
|
||||
bool canHitThisNode = (alreadyInsideBounds ||
|
||||
(rayWillHitBounds && ((location - ray.origin).squaredLength() < square(distance))));
|
||||
(rayWillHitBounds && ((location - ray.origin()).squaredLength() < square(distance))));
|
||||
|
||||
return canHitThisNode;
|
||||
}
|
||||
|
|
@ -639,10 +641,10 @@ public:
|
|||
bool alreadyInsideBounds = false;
|
||||
bool rayWillHitBounds =
|
||||
VMAP::MyCollisionDetection::collisionLocationForMovingPointFixedAABox(
|
||||
ray.origin, ray.direction, bounds, location, alreadyInsideBounds);
|
||||
ray.origin(), ray.direction(), bounds, location, alreadyInsideBounds);
|
||||
|
||||
canHitThisObject = (alreadyInsideBounds ||
|
||||
(rayWillHitBounds && ((location - ray.origin).squaredLength() < square(distance))));
|
||||
(rayWillHitBounds && ((location - ray.origin()).squaredLength() < square(distance))));
|
||||
}
|
||||
|
||||
if (canHitThisObject) {
|
||||
|
|
@ -665,30 +667,30 @@ public:
|
|||
int firstChild = NONE;
|
||||
int secondChild = NONE;
|
||||
|
||||
if (ray.origin[splitAxis] < splitLocation) {
|
||||
if (ray.origin()[splitAxis] < splitLocation) {
|
||||
|
||||
// The ray starts on the small side
|
||||
firstChild = 0;
|
||||
|
||||
if (ray.direction[splitAxis] > 0) {
|
||||
if (ray.direction()[splitAxis] > 0) {
|
||||
// The ray will eventually reach the other side
|
||||
secondChild = 1;
|
||||
}
|
||||
|
||||
} else if (ray.origin[splitAxis] > splitLocation) {
|
||||
} else if (ray.origin()[splitAxis] > splitLocation) {
|
||||
|
||||
// The ray starts on the large side
|
||||
firstChild = 1;
|
||||
|
||||
if (ray.direction[splitAxis] < 0) {
|
||||
if (ray.direction()[splitAxis] < 0) {
|
||||
secondChild = 0;
|
||||
}
|
||||
} else {
|
||||
// The ray starts on the splitting plane
|
||||
if (ray.direction[splitAxis] < 0) {
|
||||
if (ray.direction()[splitAxis] < 0) {
|
||||
// ...and goes to the small side
|
||||
firstChild = 0;
|
||||
} else if (ray.direction[splitAxis] > 0) {
|
||||
} else if (ray.direction()[splitAxis] > 0) {
|
||||
// ...and goes to the large side
|
||||
firstChild = 1;
|
||||
}
|
||||
|
|
@ -701,10 +703,10 @@ public:
|
|||
return;
|
||||
}
|
||||
|
||||
if (ray.direction[splitAxis] != 0) {
|
||||
if (ray.direction()[splitAxis] != 0) {
|
||||
// See if there was an intersection before hitting the splitting plane.
|
||||
// If so, there is no need to look on the far side and recursion terminates.
|
||||
float distanceToSplittingPlane = (splitLocation - ray.origin[splitAxis]) / ray.direction[splitAxis];
|
||||
float distanceToSplittingPlane = (splitLocation - ray.origin()[splitAxis]) / ray.direction()[splitAxis];
|
||||
if (distanceToSplittingPlane > distance) {
|
||||
// We aren't going to hit anything else before hitting the splitting plane,
|
||||
// so don't bother looking on the far side of the splitting plane at the other
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ namespace VMAP
|
|||
bool isInside = false;
|
||||
|
||||
float d = MyCollisionDetection::collisionLocationForMovingPointFixedAABox(
|
||||
pRay.origin, pRay.direction,
|
||||
pRay.origin(), pRay.direction(),
|
||||
pBox,
|
||||
pOutLocation, isInside);
|
||||
if (!isInside && ((d > 0) && (d < pMaxDist)))
|
||||
|
|
@ -84,10 +84,10 @@ namespace VMAP
|
|||
bool alreadyInsideBounds = false;
|
||||
bool rayWillHitBounds =
|
||||
MyCollisionDetection::collisionLocationForMovingPointFixedAABox(
|
||||
pRay.origin, pRay.direction, pBox, location, alreadyInsideBounds);
|
||||
pRay.origin(), pRay.direction(), pBox, location, alreadyInsideBounds);
|
||||
|
||||
bool canHitThisNode = (alreadyInsideBounds ||
|
||||
(rayWillHitBounds && ((location - pRay.origin).squaredLength() < (pMaxDist * pMaxDist))));
|
||||
(rayWillHitBounds && ((location - pRay.origin()).squaredLength() < (pMaxDist * pMaxDist))));
|
||||
|
||||
return canHitThisNode;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -337,7 +337,7 @@ namespace VMAP
|
|||
{
|
||||
IntersectionCallBack<SubModel> intersectCallback;
|
||||
NodeValueAccess<TreeNode, SubModel> vna = NodeValueAccess<TreeNode, SubModel>(getTreeNodes(), iSubModel);
|
||||
Ray relativeRay = Ray::fromOriginAndDirection(pRay.origin - getBasePosition(), pRay.direction);
|
||||
Ray relativeRay = Ray::fromOriginAndDirection(pRay.origin() - getBasePosition(), pRay.direction());
|
||||
iTreeNodes[0].intersectRay(pRay, intersectCallback, pMaxDist, vna, pStopAtFirstHit, false);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ namespace VMAP
|
|||
{
|
||||
NodeValueAccess<TreeNode, TriangleBox> vna = NodeValueAccess<TreeNode, TriangleBox>(getTreeNodes(), getTriangles());
|
||||
IntersectionCallBack<TriangleBox> intersectCallback;
|
||||
Ray relativeRay = Ray::fromOriginAndDirection(pRay.origin - getBasePosition(), pRay.direction);
|
||||
Ray relativeRay = Ray::fromOriginAndDirection(pRay.origin() - getBasePosition(), pRay.direction());
|
||||
#ifdef _DEBUG_VMAPS
|
||||
//p6=getBasePosition();
|
||||
//gBoxArray.push_back(getAABoxBounds());
|
||||
|
|
|
|||
|
|
@ -109,10 +109,10 @@ namespace VMAP
|
|||
bool alreadyInsideBounds = false;
|
||||
bool rayWillHitBounds =
|
||||
MyCollisionDetection::collisionLocationForMovingPointFixedAABox(
|
||||
ray.origin, ray.direction, iBounds, location, alreadyInsideBounds);
|
||||
ray.origin(), ray.direction(), iBounds, location, alreadyInsideBounds);
|
||||
|
||||
bool canHitThisNode = (alreadyInsideBounds ||
|
||||
(rayWillHitBounds && ((location - ray.origin).squaredLength() < (distance*distance))));
|
||||
(rayWillHitBounds && ((location - ray.origin()).squaredLength() < (distance*distance))));
|
||||
|
||||
return canHitThisNode;
|
||||
}
|
||||
|
|
@ -142,10 +142,10 @@ namespace VMAP
|
|||
bool alreadyInsideBounds = false;
|
||||
bool rayWillHitBounds =
|
||||
MyCollisionDetection::collisionLocationForMovingPointFixedAABox(
|
||||
ray.origin, ray.direction, bounds, location, alreadyInsideBounds);
|
||||
ray.origin(), ray.direction(), bounds, location, alreadyInsideBounds);
|
||||
|
||||
canHitThisObject = (alreadyInsideBounds ||
|
||||
(rayWillHitBounds && ((location - ray.origin).squaredLength() < (distance*distance))));
|
||||
(rayWillHitBounds && ((location - ray.origin()).squaredLength() < (distance*distance))));
|
||||
}
|
||||
|
||||
if (canHitThisObject) {
|
||||
|
|
@ -167,30 +167,30 @@ namespace VMAP
|
|||
int firstChild = NONE;
|
||||
int secondChild = NONE;
|
||||
|
||||
if (ray.origin[iSplitAxis] < iSplitLocation) {
|
||||
if (ray.origin()[iSplitAxis] < iSplitLocation) {
|
||||
|
||||
// The ray starts on the small side
|
||||
firstChild = 0;
|
||||
|
||||
if (ray.direction[iSplitAxis] > 0) {
|
||||
if (ray.direction()[iSplitAxis] > 0) {
|
||||
// The ray will eventually reach the other side
|
||||
secondChild = 1;
|
||||
}
|
||||
|
||||
} else if (ray.origin[iSplitAxis] > iSplitLocation) {
|
||||
} else if (ray.origin()[iSplitAxis] > iSplitLocation) {
|
||||
|
||||
// The ray starts on the large side
|
||||
firstChild = 1;
|
||||
|
||||
if (ray.direction[iSplitAxis] < 0) {
|
||||
if (ray.direction()[iSplitAxis] < 0) {
|
||||
secondChild = 0;
|
||||
}
|
||||
} else {
|
||||
// The ray starts on the splitting plane
|
||||
if (ray.direction[iSplitAxis] < 0) {
|
||||
if (ray.direction()[iSplitAxis] < 0) {
|
||||
// ...and goes to the small side
|
||||
firstChild = 0;
|
||||
} else if (ray.direction[iSplitAxis] > 0) {
|
||||
} else if (ray.direction()[iSplitAxis] > 0) {
|
||||
// ...and goes to the large side
|
||||
firstChild = 1;
|
||||
}
|
||||
|
|
@ -202,10 +202,10 @@ namespace VMAP
|
|||
if(pStopAtFirstHit && distance < enterDistance)
|
||||
return;
|
||||
}
|
||||
if (ray.direction[iSplitAxis] != 0) {
|
||||
if (ray.direction()[iSplitAxis] != 0) {
|
||||
// See if there was an intersection before hitting the splitting plane.
|
||||
// If so, there is no need to look on the far side and recursion terminates.
|
||||
float distanceToSplittingPlane = (iSplitLocation - ray.origin[iSplitAxis]) / ray.direction[iSplitAxis];
|
||||
float distanceToSplittingPlane = (iSplitLocation - ray.origin()[iSplitAxis]) / ray.direction()[iSplitAxis];
|
||||
if (distanceToSplittingPlane > distance) {
|
||||
// We aren't going to hit anything else before hitting the splitting plane,
|
||||
// so don't bother looking on the far side of the splitting plane at the other
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue