Merge remote-tracking branch 'origin/master' into Menu

This commit is contained in:
Tleety
2016-03-09 17:24:41 +01:00
40 changed files with 1175 additions and 11568 deletions
+9 -5
View File
@@ -45,7 +45,7 @@ void InputProxy::Update(double dt)
}
}
void InputProxy::Process()
void InputProxy::Process(bool suppressNewEvents /*= false*/)
{
for (auto& pair : m_CommandHandlers) {
const std::string& command = pair.first;
@@ -62,8 +62,10 @@ void InputProxy::Process()
e.PlayerID = -1;
e.Command = command;
e.Value = currentValue;
m_EventBroker->Publish(e);
//LOG_DEBUG("Input: Published command %s=%f for player %i", e.Command.c_str(), e.Value, e.PlayerID);
if (!suppressNewEvents || e.Value == 0) {
m_EventBroker->Publish(e);
//LOG_DEBUG("Input: Published command %s=%f for player %i", e.Command.c_str(), e.Value, e.PlayerID);
}
m_LastCommandValues[command] = currentValue;
}
}
@@ -78,8 +80,10 @@ void InputProxy::Process()
e.Value += value;
}
//e.Value = std::max(-1.f, std::min(e.Value, 1.f));
m_EventBroker->Publish(e);
//LOG_DEBUG("Input: Published command %s=%f for player %i", e.Command.c_str(), e.Value, e.PlayerID);
if (!suppressNewEvents || e.Value == 0) {
m_EventBroker->Publish(e);
//LOG_DEBUG("Input: Published command %s=%f for player %i", e.Command.c_str(), e.Value, e.PlayerID);
}
}
m_CommandQueue.clear();
}
@@ -50,13 +50,15 @@ void BoneAttachmentSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapp
glm::vec4 perspective;
glm::decompose(boneTransform, scale, rotation, translation, skew, perspective);
glm::vec3 angles = glm::vec3(-glm::pitch(rotation), -glm::yaw(rotation), -glm::roll(rotation));
rotation = glm::quat((glm::vec3)entity["BoneAttachment"]["OrientationOffset"]) * rotation;
rotation = glm::inverse(rotation);
glm::vec3 angles = glm::eulerAngles(rotation);
if ((bool)entity["BoneAttachment"]["InheritPosition"]) {
(glm::vec3&)entity["Transform"]["Position"] = translation + (glm::vec3)entity["BoneAttachment"]["PositionOffset"];
}
if ((bool)entity["BoneAttachment"]["InheritOrientation"]) {
(glm::vec3&)entity["Transform"]["Orientation"] = angles + (glm::vec3)entity["BoneAttachment"]["OrientationOffset"];
(glm::vec3&)entity["Transform"]["Orientation"] = angles;
}
if ((bool)entity["BoneAttachment"]["InheritScale"]) {
(glm::vec3&)entity["Transform"]["Scale"] = scale * (glm::vec3)entity["BoneAttachment"]["ScaleOffset"];