ModelManager.java 文件源码

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

项目:gdx-proto 作者:
/** players are represented by cubes, with another cube marking the direction it is facing */
public void createPlayerModel() {
    ModelBuilder mb = new ModelBuilder();
    ModelBuilder mb2 = new ModelBuilder();
    long attr = Usage.Position | Usage.Normal;
    float r = 0.5f;
    float g = 1f;
    float b = 0.75f;
    Material material = new Material(ColorAttribute.createDiffuse(new Color(r, g, b, 1f)));
    Material faceMaterial = new Material(ColorAttribute.createDiffuse(Color.BLUE));
    float w = 1f;
    float d = w;
    float h = 2f;
    mb.begin();
    //playerModel = mb.createBox(w, h, d, material, attr);
    Node node = mb.node("box", mb2.createBox(w, h, d, material, attr));
    // the face is just a box to show which direction the player is facing
    Node faceNode = mb.node("face", mb2.createBox(w/2, h/2, d/2, faceMaterial, attr));
    faceNode.translation.set(0f, 0f, d/2);
    playerModel = mb.end();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号