-
-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a661e8e
commit 6a74332
Showing
15 changed files
with
1,217 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
"cmake.configureOnOpen": true, | ||
"files.associations": { | ||
"__bit_reference": "cpp", | ||
"__config": "cpp", | ||
"__hash_table": "cpp", | ||
"__locale": "cpp", | ||
"__node_handle": "cpp", | ||
"__split_buffer": "cpp", | ||
"__threading_support": "cpp", | ||
"__tree": "cpp", | ||
"__verbose_abort": "cpp", | ||
"array": "cpp", | ||
"bitset": "cpp", | ||
"cctype": "cpp", | ||
"charconv": "cpp", | ||
"clocale": "cpp", | ||
"cmath": "cpp", | ||
"complex": "cpp", | ||
"cstdarg": "cpp", | ||
"cstddef": "cpp", | ||
"cstdint": "cpp", | ||
"cstdio": "cpp", | ||
"cstdlib": "cpp", | ||
"cstring": "cpp", | ||
"ctime": "cpp", | ||
"cwchar": "cpp", | ||
"cwctype": "cpp", | ||
"deque": "cpp", | ||
"execution": "cpp", | ||
"forward_list": "cpp", | ||
"fstream": "cpp", | ||
"future": "cpp", | ||
"initializer_list": "cpp", | ||
"iomanip": "cpp", | ||
"ios": "cpp", | ||
"iosfwd": "cpp", | ||
"iostream": "cpp", | ||
"istream": "cpp", | ||
"limits": "cpp", | ||
"list": "cpp", | ||
"locale": "cpp", | ||
"map": "cpp", | ||
"mutex": "cpp", | ||
"new": "cpp", | ||
"optional": "cpp", | ||
"ostream": "cpp", | ||
"queue": "cpp", | ||
"ratio": "cpp", | ||
"set": "cpp", | ||
"sstream": "cpp", | ||
"stack": "cpp", | ||
"stdexcept": "cpp", | ||
"streambuf": "cpp", | ||
"string": "cpp", | ||
"string_view": "cpp", | ||
"tuple": "cpp", | ||
"typeinfo": "cpp", | ||
"unordered_map": "cpp", | ||
"unordered_set": "cpp", | ||
"valarray": "cpp", | ||
"variant": "cpp", | ||
"vector": "cpp", | ||
"algorithm": "cpp" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
//----------------------------------------------------------------------------// | ||
// // | ||
// ozz-animation is hosted at http://github.com/guillaumeblanc/ozz-animation // | ||
// and distributed under the MIT License (MIT). // | ||
// // | ||
// Copyright (c) Guillaume Blanc // | ||
// // | ||
// Permission is hereby granted, free of charge, to any person obtaining a // | ||
// copy of this software and associated documentation files (the "Software"), // | ||
// to deal in the Software without restriction, including without limitation // | ||
// the rights to use, copy, modify, merge, publish, distribute, sublicense, // | ||
// and/or sell copies of the Software, and to permit persons to whom the // | ||
// Software is furnished to do so, subject to the following conditions: // | ||
// // | ||
// The above copyright notice and this permission notice shall be included in // | ||
// all copies or substantial portions of the Software. // | ||
// // | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // | ||
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // | ||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // | ||
// DEALINGS IN THE SOFTWARE. // | ||
// // | ||
//----------------------------------------------------------------------------// | ||
|
||
#ifndef OZZ_OZZ_ANIMATION_OFFLINE_MOTION_EXTRACTOR_H_ | ||
#define OZZ_OZZ_ANIMATION_OFFLINE_MOTION_EXTRACTOR_H_ | ||
|
||
#include "ozz/animation/offline/export.h" | ||
|
||
namespace ozz { | ||
namespace animation { | ||
class Skeleton; | ||
namespace offline { | ||
|
||
// Forward declare offline types. | ||
struct RawAnimation; | ||
struct RawFloat3Track; | ||
struct RawQuaternionTrack; | ||
|
||
class OZZ_ANIMOFFLINE_DLL MotionExtractor { | ||
public: | ||
bool operator()(const RawAnimation& _input, const Skeleton& _skeleton, | ||
RawFloat3Track* _motion_position, | ||
RawQuaternionTrack* _motion_rotation, | ||
RawAnimation* _output) const; | ||
|
||
struct PositionComponents { | ||
bool x = true; | ||
bool y = true; | ||
bool z = true; | ||
bool all() const { return x && y && z; } | ||
} position_components; | ||
|
||
struct RotationComponents { | ||
bool x = false; | ||
bool y = true; | ||
bool z = false; | ||
bool all() const { return x && y && z; } | ||
} rotation_components; | ||
|
||
// Defines teh reference transform to use while extracting root motion. | ||
enum class Reference { | ||
kIdentity, // Identity / global reference | ||
kSkeleton, // Use skeleton rest pose root bone transform | ||
kFirstFrame, // Uses root transform of the animation's first frame | ||
} reference = Reference::kFirstFrame; | ||
|
||
bool bake_position = true; | ||
bool bake_rotation = true; | ||
bool bake_scale = true; | ||
}; | ||
} // namespace offline | ||
} // namespace animation | ||
} // namespace ozz | ||
#endif // OZZ_OZZ_ANIMATION_OFFLINE_MOTION_EXTRACTOR_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
//----------------------------------------------------------------------------// | ||
// // | ||
// ozz-animation is hosted at http://github.com/guillaumeblanc/ozz-animation // | ||
// and distributed under the MIT License (MIT). // | ||
// // | ||
// Copyright (c) Guillaume Blanc // | ||
// // | ||
// Permission is hereby granted, free of charge, to any person obtaining a // | ||
// copy of this software and associated documentation files (the "Software"), // | ||
// to deal in the Software without restriction, including without limitation // | ||
// the rights to use, copy, modify, merge, publish, distribute, sublicense, // | ||
// and/or sell copies of the Software, and to permit persons to whom the // | ||
// Software is furnished to do so, subject to the following conditions: // | ||
// // | ||
// The above copyright notice and this permission notice shall be included in // | ||
// all copies or substantial portions of the Software. // | ||
// // | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // | ||
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // | ||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // | ||
// DEALINGS IN THE SOFTWARE. // | ||
// // | ||
//----------------------------------------------------------------------------// | ||
|
||
#ifndef OZZ_OZZ_ANIMATION_OFFLINE_RAW_TRACK_UTILS_H_ | ||
#define OZZ_OZZ_ANIMATION_OFFLINE_RAW_TRACK_UTILS_H_ | ||
|
||
#include "ozz/animation/offline/export.h" | ||
#include "ozz/animation/offline/raw_track.h" | ||
|
||
namespace ozz { | ||
namespace animation { | ||
namespace offline { | ||
|
||
// Samples a RawTrack. This function shall be used for offline purpose. | ||
// Returns false if track is invalid. | ||
template <typename _RawTrack> | ||
OZZ_ANIMOFFLINE_DLL bool SampleTrack(const _RawTrack& _track, float _ratio, | ||
typename _RawTrack::ValueType* _value); | ||
|
||
} // namespace offline | ||
} // namespace animation | ||
} // namespace ozz | ||
#endif // OZZ_OZZ_ANIMATION_OFFLINE_RAW_TRACK_UTILS_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
|
||
add_custom_command( | ||
DEPENDS $<$<BOOL:${ozz_build_fbx}>:BUILD_DATA> | ||
"${CMAKE_CURRENT_LIST_DIR}/README.md" | ||
"${ozz_media_directory}/bin/pab_skeleton.ozz" | ||
"${ozz_media_directory}/bin/pab_atlas_raw.ozz" | ||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/README.md" | ||
"${CMAKE_CURRENT_BINARY_DIR}/media/skeleton.ozz" | ||
"${CMAKE_CURRENT_BINARY_DIR}/media/raw_animation.ozz" | ||
COMMAND ${CMAKE_COMMAND} -E make_directory media | ||
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_LIST_DIR}/README.md" . | ||
COMMAND ${CMAKE_COMMAND} -E copy "${ozz_media_directory}/bin/pab_skeleton.ozz" "./media/skeleton.ozz" | ||
COMMAND ${CMAKE_COMMAND} -E copy "${ozz_media_directory}/bin/pab_atlas_raw.ozz" "./media/raw_animation.ozz" | ||
VERBATIM) | ||
|
||
add_executable(sample_motion | ||
sample_motion.cc | ||
"${CMAKE_CURRENT_BINARY_DIR}/README.md" | ||
"${CMAKE_CURRENT_BINARY_DIR}/media/skeleton.ozz" | ||
"${CMAKE_CURRENT_BINARY_DIR}/media/raw_animation.ozz") | ||
target_link_libraries(sample_motion | ||
sample_framework) | ||
target_copy_shared_libraries(sample_motion) | ||
|
||
set_target_properties(sample_motion | ||
PROPERTIES FOLDER "samples") | ||
|
||
if(EMSCRIPTEN) | ||
# Resource files are embedded to the output file with emscripten | ||
set_target_properties(sample_motion | ||
PROPERTIES LINK_FLAGS "--embed-file media --embed-file README.md") | ||
|
||
install(FILES | ||
${CMAKE_CURRENT_BINARY_DIR}/sample_motion.html | ||
${CMAKE_CURRENT_BINARY_DIR}/sample_motion.js | ||
${CMAKE_CURRENT_BINARY_DIR}/sample_motion.wasm | ||
DESTINATION bin/samples/motion) | ||
else() | ||
install(TARGETS sample_motion DESTINATION bin/samples/motion) | ||
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/media DESTINATION bin/samples/motion) | ||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/README.md DESTINATION bin/samples/motion) | ||
endif(EMSCRIPTEN) | ||
|
||
add_test(NAME sample_motion COMMAND sample_motion "--max_idle_loops=${ozz_sample_testing_loops}" $<$<BOOL:${ozz_run_tests_headless}>:--norender>) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Ozz-animation sample: Animation motion | ||
|
||
## Description | ||
|
||
## Concept | ||
|
||
## Sample usage | ||
|
||
## Implementation |
Oops, something went wrong.