Main repository of MikuMikuStudio
修订版 | d737a67d69a0311d4f9f7b1575ffa0ec40b11b05 (tree) |
---|---|
时间 | 2013-06-07 03:11:27 |
作者 | ZeroSeparation@gmail.com <ZeroSeparation@gmai...> |
Commiter | ZeroSeparation@gmail.com |
Fixed a bug where attempting to collide with an empty mesh (0 vertices) would throw an exception rather than returning 0 results.
git-svn-id: http://jmonkeyengine.googlecode.com/svn/trunk@10643 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
@@ -896,6 +896,10 @@ public class Mesh implements Savable, Cloneable { | ||
896 | 896 | BoundingVolume worldBound, |
897 | 897 | CollisionResults results){ |
898 | 898 | |
899 | + if (getVertexCount() == 0) { | |
900 | + return 0; | |
901 | + } | |
902 | + | |
899 | 903 | if (collisionTree == null){ |
900 | 904 | createCollisionData(); |
901 | 905 | } |