Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (115)
games submitted by our members
Games in WIP (562)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 2 3 [4] 5 6 ... 8
  ignore  |  Print  
  Pure Java Port of ODE - planning/feasibility  (Read 42069 times)
0 Members and 1 Guest are viewing this topic.
Offline arne

Senior Member




money is the worst drug- we should not let it rule


« Reply #90 - Posted 2005-10-13 23:04:25 »

The hanging moss algorithm can be extended to 3D to greatly reduce the amount of geometry you have to search through for a collision. Similar to a progressive refinement on an octree collision detection method.
heck! I used that hanging moss algorithm (even if extended it a bit) for that contest work and I didn't know it  Shocked Add a Tree above it (in our case a octtree), and it will also work very well for not evenly distributed points. (The hanging moss has a worst case of O(n*n) 1, but with a tree above, it should only have O(n log n) as a worst case) - @Darkprophet: Ofcourse only if the objects don't move too fast. If things start to move fast you'll always get O(n*n) no matter what - see below.
Quote

Quote
I already mentioned a LinkedSpace, where every Object knows it's neighbors (with whom it might collide). If implemented correctly it could get O(n).
Dont think that would work arne. Imagine a high speed moving thing over lots of little boxes (the boxes being the terrain). The moving thing would have to recalculate its list everytime it updates because its moving. Which again boils down to an O(n*n) solution (or the 3d hanging moss). Unless I understood you wrong?
Ok it will be O(n*n) if all objects move fast (that's independent of the datastructure, cos it could collide with any, so I can't ignore any objects to test (which is the only performance boost))  and seem to be everywhere, but that's (should be) very rare. Normally objects keep their position more or less. And then it would be O(n) ! Maybe if we add a speed factor, (O(n*speed). List copying wouldn't take that long, because the object simply has to ask it's neighbors for their neighbors. Wink

Arne

Edit: 1 Maybe it's not exactly O(n*n), even if the worst case for finding the closest of one object might be O(n), but then the others can't have O(n) ... so it's probably better - or there is only a factor... doesn't matter...

:: JOODE :: Xith3d :: OdeJava ::
Offline darkprophet

Senior Member




Go Go Gadget Arms


« Reply #91 - Posted 2005-10-14 10:20:59 »

Heh, just thought of another scenario for your LinkedSpace. Slow moving spaceship along a plane full of boxes over a long time. This is the same as moving fast in a short time.

From my understanding, the Hanging Moss algorithm divides the world into n number of boxes with t occupants. The t's are linked together and to find the neighbour, you find which box it is in first, then loop through the LinkedList to see which is its closest neighbour. Similar to hanging moss through a guass filter Smiley

What im thinking at the moment is a scenegraph heirarchy with the heirarchy being dynamically sorted on distance. I'l let you know how that goes...

DP

Friends don't let friends make MMORPGs.

Blog | Volatile-Engine
Offline Amos Wenger

Senior Member




Everything's possible, but not everything's fun...


« Reply #92 - Posted 2005-10-14 11:31:46 »

Quote
Quote
Can have a Body multiple GeomS ?
Doesn't ODE/Odejava already have that? Compound objects? IIRC, its even covered in the ode docs...
Yes I know, but it's not because it is in ODEJava that we can implement it simply.

Quote
BlueSky, you still haven't told me the difference between the integrators. I can't find it anywhere on the internet...

D{
Hmm.. I don't know exactly, but the one Newton Dynamics pretend to use seems to be more stable.
I think it's a stuff regarding steps. The bigger steps you have, the bigger error you have. Integrators are stable when they detect collisions between steps, for example (IMHO)

"Once you start working on something, don't be afraid of failure and don't abandon it. People who work sincerely are the happiest"
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline t_larkworthy

Senior Member


Medals: 1
Projects: 1


Google App Engine Rocks!


« Reply #93 - Posted 2005-10-14 12:05:57 »

Going back to basics which is essential to this port. I have found that ODE stores its Matrix3 as a a 3 by 4 matrix. This means there is no Vecmath equivelant. It also is very difficult to translate the ODE matrix multiplications as is with type checking on vecmath classes. Look at this:-
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
/*
 * set a 3x3 submatrix of A to a matrix such that submatrix(A)*b = a x b.
 * A is stored by rows, and has `skip' elements per row. the matrix is
 * assumed to be already zero, so this does not write zero elements!
 * if (plus,minus) is (+,-) then a positive version will be written.
 * if (plus,minus) is (-,+) then a negative version will be written.
 */


#define dCROSSMAT(A,a,skip,plus,minus) \
do { \
  (A)[1] = minus (a)[2]; \
  (A)[2] = plus (a)[1]; \
  (A)[(skip)+0] = plus (a)[2]; \
  (A)[(skip)+2] = minus (a)[0]; \
  (A)[2*(skip)+0] = minus (a)[1]; \
  (A)[2*(skip)+1] = plus (a)[0]; \
} while(0)


This function is used all over ODE. It is very difficult to translate nicely unless we use exactly the same underlying array structure of floats to store our matrix data. I think therfore we are gonna need our own custom matrix and possible vector datatypes. To make it easy for the user to still use the API then I suggest we supply adapters to our custom classes.

Runesketch: an Online CCG built on Google App Engine where players draw their cards and trade. Fight, draw or trade yourself to success.
Offline arne

Senior Member




money is the worst drug- we should not let it rule


« Reply #94 - Posted 2005-10-14 13:34:18 »

Going back to basics which is essential to this port. I have found that ODE stores its Matrix3 as a a 3 by 4 matrix. This means there is no Vecmath equivelant. It also is very difficult to translate the ODE matrix multiplications as is with type checking on vecmath classes. Look at this:-
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
/*
 * set a 3x3 submatrix of A to a matrix such that submatrix(A)*b = a x b.
 * A is stored by rows, and has `skip' elements per row. the matrix is
 * assumed to be already zero, so this does not write zero elements!
 * if (plus,minus) is (+,-) then a positive version will be written.
 * if (plus,minus) is (-,+) then a negative version will be written.
 */


#define dCROSSMAT(A,a,skip,plus,minus) \
do { \
  (A)[1] = minus (a)[2]; \
  (A)[2] = plus (a)[1]; \
  (A)[(skip)+0] = plus (a)[2]; \
  (A)[(skip)+2] = minus (a)[0]; \
  (A)[2*(skip)+0] = minus (a)[1]; \
  (A)[2*(skip)+1] = plus (a)[0]; \
} while(0)

Holy crap !! I don't understand that code, it looks so crude. Where is it located?
Quote
This function is used all over ODE. It is very difficult to translate nicely unless we use exactly the same underlying array structure of floats to store our matrix data. I think therfore we are gonna need our own custom matrix and possible vector datatypes. To make it easy for the user to still use the API then I suggest we supply adapters to our custom classes.
Yep it seems to be a very crude hack. We'd better at least get a basic idea of how and why that works (at least I don't have any idea) But, yes - if it gains performance, we could use it, but I think it's not an argument to say: "it's used everywhere, so we'll use it also". If we use this method, we should put it into a nice OO-Design.
And what's so difficult to change dCROSSMAT(A,a,skip,plus,minus) to A.crossmat(a,skip,plus,minus)  Err... plus, minus are that Arrays or Functions (I believe in C you were able to have Functions as Parameters) Huh

:: JOODE :: Xith3d :: OdeJava ::
Offline t_larkworthy

Senior Member


Medals: 1
Projects: 1


Google App Engine Rocks!


« Reply #95 - Posted 2005-10-14 15:22:30 »

Well the code itself is just for matrix multiplication, with a hack to make it go in different directions (I beleive thats what inverting the +,- means but I might be wrong)
The difficultiy of porting it though into a typed system where each matrix dimention is its onwn type is that this system more or less can handle the general case of an nxm matrix being mutiplies by a mxq sized matrix. This is not actually possible in the vecmath library.
Since posting I am getting screwed over even more by the way they manipulate the pointers. If you rememebr than in ODE matrices are really pointers to arrays of floats, then look at this function (again with no vecmath equivalent):-
Quote
int dFactorCholesky (dReal *A, int n)
{
  int i,j,k,nskip;
  dReal sum,*a,*b,*aa,*bb,*cc,*recip;
  dAASSERT (n > 0 && A);
  nskip = dPAD (n);
  recip = (dReal*) ALLOCA (n * sizeof(dReal));
  aa = A;
  for (i=0; i<n; i++) {
    bb = A;
    cc = A + i*nskip;
    for (j=0; j<i; j++) {
      sum = *cc;
      a = aa;
      b = bb;
      for (k=j; k; k--) sum -= (*(a++))*(*(b++));
      *cc = sum * recip[j];
      bb += nskip;
      cc++;
    }
    sum = *cc;
    a = aa;
    for (k=i; k; k--, a++) sum -= (*a)*(*a);
    if (sum <= REAL(0.0)) return 0;
    *cc = dSqrt(sum);
    recip = dRecip (*cc);
    aa += nskip;
  }
  return 1;
}


