package com.seewo.factoryaging.opengl3d.h;

import android.opengl.Matrix;
import android.util.Log;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/* JADX INFO: compiled from: Joint.java */
/* JADX INFO: loaded from: classes.dex */
public class h {
    private final int a;
    private final String b;
    private final float[] c;
    private final List<h> d = new ArrayList();
    private float[] e;
    private final float[] f;

    public h(int i2, String str, float[] fArr, float[] fArr2) {
        float[] fArr3 = new float[16];
        this.f = fArr3;
        this.a = i2;
        this.b = str;
        this.c = fArr;
        this.e = fArr2;
        Matrix.setIdentityM(fArr3, 0);
    }

    public void a(h hVar) {
        this.d.add(hVar);
    }

    public void b(float[] fArr, boolean z) {
        float[] fArr2 = new float[16];
        Matrix.multiplyMM(fArr2, 0, fArr, 0, this.c, 0);
        if (this.a >= 0 && (z || this.e == null)) {
            float[] fArr3 = new float[16];
            this.e = fArr3;
            if (!Matrix.invertM(fArr3, 0, fArr2, 0)) {
                Log.w("Joint", "Couldn't calculate inverse matrix for " + this.b);
            }
        }
        Iterator<h> it = this.d.iterator();
        while (it.hasNext()) {
            it.next().b(fArr2, z);
        }
    }

    /* JADX INFO: renamed from: c, reason: merged with bridge method [inline-methods] */
    public h clone() {
        int i2 = this.a;
        String str = this.b;
        float[] fArr = (float[]) this.c.clone();
        float[] fArr2 = this.e;
        h hVar = new h(i2, str, fArr, fArr2 != null ? (float[]) fArr2.clone() : null);
        Iterator<h> it = this.d.iterator();
        while (it.hasNext()) {
            hVar.a(it.next().clone());
        }
        return hVar;
    }

    public float[] d() {
        return this.f;
    }

    public float[] e() {
        return this.c;
    }

    public List<h> f() {
        return this.d;
    }

    public int g() {
        return this.a;
    }

    public float[] h() {
        return this.e;
    }

    public String i() {
        return this.b;
    }
}
