Add mjmodel support for textures with different number of channels.
PiperOrigin-RevId: 653974959 Change-Id: Ia280e0bdb21027646249f104f21bedee792ba7e5
This commit is contained in:
committed by
Copybara-Service
parent
70ac76bb4b
commit
e92af73cbf
@@ -2505,9 +2505,10 @@ void mjCModel::CopyObjects(mjModel* m) {
|
||||
m->tex_height[i] = ptex->height;
|
||||
m->tex_width[i] = ptex->width;
|
||||
m->tex_adr[i] = data_adr;
|
||||
m->tex_nchannel[i] = 3;
|
||||
|
||||
// copy rgb data
|
||||
memcpy(m->tex_rgb + data_adr, ptex->rgb.data(), 3*ptex->width*ptex->height);
|
||||
memcpy(m->tex_data + data_adr, ptex->rgb.data(), 3*ptex->width*ptex->height);
|
||||
|
||||
// advance counter
|
||||
data_adr += 3*ptex->width*ptex->height;
|
||||
|
||||
Reference in New Issue
Block a user