the tricky like is dReal sum,*a,*b,*aa,*bb,*cc,*recip;
meaning sum is jsut storing a float. The others are pointign to floats so in a way are acting as indexes.
thought the actualy memory storage is done to recip. So recip is being used differently to a,b,aa,bb and cc.

Its actually ok to unravle this one. But only becuase I am storing matrices and vectors as arrays of floats now. In vecmath each slot in a matrix is a distinct attribute, the only way to incremenet things is via the getElement(x,y) kind of way. As you can imagine I would have to introduce counters etc. and convert from the single dimentioned scale ODE uses to a 2D scale like the onyl way Vecmath ones can be handled. Not pretty and it would make the job 100x harder.

Hohum. No worries though. I seem to be able to translate this stuff at a reasonable pace. Our project should up for voting today.

Runesketch: an Online CCG built on Google App Engine where players draw their cards and trade. Fight, draw or trade yourself to success.
Offline arne

Senior Member




money is the worst drug- we should not let it rule


« Reply #96 - Posted 2005-10-14 16:09:29 »

Maybe we should really make our own Matrix class that supports nxm Matrices with any n and m. Then we wouldn't also need extra Vector classes, because a Vector is then simply a 1xn Matrix.
I axtually also don't really like vecmath, espacially with the distinction between points and Vectors.

:: JOODE :: Xith3d :: OdeJava ::
Offline arne

Senior Member




money is the worst drug- we should not let it rule


« Reply #97 - Posted 2005-10-14 20:38:20 »

Hrmpf. Shouldn't it be in the voting section by now?

:: JOODE :: Xith3d :: OdeJava ::
Offline t_larkworthy

Senior Member


Medals: 1
Projects: 1


Google App Engine Rocks!


« Reply #98 - Posted 2005-10-14 21:52:33 »

Yeah I know. I will post directly to it 2morrow if it is not up. I emailed them last Sat and again this morning. The actual project space has been setup on the server so everything has been done.

Runesketch: an Online CCG built on Google App Engine where players draw their cards and trade. Fight, draw or trade yourself to success.
Offline t_larkworthy

Senior Member


Medals: 1
Projects: 1


Google App Engine Rocks!


« Reply #99 - Posted 2005-10-15 21:08:53 »

OK. I have taken matters into my own hands. I sent an email a week last Thurs,  the Sat after (and setup the actual project on the Sat) and yesterday(Fri)  without the project proposal boards being affected.

POST YOUR VOTES EVERYONE!

http://192.18.37.44/forums/index.php?topic=11131.0

Runesketch: an Online CCG built on Google App Engine where players draw their cards and trade. Fight, draw or trade yourself to success.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline kitfox

Junior Member




Java games rock!


« Reply #100 - Posted 2005-10-19 09:19:39 »

How has the project creation gone?  It looks like you're well over the 3 votes needed.  What is a URL where we'll be able to find the JOODE source tree?  What requirements woudl there be to be able to contribute?
Offline t_larkworthy

Senior Member


Medals: 1
Projects: 1


Google App Engine Rocks!


« Reply #101 - Posted 2005-10-19 12:22:16 »

I think Jeff must be AWOL or something. He has not replied to my initial emails, nor reacted to me posting into the forum directly. There is a minimum period of 5 days of voting anyhow before we are given status.
The project home will be
joode.dev.java.net

If you want to contribute porting code, then you can just commit to the project. If you want to do some funky cutting edge stuff then wait until we get the code running.

Runesketch: an Online CCG built on Google App Engine where players draw their cards and trade. Fight, draw or trade yourself to success.
Offline t_larkworthy

Senior Member


Medals: 1
Projects: 1


Google App Engine Rocks!


« Reply #102 - Posted 2005-10-20 16:06:12 »

I really don't get this project application proccess. I setup a project on java.net a while ago and it said waiting for moderation. I could still browse it and do things. Since then it has been deleted without any warning. I have just re-set it up again.
I have also commited all the source I have been working on this time so the administrators won't think it is empty.  The voting process seems to be going nowhere as well.

