载入中...
搜索中...
未找到
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) {
70 self->setFeatureCurves({static_cast<const std::byte*>(data->getData()), data->getSize()}, names));
75 db.addFunc("setFeatureLayout", [bind](MotionDatabase* self, int rate, ssq::Array entries, float lengthScale) {
146 "MotionMatcher", std::function<MotionMatcher*()>([]() -> MotionMatcher* { return nullptr; }), true);
181 mm.addFunc("setFeatureQuery", [bind](MotionMatcher* self, AnimPose* current, AnimPose* previous, float dt,
189 if (item.size() != 8) throw std::runtime_error("feature sample requires time,x,y,z,vx,vy,vz,yaw");
190 samples.push_back({item.get<float>(0), item.get<float>(1), item.get<float>(2), item.get<float>(3),
193 if (curveEntries.size() > 256) throw std::runtime_error("curve query requires bounded samples");
200 return script::projectResult(bind.vm(), self->setFeatureQuery(*current, *previous, dt, samples, curves));
205 mm.addFunc("setLocomotionQuery", [bind](MotionMatcher* self, AnimPose* current, AnimPose* previous, float dt,
213 if (item.size() != 7) throw std::runtime_error("locomotion sample requires x,y,z,vx,vy,vz,yaw");
217 return script::projectResult(bind.vm(), self->setLocomotionQuery(*current, *previous, dt, samples));
233 MotionSearchRange range{item.get<int>(0), item.get<float>(1), item.get<float>(2), item.get<float>(3),
std::vector< std::pair< std::uint64_t, OceanBoatReceipt > > sources
Definition OceanSprayBindings.cpp:21
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 MotionBuilder.cpp:437
eve::Result< int > setFeatureNormalizationRanges(std::span< const MotionNormalizationRange > ranges)
Atomically select weighted source ranges used to normalize a variable feature layout.
Definition MotionBuilder.cpp:955
bool hasFeatureLayout() const
Whether this database uses an explicitly configured variable layout.
Definition MotionBuilder.cpp:856
void addFeatureBone(int boneIndex)
Include bone world position in pose features (by index).
Definition MotionBuilder.cpp:410
eve::Result< void > setFeatureLayout(const MotionFeatureLayout &layout)
Atomically configure an owning variable feature layout before bake.
Definition MotionBuilder.cpp:877
void addFeatureBoneByName(const std::string &name)
Adds feature bone by name.
Definition MotionBuilder.cpp:422
void bake()
Bake all clips into searchable frames. Call after addClip / feature bones.
Definition MotionBuilder.cpp:570
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 MotionBuilder.cpp:933
eve::Result< void > setLocomotionFeatures(int leftFoot, int rightFoot, int pelvis)
Configure the locomotion layout before baking or creating matchers.
Definition MotionBuilder.cpp:693
void setRootBone(int boneIndex)
Bone used for trajectory / velocity features (default 0). Mixamo clips typically want hips (mixamorig...
Definition MotionBuilder.cpp:428
int getFrameClipIndex(int frameIndex) const
Returns the frame clip index.
Definition MotionBuilder.cpp:679
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:211
void update(float dt)
Legacy seconds facade; explicitly forwards to advance().
Definition MotionMatcher.cpp:406
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:32
void setIgnoreRadius(int frames)
Keep continuous playback within this frame radius of the live playhead, including loop seams.
Definition MotionMatcher.cpp:64
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 OrientationWarping.cpp:274
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:540
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