Skip to content

[功能][Spine] 补完 spine 4.2 的 PhysicsConstraint wasm 绑定#98

Open
RazgrizHsu wants to merge 3 commits intococos:v4.0.0from
RazgrizHsu:v4.0.0
Open

[功能][Spine] 补完 spine 4.2 的 PhysicsConstraint wasm 绑定#98
RazgrizHsu wants to merge 3 commits intococos:v4.0.0from
RazgrizHsu:v4.0.0

Conversation

@RazgrizHsu
Copy link

实际项目中需要通过代码动态控制 spine 物理约束参数(如风力、重力、惯性等),
用于角色头发飘动、衣物摆动等效果的实时调整

具体使用场景例如触摸时给wind,gravity增加offset
然后再复原, 就可以达成与spine物理系统互动

原有绑定不完整,调用 getPhysicsConstraints() 会报 UnboundTypeError,
此 PR 补完缺失的绑定

Changelog

  • Add SPVectorPhysicsConstraintPtr using
  • Add DEFINE_ALLOW_RAW_POINTER for
    PhysicsConstraintData/PhysicsConstraint
  • Add REGISTER_SPINE_ENUM(Physics)
  • Add REGISTER_SPINE_VECTOR for physics types
  • Add PhysicsConstraintData/PhysicsConstraint class bindings
  • Add Skeleton.getPhysicsConstraints/findPhysicsConstraint
  • Fix SkeletonData.findPhysicsConstraint pointing to wrong function
  • Sync spine-core.d.ts type definitions

Continuous Integration

This pull request:

  • needs automatic test cases check.

    Manual trigger with @cocos-robot run test cases afterward.

  • does not change any runtime related code or build configuration

    If any reviewer thinks the CI checks are needed, please uncheck this option, then close and reopen the issue.


Compatibility Check

This pull request:

  • changes public API, and have ensured backward compatibility with deprecated features.
  • affects platform compatibility, e.g. system version, browser version, platform sdk version, platform toolchain, language version, hardware compatibility etc.
  • affects file structure of the build package or build configuration which requires user project upgrade.
  • introduces breaking changes, please list all changes, affected features and the scope of violation.

- Add SPVectorPhysicsConstraintPtr using
- Add DEFINE_ALLOW_RAW_POINTER for
PhysicsConstraintData/PhysicsConstraint
- Add REGISTER_SPINE_ENUM(Physics)
- Add REGISTER_SPINE_VECTOR for physics types
- Add PhysicsConstraintData/PhysicsConstraint class bindings
- Add Skeleton.getPhysicsConstraints/findPhysicsConstraint
- Fix SkeletonData.findPhysicsConstraint pointing to wrong function
- Sync spine-core.d.ts type definitions
@github-actions
Copy link

@RazgrizHsu, Please check the result of run test cases:

Task Details

Platform build boot runned crashScene FailScene
web-mobile PASS PASS FAIL graphics-line-join
ios PASS PASS PASS
mac PASS PASS PASS

@github-actions
Copy link

@RazgrizHsu, Please check the result of run test cases:

Task Details

Platform build boot runned crashScene FailScene
windows PASS PASS PASS
android PASS PASS PASS
wechatgame PASS FAIL FAIL

@star-e star-e requested a review from bofeng-song March 18, 2026 06:19
@bofeng-song
Copy link
Contributor

Related PR: cocos/cocos-engine-external#508

@bofeng-song
Copy link
Contributor

@RazgrizHsu please merge my pr to update external version
RazgrizHsu#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants