载入中...
搜索中...
未找到
AnimationMotionBindings.cpp
浏览该文件的文档.
35 "MotionDatabase", std::function<MotionDatabase*()>([]() -> MotionDatabase* { return nullptr; }), true);
51 db.addFunc("setLocomotionFeatures", [bind](MotionDatabase* self, int left, int right, int pelvis) {
56 db.addFunc("loadFeatureCurves", [bind](MotionDatabase* self, std::string path, ssq::Array sources) {
69 self->setFeatureCurves({static_cast<const std::byte*>(data->getData()), data->getSize()}, names));
74 db.addFunc("setFeatureLayout", [bind](MotionDatabase* self, int rate, ssq::Array entries, float lengthScale) {
145 "MotionMatcher", std::function<MotionMatcher*()>([]() -> MotionMatcher* { return nullptr; }), true);
180 mm.addFunc("setFeatureQuery", [bind](MotionMatcher* self, AnimPose* current, AnimPose* previous, float dt,
188 if (item.size() != 8) throw std::runtime_error("feature sample requires time,x,y,z,vx,vy,vz,yaw");
189 samples.push_back({item.get<float>(0), item.get<float>(1), item.get<float>(2), item.get<float>(3),
192 if (curveEntries.size() > 256) throw std::runtime_error("curve query requires bounded samples");
199 return script::projectResult(bind.vm(), self->setFeatureQuery(*current, *previous, dt, samples, curves));
204 mm.addFunc("setLocomotionQuery", [bind](MotionMatcher* self, AnimPose* current, AnimPose* previous, float dt,
212 if (item.size() != 7) throw std::runtime_error("locomotion sample requires x,y,z,vx,vy,vz,yaw");
216 return script::projectResult(bind.vm(), self->setLocomotionQuery(*current, *previous, dt, samples));
232 MotionSearchRange range{item.get<int>(0), item.get<float>(1), item.get<float>(2), item.get<float>(3),
Per-translation-unit VM + diagnostic-source helper for Squirrel bindings.
The single Squirrel projection for common Result, Status and Value.
Explicit Value/Owned/Borrowed semantics at the Squirrel boundary.
Evaluated local (and optional world) pose for an AnimSkeleton. Script type: AnimPose.
Definition AnimPose.h:17
Baked motion-matching feature database from one or more AnimClips. Feature layout per frame: [0....
Definition MotionDatabase.h:39
void setRootBoneByName(const std::string &name)
Sets the root bone by name.
Definition MotionDatabase.cpp:47
eve::Result< int > setFeatureNormalizationRanges(std::span< const MotionNormalizationRange > ranges)
Atomically select weighted source ranges used to normalize a variable feature layout.
Definition MotionDatabaseSchema.cpp:108
bool hasFeatureLayout() const
Whether this database uses an explicitly configured variable layout.
Definition MotionDatabaseSchema.cpp:14
void addFeatureBone(int boneIndex)
Include bone world position in pose features (by index).
Definition MotionDatabase.cpp:20
eve::Result< void > setFeatureLayout(const MotionFeatureLayout &layout)
Atomically configure an owning variable feature layout before bake.
Definition MotionDatabaseSchema.cpp:35
void addFeatureBoneByName(const std::string &name)
Adds feature bone by name.
Definition MotionDatabase.cpp:32
void bake()
Bake all clips into searchable frames. Call after addClip / feature bones.
Definition MotionDatabase.cpp:179
bool hasLocomotionFeatures() const
Whether this database uses the 30-dimensional locomotion layout.
Definition MotionDatabase.h:71
eve::Result< void > setFeatureCurves(std::span< const std::byte > bytes, std::span< const std::string > sources)
Atomically copy scalar source curves for the configured layout.
Definition MotionDatabaseSchema.cpp:86
eve::Result< void > setLocomotionFeatures(int leftFoot, int rightFoot, int pelvis)
Configure the locomotion layout before baking or creating matchers.
Definition MotionDatabaseLocomotion.cpp:11
void setRootBone(int boneIndex)
Bone used for trajectory / velocity features (default 0). Mixamo clips typically want hips (mixamorig...
Definition MotionDatabase.cpp:38
int getFrameClipIndex(int frameIndex) const
Returns the frame clip index.
Definition MotionDatabase.cpp:285
Runtime motion matching player: builds a query feature from current pose + desired trajectory,...
Definition MotionMatcher.h:66
void search()
Force an immediate search (also called periodically from update).
Definition MotionMatcher.cpp:207
void update(float dt)
Legacy seconds facade; explicitly forwards to advance().
Definition MotionMatcher.cpp:396
float getPoseReselectHistory() const
Definition MotionMatcher.h:142
void setDesiredVelocity(float x, float z)
Desired planar velocity in character/world XZ (units/sec).
Definition MotionMatcher.cpp:34
void setIgnoreRadius(int frames)
Keep continuous playback within this frame radius of the live playhead, including loop seams.
Definition MotionMatcher.cpp:66
float getPlayRateMinimum() const
Definition MotionMatcher.h:112
Pins the active VM and a stable diagnostic source for one expose() TU.
Definition SquirrelBindContext.h:32
Definition Animation.cpp:58
@ Continuing
void exposeAnimInertializerBindings(ssq::Table &table)
Register the owning AnimInertializer Squirrel surface.
Definition AnimationInertiaBindings.cpp:20
@ Trajectory
void exposeOrientationWarpingBindings(ssq::Table &table)
Register the owning OrientationWarping Squirrel surface.
Definition OrientationWarpingBindings.cpp:30
void exposeMotionMatcherBindings(ssq::Table &table)
Register the synchronous MotionMatcher Squirrel surface.
Definition AnimationMotionBindings.cpp:30
std::unique_ptr< T > Owned
C++ owning storage used by an object factory.
Definition RuntimeRegistry.h:33
ssq::Table projectResult(HSQUIRRELVM vm, Result< void > &&result)
Consume and project a void native Result using the common schema.
Definition SquirrelBinding.cpp:470
Owning configuration for one ordered motion feature channel.
Definition MotionFeatureLayout.h:25
Owning ordered feature layout; copied atomically by a database.
Definition MotionFeatureLayout.h:46
Owning candidate interval in seconds in a database clip; endpoints inclusive.
Definition MotionMatcher.h:35
std::vector< MotionTransitionBlock > transitionBlocks
Owned transition blocks, unioned across all ranges of this clip; continuation remains eligible.
Definition MotionMatcher.h:42