OSDN Git Service

[no commit message]
[mikutoga/TogaGem.git] / src / main / java / jp / sourceforge / mikutoga / parser / pmd / PmdMaterialHandler.java
1 /*
2  * PMD material information handler
3  *
4  * License : The MIT License
5  * Copyright(c) 2010 MikuToga Partners
6  */
7
8 package jp.sourceforge.mikutoga.parser.pmd;
9
10 import jp.sourceforge.mikutoga.parser.LoopHandler;
11 import jp.sourceforge.mikutoga.parser.MmdFormatException;
12 import jp.sourceforge.mikutoga.parser.ParseStage;
13
14 /**
15  * PMDモデルの各種材質情報の通知用ハンドラ。
16  * 色空間はsRGB?
17  */
18 public interface PmdMaterialHandler extends LoopHandler {
19
20     /** 材質抽出ループ。 */
21     ParseStage MATERIAL_LIST = new ParseStage();
22
23     /**
24      * 材質の拡散光成分の通知を受け取る。
25      * {@link #MATERIAL_LIST}ループの構成要素。
26      * @param red 0.0~1.0の範囲の赤成分
27      * @param green 0.0~1.0の範囲の緑成分
28      * @param blue 0.0~1.0の範囲の青成分
29      * @param alpha 0.0(透明)~1.0(不透明)のアルファ値。
30      * @throws MmdFormatException 不正フォーマットによる
31      * パース処理の中断をパーサに指示
32      */
33     void pmdMaterialDiffuse(float red, float green, float blue,
34                                float alpha )
35             throws MmdFormatException;
36
37     /**
38      * 材質の反射光成分の通知を受け取る。
39      * {@link #MATERIAL_LIST}ループの構成要素。
40      * @param red 0.0~1.0の範囲の赤成分
41      * @param green 0.0~1.0の範囲の緑成分
42      * @param blue 0.0~1.0の範囲の青成分
43      * @param shininess 光沢強度(1~15ぐらい)
44      * @throws MmdFormatException 不正フォーマットによる
45      * パース処理の中断をパーサに指示
46      */
47     void pmdMaterialSpecular(float red, float green, float blue,
48                                 float shininess)
49             throws MmdFormatException;
50
51     /**
52      * 材質の環境色成分の通知を受け取る。
53      * {@link #MATERIAL_LIST}ループの構成要素。
54      * @param red 0.0~1.0の範囲の赤成分
55      * @param green 0.0~1.0の範囲の緑成分
56      * @param blue 0.0~1.0の範囲の青成分
57      * @throws MmdFormatException 不正フォーマットによる
58      * パース処理の中断をパーサに指示
59      */
60     void pmdMaterialAmbient(float red, float green, float blue)
61             throws MmdFormatException;
62
63     /**
64      * シェーディング情報の通知を受け取る。
65      * {@link #MATERIAL_LIST}ループの構成要素。
66      * @param toonIdx トゥーンファイル番号。
67      * 0ならtoon01.bmp。9ならtoon10.bmp。0xffならtoon0.bmp。
68      * @param textureFile テクスチャファイル名。
69      * 無ければ空文字。
70      * @param sphereFile スフィアマップファイル名。
71      * 無ければ空文字。
72      * @throws MmdFormatException 不正フォーマットによる
73      * パース処理の中断をパーサに指示
74      */
75     void pmdMaterialShading(int toonIdx,
76                                String textureFile, String sphereFile )
77             throws MmdFormatException;
78
79     /**
80      * 材質情報の通知を受け取る。
81      * {@link #MATERIAL_LIST}ループの構成要素。
82      * @param hasEdge エッジを表示するならtrue
83      * @param vertexNum 面頂点数。
84      * 3の倍数のはず。
85      * 3で割ると積算で表される面IDの範囲を表す。
86      * @throws MmdFormatException 不正フォーマットによる
87      * パース処理の中断をパーサに指示
88      */
89     void pmdMaterialInfo(boolean hasEdge, int vertexNum)
90             throws MmdFormatException;
91
92 }