Exemplo n.º 1
0
  // -----------------------------------------------------------------------
  public void AssignMesh(int id) {
    if (id >= 0) {
      this.mesh_id = id;
      this.BBOX.CalcFromMesh(this.mesh_id);
      F3D.Log.info("TF3D_Body", "Assigned mesh = '" + F3D.Meshes.Get(this.mesh_id).name + "'");
      this.ReadAssignedSurfaces();

    } else {
      F3D.Log.error(
          "TF3D_Body",
          "AssignMesh() : index of assigned MeshName is -1 (Mesh name doesn't exist.)");
    }
  }
Exemplo n.º 2
0
  private void ReadAssignedSurfaces() {
    this.surfaces = new ArrayList<TF3D_SurfaceSubstItem>();

    TF3D_Mesh mesh = F3D.Meshes.items.get(this.mesh_id);

    for (int i = 0; i < mesh.IndicesGroup.items.size(); i++) {
      String name = mesh.IndicesGroup.items.get(i).material_name;
      int id = mesh.IndicesGroup.items.get(i).material_id;

      TF3D_SurfaceSubstItem sitem = new TF3D_SurfaceSubstItem(name, id);
      this.surfaces.add(sitem);

      F3D.Log.info("TF3D_Body", "Assigned surface = '" + name + "'");
    }
  }
Exemplo n.º 3
0
  // -----------------------------------------------------------------------
  public void AssignMesh(String meshname) {
    int id = F3D.Meshes.FindByName(meshname);

    if (id >= 0) {
      this.mesh_id = id;
      this.BBOX.CalcFromMesh(this.mesh_id);
      F3D.Log.info("TF3D_Body", "Assigned mesh = '" + name + "'");

      this.ReadAssignedSurfaces();
    } else {
      F3D.Log.error(
          "TF3D_Body",
          "AssignMesh() : index of assigned MeshName is -1 (Mesh '"
              + meshname
              + "' doesn't exist.)");
    }
  }