jMonkeyEngine 通过质量实现相对重力
我不确定我是否正确地措辞,但是我想在JME3中设置一个类似太空的物理系统。我有BulletAppState
设置和几个strigbodyControl
已启用球。
// Setting up BulletAppState
physics = new BulletAppState();
getStateManager().attach(physics);
physics.getPhysicsSpace().setGravity(Vector3f.ZERO);
// In each sphere Geometry object I call:
public void setPhysics(BulletAppState state, float mass) {
rigidBodyControl = new RigidBodyControl(mass);
addControl(rigidBodyControl);
rigidBodyControl.setKinematic(true);
state.getPhysicsSpace().add(this);
}
我想根据它们的质量相互吸引这些物体(例如行星)。这是否已经在JME的Jbullet库中实现?
I'm not sure if I'm wording this correctly, but I want to set up a space-like physics system in jme3. I have the BulletAppState
setup and several RigidBodyControl
enabled spheres.
// Setting up BulletAppState
physics = new BulletAppState();
getStateManager().attach(physics);
physics.getPhysicsSpace().setGravity(Vector3f.ZERO);
// In each sphere Geometry object I call:
public void setPhysics(BulletAppState state, float mass) {
rigidBodyControl = new RigidBodyControl(mass);
addControl(rigidBodyControl);
rigidBodyControl.setKinematic(true);
state.getPhysicsSpace().add(this);
}
I'd like to have these objects attract each other (like planets) based on their mass. Is this already implemented in jme's jBullet library?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从缺乏响应和进一步搜索JME API和Web的情况来看,这在JME或Jbullet中都没有实现,我将不得不编写自己的实现。不确定我是否要这样做..
对任何有兴趣的人都不擅长数学或物理o_o,我发现了一个类似的问题,带有一些好的代码片段在这里。
Judging from the lack of responses and further searching the jme API and the web, this is not implemented in either jme or jBullet, and I'll have to write my own implementation. Not sure if I'm up to that.. not to good at maths or physicses O_O
For anyone interested, I found a similar question with some good code snippet here.