org.lwjglb.engine.Utils.listToArray()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(13.2k)|赞(0)|评价(0)|浏览(94)

本文整理了Java中org.lwjglb.engine.Utils.listToArray()方法的一些代码示例,展示了Utils.listToArray()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.listToArray()方法的具体详情如下:
包路径:org.lwjglb.engine.Utils
类名称:Utils
方法名:listToArray

Utils.listToArray介绍

暂无

代码示例

代码示例来源:origin: lwjglgamedev/lwjglbook

public static MD5Frame parse(String blockId, List<String> blockBody) throws Exception {
  MD5Frame result = new MD5Frame();
  String[] tokens = blockId.trim().split("\\s+");
  if (tokens != null && tokens.length >= 2) {
    result.setId(Integer.parseInt(tokens[1]));
  } else {
    throw new Exception("Wrong frame definition: " + blockId);
  }
  List<Float> data = new ArrayList<>();
  for (String line : blockBody) {
    List<Float> lineData = parseLine(line);
    if (lineData != null) {
      data.addAll(lineData);
    }
  }
  float[] dataArr = Utils.listToArray(data);
  result.setFrameData(dataArr);
  return result;
}

代码示例来源:origin: lwjglgamedev/lwjglbook

public static MD5Frame parse(String blockId, List<String> blockBody) throws Exception {
  MD5Frame result = new MD5Frame();
  String[] tokens = blockId.trim().split("\\s+");
  if (tokens != null && tokens.length >= 2) {
    result.setId(Integer.parseInt(tokens[1]));
  } else {
    throw new Exception("Wrong frame definition: " + blockId);
  }
  List<Float> data = new ArrayList<>();
  for (String line : blockBody) {
    List<Float> lineData = parseLine(line);
    if (lineData != null) {
      data.addAll(lineData);
    }
  }
  float[] dataArr = Utils.listToArray(data);
  result.setFrameData(dataArr);
  return result;
}

代码示例来源:origin: lwjglgamedev/lwjglbook

public static MD5Frame parse(String blockId, List<String> blockBody) throws Exception {
  MD5Frame result = new MD5Frame();
  String[] tokens = blockId.trim().split("\\s+");
  if (tokens != null && tokens.length >= 2) {
    result.setId(Integer.parseInt(tokens[1]));
  } else {
    throw new Exception("Wrong frame definition: " + blockId);
  }
  List<Float> data = new ArrayList<>();
  for (String line : blockBody) {
    List<Float> lineData = parseLine(line);
    if (lineData != null) {
      data.addAll(lineData);
    }
  }
  float[] dataArr = Utils.listToArray(data);
  result.setFrameData(dataArr);
  return result;
}

代码示例来源:origin: lwjglgamedev/lwjglbook

public static MD5Frame parse(String blockId, List<String> blockBody) throws Exception {
  MD5Frame result = new MD5Frame();
  String[] tokens = blockId.trim().split("\\s+");
  if (tokens != null && tokens.length >= 2) {
    result.setId(Integer.parseInt(tokens[1]));
  } else {
    throw new Exception("Wrong frame definition: " + blockId);
  }
  List<Float> data = new ArrayList<>();
  for (String line : blockBody) {
    List<Float> lineData = parseLine(line);
    if (lineData != null) {
      data.addAll(lineData);
    }
  }
  float[] dataArr = Utils.listToArray(data);
  result.setFrameData(dataArr);
  return result;
}

代码示例来源:origin: lwjglgamedev/lwjglbook

public static MD5Frame parse(String blockId, List<String> blockBody) throws Exception {
  MD5Frame result = new MD5Frame();
  String[] tokens = blockId.trim().split("\\s+");
  if (tokens != null && tokens.length >= 2) {
    result.setId(Integer.parseInt(tokens[1]));
  } else {
    throw new Exception("Wrong frame definition: " + blockId);
  }
  List<Float> data = new ArrayList<>();
  for (String line : blockBody) {
    List<Float> lineData = parseLine(line);
    if (lineData != null) {
      data.addAll(lineData);
    }
  }
  float[] dataArr = Utils.listToArray(data);
  result.setFrameData(dataArr);
  return result;
}

