Updated ozz-animation to version 0.14.3 (commit 92c392b667844)

This commit is contained in:
Martin Felis
2024-03-17 12:47:11 +01:00
parent 1ef53d6486
commit c7d2d195a3
28 changed files with 284 additions and 282 deletions
@@ -264,7 +264,7 @@ class TwoBoneIKSampleApplication : public ozz::sample::Application {
virtual void OnDestroy() {}
virtual bool OnGui(ozz::sample::ImGui* _im_gui) {
char txt[32];
char label[32];
// IK parameters
_im_gui->DoCheckBox("Fix initial transform", &fix_initial_transform_);
@@ -273,25 +273,25 @@ class TwoBoneIKSampleApplication : public ozz::sample::Application {
static bool opened = true;
ozz::sample::ImGui::OpenClose oc(_im_gui, "IK parameters", &opened);
if (opened) {
sprintf(txt, "Soften: %.2g", soften_);
_im_gui->DoSlider(txt, 0.f, 1.f, &soften_, 2.f);
sprintf(txt, "Twist angle: %.0f",
snprintf(label, sizeof(label), "Soften: %.2g", soften_);
_im_gui->DoSlider(label, 0.f, 1.f, &soften_, 2.f);
snprintf(label, sizeof(label), "Twist angle: %.0f",
twist_angle_ * ozz::math::kRadianToDegree);
_im_gui->DoSlider(txt, -ozz::math::kPi, ozz::math::kPi, &twist_angle_);
sprintf(txt, "Weight: %.2g", weight_);
_im_gui->DoSlider(txt, 0.f, 1.f, &weight_);
_im_gui->DoSlider(label, -ozz::math::kPi, ozz::math::kPi, &twist_angle_);
snprintf(label, sizeof(label), "Weight: %.2g", weight_);
_im_gui->DoSlider(label, 0.f, 1.f, &weight_);
{
// Pole vector
static bool pole_opened = true;
ozz::sample::ImGui::OpenClose oc_pole(_im_gui, "Pole vector",
&pole_opened);
if (pole_opened) {
sprintf(txt, "x %.2g", pole_vector.x);
_im_gui->DoSlider(txt, -1.f, 1.f, &pole_vector.x);
sprintf(txt, "y %.2g", pole_vector.y);
_im_gui->DoSlider(txt, -1.f, 1.f, &pole_vector.y);
sprintf(txt, "z %.2g", pole_vector.z);
_im_gui->DoSlider(txt, -1.f, 1.f, &pole_vector.z);
snprintf(label, sizeof(label), "x %.2g", pole_vector.x);
_im_gui->DoSlider(label, -1.f, 1.f, &pole_vector.x);
snprintf(label, sizeof(label), "y %.2g", pole_vector.y);
_im_gui->DoSlider(label, -1.f, 1.f, &pole_vector.y);
snprintf(label, sizeof(label), "z %.2g", pole_vector.z);
_im_gui->DoSlider(label, -1.f, 1.f, &pole_vector.z);
}
}
}
@@ -301,17 +301,17 @@ class TwoBoneIKSampleApplication : public ozz::sample::Application {
ozz::sample::ImGui::OpenClose oc(_im_gui, "Target position", &opened);
if (opened) {
_im_gui->DoLabel("Target animation extent");
sprintf(txt, "%.2g", target_extent_);
_im_gui->DoSlider(txt, 0.f, 1.f, &target_extent_);
snprintf(label, sizeof(label), "%.2g", target_extent_);
_im_gui->DoSlider(label, 0.f, 1.f, &target_extent_);
_im_gui->DoLabel("Target Offset");
const float kOffsetRange = 1.f;
sprintf(txt, "x %.2g", target_offset_.x);
_im_gui->DoSlider(txt, -kOffsetRange, kOffsetRange, &target_offset_.x);
sprintf(txt, "y %.2g", target_offset_.y);
_im_gui->DoSlider(txt, -kOffsetRange, kOffsetRange, &target_offset_.y);
sprintf(txt, "z %.2g", target_offset_.z);
_im_gui->DoSlider(txt, -kOffsetRange, kOffsetRange, &target_offset_.z);
snprintf(label, sizeof(label), "x %.2g", target_offset_.x);
_im_gui->DoSlider(label, -kOffsetRange, kOffsetRange, &target_offset_.x);
snprintf(label, sizeof(label), "y %.2g", target_offset_.y);
_im_gui->DoSlider(label, -kOffsetRange, kOffsetRange, &target_offset_.y);
snprintf(label, sizeof(label), "z %.2g", target_offset_.z);
_im_gui->DoSlider(label, -kOffsetRange, kOffsetRange, &target_offset_.z);
}
}
{ // Root
@@ -320,28 +320,28 @@ class TwoBoneIKSampleApplication : public ozz::sample::Application {
if (opened) {
// Translation
_im_gui->DoLabel("Translation");
sprintf(txt, "x %.2g", root_translation_.x);
_im_gui->DoSlider(txt, -1.f, 1.f, &root_translation_.x);
sprintf(txt, "y %.2g", root_translation_.y);
_im_gui->DoSlider(txt, -1.f, 1.f, &root_translation_.y);
sprintf(txt, "z %.2g", root_translation_.z);
_im_gui->DoSlider(txt, -1.f, 1.f, &root_translation_.z);
snprintf(label, sizeof(label), "x %.2g", root_translation_.x);
_im_gui->DoSlider(label, -1.f, 1.f, &root_translation_.x);
snprintf(label, sizeof(label), "y %.2g", root_translation_.y);
_im_gui->DoSlider(label, -1.f, 1.f, &root_translation_.y);
snprintf(label, sizeof(label), "z %.2g", root_translation_.z);
_im_gui->DoSlider(label, -1.f, 1.f, &root_translation_.z);
// Rotation (in euler form)
_im_gui->DoLabel("Rotation");
ozz::math::Float3 euler = root_euler_ * ozz::math::kRadianToDegree;
sprintf(txt, "yaw %.3g", euler.x);
_im_gui->DoSlider(txt, -180.f, 180.f, &euler.x);
sprintf(txt, "pitch %.3g", euler.y);
_im_gui->DoSlider(txt, -180.f, 180.f, &euler.y);
sprintf(txt, "roll %.3g", euler.z);
_im_gui->DoSlider(txt, -180.f, 180.f, &euler.z);
snprintf(label, sizeof(label), "yaw %.3g", euler.x);
_im_gui->DoSlider(label, -180.f, 180.f, &euler.x);
snprintf(label, sizeof(label), "pitch %.3g", euler.y);
_im_gui->DoSlider(label, -180.f, 180.f, &euler.y);
snprintf(label, sizeof(label), "roll %.3g", euler.z);
_im_gui->DoSlider(label, -180.f, 180.f, &euler.z);
root_euler_ = euler * ozz::math::kDegreeToRadian;
// Scale (must be uniform and not 0)
_im_gui->DoLabel("Scale");
sprintf(txt, "%.2g", root_scale_);
_im_gui->DoSlider(txt, -1.f, 1.f, &root_scale_);
snprintf(label, sizeof(label), "%.2g", root_scale_);
_im_gui->DoSlider(label, -1.f, 1.f, &root_scale_);
}
}
{ // Display options