//--------------------------------------------------------------
void ofxBulletJoint::draw() {
	if(!_bCreated) {ofLog(OF_LOG_ERROR, "ofxBulletJoint :: draw : must call create() first"); return;}
	
	ofVec3f pa;
	ofVec3f pb;
	
	pb = getPositionB();
	if(_bTwoBodies) {
		pa = getPositionA();
	} else {
		pa = _targetPos;
	}
    
    ofLine( pa, pb );
}
//--------------------------------------------------------------
void ofxBulletJoint::draw() {
	if(!_bCreated) {ofLog(OF_LOG_ERROR, "ofxBulletJoint :: draw : must call create() first"); return;}
	
	ofVec3f pa;
	ofVec3f pb;
	
	pb = getPositionB();
	if(_bTwoBodies) {
		pa = getPositionA();
	} else {
		pa = _targetPos;
	}
	
	glBegin(GL_LINES);
		glVertex3f(pa.x, pa.y, pa.z);
		glVertex3f(pb.x, pb.y, pb.z);
	glEnd();
}