package com.seewo.factoryaging.opengl3d.j;

import android.net.Uri;
import android.opengl.Matrix;
import android.util.Log;
import com.seewo.factoryaging.opengl3d.i.d;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import java.nio.ShortBuffer;
import java.util.ArrayList;
import java.util.List;

/* JADX INFO: compiled from: Object3DData.java */
/* JADX INFO: loaded from: classes.dex */
public class c {
    private d.f A;
    private d B;
    private List<String> C;
    private String a;
    private boolean b;
    private boolean c;
    private float[] d;
    private int e;
    private int f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    private FloatBuffer f366g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    private FloatBuffer f367h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    private IntBuffer f368i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    private ShortBuffer f369j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    private ArrayList<d.g> f370k;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    private d.c f371l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    private d.b f372m;
    private d.e n;
    private String o;
    private FloatBuffer p;
    private FloatBuffer q;
    private FloatBuffer r;
    private FloatBuffer s;
    private List<int[]> t;
    private byte[] u;
    protected float[] v;
    protected float[] w;
    protected float[] x;
    protected float[] y;
    private boolean z;

    public c(FloatBuffer floatBuffer) {
        this.b = false;
        this.c = true;
        this.e = 0;
        this.f366g = null;
        this.f367h = null;
        this.f368i = null;
        this.f369j = null;
        this.p = null;
        this.q = null;
        this.r = null;
        this.s = null;
        this.t = null;
        this.u = null;
        this.v = new float[]{0.0f, 0.0f, 0.0f};
        this.w = new float[]{0.0f, 0.0f, 0.0f};
        this.x = new float[]{1.0f, 1.0f, 1.0f};
        float[] fArr = new float[16];
        this.y = fArr;
        Matrix.setIdentityM(fArr, 0);
        this.C = new ArrayList();
        this.p = floatBuffer;
    }

    private static ByteBuffer c(int i2) {
        ByteBuffer byteBufferAllocateDirect = ByteBuffer.allocateDirect(i2);
        byteBufferAllocateDirect.order(ByteOrder.nativeOrder());
        return byteBufferAllocateDirect;
    }

    private void i0() {
        Matrix.setIdentityM(this.y, 0);
        if (v() != null) {
            Matrix.rotateM(this.y, 0, v()[0], 1.0f, 0.0f, 0.0f);
            Matrix.rotateM(this.y, 0, v()[1], 0.0f, 1.0f, 0.0f);
            Matrix.rotateM(this.y, 0, w(), 0.0f, 0.0f, 1.0f);
        }
        if (x() != null) {
            Matrix.scaleM(this.y, 0, y(), z(), A());
        }
        if (r() != null) {
            Matrix.translateM(this.y, 0, s(), t(), u());
        }
    }

    public float A() {
        return x()[2];
    }

    public ArrayList<d.g> B() {
        return this.f370k;
    }

    public FloatBuffer C() {
        return this.s;
    }

    public byte[] D() {
        return this.u;
    }

    public String E() {
        return this.o;
    }

    public FloatBuffer F() {
        return this.p;
    }

    public FloatBuffer G() {
        return this.f366g;
    }

    public FloatBuffer H() {
        return this.q;
    }

    public FloatBuffer I() {
        return this.r;
    }

    public FloatBuffer J() {
        return this.f366g;
    }

    public boolean K() {
        return this.z;
    }

    public boolean L() {
        return this.b;
    }

    public boolean M() {
        return this.c;
    }

    public c N(float[] fArr) {
        this.d = fArr;
        return this;
    }

    public void O(d.f fVar) {
        this.A = fVar;
    }

    public c P(int i2) {
        this.e = i2;
        return this;
    }

    public c Q(IntBuffer intBuffer) {
        this.f368i = intBuffer;
        return this;
    }

    public c R(boolean z) {
        this.b = z;
        return this;
    }

    public c S(d.c cVar) {
        this.f371l = cVar;
        this.f368i = cVar.b();
        return this;
    }

    public c T(String str) {
        this.a = str;
        return this;
    }

    public void U(d dVar) {
        this.B = dVar;
    }

    public c V(float[] fArr) {
        this.v = fArr;
        i0();
        return this;
    }

    public c W(float[] fArr) {
        this.w = fArr;
        i0();
        return this;
    }

    public c X(float f) {
        this.w[1] = f;
        i0();
        return this;
    }

    public c Y(float[] fArr) {
        this.x = fArr;
        i0();
        return this;
    }

    public c Z(FloatBuffer floatBuffer) {
        this.s = floatBuffer;
        return this;
    }

