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:00:06 am
Xith3D CommunityGeneral CategorySupport (Moderator: Marvin Fröhlich)XPal and setUserData
Pages: [1]
Print
Author Topic: XPal and setUserData  (Read 763 times)
sisso
Just dropped in

Offline Offline

Posts: 21


View Profile
« on: 05. November 2007, 10:33:24 pm »

1) I´m using XPal and I have a problem to detect what object has collided.

The class Collision has two Collideable objects, but only with this information I can´t get directly what object has collide without search in all Collideables from all bodies.

And if we add a method to setUserData?

2) This is not a great problem because there is a easy workaround, but i think that is stranger that I can´t add a body at PhysicsGFXManager class.

3) Without number three for now Tongue

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: 05. November 2007, 11:23:26 pm »

1) I´m using XPal and I have a problem to detect what object has collided.

The class Collision has two Collideable objects, but only with this information I can´t get directly what object has collide without search in all Collideables from all bodies.

Well, currently there is a bug in the XPAL-JOODE part, that makes it unpredictable, if the you desired Collideable is the first or the second one in the collision event. This is pretty simple to fix and will be done in the next few days.

But I guess, this is not your problem. I guess, you need to know, which body the Collideable is attached to. Would it help, if we added a Body-getter to the Collideable interface? @Amos: Do you think, this is a problem?

And if we add a method to setUserData?

I guess, this is no problem.

2) This is not a great problem because there is a easy workaround, but i think that is stranger that I can´t add a body at PhysicsGFXManager class.

I have added this to the GFXManager. It is untested. Please tell me, if it works.

Marvin
Logged
sisso
Just dropped in

Offline Offline

Posts: 21


View Profile
« Reply #2 on: 06. November 2007, 12:49:54 am »

Quote
But I guess, this is not your problem. I guess, you need to know, which body the Collideable is attached to. Would it help, if we added a Body-getter to the Collideable interface? @Amos: Do you think, this is a problem?

I don´t think that this is necessary if we add setUserData.

Quote
I have added this to the GFXManager. It is untested. Please tell me, if it works.

Yes it´s works, no more fake colliders Tongue
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #3 on: 06. November 2007, 11:12:04 pm »

I have added a name-field and a user-object field to the Collideable and Body classes. And I have fixed the geom-swap-bug. Now the order of the two Collideables of a Collision is always the same, that you chose for the checkCollisions() method.

Marvin
Logged
sisso
Just dropped in

Offline Offline

Posts: 21


View Profile
« Reply #4 on: 07. November 2007, 12:33:57 am »

Hey nice, this will help a lot.

Thanks,
Sisso
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic