/* * 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 #include #include #include #include #include namespace AZ { namespace RPI { void ModelSystem::Reflect(AZ::ReflectContext* context) { ModelLodAsset::Reflect(context); ModelAsset::Reflect(context); MorphTargetMetaAsset::Reflect(context); SkinMetaAsset::Reflect(context); } void ModelSystem::GetAssetHandlers(AssetHandlerPtrList& assetHandlers) { assetHandlers.emplace_back(MakeAssetHandler()); assetHandlers.emplace_back(MakeAssetHandler()); assetHandlers.emplace_back(MakeAssetHandler()); assetHandlers.emplace_back(MakeAssetHandler()); } void ModelSystem::Init() { //Create Lod Database AZ::Data::InstanceHandler lodInstanceHandler; lodInstanceHandler.m_createFunction = [](Data::AssetData* modelLodAsset) { return ModelLod::CreateInternal(*(azrtti_cast(modelLodAsset))); }; Data::InstanceDatabase::Create(azrtti_typeid(), lodInstanceHandler); //Create Model Database AZ::Data::InstanceHandler modelInstanceHandler; modelInstanceHandler.m_createFunction = [](Data::AssetData* modelAsset) { return Model::CreateInternal(*(azrtti_cast(modelAsset))); }; Data::InstanceDatabase::Create(azrtti_typeid(), modelInstanceHandler); } void ModelSystem::Shutdown() { Data::InstanceDatabase::Destroy(); Data::InstanceDatabase::Destroy(); } } // namespace RPI } // namespace AZ