4 * License : The MIT License
5 * Copyright(c) 2011 MikuToga Partners
8 package jp.sfjp.mikutoga.vmd.model;
10 import java.text.MessageFormat;
11 import jp.sfjp.mikutoga.math.MkPos3D;
12 import jp.sfjp.mikutoga.math.MkQuat;
13 import jp.sfjp.mikutoga.vmd.AbstractNumbered;
17 * <p>ボーン名、ボーン位置、ボーン回転量、及び補間カーブ情報を持つ。
19 public class BoneMotion extends AbstractNumbered {
21 private static final String MSG_TXT =
22 "bone name : [{0}] #{1}\n"
23 + "rotation {2} R-Bezier {3}\n"
28 private String boneName;
30 private final MkQuat rotation = new MkQuat();
31 private final BezierParam intpltRotation = new BezierParam();
33 private final MkPos3D position = new MkPos3D();
34 private final PosCurve posCurve = new PosCurve();
50 public String getBoneName(){
56 * @param boneName ボーン名
58 public void setBoneName(String boneName){
59 this.boneName = boneName;
67 public MkQuat getRotation(){
73 * @return ボーン回転の補間曲線情報
75 public BezierParam getIntpltRotation(){
76 return this.intpltRotation;
83 public MkPos3D getPosition(){
89 * @return ボーン位置移動の補間情報
91 public PosCurve getPosCurve(){
96 * このモーションが暗黙の位置情報を持つか判定する。
97 * <p>ボーン位置が原点(0,0,0)にあり、
98 * XYZ3軸の移動補間カーブがデフォルト直線補間の場合、
100 * <p>MMDは、位置情報を持たないボーンのモーションに対し
101 * 便宜的にこの暗黙の位置情報を割り当てる。
102 * <p>通常の位置モーションが暗黙の位置情報と一致する場合もありうる。
103 * @return 暗黙の位置情報であるならtrue
105 public boolean hasImplicitPosition(){
106 if(this.position.isOriginPoint() && this.posCurve.isDefaultLinear()){
114 * @return {@inheritDoc}
117 public String toString(){
119 msg = MessageFormat.format(MSG_TXT,
122 this.rotation, this.intpltRotation,
123 this.position, this.posCurve );