Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

added missing SetMaxLength wrapper for b2RopeJoint #76

Merged
merged 1 commit into from

3 participants

@ttencate

After some tinkering, I managed to build this by running the "gdx" project from Eclipse choosing GdxBuild for the main class, then running "ant -DbuildNatives=true". It appears to work, even!

@badlogic
Owner

Awesome, all hail you (and gdx-jnigen for making it sorta easy :p),

@badlogic badlogic merged commit b5c5096 into from
@badlogic
Owner

Note to self, need to compile binaries for Mac.

@ttencate

Holy macaroni you're fast! Looking forward to the nightlies... although it works, I don't trust my own build that much :)

@robertmassaioli

@ttencate Hi there. It's a small development world. You committed to libgdx too. :D Hello from Xmonad Config days: http://robertmassaioli.wordpress.com/2010/04/15/extending-xmonad-for-dvorak/#comment-26

I have a new theory. All of the good developers group together and all work on the same codebases. :+1:

@badlogic
Owner

If i learn Haskell, can i be in that group as well? I only know SML :(

@robertmassaioli

@badlogic You wrote libgdx. You are already in that group. :)

Ninja Edit: But sure! Learn Haskell too! Haskell is awesome.

@badlogic
Owner

You are mistaken, let me melt your eyes with my greatest achievment https://github.com/libgdx/libgdx/blob/master/backends/gdx-backends-gwt/src/com/badlogic/gwtref/gen/ReflectionCacheSourceCreator.java

I'll learn me a Haskell and repent.

@robertmassaioli

@badlogic Lol. That is awesome in an omg, he is building code in code using strings kinda way. Well it passes the ultimate test, it works, even if it is stringly-typed.

@ttencate

If only libgdx had existed (or did I just not know about it?) back when I first dabbled in Android development, I might actually have finished a commercial release and my life might have been much different. But a lot has happened in the last two years, and now I'm giving this another shot in my spare time. I have a few more things that I need which might fit as utility classes into libgdx:

@badlogic Don't be ashamed of bad code if none of the alternatives are better. And I'm sure it gets the job done... whatever job that may be ;) Meh, maybe I should've pinged you when you were in London. Better luck next time I guess :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 17, 2012
  1. @ttencate
This page is out of date. Refresh to see the latest.
View
11 gdx/jni/com.badlogic.gdx.physics.box2d.joints.RopeJoint.cpp
@@ -14,3 +14,14 @@
}
+JNIEXPORT jfloat JNICALL Java_com_badlogic_gdx_physics_box2d_joints_RopeJoint_jniSetMaxLength(JNIEnv* env, jobject object, jlong addr, jfloat length) {
+
+
+//@line:51
+
+ b2RopeJoint* rope = (b2RopeJoint*)addr;
+ rope->SetMaxLength(length);
+
+
+}
+
View
8 gdx/jni/com.badlogic.gdx.physics.box2d.joints.RopeJoint.h
@@ -15,6 +15,14 @@ extern "C" {
JNIEXPORT jfloat JNICALL Java_com_badlogic_gdx_physics_box2d_joints_RopeJoint_jniGetMaxLength
(JNIEnv *, jobject, jlong);
+/*
+ * Class: com_badlogic_gdx_physics_box2d_joints_RopeJoint
+ * Method: jniSetMaxLength
+ * Signature: (JF)F
+ */
+JNIEXPORT jfloat JNICALL Java_com_badlogic_gdx_physics_box2d_joints_RopeJoint_jniSetMaxLength
+ (JNIEnv *, jobject, jlong, jfloat);
+
#ifdef __cplusplus
}
#endif
View
12 gdx/src/com/badlogic/gdx/physics/box2d/joints/RopeJoint.java
@@ -42,4 +42,14 @@ public float getMaxLength () {
b2RopeJoint* rope = (b2RopeJoint*)addr;
return rope->GetMaxLength();
*/
-}
+
+ /** Set the maximum length of the rope. */
+ public void setMaxLength (float length) {
+ jniSetMaxLength(addr, length);
+ }
+
+ private native float jniSetMaxLength (long addr, float length); /*
+ b2RopeJoint* rope = (b2RopeJoint*)addr;
+ rope->SetMaxLength(length);
+ */
+}
Something went wrong with that request. Please try again.