Skip to content

Commit

Permalink
some linux compiler errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
JulioJerez committed Sep 10, 2024
1 parent ca9b45c commit b5cfdf8
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 100 deletions.
2 changes: 1 addition & 1 deletion newton-4.00/sdk/dCollision/ndShapeCylinder.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ndShapeCylinder : public ndShapeConvex
D_COLLISION_API ndShapeCylinder(ndFloat32 radio0, ndFloat32 radio1, ndFloat32 height);
D_COLLISION_API ~ndShapeCylinder();

virtual ndShapeCylinder* GetAsShapeCylinder() { return this; }
D_COLLISION_API virtual ndShapeCylinder* GetAsShapeCylinder() { return this; }

protected:
D_COLLISION_API void Init (ndFloat32 radio0, ndFloat32 radio1, ndFloat32 height);
Expand Down
80 changes: 80 additions & 0 deletions newton-4.00/sdk/dCollision/ndShapeNull.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,84 @@
#include "ndCollisionStdafx.h"
#include "ndShapeNull.h"

ndShapeNull::ndShapeNull()
:ndShape(m_nullCollision)
{
m_inertia = ndVector::m_one | ndVector::m_triplexMask;
}

ndShapeNull::~ndShapeNull()
{
}

ndShapeNull* ndShapeNull::GetAsShapeNull()
{
return this;
}

ndVector ndShapeNull::SupportVertex(const ndVector&) const
{
return ndVector::m_zero;
}

ndVector ndShapeNull::SupportVertexSpecial(const ndVector&, ndFloat32) const
{
return ndVector::m_zero;
}

ndFloat32 ndShapeNull::RayCast(ndRayCastNotify&, const ndVector&, const ndVector&, ndFloat32, const ndBody* const, ndContactPoint&) const
{
return ndFloat32(1.2f);
}

void ndShapeNull::DebugShape(const ndMatrix&, ndShapeDebugNotify&) const
{
}

void ndShapeNull::CalculateAabb(const ndMatrix&, ndVector& p0, ndVector& p1) const
{
p0 = ndVector::m_zero;
p1 = ndVector::m_zero;
}

ndShapeInfo ndShapeNull::GetShapeInfo() const
{
ndAssert(0);
ndShapeInfo info;
return info;
}

ndFloat32 ndShapeNull::GetVolume() const
{
return ndFloat32(0.0f);
}

ndFloat32 ndShapeNull::GetBoxMinRadius() const
{
return ndFloat32(0.0f);
}

ndFloat32 ndShapeNull::GetBoxMaxRadius() const
{
return ndFloat32(0.0f);
}

ndVector ndShapeNull::CalculateVolumeIntegral(const ndMatrix&, const ndVector&, const ndShapeInstance&) const
{
return ndVector::m_zero;
}

ndVector ndShapeNull::SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector&) const
{
return point;
}

ndInt32 ndShapeNull::CalculatePlaneIntersection(const ndVector&, const ndVector&, ndVector* const) const
{
return 0;
}

ndUnsigned64 ndShapeNull::GetHash(ndUnsigned64) const
{
return 12345678;
}
116 changes: 18 additions & 98 deletions newton-4.00/sdk/dCollision/ndShapeNull.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,106 +29,26 @@ class ndShapeNull : public ndShape
{
public:
D_CLASS_REFLECTION(ndShapeNull, ndShape)
ndShapeNull();
virtual ~ndShapeNull();

virtual ndShapeNull* GetAsShapeNull();

virtual ndFloat32 GetVolume() const;
virtual ndShapeInfo GetShapeInfo() const;
virtual ndFloat32 GetBoxMinRadius() const;
virtual ndFloat32 GetBoxMaxRadius() const;
virtual ndUnsigned64 GetHash(ndUnsigned64 hash) const;
virtual void CalculateAabb(const ndMatrix& matrix, ndVector& p0, ndVector& p1) const;
virtual ndVector SupportVertex(const ndVector& dir) const;
virtual void DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const;
virtual ndVector SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector& dir) const;
virtual ndVector SupportVertexSpecial(const ndVector& dir, ndFloat32 skinMargin) const;
virtual ndInt32 CalculatePlaneIntersection(const ndVector& normal, const ndVector& point, ndVector* const contactsOut) const;
virtual ndVector CalculateVolumeIntegral(const ndMatrix& globalMatrix, const ndVector& globalPlane, const ndShapeInstance& parentScale) const;
virtual ndFloat32 RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const;
D_COLLISION_API ndShapeNull();
D_COLLISION_API virtual ~ndShapeNull();

