クラス BD1Creator
java.lang.Object
com.github.dabasan.xops.bd1.BD1Creator
public class BD1Creator extends Object
Creates BD1 blocks.
- 作成者:
- Daba
-
コンストラクタの概要
コンストラクタ コンストラクタ 説明 BD1Creator() -
メソッドの概要
修飾子とタイプ メソッド 説明 intAddBlock(BD1Block block)Adds a block to the map.intCreateBlock(com.github.dabasan.basis.vector.Vector[] vertex_positions)Creates a block.intCreateCube(com.github.dabasan.basis.vector.Vector center, float edge_length)Creates a cube.intDuplicateBlock(int block_handle)Duplicates a block.Set<Integer>GetBlockHandles()Returns all block handles.intRemoveBlock(int block_handle)Removes a block.intRescaleBlock(int block_handle, com.github.dabasan.basis.vector.Vector scale)Rescales a block.intRotateBlock(int block_handle, com.github.dabasan.basis.vector.Vector rotate)Rotates a block.intSetBlockTextureID(int block_handle, int face_index, int texture_id)Sets the texture ID.intSetBlockUV(int block_handle, int face_index, float u, float v)Sets the UV.intSetTextureFilename(int texture_id, String texture_filename)intTranslateBlock(int block_handle, com.github.dabasan.basis.vector.Vector translate)Translates a block.intWriteAsBD1(String bd1_filename, float offset_y)Writes out blocks into a BD1 file.intWriteAsOBJ(String obj_filename, float offset_y)Writes out blocks into an OBJ file.
-
コンストラクタの詳細
-
BD1Creator
public BD1Creator()
-
-
メソッドの詳細
-
SetTextureFilename
-
GetBlockHandles
Returns all block handles.- 戻り値:
- Block handles
-
AddBlock
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 positionedge_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 handletranslate- 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 handlerotate- 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 handlescale- 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 handleface_index- Face indexu- U-coordinatev- 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 handleface_index- Face indextexture_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
Writes out blocks into a BD1 file.- パラメータ:
bd1_filename- BD1 filenameoffset_y- Y-axis offset- 戻り値:
- -1 on error and 0 on success
-
WriteAsOBJ
Writes out blocks into an OBJ file.- パラメータ:
obj_filename- OBJ filenameoffset_y- Y-axis offset- 戻り値:
- -1 on error and 0 on success
-