Main repository of MikuMikuStudio
Révision | 551dea7e675447776117347eaa425a5ab3978475 (tree) |
---|---|
l'heure | 2003-09-04 03:05:36 |
Auteur | mojomonkey <mojomonkey@75d0...> |
Commiter | mojomonkey |
Removed Vector3f and replaced with Vector
git-svn-id: http://jmonkeyengine.googlecode.com/svn/trunk@75 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
@@ -48,7 +48,7 @@ import org.lwjgl.input.Mouse; | ||
48 | 48 | * <code>EntityController</code>. |
49 | 49 | * |
50 | 50 | * @author Mark Powell |
51 | - * @version 0.1.0 | |
51 | + * @version $Id: AbstractGameController.java,v 1.3 2003-09-03 18:05:36 mojomonkey Exp $ | |
52 | 52 | */ |
53 | 53 | public abstract class AbstractGameController |
54 | 54 | implements KeyboardController, MouseController, EntityController { |
@@ -187,7 +187,7 @@ public abstract class AbstractGameController | ||
187 | 187 | } |
188 | 188 | |
189 | 189 | /** |
190 | - * @see jme.controller.EntityController#setEntityPosition(Vector3f) | |
190 | + * @see jme.controller.EntityController#setEntityPosition(Vector) | |
191 | 191 | */ |
192 | 192 | public void setEntityPosition(Vector position) { |
193 | 193 | entity.setPosition(position); |
@@ -32,7 +32,7 @@ | ||
32 | 32 | |
33 | 33 | package jme.entity.effects; |
34 | 34 | |
35 | -import org.lwjgl.vector.Vector3f; | |
35 | +import jme.math.Vector; | |
36 | 36 | |
37 | 37 | /** |
38 | 38 | * <code>Particle</code> represents a single particle that is part of a larger |
@@ -42,7 +42,7 @@ import org.lwjgl.vector.Vector3f; | ||
42 | 42 | * |
43 | 43 | * |
44 | 44 | * @author Mark Powell |
45 | - * @version 1 | |
45 | + * @version $Id: Particle.java,v 1.2 2003-09-03 18:05:36 mojomonkey Exp $ | |
46 | 46 | */ |
47 | 47 | public class Particle { |
48 | 48 |
@@ -60,29 +60,29 @@ public class Particle { | ||
60 | 60 | /** |
61 | 61 | * the color of the particle in RGB format. |
62 | 62 | */ |
63 | - public Vector3f color; | |
63 | + public Vector color; | |
64 | 64 | /** |
65 | 65 | * the location in 3D space of the particle. |
66 | 66 | */ |
67 | - public Vector3f position; | |
67 | + public Vector position; | |
68 | 68 | /** |
69 | 69 | * the direction the particle is traveling in. |
70 | 70 | */ |
71 | - public Vector3f velocity; | |
71 | + public Vector velocity; | |
72 | 72 | /** |
73 | 73 | * the size of the particle. |
74 | 74 | */ |
75 | - public Vector3f size; | |
75 | + public Vector size; | |
76 | 76 | |
77 | 77 | /** |
78 | 78 | * Constructor instantiates a new <code>Particle</code> and |
79 | 79 | * initializes all the variables. |
80 | 80 | */ |
81 | 81 | public Particle() { |
82 | - color = new Vector3f(); | |
83 | - position = new Vector3f(); | |
84 | - velocity = new Vector3f(); | |
85 | - size = new Vector3f(); | |
82 | + color = new Vector(); | |
83 | + position = new Vector(); | |
84 | + velocity = new Vector(); | |
85 | + size = new Vector(); | |
86 | 86 | } |
87 | 87 | |
88 | 88 | public String toString() { |
@@ -37,8 +37,8 @@ import java.nio.ByteOrder; | ||
37 | 37 | import java.nio.FloatBuffer; |
38 | 38 | |
39 | 39 | import org.lwjgl.opengl.GL; |
40 | -import org.lwjgl.vector.Vector3f; | |
41 | 40 | |
41 | +import jme.math.Vector; | |
42 | 42 | import jme.texture.TextureManager; |
43 | 43 | |
44 | 44 | /** |
@@ -59,7 +59,7 @@ import jme.texture.TextureManager; | ||
59 | 59 | * the desired direction. This adds realism to the particle emitter. |
60 | 60 | * |
61 | 61 | * @author Mark Powell |
62 | - * @version 1 | |
62 | + * @version $Id: ParticleEmitter.java,v 1.3 2003-09-03 18:05:36 mojomonkey Exp $ | |
63 | 63 | */ |
64 | 64 | public class ParticleEmitter { |
65 | 65 |
@@ -71,8 +71,8 @@ public class ParticleEmitter { | ||
71 | 71 | private int texId; |
72 | 72 | |
73 | 73 | //attributes for positional updates. |
74 | - private Vector3f gravity; | |
75 | - private Vector3f position; | |
74 | + private Vector gravity; | |
75 | + private Vector position; | |
76 | 76 | private float speed; |
77 | 77 | private float friction; |
78 | 78 |
@@ -80,10 +80,10 @@ public class ParticleEmitter { | ||
80 | 80 | private float fade; |
81 | 81 | |
82 | 82 | //attribute for the particles appearance. |
83 | - private Vector3f startSize; | |
84 | - private Vector3f endSize; | |
85 | - private Vector3f startColor; | |
86 | - private Vector3f endColor; | |
83 | + private Vector startSize; | |
84 | + private Vector endSize; | |
85 | + private Vector startColor; | |
86 | + private Vector endColor; | |
87 | 87 | |
88 | 88 | private boolean isLooping = false; |
89 | 89 | private boolean isFirst = true; |
@@ -94,9 +94,9 @@ public class ParticleEmitter { | ||
94 | 94 | //objects attributes than create a new one. |
95 | 95 | private float[] matrix; |
96 | 96 | private FloatBuffer buf; |
97 | - private Vector3f right; | |
98 | - private Vector3f up; | |
99 | - private Vector3f billboard; | |
97 | + private Vector right; | |
98 | + private Vector up; | |
99 | + private Vector billboard; | |
100 | 100 | |
101 | 101 | /** |
102 | 102 | * Constructor instantiates a new <code>ParticleEmitter</code> |
@@ -110,12 +110,12 @@ public class ParticleEmitter { | ||
110 | 110 | this.numParticles = numParticles; |
111 | 111 | particles = new Particle[numParticles]; |
112 | 112 | |
113 | - startSize = new Vector3f(); | |
114 | - endSize = new Vector3f(); | |
115 | - startColor = new Vector3f(); | |
116 | - endColor = new Vector3f(); | |
117 | - gravity = new Vector3f(); | |
118 | - position = new Vector3f(); | |
113 | + startSize = new Vector(); | |
114 | + endSize = new Vector(); | |
115 | + startColor = new Vector(); | |
116 | + endColor = new Vector(); | |
117 | + gravity = new Vector(); | |
118 | + position = new Vector(); | |
119 | 119 | speed = 1.0f; |
120 | 120 | matrix = new float[16]; |
121 | 121 | buf = |
@@ -123,9 +123,9 @@ public class ParticleEmitter { | ||
123 | 123 | .allocateDirect(16 * 4) |
124 | 124 | .order(ByteOrder.nativeOrder()) |
125 | 125 | .asFloatBuffer(); |
126 | - right = new Vector3f(); | |
127 | - up = new Vector3f(); | |
128 | - billboard = new Vector3f(); | |
126 | + right = new Vector(); | |
127 | + up = new Vector(); | |
128 | + billboard = new Vector(); | |
129 | 129 | |
130 | 130 | for (int i = 0; i < numParticles; i++) { |
131 | 131 | particles[i] = new Particle(); |
@@ -312,7 +312,7 @@ public class ParticleEmitter { | ||
312 | 312 | * start color. |
313 | 313 | * @param endColor the final color of the particle. |
314 | 314 | */ |
315 | - public void setEndColor(Vector3f endColor) { | |
315 | + public void setEndColor(Vector endColor) { | |
316 | 316 | this.endColor = endColor; |
317 | 317 | } |
318 | 318 |
@@ -322,7 +322,7 @@ public class ParticleEmitter { | ||
322 | 322 | * start size. |
323 | 323 | * @param endSize the final size of the particle. |
324 | 324 | */ |
325 | - public void setEndSize(Vector3f endSize) { | |
325 | + public void setEndSize(Vector endSize) { | |
326 | 326 | this.endSize = endSize; |
327 | 327 | } |
328 | 328 |
@@ -332,7 +332,7 @@ public class ParticleEmitter { | ||
332 | 332 | * the direction of the particles velocity. |
333 | 333 | * @param gravity the forces that will be acting on the particle. |
334 | 334 | */ |
335 | - public void setGravity(Vector3f gravity) { | |
335 | + public void setGravity(Vector gravity) { | |
336 | 336 | this.gravity = gravity; |
337 | 337 | } |
338 | 338 |
@@ -342,7 +342,7 @@ public class ParticleEmitter { | ||
342 | 342 | * color. |
343 | 343 | * @param startColor the starting color of the particles. |
344 | 344 | */ |
345 | - public void setStartColor(Vector3f startColor) { | |
345 | + public void setStartColor(Vector startColor) { | |
346 | 346 | this.startColor = startColor; |
347 | 347 | } |
348 | 348 |
@@ -351,7 +351,7 @@ public class ParticleEmitter { | ||
351 | 351 | * particle. This size is interpolated with the final size. |
352 | 352 | * @param startSize the starting size of the particles. |
353 | 353 | */ |
354 | - public void setStartSize(Vector3f startSize) { | |
354 | + public void setStartSize(Vector startSize) { | |
355 | 355 | this.startSize = startSize; |
356 | 356 | } |
357 | 357 |
@@ -372,7 +372,7 @@ public class ParticleEmitter { | ||
372 | 372 | * generated. |
373 | 373 | * @param position |
374 | 374 | */ |
375 | - public void setPosition(Vector3f position) { | |
375 | + public void setPosition(Vector position) { | |
376 | 376 | this.position = position; |
377 | 377 | } |
378 | 378 |
@@ -35,27 +35,27 @@ package jme.entity.effects; | ||
35 | 35 | import java.util.ArrayList; |
36 | 36 | |
37 | 37 | import org.lwjgl.opengl.GL; |
38 | -import org.lwjgl.vector.Vector3f; | |
39 | 38 | |
40 | 39 | import jme.entity.EntityInterface; |
41 | 40 | import jme.entity.camera.Frustum; |
42 | 41 | import jme.geometry.bounding.BoundingVolume; |
42 | +import jme.math.Vector; | |
43 | 43 | |
44 | 44 | /** |
45 | 45 | * <code>ParticleSystem</code> maintains a collection of |
46 | 46 | * particle emitters. |
47 | 47 | * |
48 | 48 | * @author Mark Powell |
49 | - * @version $Id: ParticleSystem.java,v 1.4 2003-09-03 16:20:52 mojomonkey Exp $ | |
49 | + * @version $Id: ParticleSystem.java,v 1.5 2003-09-03 18:05:36 mojomonkey Exp $ | |
50 | 50 | */ |
51 | 51 | public class ParticleSystem implements EntityInterface { |
52 | 52 | private ArrayList emitters; |
53 | - private Vector3f position; | |
53 | + private Vector position; | |
54 | 54 | private BoundingVolume boundingVolume; |
55 | 55 | |
56 | 56 | public ParticleSystem() { |
57 | 57 | emitters = new ArrayList(); |
58 | - position = new Vector3f(); | |
58 | + position = new Vector(); | |
59 | 59 | } |
60 | 60 | |
61 | 61 | /* (non-Javadoc) |
@@ -90,7 +90,7 @@ public class ParticleSystem implements EntityInterface { | ||
90 | 90 | emitters.add(emitter); |
91 | 91 | } |
92 | 92 | |
93 | - public void setPosition(Vector3f position) { | |
93 | + public void setPosition(Vector position) { | |
94 | 94 | this.position = position; |
95 | 95 | } |
96 | 96 |
@@ -33,7 +33,7 @@ package jme.geometry.hud; | ||
33 | 33 | |
34 | 34 | import java.util.ArrayList; |
35 | 35 | |
36 | -import org.lwjgl.vector.Vector3f; | |
36 | +import jme.math.Vector; | |
37 | 37 | |
38 | 38 | /** |
39 | 39 | * <code>AbstractComponent</code> defines a base level of implementation of the |
@@ -47,7 +47,7 @@ public abstract class AbstractComponent implements Component { | ||
47 | 47 | protected int locationY; |
48 | 48 | protected float height; |
49 | 49 | protected float width; |
50 | - protected Vector3f color = new Vector3f(1,1,1); | |
50 | + protected Vector color = new Vector(1,1,1); | |
51 | 51 | protected float alpha; |
52 | 52 | |
53 | 53 | protected ArrayList children = new ArrayList(); |
@@ -31,15 +31,16 @@ | ||
31 | 31 | */ |
32 | 32 | package jme.geometry.model; |
33 | 33 | |
34 | -import org.lwjgl.vector.Vector3f; | |
34 | +import jme.math.Vector; | |
35 | + | |
35 | 36 | |
36 | 37 | /** |
37 | - * <code>Vertex</code> provides an extension to <code>Vector3f</code> to handle | |
38 | + * <code>Vertex</code> provides an extension to <code>Vector</code> to handle | |
38 | 39 | * texture coordinates as well as positions. |
39 | 40 | * |
40 | 41 | * @author Mark Powell |
41 | 42 | */ |
42 | -public class Vertex extends Vector3f { | |
43 | +public class Vertex extends Vector { | |
43 | 44 | public byte refCount; |
44 | 45 | |
45 | 46 | public byte flags; |
@@ -43,7 +43,7 @@ import org.lwjgl.opengl.GL; | ||
43 | 43 | /** |
44 | 44 | * <code>Quad</code> handles the rendering of a single quad shape. This |
45 | 45 | * quad shape is defined by four points and maintained in an array of |
46 | - * four <code>Vector3f</code> values. The ordering of the array is important | |
46 | + * four <code>Vector</code> values. The ordering of the array is important | |
47 | 47 | * as each index represents a corner of the quad. |
48 | 48 | * |
49 | 49 | * <br><br> |
@@ -53,7 +53,7 @@ import org.lwjgl.opengl.GL; | ||
53 | 53 | * 3 - BottomLeft<br> |
54 | 54 | * |
55 | 55 | * @author Mark Powell |
56 | - * @version $Id: Quad.java,v 1.5 2003-09-03 16:20:51 mojomonkey Exp $ | |
56 | + * @version $Id: Quad.java,v 1.6 2003-09-03 18:05:36 mojomonkey Exp $ | |
57 | 57 | */ |
58 | 58 | public class Quad extends Primitive { |
59 | 59 | private GL gl; |
@@ -33,8 +33,8 @@ | ||
33 | 33 | package jme.lighting; |
34 | 34 | |
35 | 35 | import jme.exception.MonkeyRuntimeException; |
36 | +import jme.math.Vector; | |
36 | 37 | |
37 | -import org.lwjgl.vector.Vector3f; | |
38 | 38 | |
39 | 39 | /** |
40 | 40 | * <code>AbstractLightMap</code> manages a data structure that contains |
@@ -48,7 +48,7 @@ import org.lwjgl.vector.Vector3f; | ||
48 | 48 | * may be (1,1,1), but a Mars terrain would be something like (1,0.4,0.7). |
49 | 49 | * |
50 | 50 | * @author Mark Powell |
51 | - * @version 0.1.0 | |
51 | + * @version $Id: AbstractLightMap.java,v 1.2 2003-09-03 18:05:36 mojomonkey Exp $ | |
52 | 52 | */ |
53 | 53 | public abstract class AbstractLightMap { |
54 | 54 |
@@ -60,7 +60,7 @@ public abstract class AbstractLightMap { | ||
60 | 60 | /** |
61 | 61 | * the vector that defines the color the light is casting. |
62 | 62 | */ |
63 | - protected Vector3f color; | |
63 | + protected Vector color; | |
64 | 64 | |
65 | 65 | /** |
66 | 66 | * <code>getShade</code> returns the shade value for the |
@@ -78,7 +78,7 @@ public abstract class AbstractLightMap { | ||
78 | 78 | * <code>getColor</code> returns the color vector of the lightmap. |
79 | 79 | * @return the color vector of the lightmap. |
80 | 80 | */ |
81 | - public Vector3f getColor() { | |
81 | + public Vector getColor() { | |
82 | 82 | return color; |
83 | 83 | } |
84 | 84 |
@@ -87,7 +87,7 @@ public abstract class AbstractLightMap { | ||
87 | 87 | * @param color the new color for the lightmap. |
88 | 88 | * @throws MonkeyRuntimeException if color is null. |
89 | 89 | */ |
90 | - public void setColor(Vector3f color) { | |
90 | + public void setColor(Vector color) { | |
91 | 91 | if(null == color) { |
92 | 92 | throw new MonkeyRuntimeException("Color cannot be null"); |
93 | 93 | } |
@@ -32,10 +32,10 @@ | ||
32 | 32 | |
33 | 33 | package jme.lighting; |
34 | 34 | |
35 | -import org.lwjgl.vector.Vector3f; | |
36 | 35 | |
37 | 36 | import jme.exception.MonkeyRuntimeException; |
38 | 37 | import jme.locale.external.data.AbstractHeightMap; |
38 | +import jme.math.Vector; | |
39 | 39 | |
40 | 40 | /** |
41 | 41 | * <code>SlopeLighting</code> creates a light map based on a given heightmap. |
@@ -46,7 +46,7 @@ import jme.locale.external.data.AbstractHeightMap; | ||
46 | 46 | * can be combinations of 1 and -2. I.e. 1,1 1,-1 -1,-1 -1,1. |
47 | 47 | * |
48 | 48 | * @author Mark Powell |
49 | - * @version 0.1.0 | |
49 | + * @version $Id: SlopeLighting.java,v 1.3 2003-09-03 18:05:36 mojomonkey Exp $ | |
50 | 50 | */ |
51 | 51 | public class SlopeLighting extends AbstractLightMap { |
52 | 52 |
@@ -100,7 +100,7 @@ public class SlopeLighting extends AbstractLightMap { | ||
100 | 100 | this.softness = softness; |
101 | 101 | this.heightMap = heightMap; |
102 | 102 | |
103 | - color = new Vector3f(1.0f, 1.0f, 1.0f); | |
103 | + color = new Vector(1.0f, 1.0f, 1.0f); | |
104 | 104 | |
105 | 105 | createLighting(); |
106 | 106 | } |
@@ -35,11 +35,11 @@ package jme.locale; | ||
35 | 35 | import java.util.logging.Level; |
36 | 36 | |
37 | 37 | import jme.exception.MonkeyRuntimeException; |
38 | +import jme.math.Vector; | |
38 | 39 | import jme.texture.TextureManager; |
39 | 40 | import jme.utility.LoggingSystem; |
40 | 41 | |
41 | 42 | import org.lwjgl.opengl.GL; |
42 | -import org.lwjgl.vector.Vector3f; | |
43 | 43 | |
44 | 44 | /** |
45 | 45 | * <code>SimpleLocale</code> defines a simple Locale. This locale is a single |
@@ -55,7 +55,7 @@ import org.lwjgl.vector.Vector3f; | ||
55 | 55 | public class SimpleLocale implements Locale { |
56 | 56 | |
57 | 57 | //Coordinates of locale. |
58 | - private Vector3f center; | |
58 | + private Vector center; | |
59 | 59 | private float halfLength; |
60 | 60 | |
61 | 61 | //material properties of the locale. |
@@ -77,7 +77,7 @@ public class SimpleLocale implements Locale { | ||
77 | 77 | * @throws MonkeyRuntimeException if center is null or length is less than |
78 | 78 | * or equal to zero. |
79 | 79 | */ |
80 | - public SimpleLocale(Vector3f center, float length) { | |
80 | + public SimpleLocale(Vector center, float length) { | |
81 | 81 | |
82 | 82 | if (null == center || length <= 0) { |
83 | 83 | throw new MonkeyRuntimeException( |
@@ -166,7 +166,7 @@ public class SimpleLocale implements Locale { | ||
166 | 166 | * <code>getCenter</code> returns the center of the locale. |
167 | 167 | * @return the center of the locale. |
168 | 168 | */ |
169 | - public Vector3f getCenter() { | |
169 | + public Vector getCenter() { | |
170 | 170 | return center; |
171 | 171 | } |
172 | 172 |
@@ -182,7 +182,7 @@ public class SimpleLocale implements Locale { | ||
182 | 182 | * <code>setCenter</code> sets the center of the locale. |
183 | 183 | * @param center the new center of the locale. |
184 | 184 | */ |
185 | - public void setCenter(Vector3f center) { | |
185 | + public void setCenter(Vector center) { | |
186 | 186 | this.center = center; |
187 | 187 | } |
188 | 188 |
@@ -32,15 +32,16 @@ | ||
32 | 32 | package test.general; |
33 | 33 | |
34 | 34 | |
35 | + | |
35 | 36 | import org.lwjgl.Display; |
36 | 37 | import org.lwjgl.opengl.GL; |
37 | 38 | import org.lwjgl.opengl.GLU; |
38 | 39 | import org.lwjgl.opengl.Window; |
39 | -import org.lwjgl.vector.Vector3f; | |
40 | 40 | |
41 | 41 | import jme.AbstractGame; |
42 | 42 | import jme.entity.effects.ParticleEmitter; |
43 | 43 | import jme.entity.effects.ParticleSystem; |
44 | +import jme.math.Vector; | |
44 | 45 | import jme.system.DisplaySystem; |
45 | 46 | import jme.utility.Timer; |
46 | 47 |
@@ -87,20 +88,20 @@ public class TestParticleSystem extends AbstractGame { | ||
87 | 88 | timer = Timer.getTimer(); |
88 | 89 | |
89 | 90 | ParticleEmitter pe = new ParticleEmitter(1000); |
90 | - pe.setStartColor(new Vector3f(1.0f,1.0f,1.0f)); | |
91 | - pe.setEndColor(new Vector3f(1.0f,1.0f,1.0f)); | |
92 | - pe.setStartSize(new Vector3f(0.25f,1.0f,0.25f)); | |
93 | - pe.setEndSize(new Vector3f(0.25f,1.0f,0.25f)); | |
91 | + pe.setStartColor(new Vector(1.0f,1.0f,1.0f)); | |
92 | + pe.setEndColor(new Vector(1.0f,1.0f,1.0f)); | |
93 | + pe.setStartSize(new Vector(0.25f,1.0f,0.25f)); | |
94 | + pe.setEndSize(new Vector(0.25f,1.0f,0.25f)); | |
94 | 95 | pe.setFade(0.01f); |
95 | 96 | pe.setSpeed(1); |
96 | - pe.setGravity(new Vector3f(0.0f,-100.0f,10.0f)); | |
97 | + pe.setGravity(new Vector(0.0f,-100.0f,10.0f)); | |
97 | 98 | pe.setFriction(1); |
98 | 99 | pe.setTexture("data/texture/star.png"); |
99 | 100 | pe.loopAnimation(true); |
100 | 101 | |
101 | 102 | ps = new ParticleSystem(); |
102 | 103 | ps.addEmitter(pe); |
103 | - ps.setPosition(new Vector3f(0,100,-10)); | |
104 | + ps.setPosition(new Vector(0,100,-10)); | |
104 | 105 | } |
105 | 106 | |
106 | 107 | protected void reinit() { |