18struct MotionFeatureLayout;
19namespace detail {
struct MotionSchemaState; }
53 void addFeatureBone(
int boneIndex);
55 void addFeatureBoneByName(
const std::string&
name);
69 [[nodiscard]]
eve::Result<void> setLocomotionFeatures(
int leftFoot,
int rightFoot,
int pelvis);
84 bool hasFeatureLayout()
const;
95 std::span<const std::string>
sources);
108 [[nodiscard]]
eve::Result<int> setFeatureNormalizationRanges(std::span<const MotionNormalizationRange> ranges);
114 void setRootBone(
int boneIndex);
118 void setRootBoneByName(
const std::string&
name);
143 float getFrameTime(
int frameIndex)
const;
145 int getFrameClipIndex(
int frameIndex)
const;
147 AnimClip* getClip(
int clipIndex)
const;
152 int getFeatureBone(
int index)
const;
155 void getFeature(
int frameIndex,
float*
out,
int outCount)
const;
157 void normalizeFeature(std::vector<float>& feature)
const;
165 float rootX = 0.f, rootZ = 0.f, rootYaw = 0.f;
166 float velX = 0.f, velZ = 0.f;
169 float trajectorySpeed = 0.f;
177 float schemaTrajectorySpeed(std::span<const float> feature)
const;
178 void extractSchemaFeature(
AnimClip*
clip,
float time, std::vector<float>&
out,
float& rootX,
179 float& rootZ,
float& rootYaw,
float& velX,
float& velZ)
const;
180 void normalizeSchemaFeatures();
181 void extractLocomotionFeature(
AnimClip*
clip,
float time, std::vector<float>&
out,
float& rootX,
float& rootZ,
182 float& rootYaw,
float& velX,
float& velZ)
const;
183 void normalizeLocomotionFeatures();
184 void requireBaked()
const;
185 void computeFeatureSize();
186 void extractFeature(
AnimClip*
clip,
float time,
float dtSample, std::vector<float>&
out,
float& rootX,
float& rootZ,
187 float& rootYaw,
float& velX,
float& velZ)
const;
188 static float yawFromQuat(
float x,
float y,
float z,
float w);
191 std::vector<AnimClip*> clips_;
192 std::vector<int> featureBones_;
193 std::vector<Frame> frames_;
195 std::vector<int> clipFrameOffsets_;
196 int featureSize_ = 0;
199 bool locomotionFeatures_ =
false;
200 std::vector<float> featureMean_;
201 std::vector<float> featureInvStd_;
203 std::unique_ptr<detail::MotionSchemaState> schema_;
204 std::vector<MotionNormalizationRange> normalizationRanges_;
#define EVENGINE_API_WORLD
std::vector< std::pair< std::uint64_t, OceanBoatReceipt > > sources
Move-only, checked operation results for the common layer.
Move-only operation result carrying either a value or Status.
Keyframed skeletal animation clip (local TRS tracks per bone). Script type: AnimClip.
Evaluated local (and optional world) pose for an AnimSkeleton. Script type: AnimPose.
3D bone hierarchy + bind-pose local TRS for skeletal animation. Independent of ik::Skeleton3D (FABRIK...
Baked motion-matching feature database from one or more AnimClips. Feature layout per frame: [0....
MotionDatabase(const MotionDatabase &)=delete
AnimSkeleton * getSkeleton() const
Returns the skeleton.
bool isBaked() const
True when baked.
int getFeatureBoneCount() const
Returns the feature bone count.
MotionDatabase & operator=(const MotionDatabase &)=delete
int getFeatureSize() const
Returns the feature size.
int getRootBone() const
Returns the root bone.
bool hasLocomotionFeatures() const
Whether this database uses the 30-dimensional locomotion layout.
int getFrameCount() const
Returns the frame count.
~MotionDatabase()
Motion database.
int getClipCount() const
Returns the clip count.
Runtime motion matching player: builds a query feature from current pose + desired trajectory,...
std::vector< float > feature
Owning ordered feature layout; copied atomically by a database.
Copied clip-time interval contributing once to feature normalization; endpoints inclusive.