- >libandroidgl20.so\r
- >libgdx.so\r
-> desktop-dependencies.jar\r
- -> gdx-0.21sources.jar\r
- -> gdx-0.21.jar\r
+ -> gdx-0.3-sources.jar\r
+ -> gdx-0.3.jar\r
-> gdx.dll\r
-> libgdx.so\r
-> README\r
-> armeabi/\r
-> libandroidgl20.so\r
-> libgdx.so\r
- -> gdx-0.21.jar\r
- -> gdx-0.21-sources.jar\r
+ -> gdx-0.3.jar\r
+ -> gdx-0.3-sources.jar\r
-> gdx.dll\r
-> desktop-dependencies.jar\r
-> libgdx.so\r
-> default.properties\r
\r
Go to the properties of the Android project and select "Java Build Path" again. Add the gdx-helloworld \r
-project in the project tab and the gdx-0.11.jar in the Libraries tab. You don't have to add the other\r
+project in the project tab and the gdx-0.3.jar in the Libraries tab. You don't have to add the other\r
jars as those are only needed for the desktop Java version. \r
\r
Now open the GDXHelloWorld.java file and paste the following code in:\r
*/\r
public final class Vector2 \r
{\r
+ /** static temporary vector **/\r
+ private final static Vector2 tmp = new Vector2();\r
+ \r
/** the x-component of this vector **/\r
public float x;\r
/** the y-component of this vector **/\r
* @param y The y-component of the other vector\r
* @return This vector for chaining\r
*/\r
- public Vector3 sub(float x, float y) \r
+ public Vector2 sub(float x, float y) \r
{\r
this.x -= x;\r
this.y -= y;\r
- return null;\r
+ return this;\r
+ }\r
+ \r
+ /** \r
+ * @return a temporary copy of this vector. Use with care as this is backed by a single static Vector2 instance. v1.tmp().add( v2.tmp() ) will not work!\r
+ */\r
+ public Vector2 tmp( )\r
+ {\r
+ return tmp.set(this);\r
}\r
}\r