CR feedback; add ability to update the render in the preference window.
Signed-off-by: rhhong <rhhong@amazon.com>
This commit is contained in:
@@ -41,16 +41,18 @@ namespace AZ::Render
|
||||
return;
|
||||
}
|
||||
|
||||
const AZ::Render::RenderActorSettings& renderActorSettings = EMotionFX::GetRenderActorSettings();
|
||||
|
||||
// Render aabb
|
||||
if (renderFlags[EMotionFX::ActorRenderFlag::RENDER_AABB])
|
||||
{
|
||||
RenderAABB(instance);
|
||||
RenderAABB(instance, renderActorSettings.m_staticAABBColor);
|
||||
}
|
||||
|
||||
// Render skeleton
|
||||
if (renderFlags[EMotionFX::ActorRenderFlag::RENDER_LINESKELETON])
|
||||
{
|
||||
RenderSkeleton(instance);
|
||||
RenderSkeleton(instance, renderActorSettings.m_skeletonColor);
|
||||
}
|
||||
|
||||
// Render internal EMFX debug lines.
|
||||
@@ -85,14 +87,16 @@ namespace AZ::Render
|
||||
continue;
|
||||
}
|
||||
|
||||
RenderNormals(mesh, globalTM, renderVertexNormals, renderFaceNormals, scaleMultiplier);
|
||||
RenderNormals(mesh, globalTM, renderVertexNormals, renderFaceNormals, renderActorSettings.m_vertexNormalsScale,
|
||||
renderActorSettings.m_faceNormalsScale, scaleMultiplier, renderActorSettings.m_vertexNormalsColor, renderActorSettings.m_faceNormalsColor);
|
||||
if (renderTangents)
|
||||
{
|
||||
RenderTangents(mesh, globalTM, scaleMultiplier);
|
||||
RenderTangents(mesh, globalTM, renderActorSettings.m_tangentsScale, scaleMultiplier,
|
||||
renderActorSettings.m_tangentsColor, renderActorSettings.m_mirroredBitangentsColor, renderActorSettings.m_bitangentsColor);
|
||||
}
|
||||
if (renderWireframe)
|
||||
{
|
||||
RenderWireframe(mesh, globalTM, scaleMultiplier);
|
||||
RenderWireframe(mesh, globalTM, renderActorSettings.m_wireframeScale, scaleMultiplier, renderActorSettings.m_wireframeColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -101,8 +105,8 @@ namespace AZ::Render
|
||||
float AtomActorDebugDraw::CalculateScaleMultiplier(EMotionFX::ActorInstance* instance) const
|
||||
{
|
||||
const AZ::Aabb aabb = instance->GetAabb();
|
||||
const float aabbRadius = AZ::Vector3(aabb.GetMax() - aabb.GetMin()).GetLength() * 0.5f;
|
||||
// Scale the multiplier down to 1% of the character size, that looks pretty nice on all models
|
||||
const float aabbRadius = aabb.GetExtents().GetLength() * 0.5f;
|
||||
// Scale the multiplier down to 1% of the character size, that looks pretty nice on most of the models.
|
||||
return aabbRadius * 0.01f;
|
||||
}
|
||||
|
||||
@@ -134,15 +138,14 @@ namespace AZ::Render
|
||||
}
|
||||
}
|
||||
|
||||
void AtomActorDebugDraw::RenderAABB(EMotionFX::ActorInstance* instance)
|
||||
void AtomActorDebugDraw::RenderAABB(EMotionFX::ActorInstance* instance, const AZ::Color& aabbColor)
|
||||
{
|
||||
RPI::AuxGeomDrawPtr auxGeom = m_auxGeomFeatureProcessor->GetDrawQueue();
|
||||
const AZ::Aabb& aabb = instance->GetAabb();
|
||||
const AZ::Render::RenderActorSettings& renderActorSettings = EMotionFX::GetRenderActorSettings();
|
||||
auxGeom->DrawAabb(aabb, renderActorSettings.m_staticAABBColor, RPI::AuxGeomDraw::DrawStyle::Line);
|
||||
auxGeom->DrawAabb(aabb, aabbColor, RPI::AuxGeomDraw::DrawStyle::Line);
|
||||
}
|
||||
|
||||
void AtomActorDebugDraw::RenderSkeleton(EMotionFX::ActorInstance* instance)
|
||||
void AtomActorDebugDraw::RenderSkeleton(EMotionFX::ActorInstance* instance, const AZ::Color& skeletonColor)
|
||||
{
|
||||
RPI::AuxGeomDrawPtr auxGeom = m_auxGeomFeatureProcessor->GetDrawQueue();
|
||||
|
||||
@@ -177,11 +180,10 @@ namespace AZ::Render
|
||||
m_auxVertices.emplace_back(bonePos);
|
||||
}
|
||||
|
||||
const AZ::Render::RenderActorSettings& renderActorSettings = EMotionFX::GetRenderActorSettings();
|
||||
RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments lineArgs;
|
||||
lineArgs.m_verts = m_auxVertices.data();
|
||||
lineArgs.m_vertCount = static_cast<uint32_t>(m_auxVertices.size());
|
||||
lineArgs.m_colors = &renderActorSettings.m_lineSkeletonColor;
|
||||
lineArgs.m_colors = &skeletonColor;
|
||||
lineArgs.m_colorCount = 1;
|
||||
lineArgs.m_depthTest = RPI::AuxGeomDraw::DepthTest::Off;
|
||||
auxGeom->DrawLines(lineArgs);
|
||||
@@ -229,7 +231,16 @@ namespace AZ::Render
|
||||
auxGeom->DrawLines(lineArgs);
|
||||
}
|
||||
|
||||
void AtomActorDebugDraw::RenderNormals(EMotionFX::Mesh* mesh, const AZ::Transform& worldTM, bool vertexNormals, bool faceNormals, float scaleMultiplier)
|
||||
void AtomActorDebugDraw::RenderNormals(
|
||||
EMotionFX::Mesh* mesh,
|
||||
const AZ::Transform& worldTM,
|
||||
bool vertexNormals,
|
||||
bool faceNormals,
|
||||
float vertexNormalsScale,
|
||||
float faceNormalsScale,
|
||||
float scaleMultiplier,
|
||||
const AZ::Color& vertexNormalsColor,
|
||||
const AZ::Color& faceNormalsColor)
|
||||
{
|
||||
if (!mesh)
|
||||
{
|
||||
@@ -247,8 +258,6 @@ namespace AZ::Render
|
||||
return;
|
||||
}
|
||||
|
||||
const AZ::Render::RenderActorSettings& renderActorSettings = EMotionFX::GetRenderActorSettings();
|
||||
|
||||
PrepareForMesh(mesh, worldTM);
|
||||
|
||||
AZ::Vector3* normals = (AZ::Vector3*)mesh->FindVertexData(EMotionFX::Mesh::ATTRIB_NORMALS);
|
||||
@@ -284,14 +293,14 @@ namespace AZ::Render
|
||||
const AZ::Vector3 normalPos = (posA + posB + posC) * (1.0f / 3.0f);
|
||||
|
||||
m_auxVertices.emplace_back(normalPos);
|
||||
m_auxVertices.emplace_back(normalPos + (normalDir * renderActorSettings.m_faceNormalsScale * scaleMultiplier));
|
||||
m_auxVertices.emplace_back(normalPos + (normalDir * faceNormalsScale * scaleMultiplier));
|
||||
}
|
||||
}
|
||||
|
||||
RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments lineArgs;
|
||||
lineArgs.m_verts = m_auxVertices.data();
|
||||
lineArgs.m_vertCount = static_cast<uint32_t>(m_auxVertices.size());
|
||||
lineArgs.m_colors = &renderActorSettings.m_faceNormalsColor;
|
||||
lineArgs.m_colors = &faceNormalsColor;
|
||||
lineArgs.m_colorCount = 1;
|
||||
lineArgs.m_depthTest = RPI::AuxGeomDraw::DepthTest::Off;
|
||||
auxGeom->DrawLines(lineArgs);
|
||||
@@ -315,7 +324,7 @@ namespace AZ::Render
|
||||
const uint32 vertexIndex = j + startVertex;
|
||||
const AZ::Vector3& position = m_worldSpacePositions[vertexIndex];
|
||||
const AZ::Vector3 normal = worldTM.TransformVector(normals[vertexIndex]).GetNormalizedSafe() *
|
||||
renderActorSettings.m_vertexNormalsScale * scaleMultiplier;
|
||||
vertexNormalsScale * scaleMultiplier;
|
||||
|
||||
m_auxVertices.emplace_back(position);
|
||||
m_auxVertices.emplace_back(position + normal);
|
||||
@@ -325,14 +334,21 @@ namespace AZ::Render
|
||||
RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments lineArgs;
|
||||
lineArgs.m_verts = m_auxVertices.data();
|
||||
lineArgs.m_vertCount = static_cast<uint32_t>(m_auxVertices.size());
|
||||
lineArgs.m_colors = &renderActorSettings.m_vertexNormalsColor;
|
||||
lineArgs.m_colors = &vertexNormalsColor;
|
||||
lineArgs.m_colorCount = 1;
|
||||
lineArgs.m_depthTest = RPI::AuxGeomDraw::DepthTest::Off;
|
||||
auxGeom->DrawLines(lineArgs);
|
||||
}
|
||||
}
|
||||
|
||||
void AtomActorDebugDraw::RenderTangents(EMotionFX::Mesh* mesh, const AZ::Transform& worldTM, float scaleMultiplier)
|
||||
void AtomActorDebugDraw::RenderTangents(
|
||||
EMotionFX::Mesh* mesh,
|
||||
const AZ::Transform& worldTM,
|
||||
float tangentsScale,
|
||||
float scaleMultiplier,
|
||||
const AZ::Color& tangentsColor,
|
||||
const AZ::Color& mirroredBitangentsColor,
|
||||
const AZ::Color& bitangentsColor)
|
||||
{
|
||||
if (!mesh)
|
||||
{
|
||||
@@ -345,8 +361,6 @@ namespace AZ::Render
|
||||
return;
|
||||
}
|
||||
|
||||
const AZ::Render::RenderActorSettings& renderActorSettings = EMotionFX::GetRenderActorSettings();
|
||||
|
||||
// Get the tangents and check if this mesh actually has tangents
|
||||
AZ::Vector4* tangents = static_cast<AZ::Vector4*>(mesh->FindVertexData(EMotionFX::Mesh::ATTRIB_TANGENTS));
|
||||
if (!tangents)
|
||||
@@ -384,23 +398,23 @@ namespace AZ::Render
|
||||
bitangent = (worldTM.TransformVector(bitangent)).GetNormalizedSafe();
|
||||
|
||||
m_auxVertices.emplace_back(m_worldSpacePositions[i]);
|
||||
m_auxColors.emplace_back(renderActorSettings.m_tangentsColor);
|
||||
m_auxVertices.emplace_back(m_worldSpacePositions[i] + (tangent * renderActorSettings.m_tangentsScale * scaleMultiplier));
|
||||
m_auxColors.emplace_back(renderActorSettings.m_tangentsColor);
|
||||
m_auxColors.emplace_back(tangentsColor);
|
||||
m_auxVertices.emplace_back(m_worldSpacePositions[i] + (tangent * tangentsScale * scaleMultiplier));
|
||||
m_auxColors.emplace_back(tangentsColor);
|
||||
|
||||
if (tangents[i].GetW() < 0.0f)
|
||||
{
|
||||
m_auxVertices.emplace_back(m_worldSpacePositions[i]);
|
||||
m_auxColors.emplace_back(renderActorSettings.m_mirroredBitangentsColor);
|
||||
m_auxVertices.emplace_back(m_worldSpacePositions[i] + (bitangent * renderActorSettings.m_tangentsScale * scaleMultiplier));
|
||||
m_auxColors.emplace_back(renderActorSettings.m_mirroredBitangentsColor);
|
||||
m_auxColors.emplace_back(mirroredBitangentsColor);
|
||||
m_auxVertices.emplace_back(m_worldSpacePositions[i] + (bitangent * tangentsScale * scaleMultiplier));
|
||||
m_auxColors.emplace_back(mirroredBitangentsColor);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_auxVertices.emplace_back(m_worldSpacePositions[i]);
|
||||
m_auxColors.emplace_back(renderActorSettings.m_bitangentsColor);
|
||||
m_auxVertices.emplace_back(m_worldSpacePositions[i] + (bitangent * renderActorSettings.m_tangentsScale * scaleMultiplier));
|
||||
m_auxColors.emplace_back(renderActorSettings.m_bitangentsColor);
|
||||
m_auxColors.emplace_back(bitangentsColor);
|
||||
m_auxVertices.emplace_back(m_worldSpacePositions[i] + (bitangent * tangentsScale * scaleMultiplier));
|
||||
m_auxColors.emplace_back(bitangentsColor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -413,7 +427,8 @@ namespace AZ::Render
|
||||
auxGeom->DrawLines(lineArgs);
|
||||
}
|
||||
|
||||
void AtomActorDebugDraw::RenderWireframe(EMotionFX::Mesh* mesh, const AZ::Transform& worldTM, float scaleMultiplier)
|
||||
void AtomActorDebugDraw::RenderWireframe(
|
||||
EMotionFX::Mesh* mesh, const AZ::Transform& worldTM, float wireframeScale, float scaleMultiplier, const AZ::Color& wireframeColor)
|
||||
{
|
||||
// Check if the mesh is valid and skip the node in case it's not
|
||||
if (!mesh)
|
||||
@@ -427,7 +442,6 @@ namespace AZ::Render
|
||||
return;
|
||||
}
|
||||
|
||||
const AZ::Render::RenderActorSettings& renderActorSettings = EMotionFX::GetRenderActorSettings();
|
||||
PrepareForMesh(mesh, worldTM);
|
||||
|
||||
const AZ::Vector3* normals = (AZ::Vector3*)mesh->FindVertexData(EMotionFX::Mesh::ATTRIB_NORMALS);
|
||||
@@ -450,12 +464,9 @@ namespace AZ::Render
|
||||
const uint32 indexB = indices[triangleStartIndex + 1] + startVertex;
|
||||
const uint32 indexC = indices[triangleStartIndex + 2] + startVertex;
|
||||
|
||||
const AZ::Vector3 posA =
|
||||
m_worldSpacePositions[indexA] + normals[indexA] * renderActorSettings.m_wireframeScale * scaleMultiplier;
|
||||
const AZ::Vector3 posB =
|
||||
m_worldSpacePositions[indexB] + normals[indexB] * renderActorSettings.m_wireframeScale * scaleMultiplier;
|
||||
const AZ::Vector3 posC =
|
||||
m_worldSpacePositions[indexC] + normals[indexC] * renderActorSettings.m_wireframeScale * scaleMultiplier;
|
||||
const AZ::Vector3 posA = m_worldSpacePositions[indexA] + normals[indexA] * wireframeScale * scaleMultiplier;
|
||||
const AZ::Vector3 posB = m_worldSpacePositions[indexB] + normals[indexB] * wireframeScale * scaleMultiplier;
|
||||
const AZ::Vector3 posC = m_worldSpacePositions[indexC] + normals[indexC] * wireframeScale * scaleMultiplier;
|
||||
|
||||
m_auxVertices.emplace_back(posA);
|
||||
m_auxVertices.emplace_back(posB);
|
||||
@@ -470,7 +481,7 @@ namespace AZ::Render
|
||||
RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments lineArgs;
|
||||
lineArgs.m_verts = m_auxVertices.data();
|
||||
lineArgs.m_vertCount = static_cast<uint32_t>(m_auxVertices.size());
|
||||
lineArgs.m_colors = &renderActorSettings.m_wireframeColor;
|
||||
lineArgs.m_colors = &wireframeColor;
|
||||
lineArgs.m_colorCount = 1;
|
||||
lineArgs.m_depthTest = RPI::AuxGeomDraw::DepthTest::Off;
|
||||
auxGeom->DrawLines(lineArgs);
|
||||
|
||||
@@ -39,12 +39,24 @@ namespace AZ::Render
|
||||
|
||||
float CalculateScaleMultiplier(EMotionFX::ActorInstance* instance) const;
|
||||
void PrepareForMesh(EMotionFX::Mesh* mesh, const AZ::Transform& worldTM);
|
||||
void RenderAABB(EMotionFX::ActorInstance* instance);
|
||||
void RenderSkeleton(EMotionFX::ActorInstance* instance);
|
||||
void RenderAABB(EMotionFX::ActorInstance* instance, const AZ::Color& aabbColor);
|
||||
void RenderSkeleton(EMotionFX::ActorInstance* instance, const AZ::Color& skeletonColor);
|
||||
void RenderEMFXDebugDraw(EMotionFX::ActorInstance* instance);
|
||||
void RenderNormals(EMotionFX::Mesh* mesh, const AZ::Transform& worldTM, bool vertexNormals, bool faceNormals, float scaleMultiplier);
|
||||
void RenderTangents(EMotionFX::Mesh* mesh, const AZ::Transform& worldTM, float scaleMultiplier);
|
||||
void RenderWireframe(EMotionFX::Mesh* mesh, const AZ::Transform& worldTM, float scaleMultiplier);
|
||||
void RenderNormals(
|
||||
EMotionFX::Mesh* mesh,
|
||||
const AZ::Transform& worldTM,
|
||||
bool vertexNormals,
|
||||
bool faceNormals,
|
||||
float vertexNormalsScale,
|
||||
float faceNormalsScale,
|
||||
float scaleMultiplier,
|
||||
const AZ::Color& vertexNormalsColor,
|
||||
const AZ::Color& faceNormalsColor);
|
||||
void RenderTangents(
|
||||
EMotionFX::Mesh* mesh, const AZ::Transform& worldTM, float tangentsScale, float scaleMultiplier,
|
||||
const AZ::Color& tangentsColor, const AZ::Color& mirroredBitangentsColor, const AZ::Color& bitangentsColor);
|
||||
void RenderWireframe(EMotionFX::Mesh* mesh, const AZ::Transform& worldTM, float wireframeScale, float scaleMultiplier,
|
||||
const AZ::Color& wireframeColor);
|
||||
|
||||
EMotionFX::Mesh* m_currentMesh = nullptr; /**< A pointer to the mesh whose world space positions are in the pre-calculated positions buffer.
|
||||
NULL in case we haven't pre-calculated any positions yet. */
|
||||
|
||||
@@ -76,7 +76,6 @@ namespace EMotionFX
|
||||
gEMFX.Get()->SetRecorder (Recorder::Create());
|
||||
gEMFX.Get()->SetMotionInstancePool (MotionInstancePool::Create());
|
||||
gEMFX.Get()->SetDebugDraw (aznew DebugDraw());
|
||||
gEMFX.Get()->SetRenderActorSettings (new AZ::Render::RenderActorSettings());
|
||||
gEMFX.Get()->SetGlobalSimulationSpeed (1.0f);
|
||||
|
||||
// set the number of threads
|
||||
@@ -125,7 +124,6 @@ namespace EMotionFX
|
||||
m_recorder = nullptr;
|
||||
m_motionInstancePool = nullptr;
|
||||
m_debugDraw = nullptr;
|
||||
m_renderActorSettings = nullptr;
|
||||
m_unitType = MCore::Distance::UNITTYPE_METERS;
|
||||
m_globalSimulationSpeed = 1.0f;
|
||||
m_isInEditorMode = false;
|
||||
@@ -138,6 +136,8 @@ namespace EMotionFX
|
||||
{
|
||||
RegisterMemoryCategories(MCore::GetMemoryTracker());
|
||||
}
|
||||
|
||||
m_renderActorSettings = AZStd::make_unique<AZ::Render::RenderActorSettings>();
|
||||
}
|
||||
|
||||
|
||||
@@ -170,8 +170,7 @@ namespace EMotionFX
|
||||
delete m_debugDraw;
|
||||
m_debugDraw = nullptr;
|
||||
|
||||
delete m_renderActorSettings;
|
||||
m_renderActorSettings = nullptr;
|
||||
m_renderActorSettings.reset();
|
||||
|
||||
m_eventManager->Destroy();
|
||||
m_eventManager = nullptr;
|
||||
@@ -316,11 +315,6 @@ namespace EMotionFX
|
||||
m_debugDraw = draw;
|
||||
}
|
||||
|
||||
void EMotionFXManager::SetRenderActorSettings(AZ::Render::RenderActorSettings* settings)
|
||||
{
|
||||
m_renderActorSettings = settings;
|
||||
}
|
||||
|
||||
// set the motion instance pool
|
||||
void EMotionFXManager::SetMotionInstancePool(MotionInstancePool* pool)
|
||||
{
|
||||
|
||||
@@ -192,9 +192,9 @@ namespace EMotionFX
|
||||
* Get the render actor settings
|
||||
* @result A pointer to global render actor settings.
|
||||
*/
|
||||
MCORE_INLINE AZ::Render::RenderActorSettings* GetRenderActorSettings() const
|
||||
AZ::Render::RenderActorSettings* GetRenderActorSettings() const
|
||||
{
|
||||
return m_renderActorSettings;
|
||||
return m_renderActorSettings.get();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -360,7 +360,7 @@ namespace EMotionFX
|
||||
Recorder* m_recorder; /**< The recorder. */
|
||||
MotionInstancePool* m_motionInstancePool; /**< The motion instance pool. */
|
||||
DebugDraw* m_debugDraw; /**< The debug drawing system. */
|
||||
AZ::Render::RenderActorSettings* m_renderActorSettings; /**< The global render actor settings. */
|
||||
AZStd::unique_ptr<AZ::Render::RenderActorSettings> m_renderActorSettings; /**< The global render actor settings. */
|
||||
|
||||
AZStd::vector<ThreadData*> m_threadDatas; /**< The per thread data. */
|
||||
MCore::Distance::EUnitType m_unitType; /**< The unit type, on default it is MCore::Distance::UNITTYPE_METERS. */
|
||||
@@ -427,12 +427,6 @@ namespace EMotionFX
|
||||
*/
|
||||
void SetDebugDraw(DebugDraw* draw);
|
||||
|
||||
/**
|
||||
* Set the render actor settings.
|
||||
* @param settings The render actor settings.
|
||||
*/
|
||||
void SetRenderActorSettings(AZ::Render::RenderActorSettings* settings);
|
||||
|
||||
/**
|
||||
* Set the motion instance pool.
|
||||
* @param pool The motion instance pool.
|
||||
@@ -526,5 +520,5 @@ namespace EMotionFX
|
||||
MCORE_INLINE Recorder& GetRecorder() { return *GetEMotionFX().GetRecorder(); } /**< Get the recorder. */
|
||||
MCORE_INLINE MotionInstancePool& GetMotionInstancePool() { return *GetEMotionFX().GetMotionInstancePool(); } /**< Get the motion instance pool. */
|
||||
MCORE_INLINE DebugDraw& GetDebugDraw() { return *GetEMotionFX().GetDebugDraw(); } /**< Get the debug drawing. */
|
||||
MCORE_INLINE AZ::Render::RenderActorSettings& GetRenderActorSettings() { return *GetEMotionFX().GetRenderActorSettings(); }/**< Get the render actor settings. */
|
||||
MCORE_INLINE AZ::Render::RenderActorSettings& GetRenderActorSettings() { return *GetEMotionFX().GetRenderActorSettings(); }/**< Get the render actor settings. */
|
||||
} // namespace EMotionFX
|
||||
|
||||
+12
-2
@@ -316,8 +316,7 @@ namespace EMStudio
|
||||
|
||||
options.m_manipulatorMode = static_cast<ManipulatorMode>(settings->value("manipulatorMode", options.m_manipulatorMode).toInt());
|
||||
|
||||
AZ::Render::RenderActorSettings& renderActorSettings = EMotionFX::GetRenderActorSettings();
|
||||
options.CopyToRenderActorSettings(renderActorSettings);
|
||||
options.CopyToRenderActorSettings(EMotionFX::GetRenderActorSettings());
|
||||
|
||||
return options;
|
||||
}
|
||||
@@ -1083,16 +1082,19 @@ namespace EMStudio
|
||||
void RenderOptions::OnVertexNormalsScaleChangedCallback() const
|
||||
{
|
||||
PluginOptionsNotificationsBus::Event(s_vertexNormalsScaleOptionName, &PluginOptionsNotificationsBus::Events::OnOptionChanged, s_vertexNormalsScaleOptionName);
|
||||
CopyToRenderActorSettings(EMotionFX::GetRenderActorSettings());
|
||||
}
|
||||
|
||||
void RenderOptions::OnFaceNormalsScaleChangedCallback() const
|
||||
{
|
||||
PluginOptionsNotificationsBus::Event(s_faceNormalsScaleOptionName, &PluginOptionsNotificationsBus::Events::OnOptionChanged, s_faceNormalsScaleOptionName);
|
||||
CopyToRenderActorSettings(EMotionFX::GetRenderActorSettings());
|
||||
}
|
||||
|
||||
void RenderOptions::OnTangentsScaleChangedCallback() const
|
||||
{
|
||||
PluginOptionsNotificationsBus::Event(s_tangentsScaleOptionName, &PluginOptionsNotificationsBus::Events::OnOptionChanged, s_tangentsScaleOptionName);
|
||||
CopyToRenderActorSettings(EMotionFX::GetRenderActorSettings());
|
||||
}
|
||||
|
||||
void RenderOptions::OnNodeOrientationScaleChangedCallback() const
|
||||
@@ -1193,6 +1195,7 @@ namespace EMStudio
|
||||
void RenderOptions::OnWireframeColorChangedCallback() const
|
||||
{
|
||||
PluginOptionsNotificationsBus::Event(s_wireframeColorOptionName, &PluginOptionsNotificationsBus::Events::OnOptionChanged, s_wireframeColorOptionName);
|
||||
CopyToRenderActorSettings(EMotionFX::GetRenderActorSettings());
|
||||
}
|
||||
|
||||
void RenderOptions::OnCollisionMeshColorChangedCallback() const
|
||||
@@ -1203,26 +1206,31 @@ namespace EMStudio
|
||||
void RenderOptions::OnVertexNormalsColorChangedCallback() const
|
||||
{
|
||||
PluginOptionsNotificationsBus::Event(s_vertexNormalsColorOptionName, &PluginOptionsNotificationsBus::Events::OnOptionChanged, s_vertexNormalsColorOptionName);
|
||||
CopyToRenderActorSettings(EMotionFX::GetRenderActorSettings());
|
||||
}
|
||||
|
||||
void RenderOptions::OnFaceNormalsColorChangedCallback() const
|
||||
{
|
||||
PluginOptionsNotificationsBus::Event(s_faceNormalsColorOptionName, &PluginOptionsNotificationsBus::Events::OnOptionChanged, s_faceNormalsColorOptionName);
|
||||
CopyToRenderActorSettings(EMotionFX::GetRenderActorSettings());
|
||||
}
|
||||
|
||||
void RenderOptions::OnTangentsColorChangedCallback() const
|
||||
{
|
||||
PluginOptionsNotificationsBus::Event(s_tangentsColorOptionName, &PluginOptionsNotificationsBus::Events::OnOptionChanged, s_tangentsColorOptionName);
|
||||
CopyToRenderActorSettings(EMotionFX::GetRenderActorSettings());
|
||||
}
|
||||
|
||||
void RenderOptions::OnMirroredBitangentsColorChangedCallback() const
|
||||
{
|
||||
PluginOptionsNotificationsBus::Event(s_mirroredBitangentsColorOptionName, &PluginOptionsNotificationsBus::Events::OnOptionChanged, s_mirroredBitangentsColorOptionName);
|
||||
CopyToRenderActorSettings(EMotionFX::GetRenderActorSettings());
|
||||
}
|
||||
|
||||
void RenderOptions::OnBitangentsColorChangedCallback() const
|
||||
{
|
||||
PluginOptionsNotificationsBus::Event(s_bitangentsColorOptionName, &PluginOptionsNotificationsBus::Events::OnOptionChanged, s_bitangentsColorOptionName);
|
||||
CopyToRenderActorSettings(EMotionFX::GetRenderActorSettings());
|
||||
}
|
||||
|
||||
void RenderOptions::OnNodeAABBColorChangedCallback() const
|
||||
@@ -1233,6 +1241,7 @@ namespace EMStudio
|
||||
void RenderOptions::OnStaticAABBColorChangedCallback() const
|
||||
{
|
||||
PluginOptionsNotificationsBus::Event(s_staticAABBColorOptionName, &PluginOptionsNotificationsBus::Events::OnOptionChanged, s_staticAABBColorOptionName);
|
||||
CopyToRenderActorSettings(EMotionFX::GetRenderActorSettings());
|
||||
}
|
||||
|
||||
void RenderOptions::OnMeshAABBColorChangedCallback() const
|
||||
@@ -1243,6 +1252,7 @@ namespace EMStudio
|
||||
void RenderOptions::OnLineSkeletonColorChangedCallback() const
|
||||
{
|
||||
PluginOptionsNotificationsBus::Event(s_lineSkeletonColorOptionName, &PluginOptionsNotificationsBus::Events::OnOptionChanged, s_lineSkeletonColorOptionName);
|
||||
CopyToRenderActorSettings(EMotionFX::GetRenderActorSettings());
|
||||
}
|
||||
|
||||
void RenderOptions::OnSkeletonColorChangedCallback() const
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/Math/Color.h>
|
||||
#include <AzCore/Memory/SystemAllocator.h>
|
||||
|
||||
namespace AZ::Render
|
||||
{
|
||||
@@ -16,6 +17,9 @@ namespace AZ::Render
|
||||
class RenderActorSettings
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(RenderActorSettings, "{240BDFE2-D7F5-4927-A8CA-D2945E41AFFD}");
|
||||
AZ_CLASS_ALLOCATOR(RenderActorSettings, AZ::SystemAllocator, 0)
|
||||
|
||||
float m_vertexNormalsScale = 1.0f;
|
||||
float m_faceNormalsScale = 1.0f;
|
||||
float m_tangentsScale = 1.0f;
|
||||
|
||||
Reference in New Issue
Block a user