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 16 #ifndef SCENE_SRC_COMPONENT_TRANSFORM_COMPONENT_H 17 #define SCENE_SRC_COMPONENT_TRANSFORM_COMPONENT_H 18 19 #include <scene/ext/component.h> 20 #include <scene/interface/intf_transform.h> 21 22 #include <meta/ext/object.h> 23 24 SCENE_BEGIN_NAMESPACE() 25 26 META_REGISTER_CLASS( 27 TransformComponent, "534bdd95-3137-4f2f-89ab-0d795560facb", META_NS::ObjectCategoryBits::NO_CATEGORY) 28 29 class TransformComponent : public META_NS::IntroduceInterfaces<Component, ITransform> { 30 META_OBJECT(TransformComponent, ClassId::TransformComponent, IntroduceInterfaces) 31 32 public: 33 META_BEGIN_STATIC_DATA() 34 SCENE_STATIC_PROPERTY_DATA(ITransform, BASE_NS::Math::Vec3, Position, "TransformComponent.position") 35 SCENE_STATIC_PROPERTY_DATA(ITransform, BASE_NS::Math::Vec3, Scale, "TransformComponent.scale") 36 SCENE_STATIC_PROPERTY_DATA(ITransform, BASE_NS::Math::Quat, Rotation, "TransformComponent.rotation") 37 META_END_STATIC_DATA() 38 39 META_IMPLEMENT_PROPERTY(BASE_NS::Math::Vec3, Position) 40 META_IMPLEMENT_PROPERTY(BASE_NS::Math::Vec3, Scale) 41 META_IMPLEMENT_PROPERTY(BASE_NS::Math::Quat, Rotation) 42 43 public: 44 BASE_NS::string GetName() const override; 45 }; 46 47 SCENE_END_NAMESPACE() 48 49 #endif