From 56c3f77377310f227187014da19ac79a64f92f52 Mon Sep 17 00:00:00 2001 From: TrevorCash Date: Sun, 23 Jan 2022 14:25:57 -0700 Subject: [PATCH 1/2] Make more methods virtual. Fixing linker errors. --- newton-4.00/sdk/dCollision/ndBody.h | 10 +++++----- newton-4.00/sdk/dCollision/ndBodyKinematic.h | 2 +- newton-4.00/sdk/dCollision/ndShapeBox.h | 6 +++--- .../dNewton/dJoints/ndJointBallAndSocket.h | 12 +++++------ .../sdk/dNewton/dJoints/ndJointHinge.h | 12 +++++------ .../dNewton/dJoints/ndJointHingeActuator.h | 20 +++++++++---------- .../sdk/dNewton/dJoints/ndJointSlider.h | 12 +++++------ 7 files changed, 37 insertions(+), 37 deletions(-) diff --git a/newton-4.00/sdk/dCollision/ndBody.h b/newton-4.00/sdk/dCollision/ndBody.h index 270d386cf6..a2c7f6f395 100644 --- a/newton-4.00/sdk/dCollision/ndBody.h +++ b/newton-4.00/sdk/dCollision/ndBody.h @@ -61,7 +61,7 @@ class ndBody : public ndContainersFreeListAlloc virtual bool RayCast(ndRayCastNotify& callback, const ndFastRay& ray, const ndFloat32 maxT) const = 0; const ndVector& GetCentreOfMass() const; - D_COLLISION_API void SetCentreOfMass(const ndVector& com); + D_COLLISION_API virtual void SetCentreOfMass(const ndVector& com); ndBodyNotify* GetNotifyCallback() const; @@ -73,10 +73,10 @@ class ndBody : public ndContainersFreeListAlloc ndQuaternion GetRotation() const; ndVector GetGlobalGetCentreOfMass() const; - D_COLLISION_API void SetNotifyCallback(ndBodyNotify* const notify); - D_COLLISION_API void SetOmega(const ndVector& veloc); - D_COLLISION_API void SetVelocity(const ndVector& veloc); - D_COLLISION_API void SetMatrix(const ndMatrix& matrix); + D_COLLISION_API virtual void SetNotifyCallback(ndBodyNotify* const notify); + D_COLLISION_API virtual void SetOmega(const ndVector& veloc); + D_COLLISION_API virtual void SetVelocity(const ndVector& veloc); + D_COLLISION_API virtual void SetMatrix(const ndMatrix& matrix); D_COLLISION_API virtual void Save(const ndLoadSaveBase::ndSaveDescriptor& desc) const; diff --git a/newton-4.00/sdk/dCollision/ndBodyKinematic.h b/newton-4.00/sdk/dCollision/ndBodyKinematic.h index 88f8b827a1..b926d38119 100644 --- a/newton-4.00/sdk/dCollision/ndBodyKinematic.h +++ b/newton-4.00/sdk/dCollision/ndBodyKinematic.h @@ -121,7 +121,7 @@ class ndBodyKinematic : public ndBody D_COLLISION_API virtual bool RayCast(ndRayCastNotify& callback, const ndFastRay& ray, const ndFloat32 maxT) const; D_COLLISION_API ndVector CalculateLinearMomentum() const; - D_COLLISION_API ndVector CalculateAngularMomentum() const; + D_COLLISION_API virtual ndVector CalculateAngularMomentum() const; D_COLLISION_API ndFloat32 TotalEnergy() const; D_COLLISION_API ndMatrix CalculateInertiaMatrix() const; diff --git a/newton-4.00/sdk/dCollision/ndShapeBox.h b/newton-4.00/sdk/dCollision/ndShapeBox.h index 2f10ffff79..3ead28ad6a 100644 --- a/newton-4.00/sdk/dCollision/ndShapeBox.h +++ b/newton-4.00/sdk/dCollision/ndShapeBox.h @@ -33,7 +33,7 @@ class ndShapeBox: public ndShapeConvex D_COLLISION_API ndShapeBox(ndFloat32 size_x, ndFloat32 size_y, ndFloat32 size_z); D_COLLISION_API virtual ~ndShapeBox(); - virtual ndShapeBox* GetAsShapeBox() { return this; } + D_COLLISION_API virtual ndShapeBox* GetAsShapeBox() { return this; } protected: D_COLLISION_API void Init (ndFloat32 size_x, ndFloat32 size_y, ndFloat32 size_z); @@ -46,8 +46,8 @@ class ndShapeBox: public ndShapeConvex D_COLLISION_API virtual ndVector SupportVertexSpecial(const ndVector& dir, ndFloat32 skinThickness, ndInt32* const vertexIndex) const; D_COLLISION_API virtual ndFloat32 RayCast(ndRayCastNotify& callback, const ndVector& localP0, const ndVector& localP1, ndFloat32 maxT, const ndBody* const body, ndContactPoint& contactOut) const; - const ndConvexSimplexEdge** GetVertexToEdgeMapping() const; - virtual ndInt32 CalculatePlaneIntersection(const ndVector& normal, const ndVector& point, ndVector* const contactsOut) const; + D_COLLISION_API const ndConvexSimplexEdge** GetVertexToEdgeMapping() const; + D_COLLISION_API virtual ndInt32 CalculatePlaneIntersection(const ndVector& normal, const ndVector& point, ndVector* const contactsOut) const; D_COLLISION_API virtual void Save(const ndLoadSaveBase::ndSaveDescriptor& desc) const; ndVector m_size[2]; diff --git a/newton-4.00/sdk/dNewton/dJoints/ndJointBallAndSocket.h b/newton-4.00/sdk/dNewton/dJoints/ndJointBallAndSocket.h index 883fc498e4..c7c33a1009 100644 --- a/newton-4.00/sdk/dNewton/dJoints/ndJointBallAndSocket.h +++ b/newton-4.00/sdk/dNewton/dJoints/ndJointBallAndSocket.h @@ -27,13 +27,13 @@ class ndJointBallAndSocket: public ndJointBilateralConstraint D_NEWTON_API ndJointBallAndSocket(const ndMatrix& pinAndPivotFrame, ndBodyKinematic* const child, ndBodyKinematic* const parent); D_NEWTON_API virtual ~ndJointBallAndSocket(); - D_NEWTON_API ndFloat32 GetMaxConeAngle() const; - D_NEWTON_API void SetConeLimit(ndFloat32 maxConeAngle); - D_NEWTON_API void SetConeFriction(ndFloat32 regularizer, ndFloat32 viscousFriction); + D_NEWTON_API virtual ndFloat32 GetMaxConeAngle() const; + D_NEWTON_API virtual void SetConeLimit(ndFloat32 maxConeAngle); + D_NEWTON_API virtual void SetConeFriction(ndFloat32 regularizer, ndFloat32 viscousFriction); - D_NEWTON_API void SetTwistLimits(ndFloat32 minAngle, ndFloat32 maxAngle); - D_NEWTON_API void GetTwistLimits(ndFloat32& minAngle, ndFloat32& maxAngle) const; - D_NEWTON_API void SetTwistFriction(ndFloat32 regularizer, ndFloat32 viscousFriction); + D_NEWTON_API virtual void SetTwistLimits(ndFloat32 minAngle, ndFloat32 maxAngle); + D_NEWTON_API virtual void GetTwistLimits(ndFloat32& minAngle, ndFloat32& maxAngle) const; + D_NEWTON_API virtual void SetTwistFriction(ndFloat32 regularizer, ndFloat32 viscousFriction); protected: D_NEWTON_API void JacobianDerivative(ndConstraintDescritor& desc); diff --git a/newton-4.00/sdk/dNewton/dJoints/ndJointHinge.h b/newton-4.00/sdk/dNewton/dJoints/ndJointHinge.h index e43e82e227..e2ce98c075 100644 --- a/newton-4.00/sdk/dNewton/dJoints/ndJointHinge.h +++ b/newton-4.00/sdk/dNewton/dJoints/ndJointHinge.h @@ -27,13 +27,13 @@ class ndJointHinge: public ndJointBilateralConstraint D_NEWTON_API ndJointHinge(const ndMatrix& pinAndPivotInChild, const ndMatrix& pinAndPivotInParent, ndBodyKinematic* const child, ndBodyKinematic* const parent); D_NEWTON_API virtual ~ndJointHinge(); - D_NEWTON_API ndFloat32 GetAngle() const; - D_NEWTON_API ndFloat32 GetOmega() const; - D_NEWTON_API ndFloat32 GetFriction() const; + D_NEWTON_API virtual ndFloat32 GetAngle() const; + D_NEWTON_API virtual ndFloat32 GetOmega() const; + D_NEWTON_API virtual ndFloat32 GetFriction() const; - D_NEWTON_API void SetFriction(ndFloat32 frictionTorque); - D_NEWTON_API void EnableLimits(bool state, ndFloat32 minLimit, ndFloat32 maxLimit); - D_NEWTON_API void SetAsSpringDamper(bool state, ndFloat32 regularizer, ndFloat32 spring, ndFloat32 damper); + D_NEWTON_API virtual void SetFriction(ndFloat32 frictionTorque); + D_NEWTON_API virtual void EnableLimits(bool state, ndFloat32 minLimit, ndFloat32 maxLimit); + D_NEWTON_API virtual void SetAsSpringDamper(bool state, ndFloat32 regularizer, ndFloat32 spring, ndFloat32 damper); private: void SubmitConstraintLimits(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1); diff --git a/newton-4.00/sdk/dNewton/dJoints/ndJointHingeActuator.h b/newton-4.00/sdk/dNewton/dJoints/ndJointHingeActuator.h index 3eb2c94907..861eea2ddc 100644 --- a/newton-4.00/sdk/dNewton/dJoints/ndJointHingeActuator.h +++ b/newton-4.00/sdk/dNewton/dJoints/ndJointHingeActuator.h @@ -24,20 +24,20 @@ class ndJointHingeActuator: public ndJointHinge D_NEWTON_API ndJointHingeActuator(const ndMatrix& pinAndPivotFrame, ndFloat32 angularRate, ndFloat32 minAngle, ndFloat32 maxAngle, ndBodyKinematic* const child, ndBodyKinematic* const parent); D_NEWTON_API virtual ~ndJointHingeActuator(); - D_NEWTON_API ndFloat32 GetTargetAngle() const; - D_NEWTON_API void SetTargetAngle(ndFloat32 angle); + D_NEWTON_API virtual ndFloat32 GetTargetAngle() const; + D_NEWTON_API virtual void SetTargetAngle(ndFloat32 angle); - D_NEWTON_API ndFloat32 GetMinAngularLimit() const; - D_NEWTON_API ndFloat32 GetMaxAngularLimit() const; + D_NEWTON_API virtual ndFloat32 GetMinAngularLimit() const; + D_NEWTON_API virtual ndFloat32 GetMaxAngularLimit() const; - D_NEWTON_API void SetMinAngularLimit(ndFloat32 limit); - D_NEWTON_API void SetMaxAngularLimit(ndFloat32 limit); + D_NEWTON_API virtual void SetMinAngularLimit(ndFloat32 limit); + D_NEWTON_API virtual void SetMaxAngularLimit(ndFloat32 limit); - D_NEWTON_API ndFloat32 GetAngularRate() const; - D_NEWTON_API void SetAngularRate(ndFloat32 rate); + D_NEWTON_API virtual ndFloat32 GetAngularRate() const; + D_NEWTON_API virtual void SetAngularRate(ndFloat32 rate); - D_NEWTON_API ndFloat32 GetMaxTorque() const; - D_NEWTON_API void SetMaxTorque(ndFloat32 torque); + D_NEWTON_API virtual ndFloat32 GetMaxTorque() const; + D_NEWTON_API virtual void SetMaxTorque(ndFloat32 torque); protected: D_NEWTON_API void JacobianDerivative(ndConstraintDescritor& desc); diff --git a/newton-4.00/sdk/dNewton/dJoints/ndJointSlider.h b/newton-4.00/sdk/dNewton/dJoints/ndJointSlider.h index 7503bfa41e..248c88e1f8 100644 --- a/newton-4.00/sdk/dNewton/dJoints/ndJointSlider.h +++ b/newton-4.00/sdk/dNewton/dJoints/ndJointSlider.h @@ -26,13 +26,13 @@ class ndJointSlider: public ndJointBilateralConstraint D_NEWTON_API ndJointSlider(const ndMatrix& pinAndPivotFrame, ndBodyKinematic* const child, ndBodyKinematic* const parent); D_NEWTON_API virtual ~ndJointSlider(); - D_NEWTON_API ndFloat32 GetSpeed() const; - D_NEWTON_API ndFloat32 GetPosit() const; - D_NEWTON_API ndFloat32 GetFriction() const; + D_NEWTON_API virtual ndFloat32 GetSpeed() const; + D_NEWTON_API virtual ndFloat32 GetPosit() const; + D_NEWTON_API virtual ndFloat32 GetFriction() const; - D_NEWTON_API void SetFriction(ndFloat32 friction); - D_NEWTON_API void EnableLimits(bool state, ndFloat32 minLimit, ndFloat32 maxLimit); - D_NEWTON_API void SetAsSpringDamper(bool state, ndFloat32 regularizer, ndFloat32 spring, ndFloat32 damper); + D_NEWTON_API virtual void SetFriction(ndFloat32 friction); + D_NEWTON_API virtual void EnableLimits(bool state, ndFloat32 minLimit, ndFloat32 maxLimit); + D_NEWTON_API virtual void SetAsSpringDamper(bool state, ndFloat32 regularizer, ndFloat32 spring, ndFloat32 damper); private: void SubmitConstraintLimits(ndConstraintDescritor& desc, const ndMatrix& matrix0, const ndMatrix& matrix1); From 19258c9561207eb5c1caf1bcce6168997bd2ece9 Mon Sep 17 00:00:00 2001 From: TrevorCash Date: Sun, 23 Jan 2022 14:32:51 -0700 Subject: [PATCH 2/2] make ndCoreStdafx match file in cmake. --- newton-4.00/sdk/dCore/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/newton-4.00/sdk/dCore/CMakeLists.txt b/newton-4.00/sdk/dCore/CMakeLists.txt index af356ac06f..2786e58384 100644 --- a/newton-4.00/sdk/dCore/CMakeLists.txt +++ b/newton-4.00/sdk/dCore/CMakeLists.txt @@ -36,8 +36,8 @@ endif() if (MSVC) if(CMAKE_VS_MSBUILD_COMMAND OR CMAKE_VS_DEVENV_COMMAND) - set_target_properties(${projectName} PROPERTIES COMPILE_FLAGS "/YundCoreStdAfx.h") - set_source_files_properties(ndCoreStdAfx.cpp PROPERTIES COMPILE_FLAGS "/YcndCoreStdAfx.h") + set_target_properties(${projectName} PROPERTIES COMPILE_FLAGS "/YundCoreStdafx.h") + set_source_files_properties(ndCoreStdAfx.cpp PROPERTIES COMPILE_FLAGS "/YcndCoreStdafx.h") endif() if (NEWTON_BUILD_TEST AND NEWTON_BUILD_SHARED_LIBS)