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;
18 * <p>ボーン名、ボーン位置、ボーン回転量、及び補間カーブ情報を持つ。
20 public class BoneMotion extends AbstractNumbered {
22 private static final String MSG_TXT =
23 "bone name : [{0}] #{1}\n"
24 + "rotation {2} R-Bezier {3}\n"
29 private String boneName;
31 private final MkQuat rotation = new MkQuat();
32 private final BezierParam intpltRotation = new BezierParam();
34 private final MkPos3D position = new MkPos3D();
35 private final PosCurve posCurve = new PosCurve();
52 public String getBoneName(){
59 * @param boneName ボーン名
61 public void setBoneName(String boneName){
62 this.boneName = boneName;
71 public MkQuat getRotation(){
78 * @return ボーン回転の補間曲線情報
80 public BezierParam getIntpltRotation(){
81 return this.intpltRotation;
89 public MkPos3D getPosition(){
96 * @return ボーン位置移動の補間情報
98 public PosCurve getPosCurve(){
103 * このモーションが暗黙の位置情報を持つか判定する。
105 * <p>ボーン位置が原点(0,0,0)にあり、
106 * XYZ3軸の移動補間カーブがデフォルト直線補間の場合、
109 * <p>MMDは、位置情報を持たないボーンのモーションに対し
110 * 便宜的にこの暗黙の位置情報を割り当てる。
112 * <p>通常の位置モーションが暗黙の位置情報と一致する場合もありうる。
114 * @return 暗黙の位置情報であるならtrue
116 public boolean hasImplicitPosition(){
117 if(this.position.isOriginPoint() && this.posCurve.isDefaultLinear()){
126 * @return {@inheritDoc}
129 public String toString(){
131 msg = MessageFormat.format(MSG_TXT,
134 this.rotation, this.intpltRotation,
135 this.position, this.posCurve );