Skip to content

Conversation

@rickertm
Copy link
Contributor

This patch adds support for double precision in the DT_Scalar type when using the USE_DOUBLES option, similar to MT_Scalar. The type is currently fixed to float and therefore results in limited precision and incorrect results when positioning and querying objects.

It also fixes building the examples with double precision, as this currently results in a number of errors due to mixing MT_Scalar with float types:

examples/dynamics/RigidBody.cpp: In member function ‘void RigidBody::setDamping(MT_Scalar, MT_Scalar)’:
examples/dynamics/RigidBody.cpp:38:60: error: no matching function for call to ‘GEN_clamped(MT_Scalar, float, float)’
   38 |  m_lin_damping = GEN_clamped(1.0f - lin_damping, 0.0f, 1.0f);

It further adds DT_GetMatrix and DT_SetMatrix functions for the DT_Scalar type similar to DT_SetPosition etc. in order to avoid checking for the correct type when reading or updating the matrix of an object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant