Ran script to remove trailing spaces and tabs

This commit is contained in:
Robert Osfield
2012-03-21 17:36:20 +00:00
parent 1e35f8975d
commit 14a563dc9f
1495 changed files with 21873 additions and 21873 deletions

View File

@@ -4,7 +4,7 @@
using namespace osgGA;
AnimationPathManipulator::AnimationPathManipulator(osg::AnimationPath* animationPath)
AnimationPathManipulator::AnimationPathManipulator(osg::AnimationPath* animationPath)
{
_printOutTimingInfo = true;
@@ -12,13 +12,13 @@ AnimationPathManipulator::AnimationPathManipulator(osg::AnimationPath* animation
_timeOffset = 0.0;
_timeScale = 1.0;
_isPaused = false;
_realStartOfTimedPeriod = 0.0;
_animStartOfTimedPeriod = 0.0;
_numOfFramesSinceStartOfTimedPeriod = -1; // need to init.
}
AnimationPathManipulator::AnimationPathManipulator( const std::string& filename )
AnimationPathManipulator::AnimationPathManipulator( const std::string& filename )
{
_printOutTimingInfo = true;
@@ -41,14 +41,14 @@ AnimationPathManipulator::AnimationPathManipulator( const std::string& filename
_animationPath->read(in);
in.close();
}
void AnimationPathManipulator::home(double currentTime)
{
if (_animationPath.valid())
{
_timeOffset = _animationPath->getFirstTime()-currentTime;
_timeOffset = _animationPath->getFirstTime()-currentTime;
}
// reset the timing of the animation.
@@ -85,13 +85,13 @@ bool AnimationPathManipulator::handle(const osgGA::GUIEventAdapter& ea,osgGA::GU
if (ea.getKey()==' ')
{
_isPaused = false;
home(ea,us);
us.requestRedraw();
us.requestContinuousUpdate(false);
return true;
}
}
else if (ea.getKey()==')')
{
double time = _isPaused ? _pauseTime : ea.getTime();
@@ -103,23 +103,23 @@ bool AnimationPathManipulator::handle(const osgGA::GUIEventAdapter& ea,osgGA::GU
// adjust timeOffset so the current animationTime does change.
_timeOffset = animationTime/_timeScale - time;
return true;
}
}
else if (ea.getKey()=='(')
{
double time = _isPaused ? _pauseTime : ea.getTime();
double animationTime = (time+_timeOffset)*_timeScale;
_timeScale /= 1.1;
OSG_NOTICE<<"Animation speed = "<<_timeScale*100<<"%"<<std::endl;
// adjust timeOffset so the current animationTime does change.
_timeOffset = animationTime/_timeScale - time;
return true;
}
}
else if(ea.getKey() == 'p')
{
if( _isPaused )
@@ -136,7 +136,7 @@ bool AnimationPathManipulator::handle(const osgGA::GUIEventAdapter& ea,osgGA::GU
us.requestContinuousUpdate(false);
return true;
}
break;
default:
break;

View File

@@ -14,12 +14,12 @@ public:
osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN),
_cameraViews(cameraViews)
{}
virtual void apply(CameraView& node)
{
_cameraViews->push_back(&node);
}
CameraViewSwitchManipulator::CameraViewList* _cameraViews;
};
@@ -45,7 +45,7 @@ bool CameraViewSwitchManipulator::handle(const GUIEventAdapter& ea,GUIActionAdap
switch(ea.getEventType())
{
case(GUIEventAdapter::KEYDOWN):
if (ea.getKey()=='[')
{
@@ -86,7 +86,7 @@ osg::Matrixd CameraViewSwitchManipulator::getMatrix() const
OSG_NOTICE<<"CameraViewSwitchManipulator::getMatrix(): Unable to calculate matrix due to empty parental path."<<std::endl;
}
}
return mat;
return mat;
}
osg::Matrixd CameraViewSwitchManipulator::getInverseMatrix() const

View File

@@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@@ -73,11 +73,11 @@ void DriveManipulator::setNode(osg::Node* node)
_modelScale = boundingSphere._radius;
//_height = sqrtf(_modelScale)*0.03;
//_buffer = sqrtf(_modelScale)*0.05;
_height = getHeightOfDriver();
_buffer = _height*2.5;
}
if (getAutoComputeHomePosition()) computeHomePosition();
if (getAutoComputeHomePosition()) computeHomePosition();
}
@@ -98,9 +98,9 @@ bool DriveManipulator::intersect(const osg::Vec3d& start, const osg::Vec3d& end,
osgUtil::IntersectionVisitor iv(lsi.get());
iv.setTraversalMask(_intersectTraversalMask);
_node->accept(iv);
if (lsi->containsIntersections())
{
intersection = lsi->getIntersections().begin()->getWorldIntersectPoint();
@@ -184,9 +184,9 @@ void DriveManipulator::home(const GUIEventAdapter& ea,GUIActionAdapter& us)
if (getAutoComputeHomePosition()) computeHomePosition();
computePosition(_homeEye, _homeCenter, _homeUp);
_velocity = 0.0;
_pitch = 0.0;
us.requestRedraw();
@@ -429,12 +429,12 @@ void DriveManipulator::computePosition(const osg::Vec3d& eye,const osg::Vec3d& c
s.normalize();
osg::Vec3d u(s^f);
u.normalize();
osg::Matrixd rotation_matrix(s[0], u[0], -f[0], 0.0,
s[1], u[1], -f[1], 0.0,
s[2], u[2], -f[2], 0.0,
0.0, 0.0, 0.0, 1.0);
_eye = eye;
_rotation = rotation_matrix.getRotate().inverse();
}
@@ -452,7 +452,7 @@ bool DriveManipulator::calcMovement()
OSG_INFO << "warning dt = "<<dt<< std::endl;
dt = 0.0;
}
double accelerationFactor = _height*10.0;
switch(_speedMode)
@@ -494,7 +494,7 @@ bool DriveManipulator::calcMovement()
osg::Matrixd rotation_matrix;
rotation_matrix.makeRotate(_rotation);
osg::Vec3d up = osg::Vec3d(0.0,1.0,0.0) * rotation_matrix;
osg::Vec3d lv = osg::Vec3d(0.0,0.0,-1.0) * rotation_matrix;
osg::Vec3d sv = osg::Vec3d(1.0,0.0,0.0) * rotation_matrix;
@@ -504,7 +504,7 @@ bool DriveManipulator::calcMovement()
double yaw = -inDegrees(dx*50.0*dt);
#ifdef KEYBOARD_PITCH
double pitch_delta = 0.5;
if (_pitchUpKeyPressed) _pitch += pitch_delta*dt;
@@ -520,12 +520,12 @@ bool DriveManipulator::calcMovement()
double dy = _ga_t0->getYnormalized();
_pitch += dy*dt;
#endif
osg::Quat yaw_rotation;
yaw_rotation.makeRotate(yaw,up);
_rotation *= yaw_rotation;
rotation_matrix.makeRotate(_rotation);
sv = osg::Vec3d(1.0,0.0,0.0) * rotation_matrix;
@@ -538,7 +538,7 @@ bool DriveManipulator::calcMovement()
double signedBuffer;
if (distanceToMove>=0.0) signedBuffer=_buffer;
else signedBuffer=-_buffer;
// check to see if any obstruction in front.
osg::Vec3d ip, np;
if (intersect(_eye,_eye+lv*(signedBuffer+distanceToMove), ip, np))
@@ -574,7 +574,7 @@ bool DriveManipulator::calcMovement()
return true;
}
// no hit on the terrain found therefore resort to a fall under
// under the influence of gravity.
osg::Vec3d dp = lfp;
@@ -598,7 +598,7 @@ bool DriveManipulator::calcMovement()
// no collision with terrain has been found therefore track horizontally.
lv *= (_velocity*dt);
_eye += lv;
}

