Merge branch 'main' into LY-123620
commit
962371979e
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Icons / Toolbar / Non Uniform Scaling</title>
|
||||
<defs>
|
||||
<rect id="path-1" x="3" y="3" width="18" height="18"></rect>
|
||||
<mask id="mask-2" maskContentUnits="userSpaceOnUse" maskUnits="objectBoundingBox" x="0" y="0" width="18" height="18" fill="white">
|
||||
<use xlink:href="#path-1"></use>
|
||||
</mask>
|
||||
</defs>
|
||||
<g id="Icons-/-Toolbar-/-Non-Uniform-Scaling" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Group">
|
||||
<rect id="Icon-Background" x="0" y="0" width="24" height="24"></rect>
|
||||
<g id="Group-3" transform="translate(4.644661, 5.000000)" fill="#65C98C">
|
||||
<rect id="Rectangle" x="3.16582489" y="1.21320344" width="1.95262146" height="5"></rect>
|
||||
<polygon id="Rectangle" points="4.14213562 -1.71418435e-13 8.28427125 4.14213562 -1.11910481e-13 4.14213562"></polygon>
|
||||
</g>
|
||||
<g id="Group-4" transform="translate(13.073593, 10.857864)" fill="#65C98C">
|
||||
<g id="Group-2" transform="translate(0.000000, 0.000000)">
|
||||
<rect id="Rectangle" x="0" y="3.16582489" width="4" height="1.95262146"></rect>
|
||||
<polygon id="Rectangle" points="5.71320344 4.14213562 1.57106781 8.28427125 1.57106781 1.14575016e-13"></polygon>
|
||||
</g>
|
||||
</g>
|
||||
<rect id="Rectangle" stroke="#65C98C" fill="#65C98C" x="3.5" y="12.5" width="8" height="8"></rect>
|
||||
<use id="Rectangle" stroke="#65C98C" mask="url(#mask-2)" stroke-width="2" stroke-dasharray="1" xlink:href="#path-1"></use>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
@ -0,0 +1,112 @@
|
||||
"""
|
||||
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
its licensors.
|
||||
|
||||
For complete copyright and license terms please see the LICENSE at the root of this
|
||||
distribution (the "License"). All use of this software is governed by the License,
|
||||
or, if provided, by the license below or the license accompanying this file. Do not
|
||||
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
Test Case Title: Event can return a value of set type successfully
|
||||
"""
|
||||
|
||||
|
||||
# fmt: off
|
||||
class Tests():
|
||||
level_created = ("Successfully created temporary level", "Failed to create temporary level")
|
||||
entity_created = ("Successfully created test entity", "Failed to create test entity")
|
||||
enter_game_mode = ("Successfully entered game mode", "Failed to enter game mode")
|
||||
lines_found = ("Successfully found expected message", "Failed to find expected message")
|
||||
exit_game_mode = ("Successfully exited game mode", "Failed to exit game mode")
|
||||
# fmt: on
|
||||
|
||||
|
||||
def ScriptEvents_ReturnSetType_Successfully():
|
||||
"""
|
||||
Summary: A temporary level is created with an Entity having ScriptCanvas component.
|
||||
ScriptEvent(T92569006_ScriptEvent.scriptevents) is created with one Method that has a return value.
|
||||
ScriptCanvas(T92569006_ScriptCanvas.scriptcanvas) is attached to Entity. Graph has Send node that sends the Method
|
||||
of the ScriptEvent and prints the returned result ( On Entity Activated -> Send node -> Print) and Receive node is
|
||||
set to return custom value ( Receive node -> Print).
|
||||
Verify that the entity containing T92569006_ScriptCanvas.scriptcanvas should print the custom value set in both
|
||||
Send and Receive nodes.
|
||||
|
||||
Expected Behavior:
|
||||
After entering game mode, the graph on the entity should print an expected message to the console
|
||||
|
||||
Test Steps:
|
||||
1) Create test level
|
||||
2) Create test entity
|
||||
3) Start Tracer
|
||||
4) Enter Game Mode
|
||||
5) Read for line
|
||||
6) Exit Game Mode
|
||||
|
||||
Note:
|
||||
- This test file must be called from the Open 3D Engine Editor command terminal
|
||||
- Any passed and failed tests are written to the Editor.log file.
|
||||
Parsing the file or running a log_monitor are required to observe the test results.
|
||||
|
||||
:return: None
|
||||
"""
|
||||
import os
|
||||
from editor_entity_utils import EditorEntity as Entity
|
||||
from utils import Report
|
||||
from utils import TestHelper as helper
|
||||
from utils import Tracer
|
||||
|
||||
import azlmbr.legacy.general as general
|
||||
import azlmbr.asset as asset
|
||||
import azlmbr.math as math
|
||||
import azlmbr.bus as bus
|
||||
|
||||
LEVEL_NAME = "tmp_level"
|
||||
WAIT_TIME = 3.0 # SECONDS
|
||||
EXPECTED_LINES = ["T92569006_ScriptEvent_Sent", "T92569006_ScriptEvent_Received"]
|
||||
SC_ASSET_PATH = os.path.join("ScriptCanvas", "T92569006_ScriptCanvas.scriptcanvas")
|
||||
|
||||
def create_editor_entity(name, sc_asset):
|
||||
entity = Entity.create_editor_entity(name)
|
||||
sc_comp = entity.add_component("Script Canvas")
|
||||
asset_id = asset.AssetCatalogRequestBus(bus.Broadcast, "GetAssetIdByPath", sc_asset, math.Uuid(), False)
|
||||
sc_comp.set_component_property_value("Script Canvas Asset|Script Canvas Asset", asset_id)
|
||||
Report.critical_result(Tests.entity_created, entity.id.isValid())
|
||||
|
||||
def locate_expected_lines(line_list: list):
|
||||
found_lines = [printInfo.message.strip() for printInfo in section_tracer.prints]
|
||||
|
||||
return all(line in found_lines for line in line_list)
|
||||
|
||||
# 1) Create temp level
|
||||
general.idle_enable(True)
|
||||
result = general.create_level_no_prompt(LEVEL_NAME, 128, 1, 512, True)
|
||||
Report.critical_result(Tests.level_created, result == 0)
|
||||
helper.wait_for_condition(lambda: general.get_current_level_name() == LEVEL_NAME, WAIT_TIME)
|
||||
general.close_pane("Error Report")
|
||||
|
||||
# 2) Create test entity
|
||||
create_editor_entity("TestEntity", SC_ASSET_PATH)
|
||||
|
||||
# 3) Start Tracer
|
||||
with Tracer() as section_tracer:
|
||||
|
||||
# 4) Enter Game Mode
|
||||
helper.enter_game_mode(Tests.enter_game_mode)
|
||||
|
||||
# 5) Read for line
|
||||
lines_located = helper.wait_for_condition(lambda: locate_expected_lines(EXPECTED_LINES), WAIT_TIME)
|
||||
Report.result(Tests.lines_found, lines_located)
|
||||
|
||||
# 6) Exit Game Mode
|
||||
helper.exit_game_mode(Tests.exit_game_mode)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import ImportPathHelper as imports
|
||||
|
||||
imports.init()
|
||||
|
||||
from utils import Report
|
||||
|
||||
Report.start_test(ScriptEvents_ReturnSetType_Successfully)
|
||||
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a2a3360287a4711882c4254d64ca2ba70cd743012a7d38ca29aa2a57f151efaa
|
||||
size 6661
|
||||
oid sha256:e15d484113e8151072b410924747a8ad304f6f12457fad577308c0491693ab34
|
||||
size 5472
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<download name="C18977329_NvCloth_AddClothSimulationToMesh" type="Map">
|
||||
<index src="filelist.xml" dest="filelist.xml"/>
|
||||
<files>
|
||||
<file src="level.pak" dest="level.pak" size="9946" md5="7368d6ce15bfc09a92f694efe73a00ec"/>
|
||||
<file src="level.pak" dest="level.pak" size="97C8" md5="64e64e1e3345dacace01dde152c72250"/>
|
||||
</files>
|
||||
</download>
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:cd8105f020151e65093988dfb09ab42ff8d33ef5b97c61fbe0011384870aadf8
|
||||
size 39238
|
||||
oid sha256:64de37c805b0be77cdb7a85b5406af58b7f845e7d97fec1721ac5d789bb641db
|
||||
size 38856
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f53fb5e096ff562e9f0f12856ce387891596776d086f49c7ed3a59dcd0a0c11a
|
||||
size 6535
|
||||
oid sha256:7b595323d4d51211463dea0338abb6ce2a4a0a8d41efb12ac3c9dccd1f972171
|
||||
size 5504
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<download name="C18977330_NvCloth_AddClothSimulationToActor" type="Map">
|
||||
<index src="filelist.xml" dest="filelist.xml"/>
|
||||
<files>
|
||||
<file src="level.pak" dest="level.pak" size="990B" md5="7c17ac9bc5bd3e14e196b731a7e8eed7"/>
|
||||
<file src="level.pak" dest="level.pak" size="9941" md5="297730934d657d7ca57a7357ee9cd566"/>
|
||||
</files>
|
||||
</download>
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:87fbd9fda267daa505f11276b64f47c26115bee9e6d14f2a6f5a1cf1e1234218
|
||||
size 39179
|
||||
oid sha256:617c455668fc41cb7fd69de690e4aa3c80f2cb36deaa371902b79de18fcd1cb2
|
||||
size 39233
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,126 @@
|
||||
<ObjectStream version="3">
|
||||
<Class name="ScriptEventsAsset" version="1" type="{CB4D603E-8CB0-4D80-8165-4244F28AF187}">
|
||||
<Class name="ScriptEvent" field="m_definition" version="1" type="{10A08CD3-32C9-4E18-8039-4B8A8157918E}">
|
||||
<Class name="unsigned int" field="m_version" value="4" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="VersionedProperty" field="m_name" version="4" type="{828CA9C0-32F1-40B3-8018-EE7C3C38192A}">
|
||||
<Class name="AZ::Uuid" field="m_id" value="{1E4A668C-8300-4047-AEA2-F5FEBF11EBA0}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="AZStd::string" field="m_label" value="Name" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="unsigned int" field="m_version" value="1" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::vector" field="m_versions" type="{326CAAFE-9101-56E2-B869-D770629A6B19}">
|
||||
<Class name="VersionedProperty" field="element" version="4" type="{828CA9C0-32F1-40B3-8018-EE7C3C38192A}">
|
||||
<Class name="AZ::Uuid" field="m_id" value="{1E4A668C-8300-4047-AEA2-F5FEBF11EBA0}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="AZStd::string" field="m_label" value="Name" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="unsigned int" field="m_version" value="0" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::vector" field="m_versions" type="{326CAAFE-9101-56E2-B869-D770629A6B19}"/>
|
||||
<Class name="any" field="m_data" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}">
|
||||
<Class name="AZStd::string" field="m_data" value="EventName" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="any" field="m_data" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}">
|
||||
<Class name="AZStd::string" field="m_data" value="T92569006_ScriptEvent" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="VersionedProperty" field="m_category" version="4" type="{828CA9C0-32F1-40B3-8018-EE7C3C38192A}">
|
||||
<Class name="AZ::Uuid" field="m_id" value="{73D97530-40F2-48FD-91BA-C20ABB0C6620}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="AZStd::string" field="m_label" value="Category" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="unsigned int" field="m_version" value="0" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::vector" field="m_versions" type="{326CAAFE-9101-56E2-B869-D770629A6B19}"/>
|
||||
<Class name="any" field="m_data" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}">
|
||||
<Class name="AZStd::string" field="m_data" value="Script Events" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="VersionedProperty" field="m_tooltip" version="4" type="{828CA9C0-32F1-40B3-8018-EE7C3C38192A}">
|
||||
<Class name="AZ::Uuid" field="m_id" value="{9D4BB4C1-8A94-43B9-BED7-C104D7758916}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="AZStd::string" field="m_label" value="Tooltip" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="unsigned int" field="m_version" value="0" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::vector" field="m_versions" type="{326CAAFE-9101-56E2-B869-D770629A6B19}"/>
|
||||
<Class name="any" field="m_data" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}">
|
||||
<Class name="AZStd::string" field="m_data" value="" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="VersionedProperty" field="m_addressType" version="4" type="{828CA9C0-32F1-40B3-8018-EE7C3C38192A}">
|
||||
<Class name="AZ::Uuid" field="m_id" value="{8D528B1F-1FEE-43BA-BD5D-C7EB3707B781}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="AZStd::string" field="m_label" value="Address Type" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="unsigned int" field="m_version" value="0" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::vector" field="m_versions" type="{326CAAFE-9101-56E2-B869-D770629A6B19}"/>
|
||||
<Class name="any" field="m_data" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}">
|
||||
<Class name="AZ::Uuid" field="m_data" value="{C0F1AFAD-5CB3-450E-B0F5-ADB5D46B0E22}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="AZStd::vector" field="m_methods" type="{D9866B79-D11A-58E6-B974-0B45783F53A4}">
|
||||
<Class name="Method" field="element" type="{E034EA83-C798-413D-ACE8-4923C51CF4F7}">
|
||||
<Class name="VersionedProperty" field="m_name" version="4" type="{828CA9C0-32F1-40B3-8018-EE7C3C38192A}">
|
||||
<Class name="AZ::Uuid" field="m_id" value="{0DEB2C25-6B32-44B7-9750-56CAA789C016}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="AZStd::string" field="m_label" value="Name" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="unsigned int" field="m_version" value="0" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::vector" field="m_versions" type="{326CAAFE-9101-56E2-B869-D770629A6B19}"/>
|
||||
<Class name="any" field="m_data" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}">
|
||||
<Class name="AZStd::string" field="m_data" value="MethodName" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="VersionedProperty" field="m_tooltip" version="4" type="{828CA9C0-32F1-40B3-8018-EE7C3C38192A}">
|
||||
<Class name="AZ::Uuid" field="m_id" value="{664A28E6-AD74-4EA7-BDE8-49CA02D1C5C7}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="AZStd::string" field="m_label" value="Tooltip" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="unsigned int" field="m_version" value="0" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::vector" field="m_versions" type="{326CAAFE-9101-56E2-B869-D770629A6B19}"/>
|
||||
<Class name="any" field="m_data" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}">
|
||||
<Class name="AZStd::string" field="m_data" value="" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="VersionedProperty" field="m_returnType" version="4" type="{828CA9C0-32F1-40B3-8018-EE7C3C38192A}">
|
||||
<Class name="AZ::Uuid" field="m_id" value="{D2C6D979-A036-4523-B79E-98D3A1D4F623}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="AZStd::string" field="m_label" value="String" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="unsigned int" field="m_version" value="1" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::vector" field="m_versions" type="{326CAAFE-9101-56E2-B869-D770629A6B19}">
|
||||
<Class name="VersionedProperty" field="element" version="4" type="{828CA9C0-32F1-40B3-8018-EE7C3C38192A}">
|
||||
<Class name="AZ::Uuid" field="m_id" value="{A2629A45-21A2-4101-BF0D-1F843B3398D7}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="AZStd::string" field="m_label" value="Return Type" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="unsigned int" field="m_version" value="0" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::vector" field="m_versions" type="{326CAAFE-9101-56E2-B869-D770629A6B19}"/>
|
||||
<Class name="any" field="m_data" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}">
|
||||
<Class name="AZ::Uuid" field="m_data" value="{C0F1AFAD-5CB3-450E-B0F5-ADB5D46B0E22}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="any" field="m_data" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}">
|
||||
<Class name="AZ::Uuid" field="m_data" value="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="AZStd::vector" field="m_parameters" type="{6ED13EA7-791B-57A8-A4F1-560B5F35B472}">
|
||||
<Class name="Parameter" field="element" type="{0DA4809B-08A6-49DC-9024-F81645D97FAC}">
|
||||
<Class name="VersionedProperty" field="m_name" version="4" type="{828CA9C0-32F1-40B3-8018-EE7C3C38192A}">
|
||||
<Class name="AZ::Uuid" field="m_id" value="{CD536CCB-29E7-4155-8C20-E37FA3B3A3D2}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="AZStd::string" field="m_label" value="Name" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="unsigned int" field="m_version" value="0" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::vector" field="m_versions" type="{326CAAFE-9101-56E2-B869-D770629A6B19}"/>
|
||||
<Class name="any" field="m_data" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}">
|
||||
<Class name="AZStd::string" field="m_data" value="ParameterName" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="VersionedProperty" field="m_tooltip" version="4" type="{828CA9C0-32F1-40B3-8018-EE7C3C38192A}">
|
||||
<Class name="AZ::Uuid" field="m_id" value="{62907B85-6C12-49E3-8A92-82E41AF029D5}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="AZStd::string" field="m_label" value="Tooltip" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="unsigned int" field="m_version" value="0" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::vector" field="m_versions" type="{326CAAFE-9101-56E2-B869-D770629A6B19}"/>
|
||||
<Class name="any" field="m_data" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}">
|
||||
<Class name="AZStd::string" field="m_data" value="" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
<Class name="VersionedProperty" field="m_type" version="4" type="{828CA9C0-32F1-40B3-8018-EE7C3C38192A}">
|
||||
<Class name="AZ::Uuid" field="m_id" value="{E3509DD4-13B0-4096-8AC4-115D9A8BCD6B}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
<Class name="AZStd::string" field="m_label" value="String" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
|
||||
<Class name="unsigned int" field="m_version" value="0" type="{43DA906B-7DEF-4CA8-9790-854106D3F983}"/>
|
||||
<Class name="AZStd::vector" field="m_versions" type="{326CAAFE-9101-56E2-B869-D770629A6B19}"/>
|
||||
<Class name="any" field="m_data" type="{03924488-C7F4-4D6D-948B-ABC2D1AE2FD3}">
|
||||
<Class name="AZ::Uuid" field="m_data" value="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}" type="{E152C105-A133-4D03-BBF8-3D4B2FBA3E2A}"/>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
</Class>
|
||||
</ObjectStream>
|
||||
|
||||
@ -0,0 +1,485 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AzCore/Math/MathMatrixSerializer.h>
|
||||
#include <AzCore/Math/Matrix3x3.h>
|
||||
#include <AzCore/Math/Matrix3x4.h>
|
||||
#include <AzCore/Math/Matrix4x4.h>
|
||||
#include <AzCore/Serialization/Json/JsonSerialization.h>
|
||||
#include <AzCore/Serialization/Json/RegistrationContext.h>
|
||||
#include <AzCore/Serialization/Json/StackedString.h>
|
||||
#include <AzCore/std/algorithm.h>
|
||||
#include <AzCore/std/string/osstring.h>
|
||||
#include <AzCore/Casting/numeric_cast.h>
|
||||
|
||||
namespace AZ::JsonMathMatrixSerializerInternal
|
||||
{
|
||||
template<typename MatrixType, size_t RowCount, size_t ColumnCount>
|
||||
JsonSerializationResult::Result LoadArray(MatrixType& output, const rapidjson::Value& inputValue, JsonDeserializerContext& context)
|
||||
{
|
||||
namespace JSR = JsonSerializationResult; // Used remove name conflicts in AzCore in uber builds.
|
||||
|
||||
constexpr size_t ElementCount = RowCount * ColumnCount;
|
||||
static_assert(ElementCount == 9 || ElementCount == 12 || ElementCount == 16,
|
||||
"MathMatrixSerializer only support Matrix3x3, Matrix3x4 and Matrix4x4.");
|
||||
|
||||
rapidjson::SizeType arraySize = inputValue.Size();
|
||||
if (arraySize < ElementCount)
|
||||
{
|
||||
return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Unsupported,
|
||||
"Not enough numbers in JSON array to load math matrix from.");
|
||||
}
|
||||
|
||||
AZ::BaseJsonSerializer* floatSerializer = context.GetRegistrationContext()->GetSerializerForType(azrtti_typeid<float>());
|
||||
if (!floatSerializer)
|
||||
{
|
||||
return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Catastrophic, "Failed to find the JSON float serializer.");
|
||||
}
|
||||
|
||||
constexpr const char* names[] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15"};
|
||||
float values[ElementCount];
|
||||
for (int i = 0; i < ElementCount; ++i)
|
||||
{
|
||||
ScopedContextPath subPath(context, names[i]);
|
||||
JSR::Result intermediate = floatSerializer->Load(values + i, azrtti_typeid<float>(), inputValue[i], context);
|
||||
if (intermediate.GetResultCode().GetProcessing() != JSR::Processing::Completed)
|
||||
{
|
||||
return intermediate;
|
||||
}
|
||||
}
|
||||
|
||||
size_t valueIndex = 0;
|
||||
for (size_t r = 0; r < RowCount; ++r)
|
||||
{
|
||||
for (size_t c = 0; c < ColumnCount; ++c)
|
||||
{
|
||||
output.SetElement(aznumeric_caster(r), aznumeric_caster(c), values[valueIndex++]);
|
||||
}
|
||||
}
|
||||
|
||||
return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Success, "Successfully read math matrix.");
|
||||
}
|
||||
|
||||
JsonSerializationResult::Result LoadFloatFromObject(
|
||||
float& output,
|
||||
const rapidjson::Value& inputValue,
|
||||
JsonDeserializerContext& context,
|
||||
const char* name,
|
||||
const char* altName)
|
||||
{
|
||||
namespace JSR = JsonSerializationResult; // Used remove name conflicts in AzCore in uber builds.
|
||||
|
||||
AZ::BaseJsonSerializer* floatSerializer = context.GetRegistrationContext()->GetSerializerForType(azrtti_typeid<float>());
|
||||
if (!floatSerializer)
|
||||
{
|
||||
return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Catastrophic, "Failed to find the json float serializer.");
|
||||
}
|
||||
|
||||
const char* nameUsed = name;
|
||||
JSR::ResultCode result(JSR::Tasks::ReadField);
|
||||
auto iterator = inputValue.FindMember(rapidjson::StringRef(name));
|
||||
if (iterator == inputValue.MemberEnd())
|
||||
{
|
||||
nameUsed = altName;
|
||||
iterator = inputValue.FindMember(rapidjson::StringRef(altName));
|
||||
if (iterator == inputValue.MemberEnd())
|
||||
{
|
||||
// field not found so leave default value
|
||||
result.Combine(JSR::ResultCode(JSR::Tasks::ReadField, JSR::Outcomes::DefaultsUsed));
|
||||
nameUsed = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
if (nameUsed)
|
||||
{
|
||||
ScopedContextPath subPath(context, nameUsed);
|
||||
JSR::Result intermediate = floatSerializer->Load(&output, azrtti_typeid<float>(), iterator->value, context);
|
||||
if (intermediate.GetResultCode().GetProcessing() != JSR::Processing::Completed)
|
||||
{
|
||||
return intermediate;
|
||||
}
|
||||
else
|
||||
{
|
||||
result.Combine(JSR::ResultCode(JSR::Tasks::ReadField, JSR::Outcomes::Success));
|
||||
}
|
||||
}
|
||||
|
||||
return context.Report(result, "Successfully read float.");
|
||||
}
|
||||
|
||||
JsonSerializationResult::Result LoadVector3FromObject(
|
||||
Vector3& output,
|
||||
const rapidjson::Value& inputValue,
|
||||
JsonDeserializerContext& context,
|
||||
AZStd::fixed_vector<AZStd::string_view, 6> names)
|
||||
{
|
||||
namespace JSR = JsonSerializationResult; // Used remove name conflicts in AzCore in uber builds.
|
||||
constexpr size_t ElementCount = 3; // Vector3
|
||||
|
||||
JSR::ResultCode result(JSR::Tasks::ReadField);
|
||||
float values[ElementCount];
|
||||
for (int i = 0; i < ElementCount; ++i)
|
||||
{
|
||||
values[i] = output.GetElement(i);
|
||||
auto name = names[i * 2];
|
||||
auto altName = names[(i * 2) + 1];
|
||||
|
||||
JSR::Result intermediate = LoadFloatFromObject(values[i], inputValue, context, name.data(), altName.data());
|
||||
if (intermediate.GetResultCode().GetProcessing() != JSR::Processing::Completed)
|
||||
{
|
||||
return intermediate;
|
||||
}
|
||||
else
|
||||
{
|
||||
result.Combine(JSR::ResultCode(JSR::Tasks::ReadField, JSR::Outcomes::Success));
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < ElementCount; ++i)
|
||||
{
|
||||
output.SetElement(i, values[i]);
|
||||
}
|
||||
|
||||
return context.Report(result, "Successfully read math matrix.");
|
||||
}
|
||||
|
||||
JsonSerializationResult::Result LoadQuaternionAndScale(
|
||||
AZ::Quaternion& quaternion,
|
||||
float& scale,
|
||||
const rapidjson::Value& inputValue,
|
||||
JsonDeserializerContext& context)
|
||||
{
|
||||
namespace JSR = JsonSerializationResult; // Used remove name conflicts in AzCore in uber builds.
|
||||
|
||||
JSR::ResultCode result(JSR::Tasks::ReadField);
|
||||
scale = 1.0f;
|
||||
JSR::Result intermediateScale = LoadFloatFromObject(scale, inputValue, context, "scale", "Scale");
|
||||
if (intermediateScale.GetResultCode().GetProcessing() != JSR::Processing::Completed)
|
||||
{
|
||||
return intermediateScale;
|
||||
}
|
||||
result.Combine(intermediateScale);
|
||||
|
||||
if (AZ::IsClose(scale, 0.0f))
|
||||
{
|
||||
result.Combine({ JSR::Tasks::ReadField, JSR::Outcomes::Unsupported });
|
||||
return context.Report(result, "Scale can not be zero.");
|
||||
}
|
||||
|
||||
AZ::Vector3 degreesRollPitchYaw = AZ::Vector3::CreateZero();
|
||||
JSR::Result intermediateDegrees = LoadVector3FromObject(degreesRollPitchYaw, inputValue, context, { "roll", "Roll", "pitch", "Pitch", "yaw", "Yaw" });
|
||||
if (intermediateDegrees.GetResultCode().GetProcessing() != JSR::Processing::Completed)
|
||||
{
|
||||
return intermediateDegrees;
|
||||
}
|
||||
result.Combine(intermediateDegrees);
|
||||
|
||||
// the quaternion should be equivalent to a series of rotations in the order z, then y, then x
|
||||
const AZ::Vector3 eulerRadians = AZ::Vector3DegToRad(degreesRollPitchYaw);
|
||||
quaternion = AZ::Quaternion::CreateRotationX(eulerRadians.GetX()) *
|
||||
AZ::Quaternion::CreateRotationY(eulerRadians.GetY()) *
|
||||
AZ::Quaternion::CreateRotationZ(eulerRadians.GetZ());
|
||||
|
||||
return context.Report(result, "Successfully read math yaw, pitch, roll, and scale.");
|
||||
}
|
||||
|
||||
template<typename MatrixType>
|
||||
JsonSerializationResult::Result LoadObject(MatrixType& output, const rapidjson::Value& inputValue, JsonDeserializerContext& context)
|
||||
{
|
||||
namespace JSR = JsonSerializationResult; // Used remove name conflicts in AzCore in uber builds.
|
||||
output = MatrixType::CreateIdentity();
|
||||
|
||||
JSR::ResultCode result(JSR::Tasks::ReadField);
|
||||
float scale;
|
||||
AZ::Quaternion rotation;
|
||||
|
||||
JSR::Result intermediate = LoadQuaternionAndScale(rotation, scale, inputValue, context);
|
||||
if (intermediate.GetResultCode().GetProcessing() != JSR::Processing::Completed)
|
||||
{
|
||||
return intermediate;
|
||||
}
|
||||
result.Combine(intermediate);
|
||||
|
||||
AZ::Vector3 translation = AZ::Vector3::CreateZero();
|
||||
JSR::Result intermediateTranslation = LoadVector3FromObject(translation, inputValue, context, { "x", "X", "y", "Y", "z", "Z" });
|
||||
if (intermediateTranslation.GetResultCode().GetProcessing() != JSR::Processing::Completed)
|
||||
{
|
||||
return intermediateTranslation;
|
||||
}
|
||||
result.Combine(intermediateTranslation);
|
||||
|
||||
// composed a matrix by rotation, then scale, then translation
|
||||
auto matrix = MatrixType::CreateFromQuaternion(rotation);
|
||||
matrix.MultiplyByScale(Vector3{ scale });
|
||||
matrix.SetTranslation(translation);
|
||||
|
||||
if (matrix == MatrixType::CreateIdentity())
|
||||
{
|
||||
return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::DefaultsUsed, "Using identity matrix for empty object.");
|
||||
}
|
||||
|
||||
output = matrix;
|
||||
return context.Report(result, "Successfully read math matrix.");
|
||||
}
|
||||
|
||||
template<>
|
||||
JsonSerializationResult::Result LoadObject<Matrix3x3>(Matrix3x3& output, const rapidjson::Value& inputValue, JsonDeserializerContext& context)
|
||||
{
|
||||
namespace JSR = JsonSerializationResult; // Used remove name conflicts in AzCore in uber builds.
|
||||
output = Matrix3x3::CreateIdentity();
|
||||
|
||||
JSR::ResultCode result(JSR::Tasks::ReadField);
|
||||
float scale;
|
||||
AZ::Quaternion rotation;
|
||||
|
||||
JSR::Result intermediate = LoadQuaternionAndScale(rotation, scale, inputValue, context);
|
||||
if (intermediate.GetResultCode().GetProcessing() != JSR::Processing::Completed)
|
||||
{
|
||||
return intermediate;
|
||||
}
|
||||
result.Combine(intermediate);
|
||||
|
||||
// composed a matrix by rotation then scale
|
||||
auto matrix = Matrix3x3::CreateFromQuaternion(rotation);
|
||||
matrix.MultiplyByScale(Vector3{ scale });
|
||||
|
||||
if (matrix == Matrix3x3::CreateIdentity())
|
||||
{
|
||||
return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::DefaultsUsed, "Using identity matrix for empty object.");
|
||||
}
|
||||
|
||||
output = matrix;
|
||||
return context.Report(result, "Successfully read math matrix.");
|
||||
}
|
||||
|
||||
template<typename MatrixType, size_t RowCount, size_t ColumnCount>
|
||||
JsonSerializationResult::Result Load(void* outputValue, const Uuid& outputValueTypeId,
|
||||
const rapidjson::Value& inputValue, JsonDeserializerContext& context)
|
||||
{
|
||||
namespace JSR = JsonSerializationResult; // Used remove name conflicts in AzCore in uber builds.
|
||||
|
||||
constexpr size_t ElementCount = RowCount * ColumnCount;
|
||||
static_assert(ElementCount == 9 || ElementCount == 12 || ElementCount == 16,
|
||||
"MathMatrixSerializer only support Matrix3x3, Matrix3x4 and Matrix4x4.");
|
||||
|
||||
AZ_Assert(azrtti_typeid<MatrixType>() == outputValueTypeId,
|
||||
"Unable to deserialize Matrix%zux%zu to json because the provided type is %s",
|
||||
RowCount, ColumnCount, outputValueTypeId.ToString<OSString>().c_str());
|
||||
AZ_UNUSED(outputValueTypeId);
|
||||
|
||||
MatrixType* matrix = reinterpret_cast<MatrixType*>(outputValue);
|
||||
AZ_Assert(matrix, "Output value for JsonMatrix%zux%zuSerializer can't be null.", RowCount, ColumnCount);
|
||||
|
||||
switch (inputValue.GetType())
|
||||
{
|
||||
case rapidjson::kArrayType:
|
||||
return LoadArray<MatrixType, RowCount, ColumnCount>(*matrix, inputValue, context);
|
||||
case rapidjson::kObjectType:
|
||||
return LoadObject<MatrixType>(*matrix, inputValue, context);
|
||||
|
||||
case rapidjson::kStringType:
|
||||
[[fallthrough]];
|
||||
case rapidjson::kNumberType:
|
||||
[[fallthrough]];
|
||||
case rapidjson::kNullType:
|
||||
[[fallthrough]];
|
||||
case rapidjson::kFalseType:
|
||||
[[fallthrough]];
|
||||
case rapidjson::kTrueType:
|
||||
return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Unsupported,
|
||||
"Unsupported type. Math matrix can only be read from arrays or objects.");
|
||||
|
||||
default:
|
||||
return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Unknown,
|
||||
"Unknown json type encountered in math matrix.");
|
||||
}
|
||||
}
|
||||
|
||||
template<typename MatrixType>
|
||||
AZ::Quaternion CreateQuaternion(const MatrixType& matrix);
|
||||
|
||||
template<>
|
||||
AZ::Quaternion CreateQuaternion<AZ::Matrix3x3>(const AZ::Matrix3x3& matrix)
|
||||
{
|
||||
return Quaternion::CreateFromMatrix3x3(matrix);
|
||||
}
|
||||
|
||||
template<>
|
||||
AZ::Quaternion CreateQuaternion<AZ::Matrix3x4>(const AZ::Matrix3x4& matrix)
|
||||
{
|
||||
return Quaternion::CreateFromMatrix3x4(matrix);
|
||||
}
|
||||
|
||||
template<>
|
||||
AZ::Quaternion CreateQuaternion<AZ::Matrix4x4>(const AZ::Matrix4x4& matrix)
|
||||
{
|
||||
return Quaternion::CreateFromMatrix4x4(matrix);
|
||||
}
|
||||
|
||||
template<typename MatrixType>
|
||||
JsonSerializationResult::Result StoreRotationAndScale(rapidjson::Value& outputValue, const void* inputValue, const void* defaultValue,
|
||||
const Uuid& valueTypeId, JsonSerializerContext& context)
|
||||
{
|
||||
namespace JSR = JsonSerializationResult; // Used remove name conflicts in AzCore in uber builds.
|
||||
AZ_UNUSED(valueTypeId);
|
||||
|
||||
const MatrixType* matrix = reinterpret_cast<const MatrixType*>(inputValue);
|
||||
AZ_Assert(matrix, "Input value for JsonMatrixSerializer can't be null.");
|
||||
const MatrixType* defaultMatrix = reinterpret_cast<const MatrixType*>(defaultValue);
|
||||
|
||||
if (!context.ShouldKeepDefaults() && defaultMatrix && *matrix == *defaultMatrix)
|
||||
{
|
||||
return context.Report(JSR::Tasks::WriteValue, JSR::Outcomes::DefaultsUsed, "Default math Matrix used.");
|
||||
}
|
||||
|
||||
MatrixType matrixToExport = *matrix;
|
||||
AZ::Vector3 scale = matrixToExport.ExtractScale();
|
||||
|
||||
AZ::Quaternion rotation = CreateQuaternion(matrixToExport);
|
||||
auto degrees = rotation.GetEulerDegrees();
|
||||
outputValue.AddMember(rapidjson::StringRef("roll"), degrees.GetX(), context.GetJsonAllocator());
|
||||
outputValue.AddMember(rapidjson::StringRef("pitch"), degrees.GetY(), context.GetJsonAllocator());
|
||||
outputValue.AddMember(rapidjson::StringRef("yaw"), degrees.GetZ(), context.GetJsonAllocator());
|
||||
outputValue.AddMember(rapidjson::StringRef("scale"), scale.GetX(), context.GetJsonAllocator());
|
||||
|
||||
return context.Report(JSR::Tasks::WriteValue, JSR::Outcomes::Success, "Math Matrix successfully stored.");
|
||||
}
|
||||
|
||||
template<typename MatrixType>
|
||||
JsonSerializationResult::Result StoreTranslation(rapidjson::Value& outputValue, const void* inputValue,
|
||||
const void* defaultValue, const Uuid& valueTypeId, JsonSerializerContext& context)
|
||||
{
|
||||
namespace JSR = JsonSerializationResult; // Used remove name conflicts in AzCore in uber builds.
|
||||
AZ_UNUSED(valueTypeId);
|
||||
|
||||
const MatrixType* matrix = reinterpret_cast<const MatrixType*>(inputValue);
|
||||
AZ_Assert(matrix, "Input value for JsonMatrixSerializer can't be null.");
|
||||
const MatrixType* defaultMatrix = reinterpret_cast<const MatrixType*>(defaultValue);
|
||||
|
||||
if (!context.ShouldKeepDefaults() && defaultMatrix && *matrix == *defaultMatrix)
|
||||
{
|
||||
return context.Report(JSR::Tasks::WriteValue, JSR::Outcomes::DefaultsUsed, "Default math Matrix used.");
|
||||
}
|
||||
|
||||
auto translation = matrix->GetTranslation();
|
||||
outputValue.AddMember(rapidjson::StringRef("x"), translation.GetX(), context.GetJsonAllocator());
|
||||
outputValue.AddMember(rapidjson::StringRef("y"), translation.GetY(), context.GetJsonAllocator());
|
||||
outputValue.AddMember(rapidjson::StringRef("z"), translation.GetZ(), context.GetJsonAllocator());
|
||||
|
||||
return context.Report(JSR::Tasks::WriteValue, JSR::Outcomes::Success, "Math Matrix successfully stored.");
|
||||
}
|
||||
}
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
// Matrix3x3
|
||||
|
||||
AZ_CLASS_ALLOCATOR_IMPL(JsonMatrix3x3Serializer, SystemAllocator, 0);
|
||||
|
||||
JsonSerializationResult::Result JsonMatrix3x3Serializer::Load(void* outputValue, const Uuid& outputValueTypeId,
|
||||
const rapidjson::Value& inputValue, JsonDeserializerContext& context)
|
||||
{
|
||||
return JsonMathMatrixSerializerInternal::Load<Matrix3x3, 3, 3>(
|
||||
outputValue,
|
||||
outputValueTypeId,
|
||||
inputValue,
|
||||
context);
|
||||
}
|
||||
|
||||
JsonSerializationResult::Result JsonMatrix3x3Serializer::Store(rapidjson::Value& outputValue, const void* inputValue,
|
||||
const void* defaultValue, const Uuid& valueTypeId, JsonSerializerContext& context)
|
||||
{
|
||||
outputValue.SetObject();
|
||||
|
||||
return JsonMathMatrixSerializerInternal::StoreRotationAndScale<Matrix3x3>(
|
||||
outputValue,
|
||||
inputValue,
|
||||
defaultValue,
|
||||
valueTypeId,
|
||||
context);
|
||||
}
|
||||
|
||||
|
||||
// Matrix3x4
|
||||
|
||||
AZ_CLASS_ALLOCATOR_IMPL(JsonMatrix3x4Serializer, SystemAllocator, 0);
|
||||
|
||||
JsonSerializationResult::Result JsonMatrix3x4Serializer::Load(void* outputValue, const Uuid& outputValueTypeId,
|
||||
const rapidjson::Value& inputValue, JsonDeserializerContext& context)
|
||||
{
|
||||
return JsonMathMatrixSerializerInternal::Load<Matrix3x4, 3, 4>(
|
||||
outputValue,
|
||||
outputValueTypeId,
|
||||
inputValue,
|
||||
context);
|
||||
}
|
||||
|
||||
JsonSerializationResult::Result JsonMatrix3x4Serializer::Store(rapidjson::Value& outputValue, const void* inputValue,
|
||||
const void* defaultValue, const Uuid& valueTypeId, JsonSerializerContext& context)
|
||||
{
|
||||
outputValue.SetObject();
|
||||
|
||||
auto result = JsonMathMatrixSerializerInternal::StoreRotationAndScale<Matrix3x4>(
|
||||
outputValue,
|
||||
inputValue,
|
||||
defaultValue,
|
||||
valueTypeId,
|
||||
context);
|
||||
|
||||
auto resultTranslation = JsonMathMatrixSerializerInternal::StoreTranslation<Matrix3x4>(
|
||||
outputValue,
|
||||
inputValue,
|
||||
defaultValue,
|
||||
valueTypeId,
|
||||
context);
|
||||
|
||||
result.GetResultCode().Combine(resultTranslation);
|
||||
return result;
|
||||
}
|
||||
|
||||
// Matrix4x4
|
||||
|
||||
AZ_CLASS_ALLOCATOR_IMPL(JsonMatrix4x4Serializer, SystemAllocator, 0);
|
||||
|
||||
JsonSerializationResult::Result JsonMatrix4x4Serializer::Load(void* outputValue, const Uuid& outputValueTypeId,
|
||||
const rapidjson::Value& inputValue, JsonDeserializerContext& context)
|
||||
{
|
||||
return JsonMathMatrixSerializerInternal::Load<Matrix4x4, 4, 4>(
|
||||
outputValue,
|
||||
outputValueTypeId,
|
||||
inputValue,
|
||||
context);
|
||||
}
|
||||
|
||||
JsonSerializationResult::Result JsonMatrix4x4Serializer::Store(rapidjson::Value& outputValue, const void* inputValue,
|
||||
const void* defaultValue, const Uuid& valueTypeId, JsonSerializerContext& context)
|
||||
{
|
||||
outputValue.SetObject();
|
||||
|
||||
auto result = JsonMathMatrixSerializerInternal::StoreRotationAndScale<Matrix4x4>(
|
||||
outputValue,
|
||||
inputValue,
|
||||
defaultValue,
|
||||
valueTypeId,
|
||||
context);
|
||||
|
||||
auto resultTranslation = JsonMathMatrixSerializerInternal::StoreTranslation<Matrix4x4>(
|
||||
outputValue,
|
||||
inputValue,
|
||||
defaultValue,
|
||||
valueTypeId,
|
||||
context);
|
||||
|
||||
result.GetResultCode().Combine(resultTranslation);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/Serialization/Json/BaseJsonSerializer.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
class JsonMatrix3x3Serializer
|
||||
: public BaseJsonSerializer
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(JsonMatrix3x3Serializer, "{8C76CD6A-8576-4604-A746-CF7A7F20F366}", BaseJsonSerializer);
|
||||
AZ_CLASS_ALLOCATOR_DECL;
|
||||
JsonSerializationResult::Result Load(void* outputValue, const Uuid& outputValueTypeId, const rapidjson::Value& inputValue,
|
||||
JsonDeserializerContext& context) override;
|
||||
JsonSerializationResult::Result Store(rapidjson::Value& outputValue, const void* inputValue, const void* defaultValue,
|
||||
const Uuid& valueTypeId, JsonSerializerContext& context) override;
|
||||
};
|
||||
|
||||
class JsonMatrix3x4Serializer
|
||||
: public BaseJsonSerializer
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(JsonMatrix3x4Serializer, "{E801333B-4AF1-4F43-976C-579670B02DC5}", BaseJsonSerializer);
|
||||
AZ_CLASS_ALLOCATOR_DECL;
|
||||
JsonSerializationResult::Result Load(void* outputValue, const Uuid& outputValueTypeId, const rapidjson::Value& inputValue,
|
||||
JsonDeserializerContext& context) override;
|
||||
JsonSerializationResult::Result Store(rapidjson::Value& outputValue, const void* inputValue, const void* defaultValue,
|
||||
const Uuid& valueTypeId, JsonSerializerContext& context) override;
|
||||
};
|
||||
|
||||
class JsonMatrix4x4Serializer
|
||||
: public BaseJsonSerializer
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(JsonMatrix4x4Serializer, "{46E888FC-248A-4910-9221-4E101A10AEA1}", BaseJsonSerializer);
|
||||
AZ_CLASS_ALLOCATOR_DECL;
|
||||
JsonSerializationResult::Result Load(void* outputValue, const Uuid& outputValueTypeId, const rapidjson::Value& inputValue,
|
||||
JsonDeserializerContext& context) override;
|
||||
JsonSerializationResult::Result Store(rapidjson::Value& outputValue, const void* inputValue, const void* defaultValue,
|
||||
const Uuid& valueTypeId, JsonSerializerContext& context) override;
|
||||
};
|
||||
}
|
||||
@ -0,0 +1,562 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AzCore/Casting/numeric_cast.h>
|
||||
#include <AzCore/Math/MathMatrixSerializer.h>
|
||||
#include <AzCore/Math/Matrix3x3.h>
|
||||
#include <AzCore/Math/Matrix3x4.h>
|
||||
#include <AzCore/Math/Matrix4x4.h>
|
||||
#include <AzCore/Math/Random.h>
|
||||
#include <AzCore/Math/MathUtils.h>
|
||||
#include <AzCore/Serialization/Json/DoubleSerializer.h>
|
||||
#include <AzCore/Serialization/Json/RegistrationContext.h>
|
||||
#include <Tests/Serialization/Json/BaseJsonSerializerFixture.h>
|
||||
#include <Tests/Serialization/Json/JsonSerializerConformityTests.h>
|
||||
|
||||
namespace JsonSerializationTests
|
||||
{
|
||||
namespace DataHelper
|
||||
{
|
||||
// Build Matrix
|
||||
|
||||
template <typename MatrixType>
|
||||
MatrixType BuildMatrixRotationWithSale(const AZ::Vector3& angles, float scale)
|
||||
{
|
||||
// start a matrix with angle degrees
|
||||
const AZ::Vector3 eulerRadians = AZ::Vector3DegToRad(angles);
|
||||
const auto rotX = MatrixType::CreateRotationX(eulerRadians.GetX());
|
||||
const auto rotY = MatrixType::CreateRotationY(eulerRadians.GetY());
|
||||
const auto rotZ = MatrixType::CreateRotationZ(eulerRadians.GetZ());
|
||||
auto matrix = rotX * rotY * rotZ;
|
||||
|
||||
// apply a scale
|
||||
matrix.MultiplyByScale(AZ::Vector3{ scale });
|
||||
return matrix;
|
||||
}
|
||||
|
||||
template <typename MatrixType>
|
||||
MatrixType BuildMatrix(const AZ::Vector3& angles, float scale, const AZ::Vector3& translation)
|
||||
{
|
||||
auto matrix = BuildMatrixRotationWithSale<MatrixType>(angles, scale);
|
||||
matrix.SetTranslation(translation);
|
||||
return matrix;
|
||||
}
|
||||
|
||||
template <>
|
||||
AZ::Matrix3x3 BuildMatrix(const AZ::Vector3& angles, float scale, const AZ::Vector3&)
|
||||
{
|
||||
return BuildMatrixRotationWithSale<AZ::Matrix3x3>(angles, scale);
|
||||
}
|
||||
|
||||
// Arbitrary Matrix
|
||||
|
||||
template <typename MatrixType>
|
||||
MatrixType CreateArbitraryMatrixRotationAndSale(AZ::SimpleLcgRandom& random)
|
||||
{
|
||||
// start a matrix with arbitrary degrees
|
||||
float roll = random.GetRandomFloat() * 360.0f;
|
||||
float pitch = random.GetRandomFloat() * 360.0f;
|
||||
float yaw = random.GetRandomFloat() * 360.0f;
|
||||
const AZ::Vector3 eulerRadians = AZ::Vector3DegToRad(AZ::Vector3{ roll, pitch, yaw });
|
||||
const auto rotX = MatrixType::CreateRotationX(eulerRadians.GetX());
|
||||
const auto rotY = MatrixType::CreateRotationY(eulerRadians.GetY());
|
||||
const auto rotZ = MatrixType::CreateRotationZ(eulerRadians.GetZ());
|
||||
auto matrix = rotX * rotY * rotZ;
|
||||
|
||||
// apply a scale
|
||||
matrix.MultiplyByScale(AZ::Vector3{ random.GetRandomFloat() });
|
||||
return matrix;
|
||||
}
|
||||
|
||||
template <typename MatrixType>
|
||||
void AssignArbitrarySetTranslation(MatrixType& matrix, AZ::SimpleLcgRandom& random)
|
||||
{
|
||||
float x = random.GetRandomFloat() * 10000.0f;
|
||||
float y = random.GetRandomFloat() * 10000.0f;
|
||||
float z = random.GetRandomFloat() * 10000.0f;
|
||||
matrix.SetTranslation(AZ::Vector3{ x, y, z });
|
||||
}
|
||||
|
||||
template <typename MatrixType>
|
||||
MatrixType CreateArbitraryMatrix(size_t seed);
|
||||
|
||||
template <>
|
||||
AZ::Matrix3x3 CreateArbitraryMatrix(size_t seed)
|
||||
{
|
||||
AZ::SimpleLcgRandom random(seed);
|
||||
return CreateArbitraryMatrixRotationAndSale<AZ::Matrix3x3>(random);
|
||||
}
|
||||
|
||||
template <>
|
||||
AZ::Matrix3x4 CreateArbitraryMatrix(size_t seed)
|
||||
{
|
||||
AZ::SimpleLcgRandom random(seed);
|
||||
auto matrix = CreateArbitraryMatrixRotationAndSale<AZ::Matrix3x4>(random);
|
||||
AssignArbitrarySetTranslation<AZ::Matrix3x4>(matrix, random);
|
||||
return matrix;
|
||||
}
|
||||
|
||||
template <>
|
||||
AZ::Matrix4x4 CreateArbitraryMatrix(size_t seed)
|
||||
{
|
||||
AZ::SimpleLcgRandom random(seed);
|
||||
auto matrix = CreateArbitraryMatrixRotationAndSale<AZ::Matrix4x4>(random);
|
||||
AssignArbitrarySetTranslation<AZ::Matrix4x4>(matrix, random);
|
||||
return matrix;
|
||||
}
|
||||
|
||||
// CreateQuaternion
|
||||
|
||||
template<typename MatrixType>
|
||||
AZ::Quaternion CreateQuaternion(const MatrixType& matrix);
|
||||
|
||||
template<>
|
||||
AZ::Quaternion CreateQuaternion<AZ::Matrix3x3>(const AZ::Matrix3x3& matrix)
|
||||
{
|
||||
return AZ::Quaternion::CreateFromMatrix3x3(matrix);
|
||||
}
|
||||
|
||||
template<>
|
||||
AZ::Quaternion CreateQuaternion<AZ::Matrix3x4>(const AZ::Matrix3x4& matrix)
|
||||
{
|
||||
return AZ::Quaternion::CreateFromMatrix3x4(matrix);
|
||||
}
|
||||
|
||||
template<>
|
||||
AZ::Quaternion CreateQuaternion<AZ::Matrix4x4>(const AZ::Matrix4x4& matrix)
|
||||
{
|
||||
return AZ::Quaternion::CreateFromMatrix4x4(matrix);
|
||||
}
|
||||
|
||||
template<typename MatrixType>
|
||||
void AddRotation(rapidjson::Value& value, const MatrixType& matrix, rapidjson::Document::AllocatorType& allocator)
|
||||
{
|
||||
AZ::Quaternion rotation = CreateQuaternion<MatrixType>(matrix);
|
||||
const auto degrees = rotation.GetEulerDegrees();
|
||||
value.AddMember("yaw", degrees.GetX(), allocator);
|
||||
value.AddMember("pitch", degrees.GetY(), allocator);
|
||||
value.AddMember("roll", degrees.GetZ(), allocator);
|
||||
}
|
||||
|
||||
void AddScale(rapidjson::Value& value, float scale, rapidjson::Document::AllocatorType& allocator)
|
||||
{
|
||||
value.AddMember("scale", scale, allocator);
|
||||
}
|
||||
|
||||
void AddTranslation(rapidjson::Value& value, const AZ::Vector3& translation, rapidjson::Document::AllocatorType& allocator)
|
||||
{
|
||||
value.AddMember("x", translation.GetX(), allocator);
|
||||
value.AddMember("y", translation.GetY(), allocator);
|
||||
value.AddMember("z", translation.GetZ(), allocator);
|
||||
}
|
||||
|
||||
template <typename MatrixType>
|
||||
void AddData(rapidjson::Value& value, const MatrixType& matrix, rapidjson::Document::AllocatorType& allocator);
|
||||
|
||||
template <>
|
||||
void AddData(rapidjson::Value& value, const AZ::Matrix3x3& matrix, rapidjson::Document::AllocatorType& allocator)
|
||||
{
|
||||
AddScale(value, matrix.RetrieveScale().GetX(), allocator);
|
||||
AddRotation(value, matrix, allocator);
|
||||
}
|
||||
|
||||
template <>
|
||||
void AddData(rapidjson::Value& value, const AZ::Matrix3x4& matrix, rapidjson::Document::AllocatorType& allocator)
|
||||
{
|
||||
AddScale(value, matrix.RetrieveScale().GetX(), allocator);
|
||||
AddTranslation(value, matrix.GetTranslation(), allocator);
|
||||
AddRotation(value, matrix, allocator);
|
||||
}
|
||||
|
||||
template <>
|
||||
void AddData(rapidjson::Value& value, const AZ::Matrix4x4& matrix, rapidjson::Document::AllocatorType& allocator)
|
||||
{
|
||||
AddScale(value, matrix.RetrieveScale().GetX(), allocator);
|
||||
AddTranslation(value, matrix.GetTranslation(), allocator);
|
||||
AddRotation(value, matrix, allocator);
|
||||
}
|
||||
};
|
||||
|
||||
template<typename MatrixType, size_t RowCount, size_t ColumnCount, typename Serializer>
|
||||
class MathMatrixSerializerTestDescription :
|
||||
public JsonSerializerConformityTestDescriptor<MatrixType>
|
||||
{
|
||||
public:
|
||||
AZStd::shared_ptr<AZ::BaseJsonSerializer> CreateSerializer() override
|
||||
{
|
||||
return AZStd::make_shared<Serializer>();
|
||||
}
|
||||
|
||||
AZStd::shared_ptr<MatrixType> CreateDefaultInstance() override
|
||||
{
|
||||
return AZStd::make_shared<MatrixType>(MatrixType::CreateIdentity());
|
||||
}
|
||||
|
||||
AZStd::shared_ptr<MatrixType> CreateFullySetInstance() override
|
||||
{
|
||||
auto angles = AZ::Vector3 { 0.0f, 0.0f, 0.0f };
|
||||
auto scale = 10.0f;
|
||||
auto translation = AZ::Vector3{ 10.0f, 20.0f, 30.0f };
|
||||
auto matrix = DataHelper::BuildMatrix<MatrixType>(angles, scale, translation);
|
||||
return AZStd::make_shared<MatrixType>(matrix);
|
||||
}
|
||||
|
||||
AZStd::string_view GetJsonForFullySetInstance() override
|
||||
{
|
||||
if constexpr (RowCount * ColumnCount == 9)
|
||||
{
|
||||
return "{\"roll\":0.0,\"pitch\":0.0,\"yaw\":0.0,\"scale\":10.0}";
|
||||
}
|
||||
else if constexpr (RowCount * ColumnCount == 12)
|
||||
{
|
||||
return "{\"roll\":0.0,\"pitch\":0.0,\"yaw\":0.0,\"scale\":10.0,\"x\":10.0,\"y\":20.0,\"z\":30.0}";
|
||||
}
|
||||
else if constexpr (RowCount * ColumnCount == 16)
|
||||
{
|
||||
return "{\"roll\":0.0,\"pitch\":0.0,\"yaw\":0.0,\"scale\":10.0,\"x\":10.0,\"y\":20.0,\"z\":30.0}";
|
||||
}
|
||||
else
|
||||
{
|
||||
static_assert((RowCount >= 3 && RowCount <= 4) && (ColumnCount >= 3 && ColumnCount <= 4),
|
||||
"Only matrix 3x3, 3x4 or 4x4 are supported by this test.");
|
||||
}
|
||||
return "{}";
|
||||
}
|
||||
|
||||
void ConfigureFeatures(JsonSerializerConformityTestDescriptorFeatures& features) override
|
||||
{
|
||||
features.EnableJsonType(rapidjson::kArrayType);
|
||||
features.EnableJsonType(rapidjson::kObjectType);
|
||||
features.m_fixedSizeArray = true;
|
||||
features.m_supportsPartialInitialization = false;
|
||||
features.m_supportsInjection = false;
|
||||
}
|
||||
|
||||
bool AreEqual(const MatrixType& lhs, const MatrixType& rhs) override
|
||||
{
|
||||
for (int r = 0; r < RowCount; ++r)
|
||||
{
|
||||
for (int c = 0; c < ColumnCount; ++c)
|
||||
{
|
||||
if (!AZ::IsClose(lhs.GetElement(r, c), rhs.GetElement(r, c), AZ::Constants::Tolerance))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
using MathMatrixSerializerConformityTestTypes = ::testing::Types<
|
||||
MathMatrixSerializerTestDescription<AZ::Matrix3x3, 3, 3, AZ::JsonMatrix3x3Serializer>,
|
||||
MathMatrixSerializerTestDescription<AZ::Matrix3x4, 3, 4, AZ::JsonMatrix3x4Serializer>,
|
||||
MathMatrixSerializerTestDescription<AZ::Matrix4x4, 4, 4, AZ::JsonMatrix4x4Serializer>
|
||||
>;
|
||||
INSTANTIATE_TYPED_TEST_CASE_P(JsonMathMatrixSerializer, JsonSerializerConformityTests, MathMatrixSerializerConformityTestTypes);
|
||||
|
||||
template<typename T>
|
||||
class JsonMathMatrixSerializerTests
|
||||
: public BaseJsonSerializerFixture
|
||||
{
|
||||
public:
|
||||
using Descriptor = T;
|
||||
|
||||
void SetUp() override
|
||||
{
|
||||
BaseJsonSerializerFixture::SetUp();
|
||||
m_serializer = AZStd::make_unique<typename T::Serializer>();
|
||||
}
|
||||
|
||||
void TearDown() override
|
||||
{
|
||||
m_serializer.reset();
|
||||
BaseJsonSerializerFixture::TearDown();
|
||||
}
|
||||
|
||||
protected:
|
||||
AZStd::unique_ptr<typename T::Serializer> m_serializer;
|
||||
};
|
||||
|
||||
struct Matrix3x3Descriptor
|
||||
{
|
||||
using MatrixType = AZ::Matrix3x3;
|
||||
using Serializer = AZ::JsonMatrix3x3Serializer;
|
||||
constexpr static size_t RowCount = 3;
|
||||
constexpr static size_t ColumnCount = 3;
|
||||
constexpr static size_t ElementCount = RowCount * ColumnCount;
|
||||
constexpr static bool HasTranslation = false;
|
||||
};
|
||||
|
||||
struct Matrix3x4Descriptor
|
||||
{
|
||||
using MatrixType = AZ::Matrix3x4;
|
||||
using Serializer = AZ::JsonMatrix3x4Serializer;
|
||||
constexpr static size_t RowCount = 3;
|
||||
constexpr static size_t ColumnCount = 4;
|
||||
constexpr static size_t ElementCount = RowCount * ColumnCount;
|
||||
constexpr static bool HasTranslation = true;
|
||||
};
|
||||
|
||||
struct Matrix4x4Descriptor
|
||||
{
|
||||
using MatrixType = AZ::Matrix4x4;
|
||||
using Serializer = AZ::JsonMatrix4x4Serializer;
|
||||
constexpr static size_t RowCount = 4;
|
||||
constexpr static size_t ColumnCount = 4;
|
||||
constexpr static size_t ElementCount = RowCount * ColumnCount;
|
||||
constexpr static bool HasTranslation = true;
|
||||
};
|
||||
|
||||
using JsonMathMatrixSerializerTypes = ::testing::Types <
|
||||
Matrix3x3Descriptor, Matrix3x4Descriptor, Matrix4x4Descriptor>;
|
||||
TYPED_TEST_CASE(JsonMathMatrixSerializerTests, JsonMathMatrixSerializerTypes);
|
||||
|
||||
// Load array tests
|
||||
|
||||
TYPED_TEST(JsonMathMatrixSerializerTests, Load_Array_ReturnsConvertAndLoadsMatrix)
|
||||
{
|
||||
using namespace AZ::JsonSerializationResult;
|
||||
|
||||
rapidjson::Value& arrayValue = this->m_jsonDocument->SetArray();
|
||||
for (size_t i = 0; i < JsonMathMatrixSerializerTests<TypeParam>::Descriptor::ElementCount; ++i)
|
||||
{
|
||||
arrayValue.PushBack(static_cast<float>(i + 1), this->m_jsonDocument->GetAllocator());
|
||||
}
|
||||
|
||||
auto output = JsonMathMatrixSerializerTests<TypeParam>::Descriptor::MatrixType::CreateZero();
|
||||
ResultCode result = this->m_serializer->Load(
|
||||
&output,
|
||||
azrtti_typeid<typename JsonMathMatrixSerializerTests<TypeParam>::Descriptor::MatrixType>(),
|
||||
*this->m_jsonDocument,
|
||||
*this->m_jsonDeserializationContext);
|
||||
ASSERT_EQ(Outcomes::Success, result.GetOutcome());
|
||||
|
||||
for (int r = 0; r < JsonMathMatrixSerializerTests<TypeParam>::Descriptor::RowCount; ++r)
|
||||
{
|
||||
for (int c = 0; c < JsonMathMatrixSerializerTests<TypeParam>::Descriptor::ColumnCount; ++c)
|
||||
{
|
||||
auto testValue = static_cast<float>((r * JsonMathMatrixSerializerTests<TypeParam>::Descriptor::ColumnCount) + c + 1);
|
||||
EXPECT_FLOAT_EQ(testValue, output.GetElement(r, c));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TYPED_TEST(JsonMathMatrixSerializerTests, Load_InvalidEntries_ReturnsUnsupportedAndLeavesMatrixUntouched)
|
||||
{
|
||||
using namespace AZ::JsonSerializationResult;
|
||||
|
||||
rapidjson::Value& arrayValue = this->m_jsonDocument->SetArray();
|
||||
for (size_t i = 0; i < JsonMathMatrixSerializerTests<TypeParam>::Descriptor::ElementCount; ++i)
|
||||
{
|
||||
if (i == 1)
|
||||
{
|
||||
arrayValue.PushBack(rapidjson::StringRef("Invalid"), this->m_jsonDocument->GetAllocator());
|
||||
}
|
||||
else
|
||||
{
|
||||
arrayValue.PushBack(static_cast<float>(i + 1), this->m_jsonDocument->GetAllocator());
|
||||
}
|
||||
}
|
||||
|
||||
auto output = JsonMathMatrixSerializerTests<TypeParam>::Descriptor::MatrixType::CreateZero();
|
||||
ResultCode result = this->m_serializer->Load(
|
||||
&output,
|
||||
azrtti_typeid<typename JsonMathMatrixSerializerTests<TypeParam>::Descriptor::MatrixType>(),
|
||||
*this->m_jsonDocument,
|
||||
*this->m_jsonDeserializationContext);
|
||||
EXPECT_EQ(Outcomes::Unsupported, result.GetOutcome());
|
||||
|
||||
for (int r = 0; r < JsonMathMatrixSerializerTests<TypeParam>::Descriptor::RowCount; ++r)
|
||||
{
|
||||
for (int c = 0; c < JsonMathMatrixSerializerTests<TypeParam>::Descriptor::ColumnCount; ++c)
|
||||
{
|
||||
EXPECT_FLOAT_EQ(0.0f, output.GetElement(r, c));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TYPED_TEST(JsonMathMatrixSerializerTests, Load_FloatSerializerMissingForArray_ReturnsCatastrophic)
|
||||
{
|
||||
using namespace AZ::JsonSerializationResult;
|
||||
|
||||
this->m_jsonRegistrationContext->EnableRemoveReflection();
|
||||
this->m_jsonRegistrationContext->template Serializer<AZ::JsonFloatSerializer>()->template HandlesType<float>();
|
||||
this->m_jsonRegistrationContext->DisableRemoveReflection();
|
||||
|
||||
rapidjson::Value& arrayValue = this->m_jsonDocument->SetArray();
|
||||
for (size_t i = 0; i < JsonMathMatrixSerializerTests<TypeParam>::Descriptor::ElementCount + 1; ++i)
|
||||
{
|
||||
arrayValue.PushBack(static_cast<float>(i + 1), this->m_jsonDocument->GetAllocator());
|
||||
}
|
||||
|
||||
typename JsonMathMatrixSerializerTests<TypeParam>::Descriptor::MatrixType output;
|
||||
ResultCode result = this->m_serializer->Load(
|
||||
&output,
|
||||
azrtti_typeid<typename JsonMathMatrixSerializerTests<TypeParam>::Descriptor::MatrixType>(),
|
||||
*this->m_jsonDocument,
|
||||
*this->m_jsonDeserializationContext);
|
||||
EXPECT_EQ(Outcomes::Catastrophic, result.GetOutcome());
|
||||
|
||||
this->m_jsonRegistrationContext->template Serializer<AZ::JsonFloatSerializer>()->template HandlesType<float>();
|
||||
}
|
||||
|
||||
// Load object tests
|
||||
TYPED_TEST(JsonMathMatrixSerializerTests, Load_ValidObjectLowerCase_ReturnsSuccessAndLoadsMatrix)
|
||||
{
|
||||
using namespace AZ::JsonSerializationResult;
|
||||
|
||||
rapidjson::Value& objectValue = this->m_jsonDocument->SetObject();
|
||||
auto input = JsonMathMatrixSerializerTests<TypeParam>::Descriptor::MatrixType::CreateIdentity();
|
||||
DataHelper::AddData(objectValue, input, this->m_jsonDocument->GetAllocator());
|
||||
|
||||
auto output = JsonMathMatrixSerializerTests<TypeParam>::Descriptor::MatrixType::CreateZero();
|
||||
ResultCode result = this->m_serializer->Load(
|
||||
&output,
|
||||
azrtti_typeid<typename JsonMathMatrixSerializerTests<TypeParam>::Descriptor::MatrixType>(),
|
||||
*this->m_jsonDocument,
|
||||
*this->m_jsonDeserializationContext);
|
||||
ASSERT_EQ(Outcomes::DefaultsUsed, result.GetOutcome());
|
||||
EXPECT_TRUE(input == output);
|
||||
}
|
||||
|
||||
TYPED_TEST(JsonMathMatrixSerializerTests, Load_ValidObjectWithExtraFields_ReturnsPartialConvertAndLoadsMatrix)
|
||||
{
|
||||
using namespace AZ::JsonSerializationResult;
|
||||
|
||||
rapidjson::Value& objectValue = this->m_jsonDocument->SetObject();
|
||||
auto input = JsonMathMatrixSerializerTests<TypeParam>::Descriptor::MatrixType::CreateIdentity();
|
||||
DataHelper::AddScale(objectValue, input.RetrieveScale().GetX(), this->m_jsonDocument->GetAllocator());
|
||||
DataHelper::AddRotation(objectValue, input, this->m_jsonDocument->GetAllocator());
|
||||
objectValue.AddMember(rapidjson::StringRef("extra"), "no value", this->m_jsonDocument->GetAllocator());
|
||||
|
||||
auto output = JsonMathMatrixSerializerTests<TypeParam>::Descriptor::MatrixType::CreateZero();
|
||||
ResultCode result = this->m_serializer->Load(
|
||||
&output,
|
||||
azrtti_typeid<typename JsonMathMatrixSerializerTests<TypeParam>::Descriptor::MatrixType>(),
|
||||
*this->m_jsonDocument,
|
||||
*this->m_jsonDeserializationContext);
|
||||
ASSERT_EQ(Outcomes::DefaultsUsed, result.GetOutcome());
|
||||
EXPECT_TRUE(input == output);
|
||||
}
|
||||
|
||||
TYPED_TEST(JsonMathMatrixSerializerTests, SaveLoad_Identity_LoadsDefaultMatrixWithIdentity)
|
||||
{
|
||||
using namespace AZ::JsonSerializationResult;
|
||||
|
||||
auto defaultValue = JsonMathMatrixSerializerTests<TypeParam>::Descriptor::MatrixType::CreateIdentity();
|
||||
|
||||
rapidjson::Value& objectInput = this->m_jsonDocument->SetObject();
|
||||
this->m_serializer->Store(
|
||||
objectInput,
|
||||
&defaultValue,
|
||||
&defaultValue,
|
||||
azrtti_typeid<typename JsonMathMatrixSerializerTests<TypeParam>::Descriptor::MatrixType>(),
|
||||
*this->m_jsonSerializationContext);
|
||||
|
||||
rapidjson::StringBuffer buffer;
|
||||
rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
|
||||
objectInput.Accept(writer);
|
||||
|
||||
auto output = defaultValue;
|
||||
ResultCode result = this->m_serializer->Load(
|
||||
&output,
|
||||
azrtti_typeid<typename JsonMathMatrixSerializerTests<TypeParam>::Descriptor::MatrixType>(),
|
||||
*this->m_jsonDocument,
|
||||
*this->m_jsonDeserializationContext);
|
||||
|
||||
EXPECT_TRUE(defaultValue == output);
|
||||
}
|
||||
|
||||
TYPED_TEST(JsonMathMatrixSerializerTests, LoadSave_Zero_SavesAndLoadsIdentityMatrix)
|
||||
{
|
||||
using namespace AZ::JsonSerializationResult;
|
||||
|
||||
auto defaultValue = JsonMathMatrixSerializerTests<TypeParam>::Descriptor::MatrixType::CreateIdentity();
|
||||
auto input = JsonMathMatrixSerializerTests<TypeParam>::Descriptor::MatrixType::CreateZero();
|
||||
|
||||
rapidjson::Value& objectInput = this->m_jsonDocument->SetObject();
|
||||
this->m_serializer->Store(
|
||||
objectInput,
|
||||
&input,
|
||||
&defaultValue,
|
||||
azrtti_typeid<typename JsonMathMatrixSerializerTests<TypeParam>::Descriptor::MatrixType>(),
|
||||
*this->m_jsonSerializationContext);
|
||||
|
||||
auto output = defaultValue;
|
||||
ResultCode result = this->m_serializer->Load(
|
||||
&output,
|
||||
azrtti_typeid<typename JsonMathMatrixSerializerTests<TypeParam>::Descriptor::MatrixType>(),
|
||||
*this->m_jsonDocument,
|
||||
*this->m_jsonDeserializationContext);
|
||||
|
||||
ASSERT_EQ(Outcomes::Unsupported, result.GetOutcome());
|
||||
EXPECT_TRUE(defaultValue == output);
|
||||
}
|
||||
|
||||
TYPED_TEST(JsonMathMatrixSerializerTests, Load_InvalidFields_ReturnsUnsupportedAndLeavesMatrixUntouched)
|
||||
{
|
||||
using namespace AZ::JsonSerializationResult;
|
||||
using Descriptor = typename JsonMathMatrixSerializerTests<TypeParam>::Descriptor;
|
||||
|
||||
const auto defaultValue = Descriptor::MatrixType::CreateIdentity();
|
||||
rapidjson::Value& objectValue = this->m_jsonDocument->SetObject();
|
||||
auto input = Descriptor::MatrixType::CreateIdentity();
|
||||
DataHelper::AddData(objectValue, input, this->m_jsonDocument->GetAllocator());
|
||||
objectValue["yaw"] = "Invalid";
|
||||
|
||||
auto output = Descriptor::MatrixType::CreateZero();
|
||||
ResultCode result = this->m_serializer->Load(
|
||||
&output,
|
||||
azrtti_typeid<typename Descriptor::MatrixType>(),
|
||||
*this->m_jsonDocument,
|
||||
*this->m_jsonDeserializationContext);
|
||||
ASSERT_EQ(Outcomes::Unsupported, result.GetOutcome());
|
||||
EXPECT_TRUE(input == output);
|
||||
}
|
||||
|
||||
TYPED_TEST(JsonMathMatrixSerializerTests, LoadSave_Arbitrary_SavesAndLoadsArbitraryMatrix)
|
||||
{
|
||||
using namespace AZ::JsonSerializationResult;
|
||||
using Descriptor = typename JsonMathMatrixSerializerTests<TypeParam>::Descriptor;
|
||||
|
||||
auto defaultValue = Descriptor::MatrixType::CreateIdentity();
|
||||
size_t elementCount = Descriptor::RowCount * Descriptor::ColumnCount;
|
||||
auto input = DataHelper::CreateArbitraryMatrix<typename Descriptor::MatrixType>(elementCount);
|
||||
|
||||
rapidjson::Value& objectInput = this->m_jsonDocument->SetObject();
|
||||
this->m_serializer->Store(
|
||||
objectInput,
|
||||
&input,
|
||||
&defaultValue,
|
||||
azrtti_typeid<typename Descriptor::MatrixType>(),
|
||||
*this->m_jsonSerializationContext);
|
||||
|
||||
auto output = defaultValue;
|
||||
ResultCode result = this->m_serializer->Load(
|
||||
&output,
|
||||
azrtti_typeid<typename Descriptor::MatrixType>(),
|
||||
*this->m_jsonDocument,
|
||||
*this->m_jsonDeserializationContext);
|
||||
|
||||
EXPECT_EQ(Processing::Completed, result.GetProcessing());
|
||||
|
||||
for (int r = 0; r < Descriptor::RowCount; ++r)
|
||||
{
|
||||
for (int c = 0; c < Descriptor::ColumnCount; ++c)
|
||||
{
|
||||
EXPECT_NEAR(input.GetElement(r, c), output.GetElement(r, c), AZ::Constants::Tolerance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace JsonSerializationTests
|
||||
@ -0,0 +1,16 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../../../Common/Apple/AzFramework/Utils/SystemUtilsApple.h"
|
||||
@ -0,0 +1,15 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../../../Common/Apple/AzFramework/Utils/SystemUtilsApple.h"
|
||||
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="12px" height="12px" viewBox="0 0 12 12" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Icons / Platform / Android</title>
|
||||
<g id="Icons-/-Platform-/-Android" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M1.74272,3.887 C1.53596,3.887 1.36053,3.9591 1.21633,4.1033 C1.07212,4.24751 1,4.42055 1,4.62251 L1,7.72344 C1,7.93046 1.0721,8.10574 1.21633,8.24996 C1.36053,8.39417 1.53596,8.46629 1.74272,8.46629 C1.94933,8.46629 2.12369,8.39419 2.26566,8.24996 C2.40735,8.10576 2.47839,7.93046 2.47839,7.72344 L2.47839,4.62251 C2.47839,4.42052 2.40629,4.24751 2.26206,4.1033 C2.11783,3.9591 1.94468,3.887 1.74272,3.887 Z" id="Path" fill="#FFFFFF" fill-rule="nonzero"></path>
|
||||
<path d="M7.71395,1.10327 L8.22598,0.158715 C8.25959,0.096182 8.24763,0.0482297 8.19,0.0145111 C8.12745,-0.0145641 8.07938,0.000168761 8.0458,0.0576682 L7.52661,1.00977 C7.06976,0.807787 6.58657,0.70661 6.07704,0.70661 C5.5674,0.70661 5.08416,0.807809 4.62749,1.00977 L4.10828,0.0576682 C4.07454,0.000168761 4.02647,-0.0144339 3.96407,0.0145111 C3.90631,0.0483815 3.89436,0.096182 3.9281,0.158715 L4.44015,1.10327 C3.92094,1.36805 3.50742,1.73681 3.19974,2.21034 C2.89206,2.68414 2.73816,3.20189 2.73816,3.76452 L9.40866,3.76452 C9.40866,3.20202 9.25474,2.68424 8.94708,2.21034 C8.63939,1.73681 8.22825,1.36805 7.71395,1.10327 Z M4.75364,2.47714 C4.69826,2.53264 4.63213,2.56026 4.55525,2.56026 C4.47822,2.56026 4.41343,2.53264 4.36058,2.47714 C4.30772,2.4219 4.28129,2.35602 4.28129,2.27888 C4.28129,2.20201 4.30772,2.136 4.36058,2.08063 C4.41343,2.02539 4.47838,1.99777 4.55525,1.99777 C4.63213,1.99777 4.69826,2.02539 4.75364,2.08063 C4.80888,2.13613 4.83663,2.20201 4.83663,2.27888 C4.83648,2.35589 4.80875,2.4219 4.75364,2.47714 Z M7.79321,2.47714 C7.74025,2.53264 7.6753,2.56026 7.59856,2.56026 C7.52151,2.56026 7.4554,2.53264 7.40013,2.47714 C7.34478,2.4219 7.31716,2.35602 7.31716,2.27888 C7.31716,2.20201 7.34478,2.136 7.40013,2.08063 C7.4554,2.02539 7.52151,1.99777 7.59856,1.99777 C7.67543,1.99777 7.74022,2.02539 7.79321,2.08063 C7.84611,2.13613 7.87249,2.20201 7.87249,2.27888 C7.87249,2.35589 7.84609,2.4219 7.79321,2.47714 Z" id="Shape" fill="#FFFFFF" fill-rule="nonzero"></path>
|
||||
<path d="M2.76681,8.82679 C2.76681,9.04815 2.84369,9.23553 2.99746,9.38931 C3.15137,9.54308 3.33875,9.61996 3.55996,9.61996 L4.09364,9.61996 L4.10095,11.2572 C4.10095,11.4639 4.17306,11.6394 4.31726,11.7837 C4.46147,11.9279 4.63464,12 4.83647,12 C5.0431,12 5.21864,11.9279 5.36286,11.7837 C5.50709,11.6394 5.57919,11.4639 5.57919,11.2572 L5.57919,9.62011 L6.57434,9.62011 L6.57434,11.2572 C6.57434,11.4639 6.64642,11.6394 6.79065,11.7837 C6.93488,11.9279 7.11026,12 7.31704,12 C7.52367,12 7.69921,11.9279 7.84343,11.7837 C7.98766,11.6394 8.05974,11.4639 8.05974,11.2572 L8.05974,9.62011 L8.60063,9.62011 C8.81693,9.62011 9.00191,9.54321 9.15596,9.38944 C9.30971,9.23566 9.38663,9.04828 9.38663,8.82694 L9.38663,4.02387 L2.76681,4.02387 L2.76681,8.82679 Z" id="Path" fill="#FFFFFF" fill-rule="nonzero"></path>
|
||||
<path d="M10.411,3.887 C10.2091,3.887 10.036,3.95803 9.89182,4.09972 C9.74761,4.24167 9.67551,4.41603 9.67551,4.62251 L9.67551,7.72344 C9.67551,7.93046 9.74759,8.10574 9.89182,8.24996 C10.036,8.39419 10.2092,8.46629 10.411,8.46629 C10.6177,8.46629 10.7932,8.39419 10.9374,8.24996 C11.0817,8.10574 11.1537,7.93046 11.1537,7.72344 L11.1537,4.62251 C11.1537,4.41601 11.0817,4.24167 10.9374,4.09972 C10.7932,3.95803 10.6177,3.887 10.411,3.887 Z" id="Path" fill="#FFFFFF" fill-rule="nonzero"></path>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.6 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 23 KiB |
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="12px" height="12px" viewBox="0 0 12 12" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Icons / Platform / Windows</title>
|
||||
<g id="Icons-/-Platform-/-Windows" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M-1.42108547e-14,1.69898 L4.88896,1.03321 L4.89106,5.74899 L0.00443941,5.77679 L-1.42108547e-14,1.69903 L-1.42108547e-14,1.69898 Z M4.88662,6.29228 L4.89036,11.0122 L0.00378518,10.3403 L0.0035048,6.26064 L4.88657,6.29228 L4.88662,6.29228 Z M5.47926,0.946061 L11.9615,0 L11.9615,5.68898 L5.47926,5.74039 L5.47926,0.946108 L5.47926,0.946061 Z M11.963,6.33667 L11.9615,12 L5.47921,11.0851 L5.47015,6.32606 L11.963,6.33667 Z" id="Shape" fill="#FFFFFF" fill-rule="nonzero"></path>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 841 B |
@ -0,0 +1,3 @@
|
||||
<svg width="18" height="12" viewBox="0 0 18 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M1.07438 9.87142H2.3975V4.19547H1.07438V9.87142ZM1.73329 3.45112C2.14776 3.45112 2.47189 3.12983 2.47189 2.72824C2.47189 2.32128 2.14776 2 1.73329 2C1.32413 2 1 2.32129 1 2.72824C1 3.12984 1.32413 3.45112 1.73329 3.45112ZM6.80274 2.01602C4.56572 2.01602 3.16283 3.55283 3.16283 6.01068C3.16283 8.46854 4.56558 10 6.80274 10C9.03446 10 10.4373 8.46854 10.4373 6.01068C10.4373 3.55283 9.03459 2.01602 6.80274 2.01602ZM6.80274 3.19407C8.16835 3.19407 9.03976 4.28643 9.03976 6.01066C9.03976 7.72951 8.16832 8.8219 6.80274 8.8219C5.43182 8.8219 4.56572 7.72954 4.56572 6.01066C4.56572 4.28646 5.43185 3.19407 6.80274 3.19407ZM10.9955 7.69743C11.0539 9.12184 12.2123 9.99997 13.9764 9.99997C15.831 9.99997 17 9.07896 17 7.61176C17 6.4605 16.3411 5.81258 14.7842 5.45384L13.9021 5.25035C12.9616 5.02546 12.5737 4.7256 12.5737 4.21155C12.5737 3.56898 13.1582 3.1406 14.0243 3.1406C14.9011 3.1406 15.5015 3.57434 15.5653 4.29722H16.8725C16.8406 2.93712 15.7247 2.01607 14.035 2.01607C12.3664 2.01607 11.1815 2.94243 11.1815 4.31326C11.1815 5.41633 11.851 6.10175 13.2644 6.42841L14.258 6.66402C15.2251 6.89428 15.6184 7.21555 15.6184 7.77244C15.6184 8.41501 14.9754 8.87552 14.0509 8.87552C13.1157 8.87552 12.409 8.40966 12.324 7.69747H10.9955L10.9955 7.69743Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
@ -0,0 +1,3 @@
|
||||
<svg width="37" height="12" viewBox="0 0 37 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M1.00003 9.87115H2.3489V6.38891C2.3489 5.70213 2.80394 5.20315 3.45401 5.20315C4.08239 5.20315 4.47244 5.59483 4.47244 6.22794V9.87102H5.78339V6.35664C5.78339 5.67524 6.22759 5.20308 6.87765 5.20308C7.53854 5.20308 7.90692 5.60012 7.90692 6.29764V9.87108H9.25579V5.97045C9.25579 4.83299 8.51364 4.07646 7.3814 4.07646C6.55257 4.07646 5.87008 4.51642 5.59369 5.2193H5.56119C5.34992 4.4896 4.77029 4.07646 3.95778 4.07646C3.17771 4.07646 2.57099 4.51107 2.32178 5.17102H2.2947V4.18377H1V9.87112L1.00003 9.87115ZM12.2084 8.95365C11.6233 8.95365 11.2333 8.65856 11.2333 8.19176C11.2333 7.74106 11.6071 7.45133 12.2571 7.4084L13.5843 7.32792V7.76253C13.5843 8.44931 12.9722 8.95366 12.2084 8.95366V8.95365ZM11.8021 9.96237C12.5388 9.96237 13.2593 9.58142 13.5898 8.96439H13.6169V9.87116H14.917V5.95433C14.917 4.81149 13.9906 4.06569 12.566 4.06569C11.1033 4.06569 10.1879 4.82759 10.1283 5.88991H11.3796C11.4663 5.41775 11.8726 5.11191 12.5118 5.11191C13.1781 5.11191 13.5844 5.4553 13.5844 6.05086V6.45864L12.0675 6.54449C10.6699 6.63034 9.88444 7.23664 9.88444 8.24537C9.88444 9.27016 10.6916 9.96231 11.8021 9.96231L11.8021 9.96237ZM20.8381 6.21187C20.746 5.01538 19.8089 4.06569 18.2921 4.06569C16.6237 4.06569 15.5402 5.20853 15.5402 7.02735C15.5402 8.87314 16.6236 9.98365 18.3029 9.98365C19.7439 9.98365 20.7352 9.14664 20.8435 7.87497H19.5705C19.4459 8.51883 19.0017 8.90514 18.3191 8.90514C17.4632 8.90514 16.9107 8.21836 16.9107 7.02721C16.9107 5.85755 17.4578 5.14929 18.3083 5.14929C19.0288 5.14929 19.4568 5.60535 19.5651 6.21165H20.8381L20.8381 6.21187ZM25.0042 2C22.7236 2 21.2934 3.53989 21.2934 6.00268C21.2934 8.46546 22.7235 10 25.0042 10C27.2794 10 28.7096 8.46546 28.7096 6.00268C28.7096 3.53989 27.2795 2 25.0042 2ZM25.0042 3.18041C26.3964 3.18041 27.2848 4.27497 27.2848 6.00265C27.2848 7.72495 26.3964 8.81954 25.0042 8.81954C23.6066 8.81954 22.7236 7.72498 22.7236 6.00265C22.7236 4.27499 23.6066 3.18041 25.0042 3.18041ZM29.2786 7.69281C29.3381 9.12007 30.5191 9.99997 32.3176 9.99997C34.2082 9.99997 35.4 9.07711 35.4 7.60696C35.4 6.4534 34.7283 5.80417 33.1411 5.44471L32.2418 5.24082C31.283 5.01548 30.8875 4.71501 30.8875 4.19993C30.8875 3.55607 31.4834 3.12684 32.3664 3.12684C33.2602 3.12684 33.8723 3.56144 33.9373 4.28577H35.27C35.2375 2.92295 34.0999 2.00004 32.3773 2.00004C30.6762 2.00004 29.4682 2.92826 29.4682 4.30185C29.4682 5.40713 30.1508 6.09392 31.5916 6.42124L32.6047 6.65733C33.5906 6.88805 33.9914 7.20997 33.9914 7.76797C33.9914 8.41183 33.336 8.87326 32.3934 8.87326C31.44 8.87326 30.7196 8.40647 30.6329 7.69285H29.2786L29.2786 7.69281Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.6 KiB |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue