Main repository of MikuMikuStudio
Revision | d09faa462946b5cfd0ab3688362a9e3665e3a78b (tree) |
---|---|
Time | 2003-09-09 23:13:10 |
Author | mojomonkey <mojomonkey@75d0...> |
Commiter | mojomonkey |
incorrect casting in returning of points.
latest jar and docs.
git-svn-id: http://jmonkeyengine.googlecode.com/svn/trunk@87 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
@@ -96,7 +96,7 @@ import org.lwjgl.opengl.Window; | ||
96 | 96 | * |
97 | 97 | * |
98 | 98 | * @author Mark Powell |
99 | - * @version $Id: Md3Model.java,v 1.9 2003-09-08 20:29:28 mojomonkey Exp $ | |
99 | + * @version $Id: Md3Model.java,v 1.10 2003-09-09 14:13:10 mojomonkey Exp $ | |
100 | 100 | */ |
101 | 101 | public class Md3Model implements Geometry { |
102 | 102 | /** |
@@ -367,7 +367,8 @@ public class Md3Model implements Geometry { | ||
367 | 367 | * @return the list of points. |
368 | 368 | */ |
369 | 369 | public Vector[] getPoints() { |
370 | - return (Vector[])points.toArray(); | |
370 | + Vector v[] = new Vector[points.size()]; | |
371 | + return (Vector[])points.toArray(v); | |
371 | 372 | } |
372 | 373 | |
373 | 374 | /** |
@@ -77,7 +77,7 @@ import org.lwjgl.opengl.GL; | ||
77 | 77 | * |
78 | 78 | * @author naj |
79 | 79 | * @author Mark Powell |
80 | - * @version $Id: MilkshapeModel.java,v 1.9 2003-09-08 20:29:27 mojomonkey Exp $ | |
80 | + * @version $Id: MilkshapeModel.java,v 1.10 2003-09-09 14:13:09 mojomonkey Exp $ | |
81 | 81 | */ |
82 | 82 | public class MilkshapeModel implements Model { |
83 | 83 |
@@ -507,7 +507,8 @@ public class MilkshapeModel implements Model { | ||
507 | 507 | } |
508 | 508 | |
509 | 509 | public Vector[] getPoints() { |
510 | - return (Vector[])points.toArray(); | |
510 | + Vector v[] = new Vector[points.size()]; | |
511 | + return (Vector[])points.toArray(v); | |
511 | 512 | } |
512 | 513 | |
513 | 514 | /** |
@@ -39,6 +39,7 @@ import org.lwjgl.opengl.Window; | ||
39 | 39 | import jme.AbstractGame; |
40 | 40 | import jme.controller.BaseFPSController; |
41 | 41 | import jme.entity.camera.Camera; |
42 | +import jme.geometry.bounding.BoundingSphere; | |
42 | 43 | import jme.geometry.hud.text.Font2D; |
43 | 44 | import jme.geometry.model.Model; |
44 | 45 | import jme.geometry.model.ms.MilkshapeModel; |
@@ -149,7 +150,12 @@ public class TestMilkshape extends AbstractGame { | ||
149 | 150 | */ |
150 | 151 | protected void initGame() { |
151 | 152 | model = new MilkshapeModel("data/model/msascii/run.txt",true); |
152 | - } | |
153 | + BoundingSphere bs = new BoundingSphere(); | |
154 | + bs.averagePoints(model.getPoints()); | |
155 | + System.out.println("num of points " + model.getPoints().length); | |
156 | + System.out.println("center " + bs.getCenter()); | |
157 | + System.out.println("radius " + bs.getRadius()); | |
158 | + } | |
153 | 159 | |
154 | 160 | /** |
155 | 161 | * Nothing here yet. |