View File

@@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@@ -24,7 +24,7 @@ EventQueue::EventQueue(GUIEventAdapter::MouseYOrientation mouseYOrientation)
_accumulateEventState = new GUIEventAdapter();
_accumulateEventState->setMouseYOrientation(mouseYOrientation);
_firstTouchEmulatesMouse = true;
}
@@ -81,7 +81,7 @@ bool EventQueue::takeEvents(Events& events, double cutOffTime)
for(; ritr != _eventQueue.rend() && ((*ritr)->getTime() > cutOffTime); ++ritr) {}
if (ritr==_eventQueue.rend()) return false;
for(Events::iterator itr = _eventQueue.begin();
itr != ritr.base();
++itr)
@@ -150,7 +150,7 @@ void EventQueue::penPressure(float pressure, double time)
event->setEventType(GUIEventAdapter::PEN_PRESSURE);
event->setPenPressure(pressure);
event->setTime(time);
addEvent(event);
}
@@ -162,7 +162,7 @@ void EventQueue::penOrientation(float tiltX, float tiltY, float rotation, double
event->setPenTiltY(tiltY);
event->setPenRotation(rotation);
event->setTime(time);
addEvent(event);
}
@@ -172,7 +172,7 @@ void EventQueue::penProximity(GUIEventAdapter::TabletPointerType pt, bool isEnte
event->setEventType( (isEntering) ? GUIEventAdapter::PEN_PROXIMITY_ENTER : GUIEventAdapter::PEN_PROXIMITY_LEAVE);
event->setTabletPointerType(pt);
event->setTime(time);
addEvent(event);
}
@@ -182,7 +182,7 @@ void EventQueue::mouseScroll(GUIEventAdapter::ScrollingMotion sm, double time)
event->setEventType(GUIEventAdapter::SCROLL);
event->setScrollingMotion(sm);
event->setTime(time);
addEvent(event);
}
@@ -192,7 +192,7 @@ void EventQueue::mouseScroll2D(float x, float y, double time)
event->setEventType(GUIEventAdapter::SCROLL);
event->setScrollingMotionDelta(x,y);
event->setTime(time);
addEvent(event);
}
@@ -212,7 +212,7 @@ void EventQueue::mouseMotion(float x, float y, double time)
GUIEventAdapter* event = new GUIEventAdapter(*_accumulateEventState);
event->setEventType(event->getButtonMask() ? GUIEventAdapter::DRAG : GUIEventAdapter::MOVE);
event->setTime(time);
addEvent(event);
}
@@ -223,13 +223,13 @@ void EventQueue::mouseButtonPress(float x, float y, unsigned int button, double
switch(button)
{
case(1):
case(1):
_accumulateEventState->setButtonMask(GUIEventAdapter::LEFT_MOUSE_BUTTON | _accumulateEventState->getButtonMask());
break;
case(2):
case(2):
_accumulateEventState->setButtonMask(GUIEventAdapter::MIDDLE_MOUSE_BUTTON | _accumulateEventState->getButtonMask());
break;
case(3):
case(3):
_accumulateEventState->setButtonMask(GUIEventAdapter::RIGHT_MOUSE_BUTTON | _accumulateEventState->getButtonMask());
break;
}
@@ -240,17 +240,17 @@ void EventQueue::mouseButtonPress(float x, float y, unsigned int button, double
switch(button)
{
case(1):
case(1):
event->setButton(GUIEventAdapter::LEFT_MOUSE_BUTTON);
break;
case(2):
case(2):
event->setButton(GUIEventAdapter::MIDDLE_MOUSE_BUTTON);
break;
case(3):
case(3):
event->setButton(GUIEventAdapter::RIGHT_MOUSE_BUTTON);
break;
}
addEvent(event);
}
@@ -261,13 +261,13 @@ void EventQueue::mouseDoubleButtonPress(float x, float y, unsigned int button, d
switch(button)
{
case(1):
case(1):
_accumulateEventState->setButtonMask(GUIEventAdapter::LEFT_MOUSE_BUTTON | _accumulateEventState->getButtonMask());
break;
case(2):
case(2):
_accumulateEventState->setButtonMask(GUIEventAdapter::MIDDLE_MOUSE_BUTTON | _accumulateEventState->getButtonMask());
break;
case(3):
case(3):
_accumulateEventState->setButtonMask(GUIEventAdapter::RIGHT_MOUSE_BUTTON | _accumulateEventState->getButtonMask());
break;
}
@@ -278,17 +278,17 @@ void EventQueue::mouseDoubleButtonPress(float x, float y, unsigned int button, d
switch(button)
{
case(1):
case(1):
event->setButton(GUIEventAdapter::LEFT_MOUSE_BUTTON);
break;
case(2):
case(2):
event->setButton(GUIEventAdapter::MIDDLE_MOUSE_BUTTON);
break;
case(3):
case(3):
event->setButton(GUIEventAdapter::RIGHT_MOUSE_BUTTON);
break;
}
addEvent(event);
}
@@ -299,13 +299,13 @@ void EventQueue::mouseButtonRelease(float x, float y, unsigned int button, doubl
switch(button)
{
case(1):
case(1):
_accumulateEventState->setButtonMask(~GUIEventAdapter::LEFT_MOUSE_BUTTON & _accumulateEventState->getButtonMask());
break;
case(2):
case(2):
_accumulateEventState->setButtonMask(~GUIEventAdapter::MIDDLE_MOUSE_BUTTON & _accumulateEventState->getButtonMask());
break;
case(3):
case(3):
_accumulateEventState->setButtonMask(~GUIEventAdapter::RIGHT_MOUSE_BUTTON & _accumulateEventState->getButtonMask());
break;
}
@@ -316,17 +316,17 @@ void EventQueue::mouseButtonRelease(float x, float y, unsigned int button, doubl
switch(button)
{
case(1):
case(1):
event->setButton(GUIEventAdapter::LEFT_MOUSE_BUTTON);
break;
case(2):
case(2):
event->setButton(GUIEventAdapter::MIDDLE_MOUSE_BUTTON);
break;
case(3):
case(3):
event->setButton(GUIEventAdapter::RIGHT_MOUSE_BUTTON);
break;
}
addEvent(event);
}
@@ -348,10 +348,10 @@ void EventQueue::keyPress(int key, double time, int unmodifiedKey)
case(GUIEventAdapter::KEY_Hyper_R): _accumulateEventState->setModKeyMask(GUIEventAdapter::MODKEY_RIGHT_HYPER | _accumulateEventState->getModKeyMask()); break;
case(GUIEventAdapter::KEY_Caps_Lock):
{
if ((_accumulateEventState->getModKeyMask() & GUIEventAdapter::MODKEY_CAPS_LOCK)!=0)
if ((_accumulateEventState->getModKeyMask() & GUIEventAdapter::MODKEY_CAPS_LOCK)!=0)
_accumulateEventState->setModKeyMask(~GUIEventAdapter::MODKEY_CAPS_LOCK & _accumulateEventState->getModKeyMask());
else
_accumulateEventState->setModKeyMask(GUIEventAdapter::MODKEY_CAPS_LOCK | _accumulateEventState->getModKeyMask());
else
_accumulateEventState->setModKeyMask(GUIEventAdapter::MODKEY_CAPS_LOCK | _accumulateEventState->getModKeyMask());
break;
}
case(GUIEventAdapter::KEY_Num_Lock):
@@ -363,14 +363,14 @@ void EventQueue::keyPress(int key, double time, int unmodifiedKey)
break;
}
default: break;
}
}
GUIEventAdapter* event = new GUIEventAdapter(*_accumulateEventState);
event->setEventType(GUIEventAdapter::KEYDOWN);
event->setKey(key);
event->setUnmodifiedKey(unmodifiedKey);
event->setTime(time);
addEvent(event);
}
@@ -391,40 +391,40 @@ void EventQueue::keyRelease(int key, double time, int unmodifiedKey)
case(GUIEventAdapter::KEY_Hyper_L): _accumulateEventState->setModKeyMask(~GUIEventAdapter::MODKEY_LEFT_HYPER & _accumulateEventState->getModKeyMask()); break;
case(GUIEventAdapter::KEY_Hyper_R): _accumulateEventState->setModKeyMask(~GUIEventAdapter::MODKEY_RIGHT_HYPER & _accumulateEventState->getModKeyMask()); break;
default: break;
}
}
GUIEventAdapter* event = new GUIEventAdapter(*_accumulateEventState);
event->setEventType(GUIEventAdapter::KEYUP);
event->setKey(key);
event->setUnmodifiedKey(unmodifiedKey);
event->setTime(time);
addEvent(event);
}
GUIEventAdapter* EventQueue::touchBegan(unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y, double time)
{
if(_firstTouchEmulatesMouse)
if(_firstTouchEmulatesMouse)
{
// emulate left mouse button press
_accumulateEventState->setButtonMask((1) | _accumulateEventState->getButtonMask());
_accumulateEventState->setX(x);
_accumulateEventState->setY(y);
}
GUIEventAdapter* event = new GUIEventAdapter(*_accumulateEventState);
event->setEventType(GUIEventAdapter::PUSH);
event->setTime(time);
event->addTouchPoint(id, phase, x, y, 0);
addEvent(event);
return event;
}
GUIEventAdapter* EventQueue::touchMoved(unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y, double time)
{
if(_firstTouchEmulatesMouse)
@@ -432,41 +432,41 @@ GUIEventAdapter* EventQueue::touchMoved(unsigned int id, GUIEventAdapter::Touch
_accumulateEventState->setX(x);
_accumulateEventState->setY(y);
}
GUIEventAdapter* event = new GUIEventAdapter(*_accumulateEventState);
event->setEventType(GUIEventAdapter::DRAG);
event->setTime(time);
event->addTouchPoint(id, phase, x, y, 0);
addEvent(event);
return event;
}
GUIEventAdapter* EventQueue::touchEnded(unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y, unsigned int tap_count, double time)
{
if (_firstTouchEmulatesMouse)
if (_firstTouchEmulatesMouse)
{
_accumulateEventState->setButtonMask(~(1) & _accumulateEventState->getButtonMask());
_accumulateEventState->setX(x);
_accumulateEventState->setY(y);
}
GUIEventAdapter* event = new GUIEventAdapter(*_accumulateEventState);
event->setEventType(GUIEventAdapter::RELEASE);
event->setTime(time);
event->addTouchPoint(id, phase, x, y, tap_count);
addEvent(event);
return event;
}
void EventQueue::closeWindow(double time)
{
GUIEventAdapter* event = new GUIEventAdapter(*_accumulateEventState);
event->setEventType(GUIEventAdapter::CLOSE_WINDOW);
event->setTime(time);
addEvent(event);
}
@@ -475,7 +475,7 @@ void EventQueue::quitApplication(double time)
GUIEventAdapter* event = new GUIEventAdapter(*_accumulateEventState);
event->setEventType(GUIEventAdapter::QUIT_APPLICATION);
event->setTime(time);
addEvent(event);
}
@@ -485,14 +485,14 @@ void EventQueue::frame(double time)
GUIEventAdapter* event = new GUIEventAdapter(*_accumulateEventState);
event->setEventType(GUIEventAdapter::FRAME);
event->setTime(time);
addEvent(event);
}
GUIEventAdapter* EventQueue::createEvent()
{
if (_accumulateEventState.valid()) return new GUIEventAdapter(*_accumulateEventState.get());
else return new GUIEventAdapter();
if (_accumulateEventState.valid()) return new GUIEventAdapter(*_accumulateEventState.get());
else return new GUIEventAdapter();
}
void EventQueue::userEvent(osg::Referenced* userEventData, double time)
@@ -501,7 +501,7 @@ void EventQueue::userEvent(osg::Referenced* userEventData, double time)
event->setEventType(GUIEventAdapter::USER);
event->setUserData(userEventData);
event->setTime(time);
addEvent(event);
}

View File

@@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#include <osgGA/EventVisitor>
@@ -35,7 +35,7 @@ void EventVisitor::addEvent(GUIEventAdapter* event)
void EventVisitor::removeEvent(GUIEventAdapter* event)
{
EventList::iterator itr = std::find(_events.begin(),_events.end(),event);
EventList::iterator itr = std::find(_events.begin(),_events.end(),event);
if (itr!=_events.end()) _events.erase(itr);
}

View File

@@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
@@ -84,12 +84,12 @@ void GUIEventAdapter::setWindowRectangle(int x, int y, int width, int height, bo
_windowY = y;
_windowWidth = width;
_windowHeight = height;
if (updateMouseRange)
{
setInputRange(0, 0, width, height);
}
}
void GUIEventAdapter::setInputRange(float Xmin, float Ymin, float Xmax, float Ymax)
@@ -108,7 +108,7 @@ const osg::Matrix GUIEventAdapter::getPenOrientation() const
osg::Matrix xrot = osg::Matrix::rotate ( xRad, osg::Vec3f(1.0f, 0.0f, 0.0f) );
osg::Matrix yrot = osg::Matrix::rotate ( yRad, osg::Vec3f(0.0f, 0.0f, 1.0f) );
osg::Matrix zrot = osg::Matrix::rotate ( zRad, osg::Vec3f(0.0f, 1.0f, 0.0f) );
return ( zrot * yrot * xrot );
}
@@ -119,6 +119,6 @@ void GUIEventAdapter::addTouchPoint(unsigned int id, TouchPhase phase, float x,
setX(x);
setY(y);
}
_touchData->addTouchPoint(id, phase, x, y, tapCount);
}

