Correctly apply frame transform to light direction.
PiperOrigin-RevId: 665340267 Change-Id: Ida16ddbf3a057ffd3e260b71180a45acbf749931
This commit is contained in:
committed by
Copybara-Service
parent
2425358c3b
commit
ad9cd7301e
@@ -3222,11 +3222,14 @@ void mjCLight::CopyFromSpec() {
|
||||
void mjCLight::Compile(void) {
|
||||
CopyFromSpec();
|
||||
|
||||
double quat[4]= {1, 0, 0, 0};
|
||||
|
||||
// frame
|
||||
if (frame) {
|
||||
mjuu_frameaccumChild(frame->pos, frame->quat, pos, quat);
|
||||
// apply frame transform to pos, qunit is unused
|
||||
double qunit[4]= {1, 0, 0, 0};
|
||||
mjuu_frameaccumChild(frame->pos, frame->quat, pos, qunit);
|
||||
|
||||
// rotate dir
|
||||
mjuu_rotVecQuat(dir, dir, frame->quat);
|
||||
}
|
||||
|
||||
// normalize direction, make sure it is not zero
|
||||
|
||||
Reference in New Issue
Block a user