TreeGenerator.java 文件源码

java
阅读 34 收藏 0 点赞 0 评论 0

项目:Skyland 作者:
public static void initWorld(BulletWorld world) {
    //TreeShape
    Model model = Assets.get(Models.MODEL_TREE_PROTOTYPE, Model.class);
    model.nodes.first().translation.set(0, -1.15f, 0);
    btCompoundShape treeShape = new btCompoundShape();
    treeShape.addChildShape(new Matrix4(new Vector3(0, 0, 0), new Quaternion(), new Vector3(1, 1, 1)), new btBoxShape(new Vector3(.2f, .9f, .2f)));
    treeShape.addChildShape(new Matrix4(new Vector3(0, 1, 0), new Quaternion(), new Vector3(1, 1, 1)), new btSphereShape(1));
    //LogShape
    model = Assets.get(Models.MODEL_LOG_PROTOTYPE, Model.class);
    model.nodes.first().translation.set(0, -1.15f, 0);

    world.addConstructor("log", new BulletConstructor(Assets.get(Models.MODEL_LOG_PROTOTYPE, Model.class), 75, new btBoxShape(new Vector3(.2f, .9f, .2f))));
    world.addConstructor("stump", new BulletConstructor(Assets.get(Models.MODEL_STUMP_PROTOTYPE, Model.class), 0, new btCylinderShape(new Vector3(.2f, .22f, .2f))));
    world.addConstructor("staticTree", new BulletConstructor(Assets.get(Models.MODEL_TREE_PROTOTYPE, Model.class), 0, treeShape));
    world.addConstructor("dynamicTree", new BulletConstructor(Assets.get(Models.MODEL_TREE_PROTOTYPE, Model.class), 100, treeShape));
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号