new object flag: not visible in main camera

This commit is contained in:
Turánszki János
2023-09-29 09:14:27 +02:00
parent ae1db0542b
commit be5b87b300
6 changed files with 56 additions and 44 deletions
+21 -1
View File
@@ -365,7 +365,7 @@ void ObjectWindow::Create(EditorComponent* _editor)
AddWidget(&navmeshCheckBox);
foregroundCheckBox.Create("Foreground: ");
foregroundCheckBox.SetTooltip("Set object to be rendered in the foreground. This is useful for first person hands or weapons.");
foregroundCheckBox.SetTooltip("Set object to be rendered in the foreground.\nThis is useful for first person hands or weapons, so that they not clip into walls and other objects.");
foregroundCheckBox.SetSize(XMFLOAT2(hei, hei));
foregroundCheckBox.SetPos(XMFLOAT2(x, y += step));
foregroundCheckBox.SetCheck(true);
@@ -382,6 +382,24 @@ void ObjectWindow::Create(EditorComponent* _editor)
});
AddWidget(&foregroundCheckBox);
notVisibleInMainCameraCheckBox.Create("Not visible in main camera: ");
notVisibleInMainCameraCheckBox.SetTooltip("Set object to be not rendered in the main camera.\nThis is useful for first person character model, as the character will still be rendered in reflections and shadows.");
notVisibleInMainCameraCheckBox.SetSize(XMFLOAT2(hei, hei));
notVisibleInMainCameraCheckBox.SetPos(XMFLOAT2(x, y += step));
notVisibleInMainCameraCheckBox.SetCheck(true);
notVisibleInMainCameraCheckBox.OnClick([&](wi::gui::EventArgs args) {
wi::scene::Scene& scene = editor->GetCurrentScene();
for (auto& x : editor->translator.selected)
{
ObjectComponent* object = scene.objects.GetComponent(x.entity);
if (object != nullptr)
{
object->SetNotVisibleInMainCamera(args.bValue);
}
}
});
AddWidget(&notVisibleInMainCameraCheckBox);
ditherSlider.Create(0, 1, 0, 1000, "Transparency: ");
ditherSlider.SetTooltip("Adjust transparency of the object. Opaque materials will use dithered transparency in this case!");
ditherSlider.SetSize(XMFLOAT2(wid, hei));
@@ -691,6 +709,7 @@ void ObjectWindow::SetEntity(Entity entity)
renderableCheckBox.SetCheck(object->IsRenderable());
shadowCheckBox.SetCheck(object->IsCastingShadow());
foregroundCheckBox.SetCheck(object->IsForeground());
notVisibleInMainCameraCheckBox.SetCheck(object->IsNotVisibleInMainCamera());
navmeshCheckBox.SetCheck(object->filterMask & wi::enums::FILTER_NAVIGATION_MESH);
cascadeMaskSlider.SetValue((float)object->cascadeMask);
ditherSlider.SetValue(object->GetTransparency());
@@ -767,6 +786,7 @@ void ObjectWindow::ResizeLayout()
add_right(renderableCheckBox);
add_right(shadowCheckBox);
add_right(foregroundCheckBox);
add_right(notVisibleInMainCameraCheckBox);
add_right(navmeshCheckBox);
add(ditherSlider);
add(cascadeMaskSlider);