代码示例来源:origin: lwjglgamedev/lwjglbook

public static MD5Frame parse(String blockId, List<String> blockBody) throws Exception {
  MD5Frame result = new MD5Frame();
  String[] tokens = blockId.trim().split("\\s+");
  if (tokens != null && tokens.length >= 2) {
    result.setId(Integer.parseInt(tokens[1]));
  } else {
    throw new Exception("Wrong frame definition: " + blockId);
  }
  List<Float> data = new ArrayList<>();
  for (String line : blockBody) {
    List<Float> lineData = parseLine(line);
    if (lineData != null) {
      data.addAll(lineData);
    }
  }
  float[] dataArr = Utils.listToArray(data);
  result.setFrameData(dataArr);
  return result;
}

代码示例来源:origin: lwjglgamedev/lwjglbook

public static MD5Frame parse(String blockId, List<String> blockBody) throws Exception {
  MD5Frame result = new MD5Frame();
  String[] tokens = blockId.trim().split("\\s+");
  if (tokens != null && tokens.length >= 2) {
    result.setId(Integer.parseInt(tokens[1]));
  } else {
    throw new Exception("Wrong frame definition: " + blockId);
  }
  List<Float> data = new ArrayList<>();
  for (String line : blockBody) {
    List<Float> lineData = parseLine(line);
    if (lineData != null) {
      data.addAll(lineData);
    }
  }
  float[] dataArr = Utils.listToArray(data);
  result.setFrameData(dataArr);
  return result;
}

代码示例来源:origin: lwjglgamedev/lwjglbook

public static MD5Frame parse(String blockId, List<String> blockBody) throws Exception {
  MD5Frame result = new MD5Frame();
  String[] tokens = blockId.trim().split("\\s+");
  if (tokens != null && tokens.length >= 2) {
    result.setId(Integer.parseInt(tokens[1]));
  } else {
    throw new Exception("Wrong frame definition: " + blockId);
  }
  List<Float> data = new ArrayList<>();
  for (String line : blockBody) {
    List<Float> lineData = parseLine(line);
    if (lineData != null) {
      data.addAll(lineData);
    }
  }
  float[] dataArr = Utils.listToArray(data);
  result.setFrameData(dataArr);
  return result;
}

代码示例来源:origin: lwjglgamedev/lwjglbook

public static MD5Frame parse(String blockId, List<String> blockBody) throws Exception {
  MD5Frame result = new MD5Frame();
  String[] tokens = blockId.trim().split("\\s+");
  if (tokens != null && tokens.length >= 2) {
    result.setId(Integer.parseInt(tokens[1]));
  } else {
    throw new Exception("Wrong frame definition: " + blockId);
  }
  List<Float> data = new ArrayList<>();
  for (String line : blockBody) {
    List<Float> lineData = parseLine(line);
    if (lineData != null) {
      data.addAll(lineData);
    }
  }
  float[] dataArr = Utils.listToArray(data);
  result.setFrameData(dataArr);
  return result;
}

代码示例来源:origin: lwjglgamedev/lwjglbook

public static MD5Frame parse(String blockId, List<String> blockBody) throws Exception {
  MD5Frame result = new MD5Frame();
  String[] tokens = blockId.trim().split("\\s+");
  if (tokens != null && tokens.length >= 2) {
    result.setId(Integer.parseInt(tokens[1]));
  } else {
    throw new Exception("Wrong frame definition: " + blockId);
  }
  List<Float> data = new ArrayList<>();
  for (String line : blockBody) {
    List<Float> lineData = parseLine(line);
    if (lineData != null) {
      data.addAll(lineData);
    }
  }
  float[] dataArr = Utils.listToArray(data);
  result.setFrameData(dataArr);
  return result;
}

代码示例来源:origin: lwjglgamedev/lwjglbook

