package net.halbear.Terrain4J.EngineCore.Audio;

import org.joml.Vector3f;

import static org.lwjgl.openal.AL10.*;

public class SoundListener {
    public SoundListener(Vector3f Position){
        alListener3f(AL_POSITION, Position.x, Position.y, Position.z);
        alListener3f(AL_VELOCITY, 0,0,0);
    }
    public void SetOrientation(Vector3f at, Vector3f up){
        float[] data = new float[6];
        data[0] = at.x;
        data[1] = at.y;
        data[2] = at.z;
        data[3] = up.x;
        data[4] = up.y;
        data[5] = up.z;
        alListenerfv(AL_ORIENTATION,data);
    }
    public void SetPosition(Vector3f Position){
        alListener3f(AL_POSITION, Position.x,Position.y,Position.z);
    }
    public void SetSpeed(Vector3f Speed){
        alListener3f(AL_VELOCITY,Speed.x,Speed.y,Speed.z);
    }
}
