Skip to content

Commit

Permalink
debug slider
Browse files Browse the repository at this point in the history
  • Loading branch information
JulioJerez committed Sep 17, 2024
1 parent 6ae3a3e commit 8d21ede
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions newton-4.00/sdk/dNewton/dJoints/ndJointSlider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,17 @@ void ndJointSlider::GetSpringDamper(ndFloat32& regularizer, ndFloat32& spring, n
regularizer = m_springDamperRegularizer;
}

void ndJointSlider::DebugJoint(ndConstraintDebugCallback& debugCallback) const
{
ndMatrix matrix0;
ndMatrix matrix1;
CalculateGlobalMatrix(matrix0, matrix1);

debugCallback.DrawFrame(matrix0);
debugCallback.DrawFrame(matrix1, 0.5f);

}

ndFloat32 ndJointSlider::PenetrationSpeed(ndFloat32 penetration) const
{
ndFloat32 param = ndClamp(penetration, ndFloat32(0.0f), D_MAX_SLIDER_PENETRATION) / D_MAX_SLIDER_PENETRATION;
Expand Down
1 change: 1 addition & 0 deletions newton-4.00/sdk/dNewton/dJoints/ndJointSlider.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class ndJointSlider: public ndJointBilateralConstraint
D_NEWTON_API void GetLimits(ndFloat32& minLimit, ndFloat32& maxLimit) const;
D_NEWTON_API virtual void SetAsSpringDamper(ndFloat32 regularizer, ndFloat32 spring, ndFloat32 damper);
D_NEWTON_API void GetSpringDamper(ndFloat32& regularizer, ndFloat32& spring, ndFloat32& damper) const;
D_NEWTON_API void DebugJoint(ndConstraintDebugCallback& debugCallback) const;

protected:
D_NEWTON_API void ClearMemory();
Expand Down

0 comments on commit 8d21ede

Please sign in to comment.