From e349ea5834777e83151cadfc74a6ff814c254d26 Mon Sep 17 00:00:00 2001 From: Yuval Tassa Date: Mon, 8 Jun 2026 17:07:32 -0700 Subject: [PATCH] Remove MJAPI from templated function declaration. PiperOrigin-RevId: 928849785 Change-Id: I35ba63f599ba12a5d2bdb0d694240e39ca7d4174 --- src/user/user_util.h | 4 ++-- test/user/user_util_test.cc | 20 -------------------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/src/user/user_util.h b/src/user/user_util.h index dab22393..65a21a7b 100644 --- a/src/user/user_util.h +++ b/src/user/user_util.h @@ -115,8 +115,8 @@ void mjuu_localquat(double* local, const double* child, const double* parent); void mjuu_crossvec(double* a, const double* b, const double* c); // compute normal vector to given triangle -template MJAPI double mjuu_makenormal(double* normal, const T a[3], - const T b[3], const T c[3]); +template double mjuu_makenormal(double* normal, const T a[3], + const T b[3], const T c[3]); // compute quaternion corresponding to minimal rotation from [0;0;1] to vec void mjuu_z2quat(double* quat, const double* vec); diff --git a/test/user/user_util_test.cc b/test/user/user_util_test.cc index e5c042b9..67c91e2b 100644 --- a/test/user/user_util_test.cc +++ b/test/user/user_util_test.cc @@ -182,26 +182,6 @@ TEST_F(UserUtilTest, VectorToStringEmpty) { EXPECT_EQ(VectorToString(v), ""); } -TEST_F(UserUtilTest, MakeNormal) { - double a[3] = {0, 0, 0}; - double b[3] = {1, 0, 0}; - double c[3] = {0, 1, 0}; - double normal[3]; - double nrm = mjuu_makenormal(normal, a, b, c); - EXPECT_EQ(nrm, 1.0); - EXPECT_THAT(normal, ElementsAre(0, 0, 1)); -} - -TEST_F(UserUtilTest, MakeNormalDegenerate) { - double a[3] = {0, 0, 0}; - double b[3] = {1, 0, 0}; - double c[3] = {2, 0, 0}; - double normal[3] = {0, 0, 0}; - double nrm = mjuu_makenormal(normal, a, b, c); - EXPECT_EQ(nrm, 1.0); - EXPECT_THAT(normal, ElementsAre(1, 0, 0)); -} - // utility: modified Gram-Schmidt to orthogonalize columns of Q (n x n) static void gramSchmidt(double* Q, int n) { for (int j = 0; j < n; j++) {