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モデルの各種剛体情報の通知用ハンドラ。
16 * <p>MMDでの剛体力学では「Bullet Physics Library」が用いられる。
17 * @see <a href="http://www.bulletphysics.org/">Bullet Physics Library</a>
19 public interface PmdRigidHandler extends LoopHandler {
22 ParseStage RIGID_LIST = new ParseStage();
26 * <p>{@link #RIGID_LIST}ループの構成要素。
27 * @param rigidName 剛体名
28 * @throws MmdFormatException 不正フォーマットによる
31 void pmdRigidName(String rigidName)
32 throws MmdFormatException;
36 * <p>{@link #RIGID_LIST}ループの構成要素。
37 * @param rigidGroupId 剛体グループ番号から1引いた数。(0-15)
38 * @param linkedBoneId 接続先ボーンID。
39 * [ 0x0000 - 0xfffe ] に収まらない場合は接続先ボーン無し。
40 * @throws MmdFormatException 不正フォーマットによる
43 void pmdRigidInfo(int rigidGroupId,
45 throws MmdFormatException;
49 * <p>{@link #RIGID_LIST}ループの構成要素。
50 * @param shapeType 形状種別。
56 * @param width 球orカプセル半径。箱の幅。
57 * @param height 箱orカプセルの高さ
59 * @throws MmdFormatException 不正フォーマットによる
62 void pmdRigidShape(byte shapeType,
63 float width, float height, float depth)
64 throws MmdFormatException;
68 * <p>{@link #RIGID_LIST}ループの構成要素。
72 * @throws MmdFormatException 不正フォーマットによる
75 void pmdRigidPosition(float posX, float posY, float posZ)
76 throws MmdFormatException;
80 * <p>{@link #RIGID_LIST}ループの構成要素。
81 * @param radX X軸回転量(radian)
82 * @param radY Y軸回転量(radian)
83 * @param radZ Z軸回転量(radian)
84 * @throws MmdFormatException 不正フォーマットによる
87 void pmdRigidRotation(float radX, float radY, float radZ)
88 throws MmdFormatException;
92 * <p>{@link #RIGID_LIST}ループの構成要素。
94 * @param dampingPos 移動減衰率
95 * @param dampingRot 回転減衰率
96 * @param restitution 反発力
98 * @throws MmdFormatException 不正フォーマットによる
101 void pmdRigidPhysics(float mass,
102 float dampingPos, float dampingRot,
103 float restitution, float friction )
104 throws MmdFormatException;
108 * <p>{@link #RIGID_LIST}ループの構成要素。
109 * @param behaveType 剛体タイプ。
113 * <li>2:物理演算+ボーン位置合わせ
115 * @param collisionMap 非衝突剛体グループビットマップ。
117 * (衝突グループ番号-1)位置のビット位置は1に、
118 * (非衝突グループ番号-1)位置のビット位置は0になる。
119 * 例)グループ1と8のみが非衝突指定の場合、0xff7eになる。
120 * @throws MmdFormatException 不正フォーマットによる
123 void pmdRigidBehavior(byte behaveType, short collisionMap)
124 throws MmdFormatException;