Box2D Forums

It is currently Mon May 20, 2013 8:55 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Thu Aug 02, 2012 8:58 am 
Offline

Joined: Wed Apr 13, 2011 9:05 am
Posts: 6
I'm trying to access the radius from a body, the closest I've got is this:

Code:

var asteroidShape:b2CircleShape = b.GetFixtureList().GetShape() as b2CircleShape;
trace("rad: " +asteroidShape.GetRadius());



It always outputs 0.1, regardless of the size of the actual shape. Any ideas what I'm doing wrong?

Thanks!


Top
 Profile  
 
PostPosted: Thu Aug 02, 2012 6:53 pm 
Offline

Joined: Sun Oct 25, 2009 3:28 am
Posts: 242
Does it collide as if it has only 0.1 radius or does it actually collide with its actual non-0.1 radius?

Also, is the circle the only fixture in that body? Double-check if you have more than one body.CreateFixture() calls.

Last thing to check, make sure you set the radius in the b2CircleShape before you call body.CreateFixture().


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

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 2 guests


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