Migrate mjtByte to mjtBool for boolean-valued fields.
PiperOrigin-RevId: 921408093 Change-Id: Icb00457836359779f0f72fc02d6a7c0dc9f6bd23
This commit is contained in:
committed by
Copybara-Service
parent
3cabb2eb8e
commit
393c1e4217
@@ -2024,13 +2024,13 @@ void mjs_setString(mjString* dest, const char* text) {
|
||||
|
||||
|
||||
// Set specific entry in destination string vector.
|
||||
mjtByte mjs_setInStringVec(mjStringVec* dest, int i, const char* text) {
|
||||
mjtBool mjs_setInStringVec(mjStringVec* dest, int i, const char* text) {
|
||||
if (dest->size() <= i) {
|
||||
mju_error("Requested index in mjs_setInStringVec is out of bounds");
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
dest->at(i) = std::string(text);
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -377,7 +377,7 @@ MJAPI void mjs_setString(mjString* dest, const char* text);
|
||||
MJAPI void mjs_setStringVec(mjStringVec* dest, const char* text);
|
||||
|
||||
// Set entry in string vector.
|
||||
MJAPI mjtByte mjs_setInStringVec(mjStringVec* dest, int i, const char* text);
|
||||
MJAPI mjtBool mjs_setInStringVec(mjStringVec* dest, int i, const char* text);
|
||||
|
||||
// Append text entry to string vector.
|
||||
MJAPI void mjs_appendString(mjStringVec* dest, const char* text);
|
||||
|
||||
@@ -2800,8 +2800,8 @@ void mjCModel::CopyTree(mjModel* m) {
|
||||
// set joint fields
|
||||
m->jnt_type[jid] = pj->type;
|
||||
m->jnt_group[jid] = pj->group;
|
||||
m->jnt_limited[jid] = (mjtByte)pj->is_limited();
|
||||
m->jnt_actfrclimited[jid] = (mjtByte)pj->is_actfrclimited();
|
||||
m->jnt_limited[jid] = (mjtBool)pj->is_limited();
|
||||
m->jnt_actfrclimited[jid] = (mjtBool)pj->is_actfrclimited();
|
||||
m->jnt_actgravcomp[jid] = pj->actgravcomp;
|
||||
m->jnt_qposadr[jid] = pj->qposadr_;
|
||||
m->jnt_dofadr[jid] = pj->dofadr_;
|
||||
@@ -3016,8 +3016,8 @@ void mjCModel::CopyTree(mjModel* m) {
|
||||
m->light_targetbodyid[lid] = pl->targetbodyid;
|
||||
m->light_type[lid] = pl->type;
|
||||
m->light_texid[lid] = pl->texid;
|
||||
m->light_castshadow[lid] = (mjtByte)pl->castshadow;
|
||||
m->light_active[lid] = (mjtByte)pl->active;
|
||||
m->light_castshadow[lid] = (mjtBool)pl->castshadow;
|
||||
m->light_active[lid] = (mjtBool)pl->active;
|
||||
mjuu_copyvec(m->light_pos+3*lid, pl->pos, 3);
|
||||
mjuu_copyvec(m->light_dir+3*lid, pl->dir, 3);
|
||||
m->light_bulbradius[lid] = pl->bulbradius;
|
||||
@@ -3822,8 +3822,8 @@ void mjCModel::CopyObjects(mjModel* m) {
|
||||
m->tendon_num[i] = (int)pte->path.size();
|
||||
m->tendon_matid[i] = pte->matid;
|
||||
m->tendon_group[i] = pte->group;
|
||||
m->tendon_limited[i] = (mjtByte)pte->is_limited();
|
||||
m->tendon_actfrclimited[i] = (mjtByte)pte->is_actfrclimited();
|
||||
m->tendon_limited[i] = (mjtBool)pte->is_limited();
|
||||
m->tendon_actfrclimited[i] = (mjtBool)pte->is_actfrclimited();
|
||||
m->tendon_width[i] = (mjtNum)pte->width;
|
||||
mjuu_copyvec(m->tendon_solref_lim+mjNREF*i, pte->solref_limit, mjNREF);
|
||||
mjuu_copyvec(m->tendon_solimp_lim+mjNIMP*i, pte->solimp_limit, mjNIMP);
|
||||
@@ -3891,9 +3891,9 @@ void mjCModel::CopyObjects(mjModel* m) {
|
||||
m->actuator_historyadr[i] = -1;
|
||||
}
|
||||
|
||||
m->actuator_ctrllimited[i] = (mjtByte)pac->is_ctrllimited();
|
||||
m->actuator_forcelimited[i] = (mjtByte)pac->is_forcelimited();
|
||||
m->actuator_actlimited[i] = (mjtByte)pac->is_actlimited();
|
||||
m->actuator_ctrllimited[i] = (mjtBool)pac->is_ctrllimited();
|
||||
m->actuator_forcelimited[i] = (mjtBool)pac->is_forcelimited();
|
||||
m->actuator_actlimited[i] = (mjtBool)pac->is_actlimited();
|
||||
m->actuator_actearly[i] = pac->actearly;
|
||||
m->actuator_cranklength[i] = (mjtNum)pac->cranklength;
|
||||
mjuu_copyvec(m->actuator_gear + 6*i, pac->gear, 6);
|
||||
|
||||
Reference in New Issue
Block a user