1 /* 2 * Copyright (C) 2023 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 OHOS_RENDER_3D_GLTF_ANIMATION_H 17 #define OHOS_RENDER_3D_GLTF_ANIMATION_H 18 19 #include <string> 20 #include "data_type/constants.h" 21 22 namespace OHOS::Render3D { 23 class GLTFAnimation { 24 public: 25 GLTFAnimation(const std::string& name, AnimationState state, int repeatCount = -1, 26 float speed = 1.0, float duration = -1, bool reverse = false) 27 : name_(name), state_(state), repeatCount_(repeatCount), speed_(speed), 28 duration_(duration), reverse_(reverse) {} ; 29 ~GLTFAnimation() = default; 30 GetName()31 const std::string& GetName() const { return name_; } GetState()32 AnimationState GetState() const { return state_; } GetRepeatCount()33 int GetRepeatCount() const { return repeatCount_; } GetSpeed()34 float GetSpeed() const { return speed_; } GetDuration()35 float GetDuration() const { return duration_; } GetReverse()36 bool GetReverse() const { return reverse_; } 37 38 private: 39 std::string name_ = ""; 40 AnimationState state_ = AnimationState::PLAY; 41 int repeatCount_ = -1; 42 float speed_ = 1.0; 43 float duration_ = -1.0; 44 bool reverse_ = false; 45 }; 46 } // namespace OHOS::Render3D 47 #endif // OHOS_RENDER_3D_GLTF_ANIMATION_H 48