public static MD5Frame parse(String blockId, List<String> blockBody) throws Exception {
  MD5Frame result = new MD5Frame();
  String[] tokens = blockId.trim().split("\\s+");
  if (tokens != null && tokens.length >= 2) {
    result.setId(Integer.parseInt(tokens[1]));
  } else {
    throw new Exception("Wrong frame definition: " + blockId);
  }
  List<Float> data = new ArrayList<>();
  for (String line : blockBody) {
    List<Float> lineData = parseLine(line);
    if (lineData != null) {
      data.addAll(lineData);
    }
  }
  float[] dataArr = Utils.listToArray(data);
  result.setFrameData(dataArr);
  return result;
}

代码示例来源:origin: lwjglgamedev/lwjglbook

public static MD5Frame parse(String blockId, List<String> blockBody) throws Exception {
  MD5Frame result = new MD5Frame();
  String[] tokens = blockId.trim().split("\\s+");
  if (tokens != null && tokens.length >= 2) {
    result.setId(Integer.parseInt(tokens[1]));
  } else {
    throw new Exception("Wrong frame definition: " + blockId);
  }
  List<Float> data = new ArrayList<>();
  for (String line : blockBody) {
    List<Float> lineData = parseLine(line);
    if (lineData != null) {
      data.addAll(lineData);
    }
  }
  float[] dataArr = Utils.listToArray(data);
  result.setFrameData(dataArr);
  return result;
}

代码示例来源:origin: lwjglgamedev/lwjglbook

public static MD5Frame parse(String blockId, List<String> blockBody) throws Exception {
  MD5Frame result = new MD5Frame();
  String[] tokens = blockId.trim().split("\\s+");
  if (tokens != null && tokens.length >= 2) {
    result.setId(Integer.parseInt(tokens[1]));
  } else {
    throw new Exception("Wrong frame definition: " + blockId);
  }
  List<Float> data = new ArrayList<>();
  for (String line : blockBody) {
    List<Float> lineData = parseLine(line);
    if (lineData != null) {
      data.addAll(lineData);
    }
  }
  float[] dataArr = Utils.listToArray(data);
  result.setFrameData(dataArr);
  return result;
}

代码示例来源:origin: lwjglgamedev/lwjglbook

public static MD5Frame parse(String blockId, List<String> blockBody) throws Exception {
  MD5Frame result = new MD5Frame();
  String[] tokens = blockId.trim().split("\\s+");
  if (tokens != null && tokens.length >= 2) {
    result.setId(Integer.parseInt(tokens[1]));
  } else {
    throw new Exception("Wrong frame definition: " + blockId);
  }
  List<Float> data = new ArrayList<>();
  for (String line : blockBody) {
    List<Float> lineData = parseLine(line);
    if (lineData != null) {
      data.addAll(lineData);
    }
  }
  float[] dataArr = Utils.listToArray(data);
  result.setFrameData(dataArr);
  return result;
}

代码示例来源:origin: lwjglgamedev/lwjglbook

public static MD5Frame parse(String blockId, List<String> blockBody) throws Exception {
  MD5Frame result = new MD5Frame();
  String[] tokens = blockId.trim().split("\\s+");
  if (tokens != null && tokens.length >= 2) {
    result.setId(Integer.parseInt(tokens[1]));
  } else {
    throw new Exception("Wrong frame definition: " + blockId);
  }
  List<Float> data = new ArrayList<>();
  for (String line : blockBody) {
    List<Float> lineData = parseLine(line);
    if (lineData != null) {
      data.addAll(lineData);
    }
  }
  float[] dataArr = Utils.listToArray(data);
  result.setFrameData(dataArr);
  return result;
}

代码示例来源:origin: lwjglgamedev/lwjglbook

public static MD5Frame parse(String blockId, List<String> blockBody) throws Exception {
  MD5Frame result = new MD5Frame();
  String[] tokens = blockId.trim().split("\\s+");
  if (tokens != null && tokens.length >= 2) {
    result.setId(Integer.parseInt(tokens[1]));
  } else {
    throw new Exception("Wrong frame definition: " + blockId);
  }
  List<Float> data = new ArrayList<>();
  for (String line : blockBody) {
    List<Float> lineData = parseLine(line);
    if (lineData != null) {
      data.addAll(lineData);
    }
  }
  float[] dataArr = Utils.listToArray(data);
  result.setFrameData(dataArr);
  return result;
}

