Show Posts
|
|
Pages: [1]
|
|
1
|
Game Development / Game Mechanics / Orientation in other Bodies Reference Frame
|
on: 2006-08-17 17:50:01
|
Hi, i feel like this is a simple question, but nevertheless I got stuck somehow. I have a bunch of bodies connected with joints. What I need to do is, I want to build the transformation matrix for body A in respect to body B. As far as I know, ODE only returns rotation and position in the *global* reference frame. So it's easy to get the global orientation of A and B. But what do I need to do to get the 'relative' orientation of A in respect to B? If I take the three transformation matricies T(G<A) (should mean, transformation from A to Global) , T(G<B) and T(A<B) if found out that: T(G<B) = T(G<A) T(A<B) (from: http://www.kwon3d.com/theory/transform/transform.html) Is it correct to compute T(A<B) as: T(A<B) = T(G<A)^-1 T(G<B) Are there other ways to find out the relative orientation of two bodies ? Any help would be very much appreciated, greetings, Marcus
|
|
|
|
|
3
|
Game Development / Game Mechanics / Re: VM crash in Joint.setParam(...)
|
on: 2005-04-07 17:57:19
|
|
Oh, now it suddenly works again. Thats strange, I have repeated the test two times bevor I wrote here - it was reliably crashing without hte casting??? Now it works - again. Doesn't make any sense to me... I think there must evetually be passed somthing illegal (or maby null) into the method? Now it's gone, but I will now include a != null check, just to be on the save side. Thanks guys!
|
|
|
|
|
5
|
Game Development / Game Mechanics / VM crash in Joint.setParam(...)
|
on: 2005-04-07 15:35:27
|
|
Hey folks, don't know wether this is a bug, but I get a VM crash when I cast my JointHinge to Joint and call setParam(x,y) on this. No crash is happening when I use the JointHinge reference in the same code. Is it not possible to set the parameters from a Joint reference ?
Greetings, Marcus
|
|
|
|
|
6
|
Game Development / Game Mechanics / How to render a GeomPlane
|
on: 2005-04-07 13:20:09
|
|
Greetings to all! I've got a bit of a "dummy" question: I would like to render the GeomPlane. The plane is defined by the for "plane equation" numbers. As probably most people, I would like to have a visible gound, so I had the idea to create a big quat array inside the rendering part which vertices intersect the defined plane. Unfortunately I 'mentally' got stuck in the 3d math stuff that is needed to calulate the 4 points in the plane. Does somebody have a simple idea how to calculate the plane vertices for rendering? Certainly most of you are using a visible ground, how do you visualize the ground? Is there another simple trick I could use?
Greetings, Marcus
|
|
|
|
|
7
|
Game Development / Game Mechanics / CappedCylinder Collision
|
on: 2005-03-30 08:58:54
|
|
Hi, I'm having some trouble with the GeomCappedCylinder. It looks like it doesn't like to be collided with anything. It completely ignores plane collisions and even worse: If it collides with for example a box, allmost everything in the collision space just dissapears. No Error message - nothing but a black canvas remains. (This is not a rendering issue, as the cyliders render fine as long as they do not collide with anything...) I have read quite a lot about the problmes with the 'uncapped' cylinder, but is the capped cylinder also buggy? Has anyone used this geom so far? I would like to build something like a multi jointed arm from CappedCylinders. Currently I use boxes and they work. But replacing them with ccylinders does not work. (I'm using ode 0.5 with javaode 0.2.4)
|
|
|
|
|
8
|
Game Development / Game Mechanics / Re: [odejava] How to use Body.getJoints()
|
on: 2005-03-02 10:02:35
|
|
Hi William,
<<In this case, probably the simplist way would be to forget about the ID altogether -- the less native stuff the better, and simply have a two protected method of Body which are used to record when that body gets attached and removed to/from a joint.>> I'm not shure what you mean, but as far as I understand I need to: 1. create the joint (of course attach it) 2. query it's ID with ... hmm, no method in the Joint class for this. How do I get the joint ID ? 3. When I somehow got the ID I put it into a hashtable (or whatever) to enable classes without reference to this joint to get it from the lookup table.
<<How urgent is this for you?>> Oh, I have created an ugly workaround. Basically I put the bodies joints into the "userObject" slot. I have created a supporting wrapper class for this, as I also need access to the joints angular motors. So I put a list of joints and AMotors into the wrapper and then call body.setUserData(wrapper). I don't like that very much, as it is, in a way, not type save and might also be easyly overwritten by other classes. It would be really nice to reflect the conceptual hierarcy via Joint[] Body.getJionts() and AMotor[] Joint.getMotors() -> By the way is it possible at all to put more than one motor in a joint ?
Ok, back to your question, it is not particular *urgent*, as im my case I would need to stick with the old workaround until I can also access the AMotors from a given Joint reference. But for me it feels like there is something like a (little) "gap" in the API.
Greetings, Marcus
|
|
|
|
|
9
|
Game Development / Game Mechanics / [odejava] How to use Body.getJoints()
|
on: 2005-02-22 11:02:00
|
|
Hello to all! I'm currently wondering how to use the Body.getJoints() function. I concluded from the documentation that it returns a java.util.List with Joints but actually it returns a list with SWIGTYPE_p_dJointID's. But I couldn't find any way to 'convert' this ID into a propper point reference? Is this a bug or is did I missunderstud something ?
Greetings, Marcus
|
|
|
|
|
10
|
Game Development / Game Mechanics / [odejava] compilation problems
|
on: 2004-10-21 18:59:29
|
|
Hello folks,
I have checked out a recent version of odejava from cvs and now trying to compile it. During compilation I get the following problems (using linux, gcc version 3.3.4 (Debian 1:3.3.4-13)):
[...] [creating libodejava.so] ../odejava/odejava_wrap.cxx: In function `void Java_org_odejava_ode_OdeJNI_dWorldSetAutoDisableAnguleThreshold(JNIEnv*, _jclass*, long long int, float)': ../odejava/odejava_wrap.cxx:4928: error: `dWorldSetAutoDisableAnguleThreshold' undeclared (first use this function) ../odejava/odejava_wrap.cxx:4928: error: (Each undeclared identifier is reported only once for each function it appears in.) ../odejava/odejava_wrap.cxx: In function `jfloat Java_org_odejava_ode_OdeJNI_dWorldGetAutoDisableAnguleThreshold(JNIEnv*, _jclass*, long long int)': ../odejava/odejava_wrap.cxx:4947: error: `dWorldGetAutoDisableAnguleThreshold' undeclared (first use this function) ../odejava/odejava_wrap.cxx: In function `jfloat Java_org_odejava_ode_OdeJNI_dWorldGetContactSurfaceLater(JNIEnv*, _jclass*, long long int)': ../odejava/odejava_wrap.cxx:5107: error: `dWorldGetContactSurfaceLater' undeclared (first use this function) ../odejava/odejava_wrap.cxx: In function `void Java_org_odejava_ode_OdeJNI_dBodySetAutoDisableAnguleThreshold(JNIEnv*, _jclass*, long long int, float)': ../odejava/odejava_wrap.cxx:6340: error: `dBodySetAutoDisableAnguleThreshold' undeclared (first use this function) ../odejava/odejava_wrap.cxx: In function `jfloat Java_org_odejava_ode_OdeJNI_dBodyGetAutoDisableAnguleThreshold(JNIEnv*, _jclass*, long long int)': ../odejava/odejava_wrap.cxx:6359: error: `dBodyGetAutoDisableAnguleThreshold' undeclared (first use this function) ../odejava/odejava_wrap.cxx: At top level: ../odejava/odejava.hpp:41: warning: `int surfaceMode' defined but not used ../odejava/odejava.hpp:42: warning: `float surfaceMu' defined but not used ../odejava/odejava.hpp:43: warning: `float surfaceMu2' defined but not used ../odejava/odejava.hpp:44: warning: `float surfaceBounce' defined but not used ../odejava/odejava.hpp:45: warning: `float surfaceBounceVel' defined but not used ../odejava/odejava.hpp:46: warning: `float surfaceMotion1' defined but not used ../odejava/odejava.hpp:47: warning: `float surfaceMotion2' defined but not used ../odejava/odejava.hpp:48: warning: `float surfaceSlip1' defined but not used ../odejava/odejava.hpp:49: warning: `float surfaceSlip2' defined but not used ../odejava/odejava.hpp:50: warning: `float surfaceSoftErp' defined but not used ../odejava/odejava.hpp:51: warning: `float surfaceSoftCfm' defined but not used ../odejava/odejava.cpp: In function `void Java_org_odejava_collision_PureJavaCollision_javaSpaceCollide2(JNIEnv*, _jobject*, long long int, long long int)': ../odejava/odejava.cpp:474: warning: cast to pointer from integer of different size ../odejava/odejava.cpp:474: warning: cast to pointer from integer of different size g++: ../odejava/odejava_wrap.o: No such file or directory -----------------------
In addition I wonder if it would be possible to add the log4j.jar into the library path (and update the ant build scripts), as the java compilation will not work without log4j. Currently you need to copy it into the JAVA_HOME/jre/lib/ext/ directory to run the build script.
|
|
|
|
|
11
|
Game Development / Game Mechanics / [odejava] collision of two connected bodies
|
on: 2004-10-20 10:20:00
|
|
Hello, I guess I'v got a newbie question. I currently performing some very basic tests with javaode. (I'm planning to use it in my masther thesis project.) I have created a world with a plane and two bodies connected with a hinge joint. Everything works really nice, so far, but I don't get collision detection for the two connected bodies working. I'm doing collision like in the javaode demo:
inside the "step" function it looks like this: collision.collide(odeSpace);
// Read & modify contact information iterateContacts();
// Add all contacts to contact jointGroup collision.applyContacts(); ------------------------
private void iterateContacts(){ int contactCount = collision.getContactCount(); Contact cList = contacts; for(int i=0; i< contactCount;i++){ cList.setIndex(i); cList.setMode(org.odejava.ode.Ode.dContactBounce | org.odejava.ode.Ode.dContactApprox1); cList.setBounce(0.1f); cList.setBounceVel(1f); cList.setMu(0.5f); } } --------------------
The bodies will collide with the plane, properly, but not with each other. Both bodies are simple boxes and reside in the same Space.
Could anyone tell we if there i need to take special actions to enable collision of connected bodies? Or is there something wrong with my setup? (If I remove the joint both bodies will collide propperly.)
I already tried to call collision2(boxID1,boxID2) in the "step" method, but this makes the jvm crash.
Greetings, Marcus
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|