Box2D Forums

It is currently Fri May 24, 2013 7:43 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Mon May 16, 2011 8:06 pm 
Offline

Joined: Mon Jul 12, 2010 2:15 am
Posts: 47
End contact doesn't fire when an object is destroyed? Could I force it to?


Top
 Profile  
 
PostPosted: Tue May 17, 2011 5:37 pm 
Offline

Joined: Mon Jul 12, 2010 2:15 am
Posts: 47
Omg, you know you're fucked when the port maintainer ignores your topics. 3:>


Top
 Profile  
 
PostPosted: Wed May 18, 2011 5:00 am 
Offline

Joined: Fri Dec 14, 2007 8:07 pm
Posts: 913
ha ha what? End contact should definitely fire when an object is destroyed. Can you provide a test bed showing this is not the case?


Top
 Profile  
 
PostPosted: Wed May 18, 2011 9:40 am 
Offline

Joined: Mon Jul 12, 2010 2:15 am
Posts: 47
Hmm, I guess I'll look at it a little better. I'm trying to destroy an object while you're dragging it around with allowdragging=true. But if it's destoried then I get a joint error.

Thinking the answer the obviosly because you can't destroy a jointed object. I decided to make it invisible and a sensor when the player removed it(and add to the score and stuff) and actually remove it on the next mouse up event.

Does any of that sound like it would cause that error?


Top
 Profile  
 
PostPosted: Wed May 18, 2011 11:14 am 
Offline

Joined: Fri Dec 14, 2007 8:07 pm
Posts: 913
What is the specific error and stack trace you are getting? You should be able to destroy a body attached to any joint (including a mouse joint). Joints listen for their body's remove events and know they should get removed when the body is destroyed.

Maybe it's trying to update the joint after it's been destroyed with the new mouse position? I'll give it a test when I've got some time.


Top
 Profile  
 
PostPosted: Wed May 18, 2011 5:56 pm 
Offline

Joined: Mon Jul 12, 2010 2:15 am
Posts: 47
Ok, so when I remove a body attached with the allowDragging mouse joint I get this:

Code:
TypeError: Error #1006: value is not a function.
   at cmodule.Box2D::FSM__ZN7b2World12DestroyJointEP7b2Joint/work()
   at <anonymous>()
   at <anonymous>()
   at Box2DAS.Dynamics.Joints::b2Joint/destroy()[C:\Documents and Settings\Administrator\My Documents\Dropbox\Jems\Engine\Box2DAS\Dynamics\Joints\b2Joint.as:32]
   at <anonymous>()[C:\Documents and Settings\Administrator\My Documents\Dropbox\Jems\Engine\wck\Joint.as:614]
   at Function/http://adobe.com/AS3/2006/builtin::apply()
   at wck::World/step()[C:\Documents and Settings\Administrator\My Documents\Dropbox\Jems\Engine\wck\World.as:193]

TypeError: Error #1009: Cannot access a property or method of a null object reference.
   at <anonymous>()[C:\Documents and Settings\Administrator\My Documents\Dropbox\Jems\Engine\wck\BodyShape.as:1337]
   at Function/http://adobe.com/AS3/2006/builtin::apply()
   at wck::World/step()[C:\Documents and Settings\Administrator\My Documents\Dropbox\Jems\Engine\wck\World.as:193]


I assume that's the problem anyways. I really have no clue what that means.


Top
 Profile  
 
PostPosted: Wed Jul 06, 2011 10:23 am 
Offline

Joined: Tue Dec 14, 2010 10:38 am
Posts: 18
I am getting a #1009 after removing a body as well. I am using removeChild() (as I've seen mayobutter recommend so many times). I've also tried removing the child outside the time step to no avail. Any ideas?

Code:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
   at misc::Util$/localizeMatrix()[/source/misc/Util.as:210]
   at wck::BodyShape/syncTransform()[/source/wck/BodyShape.as:1302]
   at wck::BodyShape/updateTween()[/source/wck/BodyShape.as:1322]
   at flash.events::EventDispatcher/dispatchEventFunction()
   at flash.events::EventDispatcher/dispatchEvent()
   at Box2DAS.Common::b2EventDispatcher/dispatchEvent()[/source/Box2DAS/Common/b2EventDispatcher.as:27]
   at Box2DAS.Dynamics::b2World/Step()[/source/Box2DAS/Dynamics/b2World.as:158]
   at wck::World/step()[/source/wck/World.as:194]


Top
 Profile  
 
PostPosted: Fri Jul 08, 2011 7:59 am 
Offline

Joined: Fri Dec 14, 2007 8:07 pm
Posts: 913
I just committed a fix for removing bodies that are currently being dragged. The problem was that after the mouse joint was removed the world would still try to update it.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: Exabot [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group