OSDN Git Service

1.105.3-SNAPSHOT版開発開始
[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      * モデル材質パースステージ。
22      */
23     class PmdMaterialStage extends ParseStage{
24         /** コンストラクタ。 */
25         PmdMaterialStage(){ super(); return; }
26     }
27
28     /** 材質抽出ループ。 */
29     PmdMaterialStage MATERIAL_LIST = new PmdMaterialStage();
30
31     /**
32      * 材質の拡散光成分の通知を受け取る。
33      * {@link #MATERIAL_LIST}ループの構成要素。
34      * @param red 0.0~1.0の範囲の赤成分
35      * @param green 0.0~1.0の範囲の緑成分
36      * @param blue 0.0~1.0の範囲の青成分
37      * @param alpha 0.0(透明)~1.0(不透明)のアルファ値。
38      * @throws MmdFormatException 不正フォーマットによる
39      * パース処理の中断をパーサに指示
40      */
41     void pmdMaterialDiffuse(float red, float green, float blue,
42                                float alpha )
43             throws MmdFormatException;
44
45     /**
46      * 材質の反射光成分の通知を受け取る。
47      * {@link #MATERIAL_LIST}ループの構成要素。
48      * @param red 0.0~1.0の範囲の赤成分
49      * @param green 0.0~1.0の範囲の緑成分
50      * @param blue 0.0~1.0の範囲の青成分
51      * @param shininess 光沢強度(1~15ぐらい)
52      * @throws MmdFormatException 不正フォーマットによる
53      * パース処理の中断をパーサに指示
54      */
55     void pmdMaterialSpecular(float red, float green, float blue,
56                                 float shininess)
57             throws MmdFormatException;
58
59     /**
60      * 材質の環境色成分の通知を受け取る。
61      * {@link #MATERIAL_LIST}ループの構成要素。
62      * @param red 0.0~1.0の範囲の赤成分
63      * @param green 0.0~1.0の範囲の緑成分
64      * @param blue 0.0~1.0の範囲の青成分
65      * @throws MmdFormatException 不正フォーマットによる
66      * パース処理の中断をパーサに指示
67      */
68     void pmdMaterialAmbient(float red, float green, float blue)
69             throws MmdFormatException;
70
71     /**
72      * シェーディング情報の通知を受け取る。
73      * {@link #MATERIAL_LIST}ループの構成要素。
74      * @param toonIdx トゥーンファイル番号。
75      * 0ならtoon01.bmp。9ならtoon10.bmp。0xffならtoon0.bmp。
76      * @param textureFile テクスチャファイル名。
77      * 無ければ空文字。
78      * @param sphereFile スフィアマップファイル名。
79      * 無ければ空文字。
80      * @throws MmdFormatException 不正フォーマットによる
81      * パース処理の中断をパーサに指示
82      */
83     void pmdMaterialShading(int toonIdx,
84                                String textureFile, String sphereFile )
85             throws MmdFormatException;
86
87     /**
88      * 材質情報の通知を受け取る。
89      * {@link #MATERIAL_LIST}ループの構成要素。
90      * @param hasEdge エッジを表示するならtrue
91      * @param vertexNum 面頂点数。
92      * 3の倍数のはず。
93      * 3で割ると積算で表される面IDの範囲を表す。
94      * @throws MmdFormatException 不正フォーマットによる
95      * パース処理の中断をパーサに指示
96      */
97     void pmdMaterialInfo(boolean hasEdge, int vertexNum)
98             throws MmdFormatException;
99
100 }