public static MD5JointData parseLine(String line) { MD5JointData result = null; Matcher matcher = PATTERN_JOINT.matcher(line); if (matcher.matches()) { result = new MD5JointData(); result.setName(matcher.group(1)); result.setParentIndex(Integer.parseInt(matcher.group(2))); float x = Float.parseFloat(matcher.group(3)); float y = Float.parseFloat(matcher.group(4)); float z = Float.parseFloat(matcher.group(5)); result.setPosition(new Vector3f(x, y, z)); x = Float.parseFloat(matcher.group(6)); y = Float.parseFloat(matcher.group(7)); z = Float.parseFloat(matcher.group(8)); result.setOrientation(new Vector3f(x, y, z)); } return result; } }
public static MD5JointInfo parse(List<String> blockBody) { MD5JointInfo result = new MD5JointInfo(); List<MD5JointData> joints = new ArrayList<>(); for (String line : blockBody) { MD5JointData jointData = MD5JointData.parseLine(line); if (jointData != null) { joints.add(jointData); } } result.setJoints(joints); return result; }
MD5Mesh.MD5Weight weight = weights.get(i); MD5JointInfo.MD5JointData joint = joints.get(weight.getJointIndex()); Vector3f rotatedPos = new Vector3f(weight.getPosition()).rotate(joint.getOrientation()); Vector3f acumPos = new Vector3f(joint.getPosition()).add(rotatedPos); acumPos.mul(weight.getBias()); vertex.position.add(acumPos);
MD5Mesh.MD5Weight weight = weights.get(i); MD5JointInfo.MD5JointData joint = joints.get(weight.getJointIndex()); Vector3f rotatedPos = new Vector3f(weight.getPosition()).rotate(joint.getOrientation()); Vector3f acumPos = new Vector3f(joint.getPosition()).add(rotatedPos); acumPos.mul(weight.getBias()); vertex.position.add(acumPos);
MD5Mesh.MD5Weight weight = weights.get(i); MD5JointInfo.MD5JointData joint = joints.get(weight.getJointIndex()); Vector3f rotatedPos = new Vector3f(weight.getPosition()).rotate(joint.getOrientation()); Vector3f acumPos = new Vector3f(joint.getPosition()).add(rotatedPos); acumPos.mul(weight.getBias()); vertex.position.add(acumPos);
MD5Mesh.MD5Weight weight = weights.get(i); MD5JointInfo.MD5JointData joint = joints.get(weight.getJointIndex()); Vector3f rotatedPos = new Vector3f(weight.getPosition()).rotate(joint.getOrientation()); Vector3f acumPos = new Vector3f(joint.getPosition()).add(rotatedPos); acumPos.mul(weight.getBias()); vertex.position.add(acumPos);
MD5Mesh.MD5Weight weight = weights.get(i); MD5JointInfo.MD5JointData joint = joints.get(weight.getJointIndex()); Vector3f rotatedPos = new Vector3f(weight.getPosition()).rotate(joint.getOrientation()); Vector3f acumPos = new Vector3f(joint.getPosition()).add(rotatedPos); acumPos.mul(weight.getBias()); vertex.position.add(acumPos);
MD5Mesh.MD5Weight weight = weights.get(i); MD5JointInfo.MD5JointData joint = joints.get(weight.getJointIndex()); Vector3f rotatedPos = new Vector3f(weight.getPosition()).rotate(joint.getOrientation()); Vector3f acumPos = new Vector3f(joint.getPosition()).add(rotatedPos); acumPos.mul(weight.getBias()); vertex.position.add(acumPos);
if (joint.getParentIndex() > -1) { Matrix4f parentMatrix = result.getLocalJointMatrices()[joint.getParentIndex()]; jointMat = new Matrix4f(parentMatrix).mul(jointMat);
if (joint.getParentIndex() > -1) { Matrix4f parentMatrix = result.getLocalJointMatrices()[joint.getParentIndex()]; jointMat = new Matrix4f(parentMatrix).mul(jointMat);
if (joint.getParentIndex() > -1) { Matrix4f parentMatrix = result.getLocalJointMatrices()[joint.getParentIndex()]; jointMat = new Matrix4f(parentMatrix).mul(jointMat);
if (joint.getParentIndex() > -1) { Matrix4f parentMatrix = result.getLocalJointMatrices()[joint.getParentIndex()]; jointMat = new Matrix4f(parentMatrix).mul(jointMat);
if (joint.getParentIndex() > -1) { Matrix4f parentMatrix = result.getLocalJointMatrices()[joint.getParentIndex()]; jointMat = new Matrix4f(parentMatrix).mul(jointMat);
if (joint.getParentIndex() > -1) { Matrix4f parentMatrix = result.getLocalJointMatrices()[joint.getParentIndex()]; jointMat = new Matrix4f(parentMatrix).mul(jointMat);
if (joint.getParentIndex() > -1) { Matrix4f parentMatrix = result.getLocalJointMatrices()[joint.getParentIndex()]; jointMat = new Matrix4f(parentMatrix).mul(jointMat);
if (joint.getParentIndex() > -1) { Matrix4f parentMatrix = result.getLocalJointMatrices()[joint.getParentIndex()]; jointMat = new Matrix4f(parentMatrix).mul(jointMat);
MD5Mesh.MD5Weight weight = weights.get(i); MD5JointInfo.MD5JointData joint = joints.get(weight.getJointIndex()); Vector3f rotatedPos = new Vector3f(weight.getPosition()).rotate(joint.getOrientation()); Vector3f acumPos = new Vector3f(joint.getPosition()).add(rotatedPos); acumPos.mul(weight.getBias()); vertex.position.add(acumPos);
MD5Mesh.MD5Weight weight = weights.get(i); MD5JointInfo.MD5JointData joint = joints.get(weight.getJointIndex()); Vector3f rotatedPos = new Vector3f(weight.getPosition()).rotate(joint.getOrientation()); Vector3f acumPos = new Vector3f(joint.getPosition()).add(rotatedPos); acumPos.mul(weight.getBias()); vertex.position.add(acumPos);
MD5Mesh.MD5Weight weight = weights.get(i); MD5JointInfo.MD5JointData joint = joints.get(weight.getJointIndex()); Vector3f rotatedPos = new Vector3f(weight.getPosition()).rotate(joint.getOrientation()); Vector3f acumPos = new Vector3f(joint.getPosition()).add(rotatedPos); acumPos.mul(weight.getBias()); vertex.position.add(acumPos);
if (joint.getParentIndex() > -1) { Matrix4f parentMatrix = result.getLocalJointMatrices()[joint.getParentIndex()]; jointMat = new Matrix4f(parentMatrix).mul(jointMat);