Encapsulate mjCMesh data, apply Google C++ naming convention to class members (See https://google.github.io/styleguide/cppguide.html#Variable_Names), and fix a couple of typos.

PiperOrigin-RevId: 553129088
Change-Id: Ic515154220af472f4fc90ca9ade92d86b205cc94
This commit is contained in:
Kyle Bayes
2023-08-02 14:42:49 +01:00
committed by nimrod
parent dac34c91bb
commit efca1a76aa
9 changed files with 712 additions and 532 deletions
+5 -5
View File
@@ -895,7 +895,7 @@ static int Round(double x) {
// write attribute
template<typename T>
void mjXUtil::WriteAttr(XMLElement* elem, string name, int n, T* data, const T* def) {
void mjXUtil::WriteAttr(XMLElement* elem, string name, int n, const T* data, const T* def) {
// make sure all are defined
if constexpr (std::is_floating_point_v<T>) {
for (int i=0; i<n; i++) {
@@ -935,16 +935,16 @@ void mjXUtil::WriteAttr(XMLElement* elem, string name, int n, T* data, const T*
template void mjXUtil::WriteAttr(XMLElement* elem, string name, int n,
double* data, const double* def);
const double* data, const double* def);
template void mjXUtil::WriteAttr(XMLElement* elem, string name, int n,
float* data, const float* def);
const float* data, const float* def);
template void mjXUtil::WriteAttr(XMLElement* elem, string name, int n,
int* data, const int* def);
const int* data, const int* def);
template void mjXUtil::WriteAttr(XMLElement* elem, string name, int n,
mjtByte* data, const mjtByte* def);
const mjtByte* data, const mjtByte* def);
// write vector<double> attribute, default = zero array