Box2D Forums

It is currently Sat Apr 19, 2014 4:56 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Rag Doll TestBed
PostPosted: Mon Dec 17, 2007 2:32 pm 
Offline

Joined: Fri Dec 07, 2007 3:09 pm
Posts: 241
I decided to zip the whole package in case anyone had trouble compiling.

NEW FILES:
- RagDoll.h
- Biped.cpp
- Biped.h
- BipedDef.cpp
- BipedDef.h

MODIFIED:
- VC8 solution and project files
- TestEntries.cpp

Available for download here: http://www.sfu.ca/~mnb2/Box2D.zip

HOW TO USE:
To create a new biped (ragdoll) only requires two lines of code:

BipedDef bd;
Biped(m_world,&bd); // creates a new biped at (0,0) in m_world

You may want to keep a reference to your biped object so that you can modify its parameters later:

Biped bip* = new Biped(m_world, &bd);

Don't forget to delete it.

You can modify all the body parts at once by making these calls to BipedDef:

void SetMotorTorque(float);
void SetMotorSpeed(float);
void SetDensity(float);
void SetFriction(float);
void SetRestitution(float);
void SetLinearDamping(float);
void SetAngularDamping(float);
void EnableLimit();
void DisableLimit();
void SetLimit(bool);
void EnableMotor();
void DisableMotor();
void SetMotor(bool);
void SetGroupIndex(int16);
void SetPosition(float, float);
void SetPosition(b2Vec2);
void IsFast(bool); // this function has been commented out for earlier versions of Box2D

Also for your convenience (in Biped) are:

float GetMass(); // get the mass of the entire Biped (default is about 60 kg = 130 density)
b2Vec2 GetCenterPosition(); // get the center position of the entire biped

Or you can modify them individually by calling

bd.<BodyPart>Def to modify the body definitions
bd.<BodyPart>Poly to modify the poly definitions, with the exception of Head, which is HeadCirc
bd.<Joint>Def to modify the joint definitions

Body parts: LFoot, RFoot, LCalf, RCalf, LThigh, RThigh, Pelvis, Stomach, Chest, Neck, Head, LUpperArm, RUpperArm, LForearm, RForearm, LHand, RHand

Joints: LAnkle, RAnkle, LKnee, RKnee, LHip, RHip, LowerAbs, UpperAbs, LowerNeck, UpperNeck, LShoulder, RShoulder, LElbow, RElbow, LWrist, RWrist

Questions, comments and critique are welcome. Let me know if I have any memory leaks, that's not really my specialty.

Also, I would much appreciate anyone's help trying to get one of these things walking on their own.


Top
 Profile  
 
 Post subject: Re: Rag Doll TestBed
PostPosted: Mon Dec 17, 2007 10:55 pm 
Offline
Site Admin

Joined: Thu Sep 06, 2007 12:34 am
Posts: 2946
Thanks! I'll put this into 2.0.


Top
 Profile  
 
 Post subject: Re: Rag Doll TestBed
PostPosted: Mon Jan 28, 2008 1:28 am 
Offline
Site Admin

Joined: Thu Sep 06, 2007 12:34 am
Posts: 2946
This is in SVN now. I made an interesting test case with this. :)

Thanks again!


Top
 Profile  
 
 Post subject: Re: Rag Doll TestBed
PostPosted: Mon Jan 28, 2008 1:16 pm 
Offline

Joined: Tue Sep 18, 2007 6:17 am
Posts: 155
Location: Western Cape, South Africa
Ragdoll Bomb? ;)


Top
 Profile  
 
 Post subject: Re: Rag Doll TestBed
PostPosted: Wed May 11, 2011 7:39 am 
Offline

Joined: Wed May 11, 2011 7:36 am
Posts: 1
The requested URL /~mnb2/Box2D.zip was not found on this server. :( any help??? :(


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

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users 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