Hi any one have a easy way of moving a bunch of bode's and joints into position then maybe a pose.
I have a rag doll made up of revoluteJoints but I now need to move it in to position for death or die,ing scene
I have all of the bodes and joints in top of my class all connected here is a snip it of my class
i just create all the pieces and ConnectBodyParts(); function just connect them with the joins but now I need to move the all at once and put in to pose
for a game I'm creating so a cannot use mouse just incase some one says use mouse joint and drag and drop 🙂
any one know how i go about it ?
#define ID_HEAD 1
#define ID_BODY 2
#define ID_RIGHT_TOP_ARM 3
#define ID_RIGHT_BOTTOM_ARM 4
#define ID_LEFT_TOP_ARM 5
#define ID_LEFT_BOTTOM_ARM 6
#define ID_RIGHT_TOP_LEG 7
#define ID_RIGHT_BOTTOM_LEG 8
#define ID_LEFT_TOP_LEG 9
#define ID_LEFT_BOTTOM_LEG 10
class RagDoll
{
private:
b2World* world;
b2Body* ragDollHead;
b2Body* ragDollBody;
b2Body* ragDollRightTopArm;
b2Body* ragDollRightBottomArm;
b2Body* ragDollLeftTopArm;
b2Body* ragDollLeftBottomArm;
b2Body* ragDollRightTopOfLeg;
b2Body* ragDollRightBottomOfLeg;
b2Body* ragDollLeftTopOfLeg;
b2Body* ragDollLeftBottomOfLeg;
public:
/**
** Constructor
**/
RagDoll(double x, double y)
{
world = _world;
ragDollHead = CreateCirclePhysics(60+x,52+y,4,ID_HEAD,"Head.png",0,false);
ragDollBody = CreateBoxPhysics(60+x,60+y,4,10,ID_BODY,"Body.png",0,false);
ragDollRightTopArm = CreateBoxPhysics(64+x,60+y,4,3,ID_RIGHT_TOP_ARM,"TopArm.png",0,false);
ragDollRightBottomArm =CreateBoxPhysics(69+x,60+y,5,3,ID_RIGHT_BOTTOM_ARM,"BottomArm.png",0,false);
ragDollLeftTopArm = CreateBoxPhysics(56+x,57+y,4,3,ID_LEFT_TOP_ARM,"TopArm.png",0,false);
ragDollLeftBottomArm = CreateBoxPhysics(52+x,57+y,5,3,ID_LEFT_BOTTOM_ARM,"BottomArm.png",0,false);
ragDollRightTopOfLeg = CreateBoxPhysics(62+x,68+y,3,6,ID_RIGHT_TOP_LEG,"TopLeg.png",0,false);
ragDollRightBottomOfLeg = CreateBoxPhysics(62+x,74+y,3,6,ID_RIGHT_BOTTOM_LEG,"BottomLeg.png",0,false);
ragDollLeftTopOfLeg = CreateBoxPhysics(58+x,68+y,3,6,ID_LEFT_TOP_LEG,"TopLeg.png",0,false);
ragDollLeftBottomOfLeg = CreateBoxPhysics(58+x,74+y,3,6,ID_LEFT_BOTTOM_LEG,"BottomLeg.png",0,false);
ConnectBodyParts();
}
I have a rag doll made up of revoluteJoints but I now need to move it in to position for death or die,ing scene
I have all of the bodes and joints in top of my class all connected here is a snip it of my class
i just create all the pieces and ConnectBodyParts(); function just connect them with the joins but now I need to move the all at once and put in to pose
for a game I'm creating so a cannot use mouse just incase some one says use mouse joint and drag and drop 🙂
any one know how i go about it ?
#define ID_HEAD 1
#define ID_BODY 2
#define ID_RIGHT_TOP_ARM 3
#define ID_RIGHT_BOTTOM_ARM 4
#define ID_LEFT_TOP_ARM 5
#define ID_LEFT_BOTTOM_ARM 6
#define ID_RIGHT_TOP_LEG 7
#define ID_RIGHT_BOTTOM_LEG 8
#define ID_LEFT_TOP_LEG 9
#define ID_LEFT_BOTTOM_LEG 10
class RagDoll
{
private:
b2World* world;
b2Body* ragDollHead;
b2Body* ragDollBody;
b2Body* ragDollRightTopArm;
b2Body* ragDollRightBottomArm;
b2Body* ragDollLeftTopArm;
b2Body* ragDollLeftBottomArm;
b2Body* ragDollRightTopOfLeg;
b2Body* ragDollRightBottomOfLeg;
b2Body* ragDollLeftTopOfLeg;
b2Body* ragDollLeftBottomOfLeg;
public:
/**
** Constructor
**/
RagDoll(double x, double y)
{
world = _world;
ragDollHead = CreateCirclePhysics(60+x,52+y,4,ID_HEAD,"Head.png",0,false);
ragDollBody = CreateBoxPhysics(60+x,60+y,4,10,ID_BODY,"Body.png",0,false);
ragDollRightTopArm = CreateBoxPhysics(64+x,60+y,4,3,ID_RIGHT_TOP_ARM,"TopArm.png",0,false);
ragDollRightBottomArm =CreateBoxPhysics(69+x,60+y,5,3,ID_RIGHT_BOTTOM_ARM,"BottomArm.png",0,false);
ragDollLeftTopArm = CreateBoxPhysics(56+x,57+y,4,3,ID_LEFT_TOP_ARM,"TopArm.png",0,false);
ragDollLeftBottomArm = CreateBoxPhysics(52+x,57+y,5,3,ID_LEFT_BOTTOM_ARM,"BottomArm.png",0,false);
ragDollRightTopOfLeg = CreateBoxPhysics(62+x,68+y,3,6,ID_RIGHT_TOP_LEG,"TopLeg.png",0,false);
ragDollRightBottomOfLeg = CreateBoxPhysics(62+x,74+y,3,6,ID_RIGHT_BOTTOM_LEG,"BottomLeg.png",0,false);
ragDollLeftTopOfLeg = CreateBoxPhysics(58+x,68+y,3,6,ID_LEFT_TOP_LEG,"TopLeg.png",0,false);
ragDollLeftBottomOfLeg = CreateBoxPhysics(58+x,74+y,3,6,ID_LEFT_BOTTOM_LEG,"BottomLeg.png",0,false);
ConnectBodyParts();
}