Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (121)
games submitted by our members
Games in WIP (577)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  [ODEJAVA] TriMesh <-> TriMesh collisions  (Read 2006 times)
0 Members and 1 Guest are viewing this topic.
Offline kevglass

JGO Kernel


Medals: 188
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Posted 2004-11-19 13:44:28 »

Does this combination work at the moment?

Kev

Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #1 - Posted 2004-11-19 19:44:52 »

Not that I have seen in Odejava.  I believe it is working in ODE, but I have not really had my ear to the ground on this one as I do not need it (I just approximate my complex shapes using primitives which I find is quite accurate and fast).

If they can do it in ODE, then we can do it in Odejava basically.  I did update our ODE version very recently, so it may even work already (just nobody has tested it).  If we need to add any extra functions or whatever, please let me know.  If TriMesh<-->TriMesh is currently a patch for ODE, then the only requirement is that it can be added into our automated build proces (i.e. by using 'patch').

Will.

Offline kevglass

JGO Kernel


Medals: 188
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #2 - Posted 2004-11-20 06:54:42 »

Cheers for the quick response Will. I may have slightly misinformed here.

TriMesh <-> TriMesh collision works. Its just the physical response that doesn't seem to. In the engine thing I'm putting together primitive collision and response works fine (well, I think) but TriMesh response doesn't actually do anything.. i.e. the collisions are detected but the object falls straight through the other...

I'm not 100% why this could be happening. I imagine it gets pretty complicated with this sort of collision. Anyway... looking through the ODE user guide I'm wondering if we currently cope with this situation:

Quote

In order to efficiently resolve collisions, dCollideTTL needs the positions of the colliding trimeshes in the previous timestep. This is used to calculate an estimated velocity of each colliding triangle, which is used to find the direction of impact, contact normals, etc. This requires the user to update these variables at every timestep. This update is performed outside of ODE, so it is not included in ODE itself. The code to do this looks something like this:

1  
2  
3  
4  
5  
  const double *DoubleArrayPtr =
    Bodies[BodyIndex].TransformationMatrix->GetArray();
  dGeomTriMeshDataSet( TriMeshData,
    TRIMESH_LAST_TRANSFORMATION,
    (void *) DoubleArrayPtr );


The transformation matrix is the standard 4x4 homogeneous transform matrix, and the "DoubleArray" is the standard flattened array of the 16 matrix values.


If not this might explain why the response doesn't happen as expected since ODE can't caculate velocities for the trimesh?

Thanks again for the swift response,

Kev

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #3 - Posted 2004-11-22 06:54:54 »

Sorry this responce wasn't quite so swift - had a big weekend.

That code isn't in odejava which could explain your problem.

The dGeomTriMeshDataSet function isn't exposed.  I can add this to the interface file so it is included next time the natives are rebuilt.

Is that all you need?

1  
2  
   const double *DoubleArrayPtr =
    Bodies[BodyIndex].TransformationMatrix->GetArray();


I can't see a get transform matrix method in the API docs.  I guess we could simply create our own using dGeomGetPosition and dGeomGetRotation.

Will.

Offline kevglass

JGO Kernel


Medals: 188
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #4 - Posted 2004-11-22 07:14:01 »

That'd be useful, just to see apart from anything else if TriMesh collision actually works.

I'm suprised the GetArray() method isn't there, the quote was from the ODE user guide which I'd assumed would be correct Wink

I'd guess that if the function doesn't exist then maybe the documentation is out of date and this might not be the problem? Might be time to check with the ODE folks direct...

Hope all these queries arn't too annoying, been meaning to have a play with ODE for ages and it suddenly seems I have time.

Kev

Offline kevglass

JGO Kernel


Medals: 188
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #5 - Posted 2004-11-22 08:49:02 »

PS: Is there a nightly build that can be picked up publically?

DarkProphet over at JME forums isn't seeing any of these issues, wondered if maybe he'd built his own release or something and these issues have automagically disappeared.

Kev

Offline darkprophet

Senior Duke




Go Go Gadget Arms


« Reply #6 - Posted 2004-11-22 11:44:31 »

Quote

DarkProphet over at JME forums isn't seeing any of these issues, wondered if maybe he'd built his own release or something and these issues have automagically disappeared.


Nope i haven't built anything, im using the latest ODE release.

What im doing however is when it comes to trimeshes is apporximating them according to their BoundingVolumes. Then i let the user decide (using jME triangle accurate collision detection) whether they should carry on with the response or cancel the contact.

However, having said that. Static triangle collision detection seems to work fine Smiley.

Ie. Terrain <> Sphere; that works fine. Also Terrain <> Box works fine also.

DP

Friends don't let friends make MMORPGs.

Blog | Volatile-Engine
Offline kevglass

JGO Kernel


Medals: 188
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #7 - Posted 2004-11-22 12:16:18 »

Ah yes, but the physical response on collision of trimeshes isn't working. The detection of the collision works ok but the bounce (or whatever) doesn't.

Out of interest, which way have you got gravity?

Kev

Offline darkprophet

Senior Duke




Go Go Gadget Arms


« Reply #8 - Posted 2004-11-22 12:18:20 »

-9.81 (sweden apparently have it as -9.82!)

But hold on, why is Sphere <> TriMesh working then?

DP

Friends don't let friends make MMORPGs.

Blog | Volatile-Engine
Offline kevglass

JGO Kernel


Medals: 188
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #9 - Posted 2004-11-22 13:31:34 »

Na, I meant are you using z or y for gravity influence?

Kev

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline darkprophet

Senior Duke




Go Go Gadget Arms


« Reply #10 - Posted 2004-11-22 13:50:29 »

y to influence...sorry, i didn't understand what you meant.. Embarrassed

DP

Friends don't let friends make MMORPGs.

Blog | Volatile-Engine
Offline kevglass

JGO Kernel


Medals: 188
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #11 - Posted 2004-11-26 05:16:58 »

Quote

The dGeomTriMeshDataSet function isn't exposed.  I can add this to the interface file so it is included next time the natives are rebuilt.

Is that all you need?


That'd be great.. I think with this we could have moving trimesh collisions which I'd quite like Wink

Kev

Pages: [1]
  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.

theagentd (16 views)
2014-10-25 15:46:29

Longarmx (52 views)
2014-10-17 03:59:02

Norakomi (45 views)
2014-10-16 15:22:06

Norakomi (34 views)
2014-10-16 15:20:20

lcass (39 views)
2014-10-15 16:18:58

TehJavaDev (68 views)
2014-10-14 00:39:48

TehJavaDev (68 views)
2014-10-14 00:35:47

TehJavaDev (60 views)
2014-10-14 00:32:37

BurntPizza (74 views)
2014-10-11 23:24:42

BurntPizza (45 views)
2014-10-11 23:10:45
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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
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!