示例#1
0
  private TrailManager(final Node root) {
    this.root = root;

    trails = new HashMap<Spatial, TrailMesh>();

    Renderer r = DisplaySystem.getDisplaySystem().getRenderer();
    ts = r.createTextureState();
    ts.setEnabled(true);
    Texture t1 =
        TextureManager.loadTexture(
            ResourceLocatorTool.locateResource(ResourceLocatorTool.TYPE_TEXTURE, "trail_y1.png"),
            Texture.MinificationFilter.Trilinear,
            Texture.MagnificationFilter.Bilinear);
    ts.setTexture(t1);

    bs = r.createBlendState();
    bs.setBlendEnabled(true);
    bs.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
    bs.setDestinationFunction(BlendState.DestinationFunction.One);
    bs.setTestEnabled(true);

    zs = r.createZBufferState();
    zs.setWritable(false);

    cs = r.createCullState();
    cs.setCullFace(CullState.Face.None);
    cs.setEnabled(true);
  }