diff --git a/SHADE_Engine/src/Camera/SHCameraSystem.cpp b/SHADE_Engine/src/Camera/SHCameraSystem.cpp index 85f3b1b1..20d44201 100644 --- a/SHADE_Engine/src/Camera/SHCameraSystem.cpp +++ b/SHADE_Engine/src/Camera/SHCameraSystem.cpp @@ -272,6 +272,13 @@ namespace SHADE if (arm->isActive == true) { camera.offset = arm->GetOffset(); + + SHVec3 tOffset = arm->GetTargetOffset(); + + + tOffset = SHVec3::RotateY(tOffset, SHMath::DegreesToRadians(arm->GetYaw())); + + if (arm->lookAtCameraOrigin) CameraLookAt(camera, camera.position + arm->GetTargetOffset()); diff --git a/SHADE_Engine/src/Editor/SHEditorUI.cpp b/SHADE_Engine/src/Editor/SHEditorUI.cpp index b9783020..45cf0f6c 100644 --- a/SHADE_Engine/src/Editor/SHEditorUI.cpp +++ b/SHADE_Engine/src/Editor/SHEditorUI.cpp @@ -308,7 +308,7 @@ namespace SHADE const bool CHANGED = ImGui::InputText("##", &buffer[0], TEXT_FIELD_MAX_LENGTH); if (CHANGED) { - value = std::string(buffer.data(), buffer.data() + TEXT_FIELD_MAX_LENGTH); + value = std::string(buffer.data(), buffer.data() + std::strlen(buffer.data())); } return CHANGED; } diff --git a/SHADE_Managed/src/Utility/Convert.cxx b/SHADE_Managed/src/Utility/Convert.cxx index 590a3cf0..4ff5dd43 100644 --- a/SHADE_Managed/src/Utility/Convert.cxx +++ b/SHADE_Managed/src/Utility/Convert.cxx @@ -91,12 +91,17 @@ namespace SHADE { if (str == nullptr) return ""; - return msclr::interop::marshal_as(str); + std::string s = msclr::interop::marshal_as(str); + s.substr(0, str->Length); + return s; } System::String^ Convert::ToCLI(const std::string& str) { - return msclr::interop::marshal_as(str); + if (str.empty()) + return ""; + + return msclr::interop::marshal_as(str)->Substring(0, str.length()); } /*---------------------------------------------------------------------------------*/