Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3509 Members - Latest Member: lioneltenel

27. May 2012, 02:13:21 am
Xith3D CommunityGeneral CategorySupport (Moderator: Marvin Fröhlich)Add method setEnabled to Bodies and Colliables at XPal
Pages: [1]
Print
Author Topic: Add method setEnabled to Bodies and Colliables at XPal  (Read 1198 times)
sisso
Just dropped in

Offline Offline

Posts: 21


View Profile
« on: 19. November 2007, 07:44:33 pm »

hi all,

Could be added to XPal a method to enable/disable a Bodies and Colliables?

I have looked that add/removing from world or ColliableGroups cause some
stranger behaviors.

Thanks,
Sisso
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #1 on: 19. November 2007, 07:53:18 pm »

I'm not sure. It would have to be done in the JOODE/Odejava implementation, which is where my knowledge ends. Is there anybody, who know a bit more about JOODE/Odejava internals?

Marvin
Logged
sisso
Just dropped in

Offline Offline

Posts: 21


View Profile
« Reply #2 on: 19. November 2007, 10:38:19 pm »

I'm not sure. It would have to be done in the JOODE/Odejava implementation, which is where my knowledge ends. Is there anybody, who know a bit more about JOODE/Odejava internals?

Marvin

In the Odejava you can disable a geometry by changing the flags:
Code:
geom.gflags &= ~Geom.GEOM_ENABLED;

But i don't known if it really works Tongue and if there the same thing to bodies.

I will try to get a time to look this...

Thanks,
Sisso
Logged
sisso
Just dropped in

Offline Offline

Posts: 21


View Profile
« Reply #3 on: 26. November 2007, 01:24:15 pm »

I am back,

Ok, I said wrong, this is for joode.

Joode Collidable flag:
Code:
geom.gflags &= ~Geom.GEOM_ENABLED;

Joode Body flag:
Code:
body.flags & ~net.java.dev.joode.Body.dxBodyDisabled

I added a method setEnabled to Collidable and Body.
It is very easy to do in joode and it works.

For OdeJava there is a method "Body.setEnabled" and "Geom.setEnabled", I don't tried this but if the method exists It should work Tongue

Thanks,
Sisso
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #4 on: 26. November 2007, 01:39:45 pm »

Joode Collidable flag:
Code:
geom.gflags &= ~Geom.GEOM_ENABLED;

Joode Body flag:
Code:
body.flags & ~net.java.dev.joode.Body.dxBodyDisabled

I added a method setEnabled to Collidable and Body.
It is very easy to do in joode and it works.

OK, I will add this when I have a second of time.

For OdeJava there is a method "Body.setEnabled" and "Geom.setEnabled", I don't tried this but if the method exists It should work Tongue

From what I have seem of the Odejava source I am afraid, it won't. Odejava is extremely dirty coding and has many bugs and unimplemented stuff. The whole collision-without-simulation stuff is not cared about at all. I had to fix/implement several things to make it to the point where the XPAL implementation is now. No I have to wait for an ODE bug to be fixed.

Marvin
Logged
'n ddrylliog
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #5 on: 26. November 2007, 03:04:42 pm »

BTW Marvin it's interesting that you realize now why I chose (earlier) JOODE as the first citizen in the XPAL land. Odejava would have a lot more of users if it had better support / was better maintained.. I know some that since William Denniss is gone, some jME guys have been working on it, I hope it's still moving forward.
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #6 on: 11. December 2007, 11:38:40 pm »

Just to make sure, that this is known: Bodies and Collideables now have a set/isEnabled getter/setter pair. Additionally the Body has a set/isGravityEnabled() getter/setter pair.

Marvin
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic