* Copyright(c) 2010 MikuToga Partners
*/
-package jp.sourceforge.mikutoga.pmd;
+package jp.sourceforge.mikutoga.math;
/**
* 二次元空間座標及び変量を表す。
+ * <p>直交座標を二つの倍精度値で表す。
+ * <p>主な用途はUVマッピングなど。
*/
-public class Pos2d {
+public class MkPos2D {
- private float xPos;
- private float yPos;
+ private double xPos;
+ private double yPos;
/**
* コンストラクタ。
* [0,0]が設定される
*/
- public Pos2d(){
- this(0.0f, 0.0f);
+ public MkPos2D(){
+ this(0.0, 0.0);
return;
}
* @param xPos X座標
* @param yPos Y座標
*/
- public Pos2d(float xPos, float yPos){
+ public MkPos2D(double xPos, double yPos){
super();
this.xPos = xPos;
this.yPos = yPos;
* X座標を設定する。
* @param xPos X座標
*/
- public void setXPos(float xPos){
+ public void setXpos(double xPos){
this.xPos = xPos;
return;
}
* X座標を返す。
* @return X座標
*/
- public float getXPos(){
+ public double getXpos(){
return this.xPos;
}
* Y座標を設定する。
* @param yPos Y座標
*/
- public void setYPos(float yPos){
+ public void setYpos(double yPos){
this.yPos = yPos;
return;
}
* Y座標を返す。
* @return Y座標
*/
- public float getYPos(){
+ public double getYpos(){
return this.yPos;
}
/**
+ * 座標を設定する。
+ * @param xPosArg X軸座標
+ * @param yPosArg Y軸座標
+ */
+ public void setPosition(double xPosArg, double yPosArg){
+ this.xPos = xPosArg;
+ this.yPos = yPosArg;
+ return;
+ }
+
+ /**
+ * この点が原点(0,0)か否か判定する。
+ * @return 原点ならtrue
+ */
+ public boolean isOriginPoint(){
+ if(this.xPos != 0.0) return false;
+ if(this.yPos != 0.0) return false;
+ return true;
+ }
+
+ /**
* {@inheritDoc}
* @return {@inheritDoc}
*/
/*
- * position
+ * 3D position
*
* License : The MIT License
* Copyright(c) 2011 MikuToga Partners
* Copyright(c) 2010 MikuToga Partners
*/
-package jp.sourceforge.mikutoga.pmd;
+package jp.sourceforge.mikutoga.math;
/**
* XYZ三次元ベクトル。
*/
-public class Vec3d {
+public class MkVec3D {
- private float xVal;
- private float yVal;
- private float zVal;
+ private double xVal;
+ private double yVal;
+ private double zVal;
/**
* コンストラクタ。
*/
- public Vec3d(){
+ public MkVec3D(){
super();
return;
}
* X値を設定する。
* @param xVal X値
*/
- public void setXVal(float xVal){
+ public void setXVal(double xVal){
this.xVal = xVal;
return;
}
* X値を返す。
* @return X値
*/
- public float getXVal(){
+ public double getXVal(){
return this.xVal;
}
* Y値を設定する。
* @param yVal Y値
*/
- public void setYVal(float yVal){
+ public void setYVal(double yVal){
this.yVal = yVal;
return;
}
* Y値を返す。
* @return Y値
*/
- public float getYVal(){
+ public double getYVal(){
return this.yVal;
}
* Z値を設定する。
* @param zVal Z値
*/
- public void setZVal(float zVal){
+ public void setZVal(double zVal){
this.zVal = zVal;
return;
}
* Z値を返す。
* @return Z値
*/
- public float getZVal(){
+ public double getZVal(){
return this.zVal;
}
/**
+ * ベクトル成分を設定する。
+ * @param xValArg X値
+ * @param yValArg Y値
+ * @param zValArg Z値
+ */
+ public void setVector(double xValArg, double yValArg, double zValArg){
+ this.xVal = xValArg;
+ this.yVal = yValArg;
+ this.zVal = zValArg;
+ return;
+ }
+
+ /**
* {@inheritDoc}
* @return {@inheritDoc}
*/
+++ /dev/null
-/*
- * 3D position
- *
- * License : The MIT License
- * Copyright(c) 2010 MikuToga Partners
- */
-
-package jp.sourceforge.mikutoga.pmd;
-
-/**
- * 三次元空間座標及び変量を表す。
- */
-public class Pos3d {
-
- private float xPos;
- private float yPos;
- private float zPos;
-
- /**
- * コンストラクタ。
- * [0,0,0]が設定される。
- */
- public Pos3d(){
- this(0.0f, 0.0f, 0.0f);
- return;
- }
-
- /**
- * コンストラクタ。
- * @param xPos X座標
- * @param yPos Y座標
- * @param zPos Z座標
- */
- public Pos3d(float xPos, float yPos, float zPos){
- super();
- this.xPos = xPos;
- this.yPos = yPos;
- this.zPos = zPos;
- return;
- }
-
- /**
- * X座標を設定する。
- * @param xPos X座標
- */
- public void setXPos(float xPos){
- this.xPos = xPos;
- return;
- }
-
- /**
- * X座標を返す。
- * @return X座標
- */
- public float getXPos(){
- return this.xPos;
- }
-
- /**
- * Y座標を設定する。
- * @param yPos Y座標
- */
- public void setYPos(float yPos){
- this.yPos = yPos;
- return;
- }
-
- /**
- * Y座標を返す。
- * @return Y座標
- */
- public float getYPos(){
- return this.yPos;
- }
-
- /**
- * Z座標を設定する。
- * @param zPos Z座標
- */
- public void setZPos(float zPos){
- this.zPos = zPos;
- return;
- }
-
- /**
- * Z座標を返す。
- * @return Z座標
- */
- public float getZPos(){
- return this.zPos;
- }
-
- /**
- * {@inheritDoc}
- * @return {@inheritDoc}
- */
- @Override
- public String toString(){
- StringBuilder result = new StringBuilder();
-
- result.append("pos=[")
- .append(this.xPos).append(", ")
- .append(this.yPos).append(", ")
- .append(this.zPos).append(']');
-
- return result.toString();
- }
-
-}
package jp.sourceforge.mikutoga.pmd.model;
import jp.sourceforge.mikutoga.corelib.I18nText;
+import jp.sourceforge.mikutoga.math.MkPos3D;
import jp.sourceforge.mikutoga.pmd.BoneType;
-import jp.sourceforge.mikutoga.pmd.Pos3d;
/**
* ボーン情報。
private BoneInfo nextBone;
private BoneInfo ikBone;
- private final Pos3d position = new Pos3d();
+ private final MkPos3D position = new MkPos3D();
private int rotationRatio;
* ボーン位置を返す。
* @return ボーン位置
*/
- public Pos3d getPosition(){
+ public MkPos3D getPosition(){
return this.position;
}
package jp.sourceforge.mikutoga.pmd.model;
import jp.sourceforge.mikutoga.corelib.I18nText;
+import jp.sourceforge.mikutoga.math.MkPos3D;
import jp.sourceforge.mikutoga.pmd.Deg3d;
-import jp.sourceforge.mikutoga.pmd.Pos3d;
import jp.sourceforge.mikutoga.pmd.Rad3d;
import jp.sourceforge.mikutoga.pmd.TripletRange;
private RigidInfo rigidA;
private RigidInfo rigidB;
- private final Pos3d position = new Pos3d();
+ private final MkPos3D position = new MkPos3D();
private final Rad3d rotation = new Rad3d();
- private final Pos3d elaPosition = new Pos3d();
+ private final MkPos3D elaPosition = new MkPos3D();
private final Deg3d elaRotation = new Deg3d();
private final TripletRange posRange = new TripletRange();
* ジョイントの位置を返す。
* @return ジョイントの位置
*/
- public Pos3d getPosition(){
+ public MkPos3D getPosition(){
return this.position;
}
* ジョイントのバネ位置を返す。
* @return ジョイントのバネ位置
*/
- public Pos3d getElasticPosition(){
+ public MkPos3D getElasticPosition(){
return this.elaPosition;
}
package jp.sourceforge.mikutoga.pmd.model;
import java.util.Comparator;
-import jp.sourceforge.mikutoga.pmd.Pos3d;
+import jp.sourceforge.mikutoga.math.MkPos3D;
/**
* モーフアニメーションを構成する個別の頂点移動の情報。
new VertexIdComparator();
private Vertex baseVertex;
- private final Pos3d offset = new Pos3d();
+ private final MkPos3D offset = new MkPos3D();
private int serialNo = -1;
* 頂点移動量を返す。
* @return 頂点移動量
*/
- public Pos3d getOffset(){
+ public MkPos3D getOffset(){
return this.offset;
}
import java.util.ArrayList;
import java.util.Collection;
import jp.sourceforge.mikutoga.corelib.I18nText;
-import jp.sourceforge.mikutoga.pmd.Pos3d;
+import jp.sourceforge.mikutoga.math.MkPos3D;
import jp.sourceforge.mikutoga.pmd.Rad3d;
import jp.sourceforge.mikutoga.pmd.RigidBehaviorType;
private RigidBehaviorType behaviorType = RigidBehaviorType.FOLLOWBONE;
private final RigidShape rigidShape = new RigidShape();
- private final Pos3d position = new Pos3d();
+ private final MkPos3D position = new MkPos3D();
private final Rad3d rotation = new Rad3d();
private BoneInfo linkedBone;
* 剛体位置を返す。
* @return 剛体位置
*/
- public Pos3d getPosition(){
+ public MkPos3D getPosition(){
return this.position;
}
package jp.sourceforge.mikutoga.pmd.model;
-import jp.sourceforge.mikutoga.pmd.Pos2d;
-import jp.sourceforge.mikutoga.pmd.Pos3d;
-import jp.sourceforge.mikutoga.pmd.Vec3d;
+import jp.sourceforge.mikutoga.math.MkPos2D;
+import jp.sourceforge.mikutoga.math.MkPos3D;
+import jp.sourceforge.mikutoga.math.MkVec3D;
/**
* 頂点情報。
private static final int MIN_WEIGHT = 0;
private static final int MAX_WEIGHT = 100;
- private final Pos3d position = new Pos3d();
- private final Vec3d normal = new Vec3d();
+ private final MkPos3D position = new MkPos3D();
+ private final MkVec3D normal = new MkVec3D();
- private final Pos2d uvPosition = new Pos2d();
+ private final MkPos2D uvPosition = new MkPos2D();
private BoneInfo boneA = null;
private BoneInfo boneB = null;
* 頂点位置座標を返す。
* @return 頂点の位置座標
*/
- public Pos3d getPosition(){
+ public MkPos3D getPosition(){
return this.position;
}
* 法線ベクトルを返す。
* @return 法線ベクトル
*/
- public Vec3d getNormal(){
+ public MkVec3D getNormal(){
return this.normal;
}
* UVマップ座標を返す。
* @return UVマップ情報
*/
- public Pos2d getUVPosition(){
+ public MkPos2D getUVPosition(){
return this.uvPosition;
}
import java.util.LinkedList;
import java.util.List;
import jp.sourceforge.mikutoga.corelib.ListUtil;
+import jp.sourceforge.mikutoga.math.MkPos3D;
import jp.sourceforge.mikutoga.parser.ParseStage;
import jp.sourceforge.mikutoga.pmd.BoneType;
-import jp.sourceforge.mikutoga.pmd.Pos3d;
import jp.sourceforge.mikutoga.pmd.model.BoneGroup;
import jp.sourceforge.mikutoga.pmd.model.BoneInfo;
import jp.sourceforge.mikutoga.pmd.model.IKChain;
*/
@Override
public void pmdBonePosition(float xPos, float yPos, float zPos){
- Pos3d position = this.currentBone.getPosition();
- position.setXPos(xPos);
- position.setYPos(yPos);
- position.setZPos(zPos);
+ MkPos3D position = this.currentBone.getPosition();
+ position.setXpos(xPos);
+ position.setYpos(yPos);
+ position.setZpos(zPos);
return;
}
import java.util.Iterator;
import java.util.List;
import jp.sourceforge.mikutoga.corelib.ListUtil;
+import jp.sourceforge.mikutoga.math.MkPos3D;
import jp.sourceforge.mikutoga.parser.ParseStage;
import jp.sourceforge.mikutoga.pmd.Deg3d;
-import jp.sourceforge.mikutoga.pmd.Pos3d;
import jp.sourceforge.mikutoga.pmd.Rad3d;
import jp.sourceforge.mikutoga.pmd.TripletRange;
import jp.sourceforge.mikutoga.pmd.model.JointInfo;
*/
@Override
public void pmdJointPosition(float posX, float posY, float posZ){
- Pos3d position = this.currentJoint.getPosition();
- position.setXPos(posX);
- position.setYPos(posY);
- position.setZPos(posZ);
+ MkPos3D position = this.currentJoint.getPosition();
+ position.setXpos(posX);
+ position.setYpos(posY);
+ position.setZpos(posZ);
return;
}
public void pmdElasticPosition(float elasticPosX,
float elasticPosY,
float elasticPosZ){
- Pos3d position = this.currentJoint.getElasticPosition();
- position.setXPos(elasticPosX);
- position.setYPos(elasticPosY);
- position.setZPos(elasticPosZ);
+ MkPos3D position = this.currentJoint.getElasticPosition();
+ position.setXpos(elasticPosX);
+ position.setYpos(elasticPosY);
+ position.setZpos(elasticPosZ);
return;
}
import java.util.List;
import java.util.Map;
import jp.sourceforge.mikutoga.corelib.ListUtil;
+import jp.sourceforge.mikutoga.math.MkPos3D;
import jp.sourceforge.mikutoga.parser.ParseStage;
import jp.sourceforge.mikutoga.pmd.MorphType;
-import jp.sourceforge.mikutoga.pmd.Pos3d;
import jp.sourceforge.mikutoga.pmd.model.MorphPart;
import jp.sourceforge.mikutoga.pmd.model.MorphVertex;
import jp.sourceforge.mikutoga.pmd.model.PmdModel;
float xPos, float yPos, float zPos){
MorphVertex morphVertex;
morphVertex = new MorphVertex();
- Pos3d position = morphVertex.getOffset();
- position.setXPos(xPos);
- position.setYPos(yPos);
- position.setZPos(zPos);
+ MkPos3D position = morphVertex.getOffset();
+ position.setXpos(xPos);
+ position.setYpos(yPos);
+ position.setZpos(zPos);
Vertex vertex;
if(this.currentMorphPart.getMorphType().isBase()){
import java.util.List;
import java.util.Map;
import java.util.Set;
+import jp.sourceforge.mikutoga.math.MkPos2D;
+import jp.sourceforge.mikutoga.math.MkPos3D;
+import jp.sourceforge.mikutoga.math.MkVec3D;
import jp.sourceforge.mikutoga.pmd.BoneType;
import jp.sourceforge.mikutoga.pmd.MorphType;
-import jp.sourceforge.mikutoga.pmd.Pos2d;
-import jp.sourceforge.mikutoga.pmd.Pos3d;
-import jp.sourceforge.mikutoga.pmd.Vec3d;
import jp.sourceforge.mikutoga.pmd.model.BoneGroup;
import jp.sourceforge.mikutoga.pmd.model.BoneInfo;
import jp.sourceforge.mikutoga.pmd.model.IKChain;
*/
private void dumpVertex(Vertex vertex)
throws IOException{
- Pos3d position = vertex.getPosition();
- dumpPos3d(position);
+ MkPos3D position = vertex.getPosition();
+ dumpPos3D(position);
- Vec3d normal = vertex.getNormal();
- dumpVec3d(normal);
+ MkVec3D normal = vertex.getNormal();
+ dumpVec3D(normal);
- Pos2d uv = vertex.getUVPosition();
+ MkPos2D uv = vertex.getUVPosition();
dumpPos2d(uv);
BoneInfo boneA = vertex.getBoneA();
else dumpShort(NOIKBONE_ID);
}
- Pos3d position = bone.getPosition();
- dumpPos3d(position);
+ MkPos3D position = bone.getPosition();
+ dumpPos3D(position);
return;
}
for(MorphVertex morphVertex : mergedMorphVertexList){
Vertex baseVertex = morphVertex.getBaseVertex();
dumpInt(baseVertex.getSerialNumber());
- dumpPos3d(baseVertex.getPosition());
+ dumpPos3D(baseVertex.getPosition());
}
for(MorphType type : typeSet){
for(MorphVertex morphVertex : morphVertexList){
dumpInt(morphVertex.getSerialNumber());
- dumpPos3d(morphVertex.getOffset());
+ dumpPos3D(morphVertex.getOffset());
}
}
}
* @param position 2次元位置情報
* @throws IOException 出力エラー
*/
- protected void dumpPos2d(Pos2d position) throws IOException{
- float xPos = position.getXPos();
- float yPos = position.getYPos();
+ protected void dumpPos2d(MkPos2D position) throws IOException{
+ float xPos = (float) position.getXpos();
+ float yPos = (float) position.getYpos();
dumpFloat(xPos);
dumpFloat(yPos);
* @param position 3次元位置情報
* @throws IOException 出力エラー
*/
- protected void dumpPos3d(Pos3d position) throws IOException{
- float xPos = position.getXPos();
- float yPos = position.getYPos();
- float zPos = position.getZPos();
+ protected void dumpPos3D(MkPos3D position) throws IOException{
+ float xPos = (float) position.getXpos();
+ float yPos = (float) position.getYpos();
+ float zPos = (float) position.getZpos();
dumpFloat(xPos);
dumpFloat(yPos);
* @param vector 3次元ベクトル
* @throws IOException 出力エラー
*/
- protected void dumpVec3d(Vec3d vector) throws IOException{
- float xVal = vector.getXVal();
- float yVal = vector.getYVal();
- float zVal = vector.getZVal();
+ protected void dumpVec3D(MkVec3D vector) throws IOException{
+ float xVal = (float) vector.getXVal();
+ float yVal = (float) vector.getYVal();
+ float zVal = (float) vector.getZVal();
dumpFloat(xVal);
dumpFloat(yVal);
dumpRigidShape(rigid.getRigidShape());
- dumpPos3d(rigid.getPosition());
+ dumpPos3D(rigid.getPosition());
dumpRad3d(rigid.getRotation());
dumpDynamics(rigid.getDynamicsInfo());
dumpInt(rigidA.getSerialNumber());
dumpInt(rigidB.getSerialNumber());
- dumpPos3d(joint.getPosition());
+ dumpPos3D(joint.getPosition());
dumpRad3d(joint.getRotation());
dumpTripletRange(joint.getPositionRange());
dumpTripletRange(joint.getRotationRange());
- dumpPos3d(joint.getElasticPosition());
+ dumpPos3D(joint.getElasticPosition());
dumpDeg3d(joint.getElasticRotation());
return;
import java.util.Iterator;
import java.util.List;
import jp.sourceforge.mikutoga.corelib.ListUtil;
+import jp.sourceforge.mikutoga.math.MkPos3D;
import jp.sourceforge.mikutoga.parser.ParseStage;
-import jp.sourceforge.mikutoga.pmd.Pos3d;
import jp.sourceforge.mikutoga.pmd.Rad3d;
import jp.sourceforge.mikutoga.pmd.RigidBehaviorType;
import jp.sourceforge.mikutoga.pmd.RigidShapeType;
*/
@Override
public void pmdRigidPosition(float posX, float posY, float posZ){
- Pos3d position = this.currentRigid.getPosition();
- position.setXPos(posX);
- position.setYPos(posY);
- position.setZPos(posZ);
+ MkPos3D position = this.currentRigid.getPosition();
+ position.setXpos(posX);
+ position.setYpos(posY);
+ position.setZpos(posZ);
return;
}
import java.util.List;
import java.util.RandomAccess;
import jp.sourceforge.mikutoga.corelib.ListUtil;
+import jp.sourceforge.mikutoga.math.MkPos2D;
+import jp.sourceforge.mikutoga.math.MkPos3D;
+import jp.sourceforge.mikutoga.math.MkVec3D;
import jp.sourceforge.mikutoga.parser.ParseStage;
-import jp.sourceforge.mikutoga.pmd.Pos2d;
-import jp.sourceforge.mikutoga.pmd.Pos3d;
-import jp.sourceforge.mikutoga.pmd.Vec3d;
import jp.sourceforge.mikutoga.pmd.model.BoneInfo;
import jp.sourceforge.mikutoga.pmd.model.PmdModel;
import jp.sourceforge.mikutoga.pmd.model.Surface;
*/
@Override
public void pmdVertexPosition(float xPos, float yPos, float zPos){
- Pos3d position = this.currentVertex.getPosition();
- position.setXPos(xPos);
- position.setYPos(yPos);
- position.setZPos(zPos);
+ MkPos3D position = this.currentVertex.getPosition();
+ position.setXpos(xPos);
+ position.setYpos(yPos);
+ position.setZpos(zPos);
return;
}
*/
@Override
public void pmdVertexNormal(float xVec, float yVec, float zVec){
- Vec3d normal = this.currentVertex.getNormal();
+ MkVec3D normal = this.currentVertex.getNormal();
normal.setXVal(xVec);
normal.setYVal(yVec);
normal.setZVal(zVec);
*/
@Override
public void pmdVertexUV(float uVal, float vVal){
- Pos2d uv = this.currentVertex.getUVPosition();
- uv.setXPos(uVal);
- uv.setYPos(vVal);
+ MkPos2D uv = this.currentVertex.getUVPosition();
+ uv.setXpos(uVal);
+ uv.setYpos(vVal);
return;
}
import java.util.List;
import java.util.Map;
import jp.sourceforge.mikutoga.corelib.I18nText;
+import jp.sourceforge.mikutoga.math.MkPos2D;
+import jp.sourceforge.mikutoga.math.MkPos3D;
+import jp.sourceforge.mikutoga.math.MkVec3D;
import jp.sourceforge.mikutoga.pmd.BoneType;
import jp.sourceforge.mikutoga.pmd.Deg3d;
import jp.sourceforge.mikutoga.pmd.MorphType;
-import jp.sourceforge.mikutoga.pmd.Pos2d;
-import jp.sourceforge.mikutoga.pmd.Pos3d;
import jp.sourceforge.mikutoga.pmd.Rad3d;
import jp.sourceforge.mikutoga.pmd.RigidShapeType;
import jp.sourceforge.mikutoga.pmd.TripletRange;
-import jp.sourceforge.mikutoga.pmd.Vec3d;
import jp.sourceforge.mikutoga.pmd.model.BoneGroup;
import jp.sourceforge.mikutoga.pmd.model.BoneInfo;
import jp.sourceforge.mikutoga.pmd.model.DynamicsInfo;
* @return this本体
* @throws IOException 出力エラー
*/
- protected PmdXmlExporter putPosition(Pos3d position) throws IOException{
+ protected PmdXmlExporter putPosition(MkPos3D position)
+ throws IOException{
put("<position ");
- putFloatAttr("x", position.getXPos()).put(' ');
- putFloatAttr("y", position.getYPos()).put(' ');
- putFloatAttr("z", position.getZPos()).put(' ');
+ putFloatAttr("x", (float) position.getXpos()).put(' ');
+ putFloatAttr("y", (float) position.getYpos()).put(' ');
+ putFloatAttr("z", (float) position.getZpos()).put(' ');
put("/>");
return this;
}
put(">").ln();
pushNest();
- Pos3d position = vertex.getPosition();
+ MkPos3D position = vertex.getPosition();
ind().putPosition(position).ln();
- Vec3d normal = vertex.getNormal();
+ MkVec3D normal = vertex.getNormal();
ind().put("<normal ");
- putFloatAttr("x", normal.getXVal()).put(' ');
- putFloatAttr("y", normal.getYVal()).put(' ');
- putFloatAttr("z", normal.getZVal()).put(' ');
+ putFloatAttr("x", (float) normal.getXVal()).put(' ');
+ putFloatAttr("y", (float) normal.getYVal()).put(' ');
+ putFloatAttr("z", (float) normal.getZVal()).put(' ');
put("/>").ln();
- Pos2d uvPos = vertex.getUVPosition();
+ MkPos2D uvPos = vertex.getUVPosition();
ind().put("<uvMap ");
- putFloatAttr("u", uvPos.getXPos()).put(' ');
- putFloatAttr("v", uvPos.getYPos()).put(' ');
+ putFloatAttr("u", (float) uvPos.getXpos()).put(' ');
+ putFloatAttr("v", (float) uvPos.getYpos()).put(' ');
put("/>").ln();
BoneInfo boneA = vertex.getBoneA();
putI18nName(i18nName);
- Pos3d position = bone.getPosition();
+ MkPos3D position = bone.getPosition();
ind().putPosition(position).ln();
BoneInfo ikBone = bone.getIKBone();
putI18nName(i18nName);
for(MorphVertex mvertex : part){
- Pos3d offset = mvertex.getOffset();
+ MkPos3D offset = mvertex.getOffset();
Vertex base = mvertex.getBaseVertex();
ind().put("<morphVertex ");
putNumberedIdAttr("vtxIdRef", PFX_VERTEX, base).put(' ');
- putFloatAttr("xOff", offset.getXPos()).put(' ');
- putFloatAttr("yOff", offset.getYPos()).put(' ');
- putFloatAttr("zOff", offset.getZPos()).put(' ');
+ putFloatAttr("xOff", (float) offset.getXpos()).put(' ');
+ putFloatAttr("yOff", (float) offset.getYpos()).put(' ');
+ putFloatAttr("zOff", (float) offset.getZpos()).put(' ');
put("/>");
ln();
}
RigidShape shape = rigid.getRigidShape();
putRigidShape(shape);
- Pos3d position = rigid.getPosition();
+ MkPos3D position = rigid.getPosition();
ind().putPosition(position).ln();
Rad3d rotation = rigid.getRotation();
+ " <=> [" + rigidB.getRigidName().getText() + "]");
ln(2);
- Pos3d position = joint.getPosition();
+ MkPos3D position = joint.getPosition();
ind().putPosition(position).ln();
TripletRange posRange = joint.getPositionRange();
popNest();
ind().put("/>").ln(2);
- Pos3d elaPosition = joint.getElasticPosition();
+ MkPos3D elaPosition = joint.getElasticPosition();
ind().put("<elasticPosition ");
- putFloatAttr("x", elaPosition.getXPos()).put(' ');
- putFloatAttr("y", elaPosition.getYPos()).put(' ');
- putFloatAttr("z", elaPosition.getZPos()).put(' ');
+ putFloatAttr("x", (float) elaPosition.getXpos()).put(' ');
+ putFloatAttr("y", (float) elaPosition.getYpos()).put(' ');
+ putFloatAttr("z", (float) elaPosition.getZpos()).put(' ');
put("/>").ln();
Deg3d elaRotation = joint.getElasticRotation();
import javax.xml.parsers.DocumentBuilder;
import jp.sourceforge.mikutoga.corelib.I18nText;
import jp.sourceforge.mikutoga.corelib.ListUtil;
+import jp.sourceforge.mikutoga.math.MkPos2D;
+import jp.sourceforge.mikutoga.math.MkPos3D;
+import jp.sourceforge.mikutoga.math.MkVec3D;
import jp.sourceforge.mikutoga.pmd.BoneType;
import jp.sourceforge.mikutoga.pmd.Deg3d;
import jp.sourceforge.mikutoga.pmd.MorphType;
-import jp.sourceforge.mikutoga.pmd.Pos2d;
-import jp.sourceforge.mikutoga.pmd.Pos3d;
import jp.sourceforge.mikutoga.pmd.Rad3d;
import jp.sourceforge.mikutoga.pmd.RigidBehaviorType;
import jp.sourceforge.mikutoga.pmd.RigidShapeType;
import jp.sourceforge.mikutoga.pmd.TripletRange;
-import jp.sourceforge.mikutoga.pmd.Vec3d;
import jp.sourceforge.mikutoga.pmd.model.BoneGroup;
import jp.sourceforge.mikutoga.pmd.model.BoneInfo;
import jp.sourceforge.mikutoga.pmd.model.DynamicsInfo;
float xPos = getFloatAttr(positionElem, "x");
float yPos = getFloatAttr(positionElem, "y");
float zPos = getFloatAttr(positionElem, "z");
- Pos3d position = boneInfo.getPosition();
- position.setXPos(xPos);
- position.setYPos(yPos);
- position.setZPos(zPos);
+ MkPos3D position = boneInfo.getPosition();
+ position.setXpos(xPos);
+ position.setYpos(yPos);
+ position.setZpos(zPos);
}
ListUtil.assignIndexedSerial(boneList);
xVal = getFloatAttr(positionElem, "x");
yVal = getFloatAttr(positionElem, "y");
zVal = getFloatAttr(positionElem, "z");
- Pos3d position = vertex.getPosition();
- position.setXPos(xVal);
- position.setYPos(yVal);
- position.setZPos(zVal);
+ MkPos3D position = vertex.getPosition();
+ position.setXpos(xVal);
+ position.setYpos(yVal);
+ position.setZpos(zVal);
Element normalElem = getChild(vertexElem, "normal");
xVal = getFloatAttr(normalElem, "x");
yVal = getFloatAttr(normalElem, "y");
zVal = getFloatAttr(normalElem, "z");
- Vec3d normal = vertex.getNormal();
+ MkVec3D normal = vertex.getNormal();
normal.setXVal(xVal);
normal.setYVal(yVal);
normal.setZVal(zVal);
Element uvElem = getChild(vertexElem, "uvMap");
float uVal = getFloatAttr(uvElem, "u");
float vVal = getFloatAttr(uvElem, "v");
- Pos2d uv = vertex.getUVPosition();
- uv.setXPos(uVal);
- uv.setYPos(vVal);
+ MkPos2D uv = vertex.getUVPosition();
+ uv.setXpos(uVal);
+ uv.setYpos(vVal);
Element skinningElem = getChild(vertexElem, "skinning");
String boneId1 = getStringAttr(skinningElem, "boneIdRef1");
MorphVertex morphVertex = new MorphVertex();
morphVertex.setBaseVertex(baseVertex);
- Pos3d position = morphVertex.getOffset();
- position.setXPos(xOff);
- position.setYPos(yOff);
- position.setZPos(zOff);
+ MkPos3D position = morphVertex.getOffset();
+ position.setXpos(xOff);
+ position.setYpos(yOff);
+ position.setZpos(zOff);
morphVertexList.add(morphVertex);
}
xVal = getFloatAttr(positionElem, "x");
yVal = getFloatAttr(positionElem, "y");
zVal = getFloatAttr(positionElem, "z");
- Pos3d position = rigid.getPosition();
- position.setXPos(xVal);
- position.setYPos(yVal);
- position.setZPos(zVal);
+ MkPos3D position = rigid.getPosition();
+ position.setXpos(xVal);
+ position.setYpos(yVal);
+ position.setZpos(zVal);
Element radRotationElem = getChild(rigidElem, "radRotation");
xVal = getFloatAttr(radRotationElem, "xRad");
float zFrom;
float zTo;
- Pos3d position = joint.getPosition();
+ MkPos3D position = joint.getPosition();
Element positionElem = getChild(jointElem, "position");
xVal = getFloatAttr(positionElem, "x");
yVal = getFloatAttr(positionElem, "y");
zVal = getFloatAttr(positionElem, "z");
- position.setXPos(xVal);
- position.setYPos(yVal);
- position.setZPos(zVal);
+ position.setXpos(xVal);
+ position.setYpos(yVal);
+ position.setZpos(zVal);
TripletRange limitPosition = joint.getPositionRange();
Element limitPositionElem = getChild(jointElem, "limitPosition");
limitRotation.setYRange(yFrom, yTo);
limitRotation.setZRange(zFrom, zTo);
- Pos3d elasticPosition = joint.getElasticPosition();
+ MkPos3D elasticPosition = joint.getElasticPosition();
Element elasticPositionElem =
getChild(jointElem, "elasticPosition");
xVal = getFloatAttr(elasticPositionElem, "x");
yVal = getFloatAttr(elasticPositionElem, "y");
zVal = getFloatAttr(elasticPositionElem, "z");
- elasticPosition.setXPos(xVal);
- elasticPosition.setYPos(yVal);
- elasticPosition.setZPos(zVal);
+ elasticPosition.setXpos(xVal);
+ elasticPosition.setYpos(yVal);
+ elasticPosition.setZpos(zVal);
Deg3d elasticRotation = joint.getElasticRotation();
Element elasticRotationElem =