1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #ifndef SCENEPLUGIN_INTF_SUBMESHBRIDGE_H 16 #define SCENEPLUGIN_INTF_SUBMESHBRIDGE_H 17 #include <scene_plugin/namespace.h> 18 19 #include <3d/ecs/components/mesh_component.h> 20 21 #include <meta/base/types.h> 22 #include <meta/interface/property/intf_property.h> 23 24 #include "intf_node_private.h" 25 SCENE_BEGIN_NAMESPACE() 26 27 REGISTER_INTERFACE(ISubMeshBridge, "8be436af-9556-44ff-9f9c-3472b168cef4") 28 class ISubMeshBridge : public CORE_NS::IInterface { 29 META_INTERFACE(CORE_NS::IInterface, ISubMeshBridge, InterfaceId::ISubMeshBridge) 30 public: 31 virtual void Initialize(CORE3D_NS::IMeshComponentManager* componentManager, CORE_NS::Entity entity, 32 META_NS::IProperty::Ptr submeshes, INodeEcsInterfacePrivate::Ptr node) = 0; 33 virtual void SetRenderSortLayerOrder(size_t index, uint8_t value) = 0; 34 virtual void SetMaterialToEcs(size_t index, SCENE_NS::IMaterial::Ptr& material) = 0; 35 virtual void SetAABBMin(size_t index, BASE_NS::Math::Vec3) = 0; 36 virtual void SetAABBMax(size_t index, BASE_NS::Math::Vec3) = 0; 37 virtual void RemoveSubmesh(int32_t index) = 0; 38 virtual CORE_NS::Entity GetEntity() const = 0; 39 }; 40 41 REGISTER_INTERFACE(ISubMeshPrivate, "bda354b5-7747-488f-b0f6-50c3d98bee2d") 42 class ISubMeshPrivate : public CORE_NS::IInterface { 43 META_INTERFACE(CORE_NS::IInterface, ISubMeshPrivate, InterfaceId::ISubMeshPrivate) 44 public: 45 virtual void AddSubmeshBrigde(ISubMeshBridge::Ptr bridge) = 0; 46 virtual void RemoveSubmeshBrigde(ISubMeshBridge::Ptr bridge) = 0; 47 virtual CORE_NS::Entity GetEntity() const = 0; 48 49 virtual void SetDefaultMaterial(SCENE_NS::IMaterial::Ptr material) = 0; 50 virtual void RestoreDefaultMaterial() = 0; 51 52 virtual void SetOverrideMaterial(SCENE_NS::IMaterial::Ptr material) = 0; 53 }; 54 55 SCENE_END_NAMESPACE() 56 #endif