SkeletonControl skeletonControl;
HashMap<String, Texture> textureMap = new HashMap<String, Texture>();
public static final Logger logger = Logger.getLogger(PMDLoaderGLSLSkinning2.class.getName());
+ public static boolean interleaveEnabled = true;
public PMDLoaderGLSLSkinning2() {
}
public PMDLoaderGLSLSkinning2(AssetManager assetManager, PMDModel model) {
node.pmdGeometryArray[pmdGeometryIndex++] = geom;
meshConverter.getMeshDataList().set(i, null);
// go.add(mesh);
- mesh.setInterleaved();
+ if (interleaveEnabled) {
+ mesh.setInterleaved();
+ }
}
// go.optimize3();
createSkinCommonVertData();
}
s = s.toLowerCase();
if (s.equals("spa")) {
-// texture.setWrap(Texture.WrapMode.Repeat);
+ texture.setWrap(Texture.WrapMode.Repeat);
texture.setMinFilter(Texture.MinFilter.BilinearNoMipMaps);
mat.setTexture("SphereMap_A", texture);
} else if (s.equals("sph")) {
-// texture.setWrap(Texture.WrapMode.Repeat);
+ texture.setWrap(Texture.WrapMode.Repeat);
texture.setMinFilter(Texture.MinFilter.BilinearNoMipMaps);
mat.setTexture("SphereMap_H", texture);
} else {
-// texture.setWrap(Texture.WrapMode.Repeat);
+ texture.setWrap(Texture.WrapMode.Repeat);
mat.setTexture("DiffuseMap", texture);
}
}
package projectkyoto.jme3.mmd;
import com.jme3.bounding.BoundingBox;
+import com.jme3.bounding.BoundingSphere;
import com.jme3.bounding.BoundingVolume;
import com.jme3.export.InputCapsule;
import com.jme3.export.JmeExporter;
public void setBoneMatrixArray(Matrix4f[] boneMatrixArray) {
this.boneMatrixArray = boneMatrixArray;
}
- BoundingVolume bound = new BoundingBox(Vector3f.ZERO, 20, 20, 20);
+// BoundingVolume bound = new BoundingBox(Vector3f.ZERO, Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY);
+ BoundingVolume bound = new BoundingBox(Vector3f.ZERO, Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY);
@Override
public BoundingVolume getBound() {
+ BoundingBox bb = (BoundingBox)super.getBound();
+ BoundingBox bb2 = new BoundingBox(bb.getCenter(), bb.getXExtent()*2, bb.getYExtent()*2,
+ bb.getZExtent()*2);
+ BoundingBox bb3 = new BoundingBox(bb.getCenter().ZERO,5,5,5);
return bound;
}
this.boneMatrixBuffer = boneMatrixBuffer;
}
- BoundingVolume bound = new BoundingBox(Vector3f.ZERO, 20, 20, 20);
+ BoundingVolume bound = new BoundingBox(Vector3f.ZERO, Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY);
@Override
public BoundingVolume getBound() {
- return bound;
+ return bound; //super.getBound();
}
@Override
public synchronized PMDSkinMesh clone() {
continue;
}
motionMap.put(m.getBoneName(), motionList);
-logger.info("boneName = "+m.getBoneName()+" "+motionList.boneIndex+" "+motionList.bone);
+//logger.info("boneName = "+m.getBoneName()+" "+motionList.boneIndex+" "+motionList.bone);
PMDBone pmdBone = pmdNode.getPmdModel().getBoneList().getBones()[motionList.boneIndex];
if (pmdBone.getBoneType() == 9) {
// FOLLOW_ROTATE
// System.out.print(" ");
// }
}
- System.out.println();
+// System.out.println();
for (VMDSkin skin : vmdFile.getSkinArray()) {
SkinList skinList = skinMap.get(skin.getSkinName());
if (skinList == null) {
for (int i = pmdNode.getSkeleton().getBoneCount() - 1; i >= 0; i--) {
int i2 = i; //boneEnabled.length -1 - i;
if (boneEnabled[i2] == 1) {
- if (!pmdNode.getSkeleton().getBone(i).getName().equals(pmdNode.getPmdModel().getBoneList().getBones()[i2].getBoneName())) {
- System.out.println("ERROR " + pmdNode.getSkeleton().getBone(i).getName() + " " + pmdNode.getPmdModel().getBoneList().getBones()[i2].getBoneName());
- }
+// if (!pmdNode.getSkeleton().getBone(i).getName().equals(pmdNode.getPmdModel().getBoneList().getBones()[i2].getBoneName())) {
+// System.out.println("ERROR " + pmdNode.getSkeleton().getBone(i).getName() + " " + pmdNode.getPmdModel().getBoneList().getBones()[i2].getBoneName());
+// }
Bone bone = pmdNode.getSkeleton().getBone(i);
bone.getLocalRotation().loadIdentity();
}
public void setFixedPhysics(boolean fixedPhysics) {
this.fixedPhysics = fixedPhysics;
- logger.info("fixedPhysics = " + fixedPhysics);
+// logger.info("fixedPhysics = " + fixedPhysics);
}
@Override
// bnfb.put(v.getNormal().x).put(v.getNormal().y).put(v.getNormal().z);
if (textureFlag) {
float f1 = v.getUv().getU();
- float f2 = v.getUv().getV();
+ float f2 = 1f-v.getUv().getV();
// tfb.put(v.getUv().getU()).put(1f - v.getUv().getV());
- f1 = f1 - FastMath.floor(f1);
- f2 = f2 - FastMath.floor(f2);
- f2 = 1 - f2;
+// f1 = f1 - FastMath.floor(f1);
+// f2 = f2 - FastMath.floor(f2);
+// f2 = 1 - f2;
tfb.put(f1).put(f2);
}
float weight = (float) v.getBoneWeight() / 100.0f;
skinvfb.put(v.getPos().x).put(v.getPos().y).put(v.getPos().z);
v.getNormal().normalize();
skinnfb.put(v.getNormal().x).put(v.getNormal().y).put(v.getNormal().z);
- float f1 = v.getUv().getU();
- float f2 = v.getUv().getV();
+// float f1 = v.getUv().getU();
+// float f2 = v.getUv().getV();
// tfb.put(v.getUv().getU()).put(1f - v.getUv().getV());
- f1 = f1 - FastMath.floor(f1);
- f2 = f2 - FastMath.floor(f2);
- f2 = 1 - f2;
- skintfb.put(f1).put(f2);
-// skintfb.put(v.getUv().getU()).put(1f - v.getUv().getV());
+// f1 = f1 - FastMath.floor(f1);
+// f2 = f2 - FastMath.floor(f2);
+// f2 = 1 - f2;
+// skintfb.put(f1).put(f2);
+ skintfb.put(v.getUv().getU()).put(1f - v.getUv().getV());
// skinbisb.put((short) meshConverter.getSkinMeshData()
// .getBoneList().indexOf(v.getBoneNum1()))
// .put((short) meshConverter.getSkinMeshData()