クラス BD1Creator

java.lang.Object
com.github.dabasan.xops.bd1.BD1Creator

public class BD1Creator
extends Object
Creates BD1 blocks.
作成者:
Daba
  • コンストラクタの概要

    コンストラクタ 
    コンストラクタ 説明
    BD1Creator()  
  • メソッドの概要

    修飾子とタイプ メソッド 説明
    int AddBlock​(BD1Block block)
    Adds a block to the map.
    int CreateBlock​(com.github.dabasan.basis.vector.Vector[] vertex_positions)
    Creates a block.
    int CreateCube​(com.github.dabasan.basis.vector.Vector center, float edge_length)
    Creates a cube.
    int DuplicateBlock​(int block_handle)
    Duplicates a block.
    Set<Integer> GetBlockHandles()
    Returns all block handles.
    int RemoveBlock​(int block_handle)
    Removes a block.
    int RescaleBlock​(int block_handle, com.github.dabasan.basis.vector.Vector scale)
    Rescales a block.
    int RotateBlock​(int block_handle, com.github.dabasan.basis.vector.Vector rotate)
    Rotates a block.
    int SetBlockTextureID​(int block_handle, int face_index, int texture_id)
    Sets the texture ID.
    int SetBlockUV​(int block_handle, int face_index, float u, float v)
    Sets the UV.
    int SetTextureFilename​(int texture_id, String texture_filename)  
    int TranslateBlock​(int block_handle, com.github.dabasan.basis.vector.Vector translate)
    Translates a block.
    int WriteAsBD1​(String bd1_filename, float offset_y)
    Writes out blocks into a BD1 file.
    int WriteAsOBJ​(String obj_filename, float offset_y)
    Writes out blocks into an OBJ file.

    クラスから継承されたメソッド java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • コンストラクタの詳細

  • メソッドの詳細

    • SetTextureFilename

      public int SetTextureFilename​(int texture_id, String texture_filename)
    • GetBlockHandles

      public Set<Integer> GetBlockHandles()
      Returns all block handles.
      戻り値:
      Block handles
    • AddBlock

      public int AddBlock​(BD1Block block)
      Adds a block to the map.
      パラメータ:
      block - Block
      戻り値:
      Block handle
    • DuplicateBlock

      public int DuplicateBlock​(int block_handle)
      Duplicates a block.
      パラメータ:
      block_handle - Handle of the block to be duplicated
      戻り値:
      Duplicated block handle
    • CreateCube

      public int CreateCube​(com.github.dabasan.basis.vector.Vector center, float edge_length)
      Creates a cube.
      パラメータ:
      center - Center position
      edge_length - Length of edges
      戻り値:
      Block handle
    • CreateBlock

      public int CreateBlock​(com.github.dabasan.basis.vector.Vector[] vertex_positions)
      Creates a block.
      パラメータ:
      vertex_positions - Vertex positions
      戻り値:
      Block handle
    • TranslateBlock

      public int TranslateBlock​(int block_handle, com.github.dabasan.basis.vector.Vector translate)
      Translates a block.
      パラメータ:
      block_handle - Block handle
      translate - Translation vector
      戻り値:
      -1 on error and 0 on success
    • RotateBlock

      public int RotateBlock​(int block_handle, com.github.dabasan.basis.vector.Vector rotate)
      Rotates a block.
      パラメータ:
      block_handle - Block handle
      rotate - Rotation angles (radian)
      戻り値:
      -1 on error and 0 on success
    • RescaleBlock

      public int RescaleBlock​(int block_handle, com.github.dabasan.basis.vector.Vector scale)
      Rescales a block.
      パラメータ:
      block_handle - Block handle
      scale - Scale
      戻り値:
      -1 on error and 0 on success
    • SetBlockUV

      public int SetBlockUV​(int block_handle, int face_index, float u, float v)
      Sets the UV.
      パラメータ:
      block_handle - Block handle
      face_index - Face index
      u - U-coordinate
      v - V-coordinate
      戻り値:
      -1 on error and 0 on success
    • SetBlockTextureID

      public int SetBlockTextureID​(int block_handle, int face_index, int texture_id)
      Sets the texture ID.
      パラメータ:
      block_handle - Block handle
      face_index - Face index
      texture_id - Texture ID
      戻り値:
      -1 on error and 0 on success
    • RemoveBlock

      public int RemoveBlock​(int block_handle)
      Removes a block.
      パラメータ:
      block_handle - Block handle
      戻り値:
      -1 on error and 0 on success
    • WriteAsBD1

      public int WriteAsBD1​(String bd1_filename, float offset_y)
      Writes out blocks into a BD1 file.
      パラメータ:
      bd1_filename - BD1 filename
      offset_y - Y-axis offset
      戻り値:
      -1 on error and 0 on success
    • WriteAsOBJ

      public int WriteAsOBJ​(String obj_filename, float offset_y)
      Writes out blocks into an OBJ file.
      パラメータ:
      obj_filename - OBJ filename
      offset_y - Y-axis offset
      戻り値:
      -1 on error and 0 on success