Hello,
I'm working on a little 3d game with "sandy3d", and I want to put some physics in it so I decided to use box2d.
I started to make my 3d world into box2d with top to down effect, I set the DebugDraw on to check, but I don't get it, why the world is not well center in my window?
And what are your advice for me to simulate my 3d world? (like no gravity and stuff)
Here is my world declaration:
How does Bounders works? I have a map of 1024*1024, is my declaration correct?
Here is my DebugDraw:
Thank you
I'm working on a little 3d game with "sandy3d", and I want to put some physics in it so I decided to use box2d.
I started to make my 3d world into box2d with top to down effect, I set the DebugDraw on to check, but I don't get it, why the world is not well center in my window?
And what are your advice for me to simulate my 3d world? (like no gravity and stuff)
Here is my world declaration:
Code:
var worldBox:b2AABB = new b2AABB();
worldBox.lowerBound.Set(-512/30,-512/30);
worldBox.upperBound.Set(512/30,512/30);
worldBox.lowerBound.Set(-512/30,-512/30);
worldBox.upperBound.Set(512/30,512/30);
How does Bounders works? I have a map of 1024*1024, is my declaration correct?
Here is my DebugDraw:
Code:
var dbgDraw:b2DebugDraw = new b2DebugDraw();
dbgDraw.m_sprite = new Sprite();
addChild(dbgDraw.m_sprite);
dbgDraw.m_drawScale = 5.0;
dbgDraw.m_fillAlpha = 0.3;
dbgDraw.m_lineThickness = 1.0;
dbgDraw.m_drawFlags = b2DebugDraw.e_shapeBit |b2DebugDraw.e_centerOfMassBit;
myWorld.SetDebugDraw(dbgDraw);
dbgDraw.m_sprite = new Sprite();
addChild(dbgDraw.m_sprite);
dbgDraw.m_drawScale = 5.0;
dbgDraw.m_fillAlpha = 0.3;
dbgDraw.m_lineThickness = 1.0;
dbgDraw.m_drawFlags = b2DebugDraw.e_shapeBit |b2DebugDraw.e_centerOfMassBit;
myWorld.SetDebugDraw(dbgDraw);
Thank you