Jump to content

Recommended Posts

Posted
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.

Cyclone - Ultra Game System - Component PreprocessorTex2TGA - Darkness Awaits Template (Leadwerks)

If you like my work, consider supporting me on Patreon!

Posted

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.

My job is to make tools you love, with the features you want, and performance you can't live without.

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...