D_COLLISION_API virtual ndShapeNull* GetAsShapeNull();

D_COLLISION_API virtual ndFloat32 GetVolume() const;
D_COLLISION_API virtual ndShapeInfo GetShapeInfo() const;
D_COLLISION_API virtual ndFloat32 GetBoxMinRadius() const;
D_COLLISION_API virtual ndFloat32 GetBoxMaxRadius() const;
D_COLLISION_API virtual ndUnsigned64 GetHash(ndUnsigned64 hash) const;
D_COLLISION_API virtual void CalculateAabb(const ndMatrix& matrix, ndVector& p0, ndVector& p1) const;
D_COLLISION_API virtual ndVector SupportVertex(const ndVector& dir) const;
D_COLLISION_API virtual void DebugShape(const ndMatrix& matrix, ndShapeDebugNotify& debugCallback) const;
D_COLLISION_API virtual ndVector SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector& dir) const;
D_COLLISION_API virtual ndVector SupportVertexSpecial(const ndVector& dir, ndFloat32 skinMargin) const;
D_COLLISION_API virtual ndInt32 CalculatePlaneIntersection(const ndVector& normal, const ndVector& point, ndVector* const contactsOut) const;
D_COLLISION_API virtual ndVector CalculateVolumeIntegral(const ndMatrix& globalMatrix, const ndVector& globalPlane, const ndShapeInstance& parentScale) const;
D_COLLISION_API virtual ndFloat32 RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const;
};

inline ndShapeNull::ndShapeNull()
:ndShape(m_nullCollision)
{
m_inertia = ndVector::m_one | ndVector::m_triplexMask;
}

inline ndShapeNull::~ndShapeNull()
{
}

inline ndShapeNull* ndShapeNull::GetAsShapeNull()
{
return this;
}

inline ndVector ndShapeNull::SupportVertex(const ndVector&) const
{
return ndVector::m_zero;
}

inline ndVector ndShapeNull::SupportVertexSpecial(const ndVector&, ndFloat32) const
{
return ndVector::m_zero;
}

inline ndFloat32 ndShapeNull::RayCast(ndRayCastNotify&, const ndVector&, const ndVector&, ndFloat32, const ndBody* const, ndContactPoint&) const
{
return ndFloat32(1.2f);
}

inline void ndShapeNull::DebugShape(const ndMatrix&, ndShapeDebugNotify&) const
{
}

inline void ndShapeNull::CalculateAabb(const ndMatrix&, ndVector& p0, ndVector& p1) const
{
p0 = ndVector::m_zero;
p1 = ndVector::m_zero;
}

inline ndShapeInfo ndShapeNull::GetShapeInfo() const
{
ndAssert(0);
ndShapeInfo info;
return info;
}

inline ndFloat32 ndShapeNull::GetVolume() const
{
return ndFloat32(0.0f);
}

inline ndFloat32 ndShapeNull::GetBoxMinRadius() const
{
return ndFloat32(0.0f);
}

inline ndFloat32 ndShapeNull::GetBoxMaxRadius() const
{
return ndFloat32(0.0f);
}

inline ndVector ndShapeNull::CalculateVolumeIntegral(const ndMatrix&, const ndVector&, const ndShapeInstance&) const
{
return ndVector::m_zero;
}

inline ndVector ndShapeNull::SupportVertexSpecialProjectPoint(const ndVector& point, const ndVector&) const
{
return point;
}

inline ndInt32 ndShapeNull::CalculatePlaneIntersection(const ndVector&, const ndVector&, ndVector* const) const
{
return 0;
}

inline ndUnsigned64 ndShapeNull::GetHash(ndUnsigned64) const
{
return 12345678;
}
#endif

2 changes: 1 addition & 1 deletion newton-4.00/sdk/dCore/ndUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ inline void ndMemCpy(T* const dst, const T* const src, ndInt64 elements)
memcpy(dst, src, sizeof(T) * elements);
}


#ifndef _MSC_VER
#define _stricmp(x,y) strcasecmp(x,y)
#define strcpy_s(x,n,y) strncpy(x,y,n)
#endif

inline void strtolwr(char* const string)
Expand Down

0 comments on commit b5cfdf8

Please sign in to comment.