box2d体形修改
是否可以在分配后修改体内的形状,例如,我的游戏英雄身体有一个盒子形状,当我按下向下箭头时,我希望我的英雄蹲下女巫意味着我需要身体形状调整大小。
我已经在谷歌中搜索过,但似乎修改形状的主题并不那么受欢迎。如果不可能,也许您知道更好的方法。
Is it possible to modify a shape within a body after assigning it, for example I have a box shape for my game hero body, and when I press the down arrow I want my hero to crouch witch means that I need the body shape to be resized.
I've already searched in google but it appears that the topic of modyfing shapes is not so popular. If it's impossible maybe you know a better way of doing this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为如果不更换形状并将它们重新连接到身体上,这是不可能的。
我的建议是有两个独立的身体,一个用于角色的底部,一个用于顶部,并通过棱柱形关节连接。
(有关关节的更多信息此处。)
I don't think it's possible without something like replacing the shapes and reattaching them to the body.
My suggestion would be to have two separate bodies, one for the bottom part of the character and one for the top part, connected with a prismatic joint.
(More info on joints here.)