Runesketch: an Online CCG built on Google App Engine where players draw their cards and trade. Fight, draw or trade yourself to success.
Offline darkprophet

Senior Member




Go Go Gadget Arms


« Reply #103 - Posted 2005-10-20 16:31:33 »

sourceforge.net? Tongue

Friends don't let friends make MMORPGs.

Blog | Volatile-Engine
Offline t_larkworthy

Senior Member


Medals: 1
Projects: 1


Google App Engine Rocks!


« Reply #104 - Posted 2005-10-20 17:25:12 »

Quote
sourceforge.net? Tongue
I think we should give it a bit longer. But I don' want to wait another whole week, I want help!

I have managed a fair bit of code so far. I think I have coded the stepIsland method which is a beastie, but I have not testing framework in place yet so I don't know if any code actually works. I think the next method is the final big one .. the LCP algorithm and then I think the prototype system will essentially be in place. I have coded the model data structures (Mass, Body, Space, Geom, Joint, etc.) and the simplest forms of each (SimpleSpace, Sphere, actually no joints). I have then tried to code the actualy workings of ODE, I think I have the collision system translated, but the dynamics are harder. I have started on the outside and workied inwards, doing StepIsland and now onto LCP. The LCP algorithm quite nicely has some nice test methods so maybe I will be able to test that code.

Testing is gonna be a real issue I feel. I was thinking maybe a good idea would be to use ODE class in ODEJava to test some of the functionality. But ODEJava only exposes the highest level of ODE functionality, it won't probably won't be helpful in fixing bugs. You can use it to be sure something works. But actually fixing it will still be hard.

I am away this weekend so if the project appears there might be a little delay before everyone gets their rights.

Runesketch: an Online CCG built on Google App Engine where players draw their cards and trade. Fight, draw or trade yourself to success.
Offline darkprophet

Senior Member




Go Go Gadget Arms


« Reply #105 - Posted 2005-10-20 18:13:04 »

The only thing that is left to establish is how closely are you going to follow ODE...What I mean by that questions is what are you going to do when ODE adds a new feature (like convex hull collision), are you going to port their code to java?

Or are you going to get what ODE has now and just work from there regardless of what ODE does?

DP

Friends don't let friends make MMORPGs.

Blog | Volatile-Engine
Offline arne

Senior Member




money is the worst drug- we should not let it rule


« Reply #106 - Posted 2005-10-23 09:33:38 »

Another Week went by - and still nothing!  Angry Maybe we should really switch to sourceforge !

@t_larkworthy: have you got the PM I send you?

:: JOODE :: Xith3d :: OdeJava ::
Offline arne

Senior Member




money is the worst drug- we should not let it rule


« Reply #107 - Posted 2005-10-23 09:36:40 »

The only thing that is left to establish is how closely are you going to follow ODE...What I mean by that questions is what are you going to do when ODE adds a new feature (like convex hull collision), are you going to port their code to java?

Or are you going to get what ODE has now and just work from there regardless of what ODE does?

DP

I'd say, it depends on how easy it is to port the new feature. But maybe it would be wise to keep in step with ODE, so ODEJava code using ODE can easily be switched to JOODE.

Arne

:: JOODE :: Xith3d :: OdeJava ::
Offline t_larkworthy

Senior Member


Medals: 1
Projects: 1


Google App Engine Rocks!


« Reply #108 - Posted 2005-10-23 21:24:42 »

OK everyone. I think things are beginning to happen on the proejct formation front. I have had some emails and things, so hopefully we shall be rolling soon.
Yes Arne I got your PM. I have just been away for the weekend.

Quote
The only thing that is left to establish is how closely are you going to follow ODE...What I mean by that questions is what are you going to do when ODE adds a new feature (like convex hull collision), are you going to port their code to java?

Myeah, I think it would not  be hard to add new features as they come out for ODE, but only bother if they really add something. I think we should be trying to develop our own solutions to deficits in ODE. I really want a nice collision system for example, and I don't want to wait for ODE to develop it.   

Runesketch: an Online CCG built on Google App Engine where players draw their cards and trade. Fight, draw or trade yourself to success.
Offline t_larkworthy

Senior Member


Medals: 1
Projects: 1


Google App Engine Rocks!