    public void a(String str) {
        this.C.add(str);
    }

    public void a0(byte[] bArr) {
        this.u = bArr;
    }

    @Deprecated
    public void b() {
        float fD = this.A.d();
        float f = fD != 0.0f ? 1.0f / fD : 1.0f;
        Log.i("Object3DData", "Scaling model with factor: " + f + ". Largest: " + fD);
        d.g gVarA = this.A.a();
        StringBuilder sb = new StringBuilder();
        sb.append("Objects actual position: ");
        sb.append(gVarA.toString());
        Log.i("Object3DData", sb.toString());
        FloatBuffer floatBufferG = G() != null ? G() : F();
        for (int i2 = 0; i2 < floatBufferG.capacity() / 3; i2++) {
            int i3 = i2 * 3;
            float f2 = floatBufferG.get(i3);
            int i4 = i3 + 1;
            float f3 = floatBufferG.get(i4);
            int i5 = i3 + 2;
            float f4 = floatBufferG.get(i5);
            floatBufferG.put(i3, (f2 - gVarA.a()) * f);
            floatBufferG.put(i4, (f3 - gVarA.b()) * f);
            floatBufferG.put(i5, (f4 - gVarA.c()) * f);
        }
    }

    public void b0(String str) {
        this.o = str;
    }

    public void c0(Uri uri) {
    }

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

    public c d0(int i2) {
        return this;
    }

    public int e() {
        return this.e;
    }

    public c e0(FloatBuffer floatBuffer) {
        this.p = floatBuffer;
        return this;
    }

    public List<int[]> f() {
        return this.t;
    }

    public c f0(FloatBuffer floatBuffer) {
        this.f366g = floatBuffer;
        return this;
    }

    public IntBuffer g() {
        return this.f368i;
    }

    public c g0(FloatBuffer floatBuffer) {
        this.q = floatBuffer;
        return this;
    }

    public ShortBuffer h() {
        IntBuffer intBuffer;
        if (this.f369j == null && (intBuffer = this.f368i) != null) {
            this.f369j = c(intBuffer.capacity() * 2).asShortBuffer();
            for (int i2 = 0; i2 < this.f368i.capacity(); i2++) {
                this.f369j.put((short) this.f368i.get(i2));
            }
        }
        return this.f369j;
    }

    public c h0(FloatBuffer floatBuffer) {
        this.r = floatBuffer;
        return this;
    }

    public int i() {
        return this.f;
    }

    public List<String> j() {
        return this.C;
    }

    public d.b k() {
        return this.f372m;
    }

    public d.c l() {
        return this.f371l;
    }

    public String m() {
        return this.a;
    }

    public d n() {
        return this.B;
    }

    public d.e o() {
        return this.n;
    }

    public float[] p() {
        return this.y;
    }

    public FloatBuffer q() {
        return this.f367h;
    }

    public float[] r() {
        return this.v;
    }

    public float s() {
        float[] fArr = this.v;
        if (fArr != null) {
            return fArr[0];
        }
        return 0.0f;
    }

    public float t() {
        float[] fArr = this.v;
        if (fArr != null) {
            return fArr[1];
        }
        return 0.0f;
    }

    public float u() {
        float[] fArr = this.v;
        if (fArr != null) {
            return fArr[2];
        }
        return 0.0f;
    }

    public float[] v() {
        return this.w;
    }

    public float w() {
        return this.w[2];
    }

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

    public float y() {
        return x()[0];
    }

    public float z() {
        return x()[1];
    }

    public c(FloatBuffer floatBuffer, FloatBuffer floatBuffer2, ArrayList<d.g> arrayList, d.c cVar, d.b bVar, d.e eVar) {
        this.b = false;
        this.c = true;
        this.e = 0;
        this.f366g = null;
        this.f367h = null;
        this.f368i = null;
        this.f369j = null;
        this.p = null;
        this.q = null;
        this.r = null;
        this.s = null;
        this.t = null;
        this.u = null;
        this.v = new float[]{0.0f, 0.0f, 0.0f};
        this.w = new float[]{0.0f, 0.0f, 0.0f};
        this.x = new float[]{1.0f, 1.0f, 1.0f};
        float[] fArr = new float[16];
        this.y = fArr;
        Matrix.setIdentityM(fArr, 0);
        this.C = new ArrayList();
        this.f366g = floatBuffer;
        this.f367h = floatBuffer2;
        this.f370k = arrayList;
        this.f371l = cVar;
        this.f372m = bVar;
        this.n = eVar;
    }
}
