From b5cfdf86e343a08d92b9edff716b92860ad5701e Mon Sep 17 00:00:00 2001 From: JulioJerez Date: Tue, 10 Sep 2024 08:56:38 -0700 Subject: [PATCH] some linux compiler errors. --- newton-4.00/sdk/dCollision/ndShapeCylinder.h | 2 +- newton-4.00/sdk/dCollision/ndShapeNull.cpp | 80 +++++++++++++ newton-4.00/sdk/dCollision/ndShapeNull.h | 116 +++---------------- newton-4.00/sdk/dCore/ndUtils.h | 2 +- 4 files changed, 100 insertions(+), 100 deletions(-) diff --git a/newton-4.00/sdk/dCollision/ndShapeCylinder.h b/newton-4.00/sdk/dCollision/ndShapeCylinder.h index d664e089f8..9133741cc7 100644 --- a/newton-4.00/sdk/dCollision/ndShapeCylinder.h +++ b/newton-4.00/sdk/dCollision/ndShapeCylinder.h @@ -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); diff --git a/newton-4.00/sdk/dCollision/ndShapeNull.cpp b/newton-4.00/sdk/dCollision/ndShapeNull.cpp index 2b643999e7..81e2b79ad4 100644 --- a/newton-4.00/sdk/dCollision/ndShapeNull.cpp +++ b/newton-4.00/sdk/dCollision/ndShapeNull.cpp @@ -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; +} diff --git a/newton-4.00/sdk/dCollision/ndShapeNull.h b/newton-4.00/sdk/dCollision/ndShapeNull.h index b6305b8253..577e6c193c 100644 --- a/newton-4.00/sdk/dCollision/ndShapeNull.h +++ b/newton-4.00/sdk/dCollision/ndShapeNull.h @@ -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 diff --git a/newton-4.00/sdk/dCore/ndUtils.h b/newton-4.00/sdk/dCore/ndUtils.h index cd0399fff1..53738e6929 100644 --- a/newton-4.00/sdk/dCore/ndUtils.h +++ b/newton-4.00/sdk/dCore/ndUtils.h @@ -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)