« Reply #109 - Posted 2005-10-23 21:35:49 »

OK I have had some requests from prospective developers for a copy of the sources I have done so far.
here is a link to them:-
http://homepages.inf.ed.ac.uk/s0570397/joode-src.tar.gz
Please realise though that these are not stable in anyway yet and it would probably not be a good idea to try and develop from them.

Runesketch: an Online CCG built on Google App Engine where players draw their cards and trade. Fight, draw or trade yourself to success.
Offline kitfox

Junior Member




Java games rock!


« Reply #110 - Posted 2005-10-24 12:21:06 »

This has been a long time trying to get the dev.java.net account set up.  I've set up several myself, and while it does take a few days, this is a particularly long wait.

Browing to joode.dev.java.net, it looks like a project has been created for you, but you might still need to log in and set it up before others can access it. 

There are help forums for administering dev.java.net, and I've found that the folks who read these boards are often administrators who can pull strings behind the scenes.  Try posting to the boards below and see if this helps get the JOODE site set up quickly:

https://java-net.dev.java.net/servlets/ProjectForumView

Mark McKay
Offline kitfox

Junior Member




Java games rock!


« Reply #111 - Posted 2005-10-24 12:26:54 »

Just had a quick look at the source archive you posted.  While I've not had time to look though it in detail, I did notice that the root package was joode.  Could I suggest it be changed to net.java.dev.joode, or something similar to keep the package naming convention?

Mark McKay
Offline t_larkworthy

Senior Member


Medals: 1
Projects: 1


Google App Engine Rocks!


« Reply #112 - Posted 2005-10-24 14:41:32 »

Quote
Could I suggest it be changed to net.java.dev.joode
yes. It shall be done

Runesketch: an Online CCG built on Google App Engine where players draw their cards and trade. Fight, draw or trade yourself to success.
Offline arne

Senior Member




money is the worst drug- we should not let it rule


« Reply #113 - Posted 2005-10-25 19:48:29 »

Nice work - I wasn't able to look at all the code yet - or better: to understand the code.

