projects
/
platform
/
core
/
uifw
/
dali-toolkit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change public member variable to private
[platform/core/uifw/dali-toolkit.git]
/
dali-scene3d
/
public-api
/
loader
/
bvh-loader.cpp
diff --git
a/dali-scene3d/public-api/loader/bvh-loader.cpp
b/dali-scene3d/public-api/loader/bvh-loader.cpp
index
fc6815d
..
70cb297
100644
(file)
--- a/
dali-scene3d/public-api/loader/bvh-loader.cpp
+++ b/
dali-scene3d/public-api/loader/bvh-loader.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 202
2
Samsung Electronics Co., Ltd.
+ * Copyright (c) 202
3
Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-25,11
+25,7
@@
#include <sstream>
#include <string_view>
#include <sstream>
#include <string_view>
-namespace Dali
-{
-namespace Scene3D
-{
-namespace Loader
+namespace Dali::Scene3D::Loader
{
namespace
{
{
namespace
{
@@
-291,8
+287,8
@@
AnimationDefinition GenerateAnimation(const std::string& animationName, std::sha
{
AnimationDefinition animationDefinition;
{
AnimationDefinition animationDefinition;
- animationDefinition.
mName = animationName
;
- animationDefinition.
mDuration = frameTime * (frameCount - 1
);
+ animationDefinition.
SetName(animationName)
;
+ animationDefinition.
SetDuration(frameTime * (frameCount - 1)
);
float keyFrameInterval = (frameCount > 1u) ? 1.0f / static_cast<float>(frameCount - 1u) : Dali::Math::MACHINE_EPSILON_10;
std::vector<std::shared_ptr<Joint>> jointList;
float keyFrameInterval = (frameCount > 1u) ? 1.0f / static_cast<float>(frameCount - 1u) : Dali::Math::MACHINE_EPSILON_10;
std::vector<std::shared_ptr<Joint>> jointList;
@@
-300,16
+296,16
@@
AnimationDefinition GenerateAnimation(const std::string& animationName, std::sha
if(!jointList.empty())
{
if(!jointList.empty())
{
- animationDefinition.
mProperties.res
ize(jointList.size() * 2u); // translation and rotation
+ animationDefinition.
ReserveS
ize(jointList.size() * 2u); // translation and rotation
for(uint32_t i = 0; i < jointList.size(); ++i)
{
for(uint32_t i = 0; i < jointList.size(); ++i)
{
- AnimatedProperty
& translationProperty = animationDefinition.mProperties[i * 2u]
;
- translationProperty.mTimePeriod = Dali::TimePeriod(animationDefinition.
mDuration
);
+ AnimatedProperty
translationProperty
;
+ translationProperty.mTimePeriod = Dali::TimePeriod(animationDefinition.
GetDuration()
);
translationProperty.mNodeName = jointList[i]->name;
translationProperty.mPropertyName = PROPERTY_NAME_POSITION.data();
translationProperty.mNodeName = jointList[i]->name;
translationProperty.mPropertyName = PROPERTY_NAME_POSITION.data();
- AnimatedProperty
& rotationProperty = animationDefinition.mProperties[i * 2u + 1]
;
- rotationProperty.mTimePeriod = Dali::TimePeriod(animationDefinition.
mDuration
);
+ AnimatedProperty
rotationProperty
;
+ rotationProperty.mTimePeriod = Dali::TimePeriod(animationDefinition.
GetDuration()
);
rotationProperty.mNodeName = jointList[i]->name;
rotationProperty.mPropertyName = PROPERTY_NAME_ORIENTATION.data();
rotationProperty.mNodeName = jointList[i]->name;
rotationProperty.mPropertyName = PROPERTY_NAME_ORIENTATION.data();
@@
-317,9
+313,11
@@
AnimationDefinition GenerateAnimation(const std::string& animationName, std::sha
rotationProperty.mKeyFrames = Dali::KeyFrames::New();
for(uint32_t j = 0; j < frameCount; ++j)
{
rotationProperty.mKeyFrames = Dali::KeyFrames::New();
for(uint32_t j = 0; j < frameCount; ++j)
{
- translationProperty.mKeyFrames.Add(static_cast<float>(j) * keyFrameInterval, (jointList[i]->translations[j]
/
scale));
+ translationProperty.mKeyFrames.Add(static_cast<float>(j) * keyFrameInterval, (jointList[i]->translations[j]
*
scale));
rotationProperty.mKeyFrames.Add(static_cast<float>(j) * keyFrameInterval, jointList[i]->rotations[j]);
}
rotationProperty.mKeyFrames.Add(static_cast<float>(j) * keyFrameInterval, jointList[i]->rotations[j]);
}
+ animationDefinition.SetProperty(i * 2u, std::move(translationProperty));
+ animationDefinition.SetProperty(i * 2u + 1, std::move(rotationProperty));
}
}
}
}
@@
-340,6
+338,4
@@
AnimationDefinition LoadBvh(const std::string& path, const std::string& animatio
return GenerateAnimation(animationName, rootJoint, frameCount, frameTime, scale);
}
return GenerateAnimation(animationName, rootJoint, frameCount, frameTime, scale);
}
-} // namespace Loader
-} // namespace Scene3D
-} // namespace Dali
\ No newline at end of file
+} // namespace Dali::Scene3D::Loader
\ No newline at end of file