* Mesh.cloneForAnim() now clones tangent buffer as well
* Fix javadoc in Mesh.cloneForAnim(), the position/normal/tangent buffers are cloned git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8878 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
a1d73d159d
commit
58d26b5ebe
@ -260,7 +260,7 @@ public class Mesh implements Savable, Cloneable {
|
|||||||
* Clone the mesh for animation use.
|
* Clone the mesh for animation use.
|
||||||
* This creates a shallow clone of the mesh, sharing most
|
* This creates a shallow clone of the mesh, sharing most
|
||||||
* of the {@link VertexBuffer vertex buffer} data, however the
|
* of the {@link VertexBuffer vertex buffer} data, however the
|
||||||
* {@link Type#BindPosePosition} and {@link Type#BindPoseNormal} buffers
|
* {@link Type#Position}, {@link Type#Normal}, and {@link Type#Tangent} buffers
|
||||||
* are deeply cloned.
|
* are deeply cloned.
|
||||||
*
|
*
|
||||||
* @return A clone of the mesh for animation use.
|
* @return A clone of the mesh for animation use.
|
||||||
@ -269,6 +269,7 @@ public class Mesh implements Savable, Cloneable {
|
|||||||
Mesh clone = clone();
|
Mesh clone = clone();
|
||||||
if (getBuffer(Type.BindPosePosition) != null){
|
if (getBuffer(Type.BindPosePosition) != null){
|
||||||
VertexBuffer oldPos = getBuffer(Type.Position);
|
VertexBuffer oldPos = getBuffer(Type.Position);
|
||||||
|
|
||||||
// NOTE: creates deep clone
|
// NOTE: creates deep clone
|
||||||
VertexBuffer newPos = oldPos.clone();
|
VertexBuffer newPos = oldPos.clone();
|
||||||
clone.clearBuffer(Type.Position);
|
clone.clearBuffer(Type.Position);
|
||||||
@ -279,6 +280,13 @@ public class Mesh implements Savable, Cloneable {
|
|||||||
VertexBuffer newNorm = oldNorm.clone();
|
VertexBuffer newNorm = oldNorm.clone();
|
||||||
clone.clearBuffer(Type.Normal);
|
clone.clearBuffer(Type.Normal);
|
||||||
clone.setBuffer(newNorm);
|
clone.setBuffer(newNorm);
|
||||||
|
|
||||||
|
if (getBuffer(Type.BindPoseTangent) != null){
|
||||||
|
VertexBuffer oldTang = getBuffer(Type.Tangent);
|
||||||
|
VertexBuffer newTang = oldTang.clone();
|
||||||
|
clone.clearBuffer(Type.Tangent);
|
||||||
|
clone.setBuffer(newTang);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return clone;
|
return clone;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user