载入中...
搜索中...
未找到
CollapseAnimationInternal.h
浏览该文件的文档.
1#pragma once
2#include <cmath>
3#include "common/Diagnostic.h"
5
7constexpr std::uint32_t MaxSamples = 2000000;
8constexpr std::uint32_t MaxRecipeBytes = 65536;
9inline Diagnostic invalid(const char* message) {
10 return Diagnostic::error(DiagnosticCode::InvalidArgument, message, "collapseAnimation");
11}
12inline bool valid(const BonePresentation& b) {
13 const float values[] = {b.halfExtentX, b.halfExtentY, b.halfExtentZ, b.worldX, b.worldY,
14 b.worldZ, b.rotX, b.rotY, b.rotZ, b.rotW};
15 for (float v : values)
16 if (!std::isfinite(v)) return false;
17 const float norm = b.rotX * b.rotX + b.rotY * b.rotY + b.rotZ * b.rotZ + b.rotW * b.rotW;
18 return b.halfExtentX > 0 && b.halfExtentY > 0 && b.halfExtentZ > 0 && std::isfinite(norm) && norm > 0.5f &&
19 norm < 1.5f && static_cast<unsigned>(b.state) <= 2 && b.clusterId >= 0 && b.fractureLevel >= 0;
20}
21} // namespace eve::physics::collapse_detail
Stable, structured diagnostics shared by engine modules.
std::string message
float v
bool valid
MeleePoint3 b
Definition MeleeHit.cpp:41
std::set< std::string > values
A structured explanation of a failed, degraded, or noteworthy result.
Definition Diagnostic.h:94
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Presentation snapshot for one bone (world pose + proxy extents).