Hi there, I’m having trouble adding occlusion into my game engine and was wondering what’s the issue.
void InitOcclusion(vector3 vertices[8])
{
FMOD_VECTOR m_Vertices[8];
for (int i = 0; i < 8; i++)
{
m_Vertices[i].x = vertices[i].x;
m_Vertices[i].y = vertices[i].y;
m_Vertices[i].z = vertices[i].z;
}
/* FMOD_VECTOR rectangle[8] = {
{ 0.5, 10, 5}, { 0.5, 10, -5}, { 0.5, 0, 5}, { 0.5, 0, -5},
{-0.5, 10, 5}, {-0.5, 10, -5}, {-0.5, 0, 5}, {-0.5, 0, -5}
}; */ //Hardcoding the vertices doesn't work either
FMOD::Geometry* geometry;
m_CoreSystem->createGeometry(1, 8, &geometry);
int index = 0;
geometry->addPolygon(1, 1, true, 8, m_Vertices, &index);
}
Instead of hardcoding the vertices that needs to be occluded, I am passing the values in from another function that I’ve set up. Currently, there’s only 1 wall inside my testing case and my sounds are all in 3D.
I can’t seem to get the occlusion to work, or rather can’t tell if it’s working based of hearing the audio. Any suggestions to improve on the code? Thank you
edit: my listener position is {-2.5, 5, 0} while audio source is {2.5, 5, 0}