Merge meshes in animated models by finding ones that maintain the same
relative position throughout all animations. Also, don't include transforms in the animations for nodes that never move. git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@218 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -30,6 +30,8 @@ import java.nio.IntBuffer;
|
||||
|
||||
import org.lwjgl.opengl.ARBShaderObjects;
|
||||
|
||||
import com.jme.math.Matrix4f;
|
||||
import com.jme.math.Quaternion;
|
||||
import com.jme.math.Vector3f;
|
||||
import com.jme.scene.Controller;
|
||||
import com.jme.scene.state.GLSLShaderObjectsState;
|
||||
@@ -111,6 +113,31 @@ public class JmeUtil
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a matrix to the transform defined by the given translation,
|
||||
* rotation, and scale values.
|
||||
*/
|
||||
public static Matrix4f setTransform (
|
||||
Vector3f translation, Quaternion rotation, Vector3f scale, Matrix4f result)
|
||||
{
|
||||
result.setRotationQuaternion(rotation);
|
||||
result.setTranslation(translation);
|
||||
|
||||
result.m00 *= scale.x;
|
||||
result.m01 *= scale.y;
|
||||
result.m02 *= scale.z;
|
||||
|
||||
result.m10 *= scale.x;
|
||||
result.m11 *= scale.y;
|
||||
result.m12 *= scale.z;
|
||||
|
||||
result.m20 *= scale.x;
|
||||
result.m21 *= scale.y;
|
||||
result.m22 *= scale.z;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempts to parse a string containing an axis: either "x", "y", or "z", or three
|
||||
* comma-delimited values representing an axis vector. The value returned may be one of
|
||||
|
||||
Reference in New Issue
Block a user