Exemplo n.º 1
0
//------------------------------------------------
void TravelingCam::setup(ofVec3f meshOffset) {
    parameters.setName("Traveling Cam");
    parameters.add(speed.set("Cam Speed", 0.001, 0, 0.1));
    parameters.add(rampTime.set("Start/Stop ramp", 500, 0, 5000));
    parameters.add(altura.set("altura camara", 0, -100, 100 ));

    resolucionCurvas.addListener(this, &TravelingCam::curveResChanged);

    parameters.add(resolucionCurvas.set("resolucion Curvas", 20, 2, 130));

    parameters.add(xenoFactor.set("xenoFactor", 0.5,0,1));

    this->meshOffset = meshOffset;

    ofFile f(DEFAULT_PATH);
    if (f.exists()) {
        pathSaveLoad::loadPolylineVertices(DEFAULT_PATH, path, meshOffset, resolucionCurvas);
    }
    xenoFactor = 0.5;
    xenoPos.set(ofGetWidth()/2, ofGetHeight()/2);
    enableMouseInput();
    slowdownDist = speed*rampTime;

    heightMult =1;
}
Exemplo n.º 2
0
//----------------------------------------
ofEasyCam::ofEasyCam(){
    lastTap = 0;
    lastDistance = 0;
    drag = 0.9f;
    sensitivityRot = 1.0f;//when 1 moving the mouse from one side to the other of the arcball (min(viewport.width, viewport.height)) will rotate 180degrees. when .5, 90 degrees.
    sensitivityXY = .5;
    sensitivityZ= .7;
 
    bDistanceSet = false;
    bMouseInputEnabled = false;
    bDoRotate = false;
    bApplyInertia =false;
    bDoTranslate = false;
    bInsideArcball = true;
    bValidClick = false;
    bEnableMouseMiddleButton = true;
    bAutoDistance = true;
    doTranslationKey = 'm';
 
    reset();
    enableMouseInput(); 
  
    // <>< # Added extra boolean for disable Rotation function. By default its on (true) 
    bRotation = true;
 
}
Exemplo n.º 3
0
//------------------------------------------------
void TravelingCam::stop() {
    if (bStarted) {
        ofRemoveListener(ofEvents().update, this, &TravelingCam::update);
        enableMouseInput(false);
        bStarted = false;
    }

}
Exemplo n.º 4
0
//----------------------------------------
void ofEasyCam::setEvents(ofCoreEvents & _events){
	// If en/disableMouseInput were called within ofApp::setup(),
	// bMouseInputEnabled will tell us about whether the camera
	// mouse input needs to be initialised as enabled or disabled.
	// we will still set `events`, so that subsequent enabling
	// and disabling can work.

	// we need a temporary copy of bMouseInputEnabled, since it will 
	// get changed by disableMouseInput as a side-effect.
	bool wasMouseInputEnabled = bMouseInputEnabled || !events;
	disableMouseInput();
	events = &_events;
	if (wasMouseInputEnabled) {
		// note: this will set bMouseInputEnabled to true as a side-effect.
		enableMouseInput();
	}
	bEventsSet = true;
}
Exemplo n.º 5
0
//----------------------------------------
ofEasyCam::ofEasyCam(){
	lastTap	= 0;
	lastDistance = 0;
	drag = 0.9f;
	sensitivityRot = 1.0f;//when 1 moving the mouse from one side to the other of the arcball (min(viewport.width, viewport.height)) will rotate 180degrees. when .5, 90 degrees.
	sensitivityXY = .5f;
	sensitivityZ= .7f;
	
	bDistanceSet = false; 
	bMouseInputEnabled = false;
	bDoRotate = false;
	bApplyInertia =false;
	bDoTranslate = false;
	bDoScrollZoom = false;
	bInsideArcball = true;
	bEnableMouseMiddleButton = true;
	bAutoDistance = true;
	doTranslationKey = 'm';
	
	reset();
	enableMouseInput();	

}
Exemplo n.º 6
0
//----------------------------------------
ofx2DCam::ofx2DCam(){
    setLookAt(OFX2DCAM_FRONT);
    lastTap	= 0;
    
    bApplyInertia =false;
    bDoTranslate = false;

    bDistanceSet = false;
    bDoScale = false;
  
    reset();
    parameters.setName("ofx2Dcam");
    parameters.add(bEnableMouse.set("Enable Mouse Input", false));
    parameters.add(dragSensitivity.set("Drag Sensitivity", 1, 0, 3));
    parameters.add(scrollSensitivity.set("Scroll Sensitivity", 10, 0, 30));
    parameters.add(drag.set("Drag", 0.9, 0, 1));
    parameters.add(farClip.set("Far Clip", 2000, 5000, 10000));
    parameters.add(nearClip.set("Near Clip", -1000, -5000, 10000));
    
    bEnableMouse.addListener(this, &ofx2DCam::enableMouseInputCB);
    enableMouseInput();

}
Exemplo n.º 7
0
//----------------------------------------
ofEasyCamExt::ofEasyCamExt()
{
	lastTap	= 0;
	lastDistance = 0;
	drag = 0.9f;
	
	sensitivityRot = 0.01f;	//when 1 moving the mouse from one side to the other of the arcball (min(viewport.width, viewport.height)) will rotate 180degrees. when .5, 90 degrees.
	sensitivityXY = 0.5;
	sensitivityZ  = 0.01;
	
	bDistanceSet = false; 
	bMouseInputEnabled = false;
	bDoRotate = false;
	bApplyInertia =false;
	bDoTranslate = false;
	bInsideArcball = true;
	bValidClick = false;
	bEnableMouseMiddleButton = true;
	bAutoDistance = true;
	
	doTranslationKey = 'a';
	doDollyKey = 'z';
	
	dollyForwardKey = 0;
	dollyBackwardKey = 0;
	
	easeType = EasingEquations::EASE_LINEAR;
	isDoingMove = false;
	
	dollyImpulseAmount = 0.01f;
	maxDollyImpulseSpeed = 1.0f;
	
	reset();
	enableMouseInput();	

}
Exemplo n.º 8
0
//----------------------------------------
ofEasyFingerCam::ofEasyFingerCam()
{
    selectedPlane = new AxisPlane();
    drag = 0.1f;
    zoomSpeed = 2.0f;
    bMouseInputEnabled = false;
    bFingerInputEnabled = false;
    mousePosViewPrev.set(0, 0);
    lastFrame = 0;
    bDistanceSet = false;
    lastDistance = 0;
    distanceScaleVelocity = 0;
    fingers = std::vector<Finger *>();
    target.setPosition(0, 0, 0);
    zooming = true;
    reset();
    setParent(target);
    prevDistance = 0;
    ofVec3f center = ofVec3f(0.0f, 0.0f, 0.0f);
    ofVec3f normal = ofVec3f(0.0f, 1.0f, 0.0f).normalize();
    ofVec2f scale = ofVec2f(1.0f, 1.0f);
    enableMouseInput();
    enableFingerInput();
}
Exemplo n.º 9
0
void ofEasyCam::setEvents(ofCoreEvents & _events){
	disableMouseInput();
	bEventsSet = true;
	events = &_events;
	enableMouseInput();
}
Exemplo n.º 10
0
//----------------------------------------
void ofx2DCam::disableMouseInput(){
    enableMouseInput(false);
}
Exemplo n.º 11
0
//----------------------------------------
void ofx2DCam::enableMouseInputCB(bool &e){
    enableMouseInput(e);
}