diff --git a/Content/Documentation/ScriptingAPI-Documentation.md b/Content/Documentation/ScriptingAPI-Documentation.md index d57161bf6..5727b476e 100644 --- a/Content/Documentation/ScriptingAPI-Documentation.md +++ b/Content/Documentation/ScriptingAPI-Documentation.md @@ -1206,6 +1206,10 @@ It inherits functions from RenderPath2D, so it can render a 2D overlay. - SetSharpenFilterEnabled(bool value) - SetSharpenFilterAmount(float value) - SetExposure(float value) +- SetOutlineEnabled(bool value) +- SetOutlineThreshold(float value) +- SetOutlineThickness(float value) +- SetOutlineColor(float r,g,b,a) #### LoadingScreen It is a RenderPath2D but one that internally manages resource loading and can display information about the process. diff --git a/Editor/AnimationWindow.cpp b/Editor/AnimationWindow.cpp index 635fd4e00..a114fb2ba 100644 --- a/Editor/AnimationWindow.cpp +++ b/Editor/AnimationWindow.cpp @@ -986,11 +986,10 @@ void AnimationWindow::Create(EditorComponent* _editor) animation.samplers.clear(); NameComponent name; - name.name += "[retarget]"; const NameComponent* name_source = scene.names.GetComponent(entity); if (name_source != nullptr) { - name.name += " " + name_source->name; + name.name += name_source->name; } scene.names.Create(retarget_entity) = name; diff --git a/Editor/ColliderWindow.cpp b/Editor/ColliderWindow.cpp index 52791accb..eb356aa8b 100644 --- a/Editor/ColliderWindow.cpp +++ b/Editor/ColliderWindow.cpp @@ -187,17 +187,15 @@ void ColliderWindow::Create(EditorComponent* _editor) void ColliderWindow::SetEntity(Entity entity) { - if (this->entity == entity) - return; - - this->entity = entity; - Scene& scene = editor->GetCurrentScene(); const ColliderComponent* collider = scene.colliders.GetComponent(entity); if (collider != nullptr) { + if (this->entity == entity) + return; + this->entity = entity; cpuCheckBox.SetCheck(collider->IsCPUEnabled()); gpuCheckBox.SetCheck(collider->IsGPUEnabled()); shapeCombo.SetSelectedByUserdataWithoutCallback((uint64_t)collider->shape); @@ -209,6 +207,10 @@ void ColliderWindow::SetEntity(Entity entity) tailY.SetValue(collider->tail.y); tailZ.SetValue(collider->tail.z); } + else + { + this->entity = INVALID_ENTITY; + } } void ColliderWindow::ResizeLayout() diff --git a/Editor/Editor.cpp b/Editor/Editor.cpp index ad67fd66b..e75c563c4 100644 --- a/Editor/Editor.cpp +++ b/Editor/Editor.cpp @@ -600,7 +600,7 @@ void EditorComponent::Update(float dt) CheckBonePickingEnabled(); UpdateTopMenuAnimation(); - save_text_alpha = std::max(0.0f, save_text_alpha - dt); + save_text_alpha = std::max(0.0f, save_text_alpha - 0.016f); // constant fade time (no dt, because after saving, dt can become huge) bool clear_selected = false; if (wi::input::Press(wi::input::KEYBOARD_BUTTON_ESCAPE)) diff --git a/Editor/RigidBodyWindow.cpp b/Editor/RigidBodyWindow.cpp index 3db6fe075..8d80d344b 100644 --- a/Editor/RigidBodyWindow.cpp +++ b/Editor/RigidBodyWindow.cpp @@ -310,18 +310,15 @@ void RigidBodyWindow::Create(EditorComponent* _editor) void RigidBodyWindow::SetEntity(Entity entity) { - if (this->entity == entity) - return; - - this->entity = entity; - Scene& scene = editor->GetCurrentScene(); - const RigidBodyPhysicsComponent* physicsComponent = scene.rigidbodies.GetComponent(entity); if (physicsComponent != nullptr) { + if (this->entity == entity) + return; + this->entity = entity; massSlider.SetValue(physicsComponent->mass); frictionSlider.SetValue(physicsComponent->friction); restitutionSlider.SetValue(physicsComponent->restitution); @@ -334,6 +331,10 @@ void RigidBodyWindow::SetEntity(Entity entity) collisionShapeComboBox.SetSelectedByUserdata((uint64_t)physicsComponent->shape); } + else + { + this->entity = INVALID_ENTITY; + } } diff --git a/WickedEngine/wiPhysics_Bullet.cpp b/WickedEngine/wiPhysics_Bullet.cpp index 6e7a2408f..aaa6db764 100644 --- a/WickedEngine/wiPhysics_Bullet.cpp +++ b/WickedEngine/wiPhysics_Bullet.cpp @@ -202,8 +202,6 @@ namespace wi::physics { convexHull->addPoint(btVector3(pos.x, pos.y, pos.z)); } - btVector3 S(transform.scale_local.x, transform.scale_local.y, transform.scale_local.z); - physicsobject.shape->setLocalScaling(S); } else { @@ -241,8 +239,6 @@ namespace wi::physics bool useQuantizedAabbCompression = true; physicsobject.shape = std::make_unique(&physicsobject.triangles, useQuantizedAabbCompression); - btVector3 S(transform.scale_local.x, transform.scale_local.y, transform.scale_local.z); - physicsobject.shape->setLocalScaling(S); } else { @@ -262,6 +258,9 @@ namespace wi::physics // Use default margin for now //shape->setMargin(btScalar(0.01)); + btVector3 S(transform.scale_local.x, transform.scale_local.y, transform.scale_local.z); + physicsobject.shape->setLocalScaling(S); + btScalar mass = physicscomponent.mass; bool isDynamic = (mass != 0.f && !physicscomponent.IsKinematic()); diff --git a/WickedEngine/wiRenderPath3D_BindLua.cpp b/WickedEngine/wiRenderPath3D_BindLua.cpp index d28b9fd02..4546448a9 100644 --- a/WickedEngine/wiRenderPath3D_BindLua.cpp +++ b/WickedEngine/wiRenderPath3D_BindLua.cpp @@ -51,6 +51,10 @@ namespace wi::lua lunamethod(RenderPath3D_BindLua, SetMotionBlurStrength), lunamethod(RenderPath3D_BindLua, SetDepthOfFieldStrength), lunamethod(RenderPath3D_BindLua, SetLightShaftsStrength), + lunamethod(RenderPath3D_BindLua, SetOutlineEnabled), + lunamethod(RenderPath3D_BindLua, SetOutlineThickness), + lunamethod(RenderPath3D_BindLua, SetOutlineThreshold), + lunamethod(RenderPath3D_BindLua, SetOutlineColor), { NULL, NULL } }; Luna::PropertyType RenderPath3D_BindLua::properties[] = { @@ -381,8 +385,6 @@ namespace wi::lua wi::lua::SError(L, "SetExposure(float value) not enough arguments!"); return 0; } - - int RenderPath3D_BindLua::SetMotionBlurStrength(lua_State* L) { if (component == nullptr) @@ -428,6 +430,66 @@ namespace wi::lua wi::lua::SError(L, "SetLightShaftsStrength(float value) not enough arguments!"); return 0; } + int RenderPath3D_BindLua::SetOutlineEnabled(lua_State* L) + { + if (component == nullptr) + { + wi::lua::SError(L, "SetOutlineEnabled(bool value) component is null!"); + return 0; + } + if (wi::lua::SGetArgCount(L) > 0) + { + ((RenderPath3D*)component)->setOutlineEnabled(wi::lua::SGetBool(L, 1)); + } + else + wi::lua::SError(L, "SetOutlineEnabled(bool value) not enough arguments!"); + return 0; + } + int RenderPath3D_BindLua::SetOutlineThickness(lua_State* L) + { + if (component == nullptr) + { + wi::lua::SError(L, "SetOutlineThickness(float value) component is null!"); + return 0; + } + if (wi::lua::SGetArgCount(L) > 0) + { + ((RenderPath3D*)component)->setOutlineThickness(wi::lua::SGetFloat(L, 1)); + } + else + wi::lua::SError(L, "SetOutlineThickness(float value) not enough arguments!"); + return 0; + } + int RenderPath3D_BindLua::SetOutlineThreshold(lua_State* L) + { + if (component == nullptr) + { + wi::lua::SError(L, "SetOutlineThreshold(float value) component is null!"); + return 0; + } + if (wi::lua::SGetArgCount(L) > 0) + { + ((RenderPath3D*)component)->setOutlineThreshold(wi::lua::SGetFloat(L, 1)); + } + else + wi::lua::SError(L, "SetOutlineThreshold(float value) not enough arguments!"); + return 0; + } + int RenderPath3D_BindLua::SetOutlineColor(lua_State* L) + { + if (component == nullptr) + { + wi::lua::SError(L, "SetOutlineColor(float r,g,b,a) component is null!"); + return 0; + } + if (wi::lua::SGetArgCount(L) > 3) + { + ((RenderPath3D*)component)->setOutlineColor(wi::lua::SGetFloat4(L, 1)); + } + else + wi::lua::SError(L, "SetOutlineColor(float r,g,b,a) not enough arguments!"); + return 0; + } void RenderPath3D_BindLua::Bind() { diff --git a/WickedEngine/wiRenderPath3D_BindLua.h b/WickedEngine/wiRenderPath3D_BindLua.h index 61b1c4e4c..d263a502f 100644 --- a/WickedEngine/wiRenderPath3D_BindLua.h +++ b/WickedEngine/wiRenderPath3D_BindLua.h @@ -55,6 +55,10 @@ namespace wi::lua int SetMotionBlurStrength(lua_State* L); int SetDepthOfFieldStrength(lua_State* L); int SetLightShaftsStrength(lua_State* L); + int SetOutlineEnabled(lua_State* L); + int SetOutlineThickness(lua_State* L); + int SetOutlineThreshold(lua_State* L); + int SetOutlineColor(lua_State* L); static void Bind(); }; diff --git a/WickedEngine/wiVersion.cpp b/WickedEngine/wiVersion.cpp index c64294065..6798c1eef 100644 --- a/WickedEngine/wiVersion.cpp +++ b/WickedEngine/wiVersion.cpp @@ -9,7 +9,7 @@ namespace wi::version // minor features, major updates, breaking compatibility changes const int minor = 71; // minor bug fixes, alterations, refactors, updates - const int revision = 51; + const int revision = 52; const std::string version_string = std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(revision);