You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
718 B
39 lines
718 B
#include "ofxCircleJoint.h"
|
|
|
|
ofxCircleJoint::ofxCircleJoint()
|
|
{
|
|
setDefaultProperties();
|
|
}
|
|
|
|
void ofxCircleJoint::update()
|
|
{
|
|
if (!enabled) return;
|
|
}
|
|
|
|
void ofxCircleJoint::draw()
|
|
{
|
|
if (!visible) return;
|
|
if (!enabled) return;
|
|
|
|
ofPushStyle();
|
|
ofFill();
|
|
ofSetColor(fillColor);
|
|
ofCircle(position.x, position.y, radius);
|
|
ofNoFill();
|
|
ofSetColor(strokeColor);
|
|
ofSetLineWidth(strokeWidth);
|
|
ofCircle(position.x, position.y, radius);
|
|
ofPopStyle();
|
|
}
|
|
|
|
void ofxCircleJoint::setDefaultProperties()
|
|
{
|
|
radius = 10.0f;
|
|
}
|
|
|
|
bool ofxCircleJoint::hitTest(ofVec2f pos)
|
|
{
|
|
float distance = position.distance(pos);
|
|
if ( distance < radius ) return true;
|
|
else return false;
|
|
}
|