reepblue Posted May 4 Posted May 4 While it's confirmed that the listener is attached to the hmd by default, it seems that the listener's position doesn't update when Hmd::SetOffset() is changed. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon!
Solution Josh Posted May 9 Solution Posted May 9 Fixed. Here is the code I used for testing. #include "Leadwerks.h" using namespace Leadwerks; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CLIENTCOORDS | WINDOW_CENTER | WINDOW_TITLEBAR); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a world auto world = CreateWorld(); //Get the VR headset auto hmd = GetHmd(world); //Environment maps auto specmap = LoadTexture("https://github.com/Leadwerks/Assets/raw/main/Materials/Environment/footprint_court/specular.dds"); auto diffmap = LoadTexture("https://github.com/Leadwerks/Assets/raw/main/Materials/Environment/footprint_court/diffuse.dds"); world->SetEnvironmentMap(specmap, ENVIRONMENTMAP_BACKGROUND); world->SetEnvironmentMap(specmap, ENVIRONMENTMAP_SPECULAR); world->SetEnvironmentMap(diffmap, ENVIRONMENTMAP_DIFFUSE); //Create a light auto light = CreateBoxLight(world); light->SetRotation(55, 35, 0); light->SetRange(-10, 10); light->SetColor(2); //Add a floor auto floor = CreateBox(world, 5, 1, 5); floor->SetPosition(0, -0.5, 0); auto mtl = CreateMaterial(); mtl->SetTexture(LoadTexture("https://github.com/UltraEngine/Documentation/raw/master/Assets/Materials/Developer/griid_gray.dds")); floor->SetMaterial(mtl); hmd->SetOffset(Vec3(1, 0, 0), Vec3(0,90,0)); auto box = CreateBox(world, 0.05); box->SetPosition(0, 1.6, 0); auto sound = LoadSound(AppDir() + "/flashlightswitch.wav"); box->EmitSound(sound, 50, 1, 1, true); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer); } return 0; } Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.