I looked at the Matrix representations in joode.util and I really like how it's done - Vector, Matrix and Quat all extending Real, but to make the design better and the code more readable I'd suggest to make Real to save a 2-dimensional array and not a simple array (I believe they had to do this, because C only supports one-dimensional Arrays - correct me if I'm wrong).

A better structure would be even:

                         Real   <--- Quaternion
                           A
                            |
                        Matrix
                        A     A   
                      /            \
                   /                  \
SymmetricMatrix       Vector
    A             A                 A      A
     |              |                   |        |
Matrix3 Matrix4  Vector3 Vector4

(The A's are arrowheads)

The function in MathUtil could then be moved into the according class. We want be able to have an extra class for all diferent kinds of matrices, so Matrix represents a nxm matrix. In Matrix there should be a method to multiply two matrices, because this might not always work - we should in the cases, when this doesn't work throw an exception. A method canMultiply would then be also nice.

Optimisations of linear equatation-system can get solved with the Simplex algorithm, where you specify the linear equatation system inside a matrix. Because we might have to do such calculations - we could also add such a method to our Matrix class.
We could then hehe Wink linear optimise a translation matrix  Cheesy - I don't know what kind of crude hack would require this, but it's a funny thought. Grin

Arne

:: JOODE :: Xith3d :: OdeJava ::
Offline t_larkworthy

Senior Member


Medals: 1
Projects: 1


Google App Engine Rocks!


« Reply #114 - Posted 2005-10-25 23:33:33 »

Yeah. It would be nice to extend the matrix into 2D, but I did it this way becuase all of the math functions in ODE do really clever/hacky stuff using the faact they are stored in one dimention. I don't understand half the math functions but if they are stored in joode the same way I do not need to, I can just translate the way ODE skipps around the indexes in joode as well.

I have hit a bit of a brick way trying to port the LCP algorithm but I have a new stratergy. For the functions that do loads with pointers I have introduced the PointerToReal class. This stores the underlying Real and an index. When ODE code increments a pointer I can simply add to the index of the joode version. When ODE assigns one pointer to another I can then just copy the array reference across the pointers and set the index. I think this is the easiest way. The LCP algorithm is a monster to translate though, so it may take me a while. 

Runesketch: an Online CCG built on Google App Engine where players draw their cards and trade. Fight, draw or trade yourself to success.
Offline arne

Senior Member




money is the worst drug- we should not let it rule


« Reply #115 - Posted 2005-10-26 14:21:26 »

Yeah. It would be nice to extend the matrix into 2D, but I did it this way becuase all of the math functions in ODE do really clever/hacky stuff using the faact they are stored in one dimention. I don't understand half the math functions but if they are stored in joode the same way I do not need to, I can just translate the way ODE skipps around the indexes in joode as well.
ok - but we could have a function like get(int x, int y) that automatically translates into the correct position in the linear array. And then we could add a function get(int n) that returns the value of the n'th position of the data array. Then we won't have to have the data array to be public and then we could still change it afterwards to a 2*2 matrix, if we like.
Quote
I have hit a bit of a brick way trying to port the LCP algorithm but I have a new stratergy. For the functions that do loads with pointers I have introduced the PointerToReal class. This stores the underlying Real and an index. When ODE code increments a pointer I can simply add to the index of the joode version. When ODE assigns one pointer to another I can then just copy the array reference across the pointers and set the index. I think this is the easiest way. The LCP algorithm is a monster to translate though, so it may take me a while. 

To add stuff to pointers makes only sense, if you're dealing with arrays - and there we've got the indices, so it should be no problem, we could simply increase the index (a pointer would then be a simple int). I don't understand your PointerToReal class, simply use my suggested get(int n).

Arne

:: JOODE :: Xith3d :: OdeJava ::
Offline arne

Senior Member




money is the worst drug- we should not let it rule


« Reply #116 - Posted 2005-10-26 18:38:30 »

mmh I believe I know now why they use all those skip variables... they don't specify the width in Real, so they always have to specify it in the function call. I believe now they misuse this, to save loads of matrices in their Real objects. (That's why there are starting points... but hmm sometimes such is missing .. maybe I'm wrong) Even if it gains a bit of performance we should not code JOODE like that, because
1. you can't read it
2. you can't find errors that easily anymore.
3. you don't know what the function does and how it does that.

Ok I know that'll be much harder than just porting it, but this design is so hacky and crude - we really should try to make it into nice code starting with joode.util, so we'll know how to call the functions. It'll make further porting and improving of the code easier, so it'll be worth the effort.

Functions defined in MathUtil (I only printed those that weren't more or less represented by other functions):
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
dDotpq(Real a,Real b,int s1, int s2, int p,int q); // -> Real ?
dCROSSpqr(Real a, Operator op,Real b,Real c, int p, int q, int r); // -> Real ?
dCROSSMAT(Real A,Real a,int skip,Operator plus,Operator minus); -> Real ?
dDISTANCE (Real a, Real b); // this is easy -> Vector
dMULTIPLYOP0_331(Real A,Operator op,Real B,Real C, int as, int bs, int cs); // what kind of matrix multiplication is this??
dNormalize4 (Real a); // -> Vector, Quat
dMultiply0 (dReal *A, const dReal *B, const dReal *C, int p, int q, int r); // why are there 3 different types of multiply?
dFactorCholesky (dReal A, int n); // what is FactorCholesky???
dSolveCholesky (const dReal *L, dReal *b, int n);
dInvertPDMatrix (const dReal *A, dReal *Ainv, int n);
dPAD(int a); // what's this?
dIsPositiveDefinite (Real A, int n);
dVectorScale (dReal *a, const dReal *d, int n) // -> Vector
dSolveLDLT (const dReal *L, const dReal *d, dReal *b, int n, int nskip) // what's this?
dLDLTAddTL (dReal *L, dReal *d, const dReal *a, int n, int nskip)
dLDLTRemove (dReal **A, const int *p, dReal *L, dReal *d, int n1, int n2, int r, int nskip)
dRemoveRowCol (dReal *A, int n, int nskip, int r)  // -> Real
dRFromAxisAndAngle (dMatrix3 R, dReal ax, dReal ay, dReal az, dReal angle) // -> Matrix3, Matrix4
dRFromEulerAngles (dMatrix3 R, dReal phi, dReal theta, dReal psi) // -> Matrix3, Matrix4
dRFrom2Axes (dMatrix3 R, dReal ax, dReal ay, dReal az, dReal bx, dReal by, dReal bz) // -> Matrix3, Matrix4
dRFromZAxis (dMatrix3 R, dReal ax, dReal ay, dReal az) -> Matrix3,Matrix4
dQSetIdentity (dQuaternion q) // -> Quaternion
dQFromAxisAndAngle (dQuaternion q, dReal ax, dReal ay, dReal az, dReal angle) // -> Quaternion
dRfromQ (Matrix3 R, Quaternion q) // -> Matrix3
dQfromR (dQuaternion q, const dMatrix3 R) // -> Quaternion
dDQfromW (Real dq, Vector3 w, Quaternion q) // -> Quaternion
Multiply2_p8r (Real A, Real B, Real C, int p, int r, int Askip, int as, int bs, int cs) // -> Matrix ? -> Real?


I wrote behind most of these methods, where it should belong to (i.e. -> Matrix3). Sometimes I didn't really know what the function does, so I've put a comment (i.e. what's this?). This way we should be able to sort all these functions into their according classes pretty easily. The porting shouldn't go harder then, because you'll only have to make e.g. dRfromQ(Matrix3 R, Quaternion q) to Matrix3.set(Quaternion q).

:: JOODE :: Xith3d :: OdeJava ::
Offline t_larkworthy

Senior Member


Medals: 1
Projects: 1


Google App Engine Rocks!


« Reply #117 - Posted 2005-10-27 17:15:50 »

oh sorry
Quote
dMULTIPLYOP0_331(Real A,Operator op,Real B,Real C, int as, int bs, int cs); // what kind of matrix multiplication is this??

is something I added. Noramlly in ODE there is the function
dMULTIPLYOP0_331((Real A,Operator op,Real B,Real C)

However quite often code in ODE will call this function like
dMULTIPLYOP0_331(a +3, ....) meaning they increment the pointer a by 3 indexes before passing it to the function. This cannot be done in java where our dReals are arrays in a Real object. So in joode I have have coded it so that you pass the array in, and also a starting index (so the last 3 ints are the indexes to start indexing the arrays contained in the first 3 Real objects).

This seemed like the easist way to do it when I first started coding. I am beginning to think that this way of changing a pointer into an array and index is confusing when there are alot of pointers around. I am thinking that pointers should be encapsulated as a datatype of their own for joode. It would make converting some code alot easier.



Runesketch: an Online CCG built on Google App Engine where players draw their cards and trade. Fight, draw or trade yourself to success.
Offline arne

Senior Member




money is the worst drug- we should not let it rule


« Reply #118 - Posted 2005-10-27 17:34:16 »

ok, but that actually doesn't answer my question Wink
When I think about matrix multiplication I think, that's Matrix A = B*C (if the function writes the result into A). So where comes there an operator in  and what sense does it make to start multiplying at i.e. m22 in the matrix? Or is the Type Real really used as something like a list of Matrices, Vectors... ?

:: JOODE :: Xith3d :: OdeJava ::
Offline t_larkworthy

Senior Member


Medals: 1
Projects: 1


Google App Engine Rocks!


« Reply #119 - Posted 2005-10-27 21:43:30 »

The operator parameter allows the users to say instead of multiply the result of B and C and putting into A (by passing in * as the operator) they can also say multiply B and C and add it to the existing result in A (by putting += as the operator). Its fairly horrific. I have had to code alternative methods for each operator usage.
As for skipping stuff, yeah they do that alot. For some reason eclipse has just bust on me so I cant find where abouts they do this. But yeah, they do all kinds of weird stuff with the pointers. I know the LCP algorithm holds various of its intermediate results in massive dReal arrays. Also in the LCP algorith it uses the notion of Jacobian matrices which are 3x6 matrices, and I have no idea how they work.


 

Runesketch: an Online CCG built on Google App Engine where players draw their cards and trade. Fight, draw or trade yourself to success.
Pages: 1 2 3 [4] 5 6 ... 8
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

BurntPizza (28 views)
2014-09-21 02:42:18

BurntPizza (18 views)
2014-09-21 01:30:30

moogie (20 views)
2014-09-21 00:26:15

UprightPath (27 views)
2014-09-20 20:14:06

BurntPizza (29 views)
2014-09-19 03:14:18

Dwinin (46 views)
2014-09-12 09:08:26

Norakomi (74 views)
2014-09-10 13:57:51

TehJavaDev (102 views)
2014-09-10 06:39:09

Tekkerue (50 views)
2014-09-09 02:24:56

mitcheeb (71 views)
2014-09-08 06:06:29
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!