From 730daae1e65426d26cba0d01e0070dac03e6e8c0 Mon Sep 17 00:00:00 2001 From: santorac <55155825+santorac@users.noreply.github.com> Date: Thu, 20 Jan 2022 09:33:21 -0800 Subject: [PATCH] Added code comments. Signed-off-by: santorac <55155825+santorac@users.noreply.github.com> --- .../Code/Source/RPI.Reflect/Material/MaterialAsset.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp index f2a9efd896..92fded1d5d 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialAsset.cpp @@ -109,6 +109,9 @@ namespace AZ return m_wasPreFinalized; } + //! Attempts to convert a numeric MaterialPropertyValue to another numeric type @T, + //! since MaterialPropertyValue itself does not support any kind of casting. + //! If the original MaterialPropertyValue is not a numeric type, the original value is returned. template MaterialPropertyValue CastNumericMaterialPropertyValue(const MaterialPropertyValue& value) { @@ -135,7 +138,10 @@ namespace AZ return value; } } - + + //! Attempts to convert an AZ::Vector[2-4] MaterialPropertyValue to another AZ::Vector[2-4] type @T. + //! Any extra elements will be dropped or set to 0.0 as needed. + //! If the original MaterialPropertyValue is not a Vector type, the original value is returned. template MaterialPropertyValue CastVectorMaterialPropertyValue(const MaterialPropertyValue& value) {