Fix bug in mesh normal scaling for nonuniform mesh scales.
PiperOrigin-RevId: 946937791 Change-Id: I1b8a0ad4d573842ef9f76572dea25668dd319b52
This commit is contained in:
committed by
Copybara-Service
parent
fbf031a7d5
commit
f5f9d9efb7
@@ -1292,10 +1292,11 @@ void mjCMesh::ApplyTransformations(double* dvert) {
|
||||
dvert[3*i + 2] *= scale[2];
|
||||
}
|
||||
|
||||
// normals are covectors: transform by the inverse scale
|
||||
for (int i = 0; i < nnormal(); i++) {
|
||||
normal_[3*i + 0] *= scale[0];
|
||||
normal_[3*i + 1] *= scale[1];
|
||||
normal_[3*i + 2] *= scale[2];
|
||||
normal_[3*i + 0] /= scale[0];
|
||||
normal_[3*i + 1] /= scale[1];
|
||||
normal_[3*i + 2] /= scale[2];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user