代码示例来源:origin: lwjglgamedev/lwjglbook

private static Mesh processMesh(AIMesh aiMesh, List<Material> materials) {
  List<Float> vertices = new ArrayList<>();
  List<Float> textures = new ArrayList<>();
  List<Float> normals = new ArrayList<>();
  List<Integer> indices = new ArrayList();
  processVertices(aiMesh, vertices);
  processNormals(aiMesh, normals);
  processTextCoords(aiMesh, textures);
  processIndices(aiMesh, indices);
  Mesh mesh = new Mesh(Utils.listToArray(vertices), Utils.listToArray(textures),
      Utils.listToArray(normals), Utils.listIntToArray(indices));
  Material material;
  int materialIdx = aiMesh.mMaterialIndex();
  if (materialIdx >= 0 && materialIdx < materials.size()) {
    material = materials.get(materialIdx);
  } else {
    material = new Material();
  }
  mesh.setMaterial(material);
  return mesh;
}

代码示例来源:origin: lwjglgamedev/lwjglbook

private static Mesh processMesh(AIMesh aiMesh, List<Material> materials) {
  List<Float> vertices = new ArrayList<>();
  List<Float> textures = new ArrayList<>();
  List<Float> normals = new ArrayList<>();
  List<Integer> indices = new ArrayList();
  processVertices(aiMesh, vertices);
  processNormals(aiMesh, normals);
  processTextCoords(aiMesh, textures);
  processIndices(aiMesh, indices);
  Mesh mesh = new Mesh(Utils.listToArray(vertices), Utils.listToArray(textures),
      Utils.listToArray(normals), Utils.listIntToArray(indices));
  Material material;
  int materialIdx = aiMesh.mMaterialIndex();
  if (materialIdx >= 0 && materialIdx < materials.size()) {
    material = materials.get(materialIdx);
  } else {
    material = new Material();
  }
  mesh.setMaterial(material);
  return mesh;
}

代码示例来源:origin: lwjglgamedev/lwjglbook

private static Mesh processMesh(AIMesh aiMesh, List<Material> materials, List<Bone> boneList) {
  List<Float> vertices = new ArrayList<>();
  List<Float> textures = new ArrayList<>();
  List<Float> normals = new ArrayList<>();
  List<Integer> indices = new ArrayList<>();
  List<Integer> boneIds = new ArrayList<>();
  List<Float> weights = new ArrayList<>();
  processVertices(aiMesh, vertices);
  processNormals(aiMesh, normals);
  processTextCoords(aiMesh, textures);
  processIndices(aiMesh, indices);
  processBones(aiMesh, boneList, boneIds, weights);
  Mesh mesh = new Mesh(Utils.listToArray(vertices), Utils.listToArray(textures),
      Utils.listToArray(normals), Utils.listIntToArray(indices),
      Utils.listIntToArray(boneIds), Utils.listToArray(weights));
  Material material;
  int materialIdx = aiMesh.mMaterialIndex();
  if (materialIdx >= 0 && materialIdx < materials.size()) {
    material = materials.get(materialIdx);
  } else {
    material = new Material();
  }
  mesh.setMaterial(material);
  return mesh;
}

代码示例来源:origin: lwjglgamedev/lwjglbook

private static Mesh processMesh(AIMesh aiMesh, List<Material> materials) {
  List<Float> vertices = new ArrayList<>();
  List<Float> textures = new ArrayList<>();
  List<Float> normals = new ArrayList<>();
  List<Integer> indices = new ArrayList();
  processVertices(aiMesh, vertices);
  processNormals(aiMesh, normals);
  processTextCoords(aiMesh, textures);
  processIndices(aiMesh, indices);
  Mesh mesh = new Mesh(Utils.listToArray(vertices),
      Utils.listToArray(textures),
      Utils.listToArray(normals),
      Utils.listIntToArray(indices)
  );
  Material material;
  int materialIdx = aiMesh.mMaterialIndex();
  if (materialIdx >= 0 && materialIdx < materials.size()) {
    material = materials.get(materialIdx);
  } else {
    material = new Material();
  }
  mesh.setMaterial(material);
  return mesh;
}

相关文章