* Ensure bind pose format and num components matches base buffer. Fixes crash when batching model with 3D tangents

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10219 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
sha..RD 2013-01-28 02:29:49 +00:00
parent 3de0e580b8
commit d6448dd112

View File

@ -312,8 +312,8 @@ public class Mesh implements Savable, Cloneable {
VertexBuffer bindPos = new VertexBuffer(Type.BindPosePosition);
bindPos.setupData(Usage.CpuOnly,
3,
Format.Float,
pos.getNumComponents(),
pos.getFormat(),
BufferUtils.clone(pos.getData()));
setBuffer(bindPos);
@ -325,8 +325,8 @@ public class Mesh implements Savable, Cloneable {
if (norm != null) {
VertexBuffer bindNorm = new VertexBuffer(Type.BindPoseNormal);
bindNorm.setupData(Usage.CpuOnly,
3,
Format.Float,
norm.getNumComponents(),
norm.getFormat(),
BufferUtils.clone(norm.getData()));
setBuffer(bindNorm);
norm.setUsage(Usage.Stream);
@ -336,8 +336,8 @@ public class Mesh implements Savable, Cloneable {
if (tangents != null) {
VertexBuffer bindTangents = new VertexBuffer(Type.BindPoseTangent);
bindTangents.setupData(Usage.CpuOnly,
4,
Format.Float,
tangents.getNumComponents(),
tangents.getFormat(),
BufferUtils.clone(tangents.getData()));
setBuffer(bindTangents);
tangents.setUsage(Usage.Stream);