View File

@@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/

View File

@@ -80,7 +80,7 @@ bool MultiTouchTrackballManipulator::handle( const GUIEventAdapter& ea, GUIActio
case osgGA::GUIEventAdapter::PUSH:
case osgGA::GUIEventAdapter::DRAG:
case osgGA::GUIEventAdapter::RELEASE:
if (ea.isMultiTouchEvent())
if (ea.isMultiTouchEvent())
{
double eventTimeDelta = 1/60.0; //_ga_t0->getTime() - _ga_t1->getTime();
if( eventTimeDelta < 0. )
@@ -129,6 +129,6 @@ bool MultiTouchTrackballManipulator::handle( const GUIEventAdapter& ea, GUIActio
default:
break;
}
return handled ? handled : TrackballManipulator::handle(ea, us);
}

View File

@@ -105,7 +105,7 @@ void NodeTrackerManipulator::setTrackNode(osg::Node* node)
OSG_NOTICE<<" "<<(*itr)->className()<<std::endl;
}
}
OSG_INFO<<"NodeTrackerManipulator::setTrackNode(Node*"<<node<<" "<<node->getName()<<"): Path set"<<std::endl;
setTrackNodePath( nodePaths[0] );

View File

@@ -151,7 +151,7 @@ void OrbitManipulator::getTransformation( osg::Vec3d& eye, osg::Vec3d& center, o
/** Sets the transformation by heading. Heading is given as an angle in radians giving a azimuth in xy plane.
Its meaning is similar to longitude used in cartography and navigation.
Positive number is going to the east direction.*/
void OrbitManipulator::setHeading( double azimuth )
void OrbitManipulator::setHeading( double azimuth )
{
CoordinateFrame coordinateFrame = getCoordinateFrame( _center );
Vec3d localUp = getUpVector( coordinateFrame );

View File

@@ -287,21 +287,21 @@ bool SphericalManipulator::calcMovement()
{
dy = _ga_t0->getScrollingMotion() == osgGA::GUIEventAdapter::SCROLL_UP ? _zoomDelta : -_zoomDelta;
buttonMask=GUIEventAdapter::SCROLL;
}
else
}
else
{
if (_ga_t1.get()==NULL) return false;
dx = _ga_t0->getXnormalized()-_ga_t1->getXnormalized();
dy = _ga_t0->getYnormalized()-_ga_t1->getYnormalized();
float distance = sqrtf(dx*dx + dy*dy);
// return if movement is too fast, indicating an error in event values or change in screen.
if (distance>0.5)
{
return false;
}
// return if there is no movement.
if (distance==0.0f)
{
@@ -310,7 +310,7 @@ bool SphericalManipulator::calcMovement()
buttonMask = _ga_t1->getButtonMask();
}
double throwScale = (_thrown && _ga_t0.valid() && _ga_t1.valid()) ?
_delta_frame_time / (_ga_t0->getTime() - _ga_t1->getTime()) : 1.0;
@@ -353,7 +353,7 @@ bool SphericalManipulator::calcMovement()
{
_elevation-=throwScale*dy*osg::PI_4;
// Only allows vertical rotation of 180deg
// Only allows vertical rotation of 180deg
if(_elevation < -osg::PI_2)
_elevation=-osg::PI_2;
else if(_elevation > osg::PI_2)

View File

@@ -745,7 +745,7 @@ void StandardManipulator::fixVerticalAxis( const osg::Vec3d& forward, const osg:
/** The method sends a ray into the scene and the point of the closest intersection
is used to set a new center for the manipulator. For Orbit-style manipulators,
the orbiting center is set. For FirstPerson-style manipulators, view is pointed
the orbiting center is set. For FirstPerson-style manipulators, view is pointed
towards the center.*/
bool StandardManipulator::setCenterByMousePointerIntersection( const GUIEventAdapter& ea, GUIActionAdapter& us )
{

View File

@@ -38,9 +38,9 @@ void StateSetManipulator::setStateSet(StateSet *stateset)
{
_stateset = stateset;
#if 0
// specify that this stateset is dynamic so it prevents
// the draw and update phase from overlapping - good for
// stability but breaks all the performance advantage of
// specify that this stateset is dynamic so it prevents
// the draw and update phase from overlapping - good for
// stability but breaks all the performance advantage of
// DrawThreadPerContex.
_stateset->setDataVariance(osg::Object::DYNAMIC);
#endif
@@ -59,11 +59,11 @@ const StateSet *StateSetManipulator::getStateSet() const
void StateSetManipulator::clone()
{
if (!_stateset) return;
// we clone the StateSet so that any draw traversals that might be running at the time of the
// event traversal won't change the same StateSet that is being read. One could just set the
// event traversal won't change the same StateSet that is being read. One could just set the
// DataVariance to DYNAMIC to avoid this overlap, but this would introduce a performance penalty.
StateSet::ParentList parents = _stateset->getParents();
osg::ref_ptr<osg::StateSet> newStateSet = dynamic_cast<osg::StateSet*>(_stateset->clone(osg::CopyOp::SHALLOW_COPY));
@@ -81,7 +81,7 @@ void StateSetManipulator::clone()
if (drawable) drawable->setStateSet(newStateSet.get());
}
}
_stateset = newStateSet;
}
@@ -101,7 +101,7 @@ bool StateSetManipulator::handle(const GUIEventAdapter& ea,GUIActionAdapter& aa)
(_stateset->getTextureMode(0,GL_TEXTURE_3D)&mode)!=0 ||
(_stateset->getTextureMode(0,GL_TEXTURE_RECTANGLE)&mode)!=0 ||
(_stateset->getTextureMode(0,GL_TEXTURE_CUBE_MAP)&mode)!=0;
#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE)
_texture |= ((_stateset->getTextureMode(0,GL_TEXTURE_1D)&mode)!=0);
#endif
@@ -153,9 +153,9 @@ void StateSetManipulator::getUsage(osg::ApplicationUsage& usage) const
void StateSetManipulator::setBackfaceEnabled(bool newbackface)
{
if (_backface == newbackface) return;
clone();
_backface = newbackface;
if( _backface ) _stateset->setMode(GL_CULL_FACE,osg::StateAttribute::ON);
else _stateset->setMode(GL_CULL_FACE,osg::StateAttribute::OVERRIDE|osg::StateAttribute::OFF);
@@ -164,7 +164,7 @@ void StateSetManipulator::setBackfaceEnabled(bool newbackface)
void StateSetManipulator::setLightingEnabled(bool newlighting)
{
if (_lighting == newlighting) return;
clone();
_lighting = newlighting;
@@ -175,7 +175,7 @@ void StateSetManipulator::setLightingEnabled(bool newlighting)
void StateSetManipulator::setTextureEnabled(bool newtexture)
{
if (_texture==newtexture) return;
clone();
_texture = newtexture;
@@ -213,7 +213,7 @@ void StateSetManipulator::cyclePolygonMode()
osg::PolygonMode* polyModeObj = getOrCreatePolygonMode();
osg::PolygonMode::Mode currentMode = getPolygonMode();
// cycle through the available modes.
// cycle through the available modes.
switch(currentMode)
{
case osg::PolygonMode::FILL : polyModeObj->setMode(osg::PolygonMode::FRONT_AND_BACK,osg::PolygonMode::LINE); break;
@@ -232,7 +232,7 @@ osg::PolygonMode::Mode StateSetManipulator::getPolygonMode() const
osg::PolygonMode* StateSetManipulator::getOrCreatePolygonMode()
{
osg::PolygonMode* polyModeObj = dynamic_cast<osg::PolygonMode*>(_stateset->getAttribute(osg::StateAttribute::POLYGONMODE));
if (!polyModeObj)
if (!polyModeObj)
{
polyModeObj = new osg::PolygonMode;
_stateset->setAttribute(polyModeObj);

View File

@@ -28,7 +28,7 @@ UFOManipulator::UFOManipulator():
_t0(0.0),
_shift(false),
_ctrl(false)
{
{
_minHeightAboveGround = 2.0;
_minDistanceInFront = 5.0;
@@ -67,9 +67,9 @@ bool UFOManipulator::intersect(const osg::Vec3d& start, const osg::Vec3d& end, o
osgUtil::IntersectionVisitor iv(lsi.get());
iv.setTraversalMask(_intersectTraversalMask);
_node->accept(iv);
if (lsi->containsIntersections())
{
intersection = lsi->getIntersections().begin()->getWorldIntersectPoint();
@@ -82,7 +82,7 @@ void UFOManipulator::setNode( osg::Node *node )
{
_node = node;
if (getAutoComputeHomePosition())
if (getAutoComputeHomePosition())
computeHomePosition();
home(0.0);
@@ -99,12 +99,12 @@ osg::Node* UFOManipulator::getNode()
}
const char* UFOManipulator::className() const
{
return "UFO";
const char* UFOManipulator::className() const
{
return "UFO";
}
void UFOManipulator::setByMatrix( const osg::Matrixd &mat )
void UFOManipulator::setByMatrix( const osg::Matrixd &mat )
{
_inverseMatrix = mat;
_matrix.invert( _inverseMatrix );
@@ -117,7 +117,7 @@ void UFOManipulator::setByMatrix( const osg::Matrixd &mat )
_stop();
}
void UFOManipulator::setByInverseMatrix( const osg::Matrixd &invmat)
void UFOManipulator::setByInverseMatrix( const osg::Matrixd &invmat)
{
_matrix = invmat;
_inverseMatrix.invert( _matrix );
@@ -135,7 +135,7 @@ osg::Matrixd UFOManipulator::getMatrix() const
return (osg::Matrix::inverse(_offset) * _matrix);
}
osg::Matrixd UFOManipulator::getInverseMatrix() const
osg::Matrixd UFOManipulator::getInverseMatrix() const
{
return (_inverseMatrix * _offset);
}
@@ -149,7 +149,7 @@ void UFOManipulator::computeHomePosition()
/*
* Find the ground - Assumption: The ground is the hit of an intersection
* from a line segment extending from above to below the database at its
* from a line segment extending from above to below the database at its
* horizontal center, that intersects the database closest to zero. */
osg::CoordinateFrame cf( getCoordinateFrame(bs.center()) ); // not sure what position to use here
@@ -191,7 +191,7 @@ void UFOManipulator::init(const GUIEventAdapter&, GUIActionAdapter&)
_stop();
}
void UFOManipulator::home(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us)
void UFOManipulator::home(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us)
{
home(ea.getTime());
us.requestRedraw();
@@ -199,9 +199,9 @@ void UFOManipulator::home(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdap
}
void UFOManipulator::home(double)
void UFOManipulator::home(double)
{
if (getAutoComputeHomePosition())
if (getAutoComputeHomePosition())
computeHomePosition();
_position = _homeEye;
@@ -256,7 +256,7 @@ bool UFOManipulator::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAda
void UFOManipulator::getUsage(osg::ApplicationUsage& usage) const
{
/** Way too busy. This needs to wait until we have a scrollable window
/** Way too busy. This needs to wait until we have a scrollable window
usage.addKeyboardMouseBinding("UFO Manipulator: <SpaceBar>", "Reset the viewing angle to 0.0");
usage.addKeyboardMouseBinding("UFO Manipulator: <UpArrow>", "Acceleration forward.");
usage.addKeyboardMouseBinding("UFO Manipulator: <DownArrow>", "Acceleration backward (or deceleration forward");
@@ -429,7 +429,7 @@ void UFOManipulator::_keyDown( const osgGA::GUIEventAdapter &ea, osgGA::GUIActio
if( fabs( _directionRotationRate ) < _directionRotationEpsilon )
_directionRotationRate = 0.0;
}
}
break;
@@ -464,7 +464,7 @@ void UFOManipulator::_frame( const osgGA::GUIEventAdapter &ea, osgGA::GUIActionA
{
osg::Vec3d _sideVec = _direction * osg::Matrix::rotate( -M_PI*0.5, upVec);
_position += ((_direction * _forwardSpeed) +
_position += ((_direction * _forwardSpeed) +
(_sideVec * _sideSpeed) +
(upVec * _upSpeed))
* _dt;
@@ -476,7 +476,7 @@ void UFOManipulator::_frame( const osgGA::GUIEventAdapter &ea, osgGA::GUIActionA
_pitchOffset *= -1;
_yawOffset += _yawOffsetRate * _dt;
if( _yawOffset >= M_PI || _yawOffset < -M_PI )
if( _yawOffset >= M_PI || _yawOffset < -M_PI )
_yawOffset *= -1;
_offset = osg::Matrix::rotate( _yawOffset, getSideVector(cf),
@@ -485,7 +485,7 @@ void UFOManipulator::_frame( const osgGA::GUIEventAdapter &ea, osgGA::GUIActionA
_adjustPosition();
_inverseMatrix.makeLookAt( _position, _position + _direction, upVec);
_inverseMatrix.makeLookAt( _position, _position + _direction, upVec);
_matrix.invert(_inverseMatrix);
if( _decelerateUpSideRate )
@@ -540,7 +540,7 @@ void UFOManipulator::_adjustPosition()
// Check intersects infront.
osg::Vec3d ip;
if (intersect(_position,
if (intersect(_position,
_position + (_direction * (_minDistanceInFront * 3.0)),
ip ))
{
@@ -552,13 +552,13 @@ void UFOManipulator::_adjustPosition()
_stop();
}
}
// Check intersects below.
osg::CoordinateFrame cf( getCoordinateFrame(_position) );
osg::Vec3d upVec( getUpVector(cf) );
if (intersect(_position,
_position - upVec*_minHeightAboveGround*3,
if (intersect(_position,
_position - upVec*_minHeightAboveGround*3,
ip ))
{
double d = (ip - _position).length();

View File

@@ -1,13 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/