reepblue Posted May 4 Posted May 4 virtual bool Attach(shared_ptr<Hmd> hmd); virtual bool Attach(shared_ptr<VrController> controller); I've tried these methods per your suggestion and both don't work as intended. When you attach a model to the Hmd, it's doesn't seem to consider the offset even when you move the said model it is. if (!head) { head = CreateSphere(world, -0.14f); head->SetCollider(nullptr); head->SetShadows(false); head->SetColor(0.0f, 0.0f, 0.0f, 0.0f); head->SetPosition(entity->GetPosition() + hmd->GetPosition()); head->Attach(hmd); auto mat = CreateMaterial(); mat->SetShaderFamily(LoadShaderFamily("Shaders/Unlit.fam")); mat->SetThickness(0); mat->SetTransparent(true); head->SetMaterial(mat); mat = NULL; } The entity update at all when attach to the controller. // Update the model. auto mdl = GetController(weapon_controller); if (weapon && mdl) { if (weapon->extra == NULL) { weapon->SetMatrix(mdl->GetMatrix(true), true); weapon->SetHidden(false); mdl->SetHidden(true); weapon->Attach(hmd->controllers[weapon_controller]); weapon->extra = Self(); } else { //weapon->SetMatrix(mdl->GetMatrix(true), true); } } If you need the project, let me know. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon!
Josh Posted May 9 Posted May 9 It seems to work with or without offsets on the controllers. It works when attached to the headset, but does not consider the offset. Also, the orientation is not feeding back to the actual entity orientation, so objects get culled if their original position is not onscreen. Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Solution Josh Posted May 10 Solution Posted May 10 Okay, I got it all worked out. 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.