Add mjmTexture to C API.
PiperOrigin-RevId: 606543622 Change-Id: I2db743c1c40116f0503329fb1d004d9b041e83e7
This commit is contained in:
committed by
Copybara-Service
parent
47bb4a828e
commit
06505f49f9
@@ -137,6 +137,15 @@ mjmFrame* mjm_addFrame(mjmBody* bodyspec, mjmFrame* parentframe) {
|
||||
|
||||
|
||||
|
||||
// add texture to model
|
||||
mjmTexture* mjm_addTexture(void* model) {
|
||||
mjCModel* modelC = static_cast<mjCModel*>(model);
|
||||
mjCTexture* texture = modelC->AddTexture();
|
||||
return &texture->spec;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// add material to model
|
||||
mjmMaterial* mjm_addMaterial(void* model, void* defspec) {
|
||||
mjCModel* modelC = static_cast<mjCModel*>(model);
|
||||
@@ -312,6 +321,19 @@ void mjm_setString(mjString dest, const char* text) {
|
||||
|
||||
|
||||
|
||||
// Set specific entry in destination string vector.
|
||||
mjtByte mjm_setInStringVec(mjStringVec dest, int i, const char* text) {
|
||||
std::vector<std::string>* v = reinterpret_cast<std::vector<std::string>*>(dest);
|
||||
if (v->size() <= i) {
|
||||
mju_error("Requested index in mjm_setInStringVec is out of bounds");
|
||||
return 0;
|
||||
}
|
||||
v->at(i) = std::string(text);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// split text and copy into string array
|
||||
void mjm_setStringVec(mjStringVec dest, const char* text) {
|
||||
std::vector<std::string>* v = reinterpret_cast<std::vector<std::string>*>(dest);
|
||||
|
||||
Reference in New Issue
Block a user