2 * PMD rigid information handler
4 * License : The MIT License
5 * Copyright(c) 2010 MikuToga Partners
8 package jp.sfjp.mikutoga.pmd.parser;
10 import jp.sfjp.mikutoga.bin.parser.LoopHandler;
11 import jp.sfjp.mikutoga.bin.parser.MmdFormatException;
12 import jp.sfjp.mikutoga.bin.parser.ParseStage;
15 * PMDモデルの各種剛体情報の通知用ハンドラ。
17 * <p>MMDでの剛体力学では「Bullet Physics Library」が用いられる。
19 * @see <a href="http://www.bulletphysics.org/">Bullet Physics Library</a>
21 public interface PmdRigidHandler extends LoopHandler {
24 ParseStage RIGID_LIST = new ParseStage();
29 * <p>{@link #RIGID_LIST}ループの構成要素。
31 * @param rigidName 剛体名
32 * @throws MmdFormatException 不正フォーマットによる
35 void pmdRigidName(String rigidName)
36 throws MmdFormatException;
41 * <p>{@link #RIGID_LIST}ループの構成要素。
43 * @param rigidGroupId 剛体グループ番号から1引いた数。(0-15)
44 * @param linkedBoneId 接続先ボーンID。
45 * [ 0x0000 - 0xfffe ] に収まらない場合は接続先ボーン無し。
46 * @throws MmdFormatException 不正フォーマットによる
49 void pmdRigidInfo(int rigidGroupId,
51 throws MmdFormatException;
56 * <p>{@link #RIGID_LIST}ループの構成要素。
58 * @param shapeType 形状種別。
64 * @param width 球orカプセル半径。箱の幅。
65 * @param height 箱orカプセルの高さ
67 * @throws MmdFormatException 不正フォーマットによる
70 void pmdRigidShape(byte shapeType,
71 float width, float height, float depth)
72 throws MmdFormatException;
77 * <p>{@link #RIGID_LIST}ループの構成要素。
82 * @throws MmdFormatException 不正フォーマットによる
85 void pmdRigidPosition(float posX, float posY, float posZ)
86 throws MmdFormatException;
91 * <p>{@link #RIGID_LIST}ループの構成要素。
93 * @param radX X軸回転量(radian)
94 * @param radY Y軸回転量(radian)
95 * @param radZ Z軸回転量(radian)
96 * @throws MmdFormatException 不正フォーマットによる
99 void pmdRigidRotation(float radX, float radY, float radZ)
100 throws MmdFormatException;
105 * <p>{@link #RIGID_LIST}ループの構成要素。
108 * @param dampingPos 移動減衰率
109 * @param dampingRot 回転減衰率
110 * @param restitution 反発力
111 * @param friction 摩擦力
112 * @throws MmdFormatException 不正フォーマットによる
115 void pmdRigidPhysics(float mass,
116 float dampingPos, float dampingRot,
117 float restitution, float friction )
118 throws MmdFormatException;
123 * <p>{@link #RIGID_LIST}ループの構成要素。
125 * @param behaveType 剛体タイプ。
129 * <li>2:物理演算+ボーン位置合わせ
131 * @param collisionMap 非衝突剛体グループビットマップ。
132 * <p>(衝突グループ番号-1)位置のビット位置は1に、
133 * (非衝突グループ番号-1)位置のビット位置は0になる。
134 * 例)グループ1と8のみが非衝突指定の場合、0xff7eになる。
135 * @throws MmdFormatException 不正フォーマットによる
138 void pmdRigidBehavior(byte behaveType, short collisionMap)
139 throws MmdFormatException;