From d6448dd112faec223af2a74fed6cb5c6235d8a43 Mon Sep 17 00:00:00 2001 From: "sha..RD" Date: Mon, 28 Jan 2013 02:29:49 +0000 Subject: [PATCH] * 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 --- engine/src/core/com/jme3/scene/Mesh.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/engine/src/core/com/jme3/scene/Mesh.java b/engine/src/core/com/jme3/scene/Mesh.java index 12654b0f2..d8e6162c0 100644 --- a/engine/src/core/com/jme3/scene/Mesh.java +++ b/engine/src/core/com/jme3/scene/Mesh.java @@ -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);