コード例 #1
0
//--------------------------------------------------------------
// draws the length of the joint and locations of pivots, but if bodies are sprung more than the length,
// will not connect all the way //
void ofxBulletJoint::drawJointConstraints() {
	ofVec3f pa = getPivotAWorldPos();
	ofVec3f pb = getPivotBWorldPos();
	
	ofLine( pa, pb );
	
	ofSetColor(255, 0, 0);
	ofDrawSphere(pa, .5);
	ofSetColor(0, 0, 255);
	ofDrawSphere(pb, .5);
}
コード例 #2
0
//--------------------------------------------------------------
// draws the length of the joint and locations of pivots, but if bodies are sprung more than the length,
// will not connect all the way //
void ofxBulletJoint::drawJointConstraints() {
	ofVec3f pa = getPivotAWorldPos();
	ofVec3f pb = getPivotBWorldPos();
	
	glBegin(GL_LINES);
		glVertex3f(pa.x, pa.y, pa.z);
		glVertex3f(pb.x, pb.y, pb.z);
	glEnd();
	
	ofSetColor(255, 0, 0);
	ofSphere(pa, .5);
	ofSetColor(0, 0, 255);
	ofSphere(pb, .5);
}