示例#1
0
 /** Creates a new crate. */
 public CrateView() {
   super(bluePrint, false);
   enableLazyTransformations();
   if (Globals.normalMapping) {
     ShaderProvider.setShader("normals", this);
   }
 }
示例#2
0
 public CrateView(ClientObject obj) {
   super(obj, true);
   enableLazyTransformations();
   if (Globals.normalMapping) {
     ShaderProvider.setShader("normals", this);
   }
 }
示例#3
0
  private void checkChild() {
    if (world == null) {
      throw new RuntimeException("The CrateView instance has to know its world!");
    }
    if (animIndex == 0 && child == null && !botUsage) {
      // Create the child object with the animation inside.
      addChild(childBluePrint);
      if (Globals.compiledObjects) {
        child.compile(true);
      }

      String name = "phong";
      if (Globals.normalMapping) {
        name = "normals";
      }

      ShaderProvider.setShader(name, child);
      world.addObject(child);
    }
  }