当前位置: 首页>>代码示例>>C++>>正文


C++ WindowEventProducerUnrecPtr类代码示例

本文整理汇总了C++中WindowEventProducerUnrecPtr的典型用法代码示例。如果您正苦于以下问题:C++ WindowEventProducerUnrecPtr类的具体用法?C++ WindowEventProducerUnrecPtr怎么用?C++ WindowEventProducerUnrecPtr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了WindowEventProducerUnrecPtr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: keyPressed

   virtual void keyPressed(const KeyEventUnrecPtr e)
   {
       if(e->getKey() == KeyEvent::KEY_Q && e->getModifiers() & KeyEvent::KEY_MODIFIER_COMMAND)
       {
           TutorialWindow->closeWindow();
       }

       switch(e->getKey())
       {
       case KeyEvent::KEY_SPACE:
           TheAnimation->pause(!TheAnimation->isPaused());
           break;
       case KeyEvent::KEY_ENTER:
           TheAnimation->attachUpdateProducer(TutorialWindow->editEventProducer());
           TheAnimation->start();
           break;
       case KeyEvent::KEY_1:
                dynamic_pointer_cast<FieldAnimation>(TheAnimation)->setInterpolationType(Animator::STEP_INTERPOLATION);
           break;
       case KeyEvent::KEY_2:
                dynamic_pointer_cast<FieldAnimation>(TheAnimation)->setInterpolationType(Animator::LINEAR_INTERPOLATION);
           break;
       case KeyEvent::KEY_3:
                dynamic_pointer_cast<FieldAnimation>(TheAnimation)->setInterpolationType(Animator::CUBIC_INTERPOLATION);
           break;
       }
   }
开发者ID:msteners,项目名称:OpenSGToolbox,代码行数:27,代码来源:02TransformAnimation.cpp

示例2: keyPressed

   virtual void keyPressed(const KeyEventUnrecPtr e)
   {
       if(e->getKey() == KeyEvent::KEY_Q && e->getModifiers() & KeyEvent::KEY_MODIFIER_COMMAND)
       {
           TutorialWindow->closeWindow();
       }

       switch(e->getKey())
       {
       case KeyEvent::KEY_SPACE:
           TheAnimationGroup->pause(!TheAnimationGroup->isPaused());
           break;
       case KeyEvent::KEY_ENTER:
           TheAnimationGroup->attachUpdateProducer(TutorialWindow->editEventProducer());
           TheAnimationGroup->start();
           break;
       case KeyEvent::KEY_MINUS:
           TheAnimationGroup->setScale(osgMax(TheAnimationGroup->getScale()-0.1f, 0.0f));
           break;
       case KeyEvent::KEY_PLUS:
       case KeyEvent::KEY_EQUALS:
           TheAnimationGroup->setScale(osgMax(TheAnimationGroup->getScale()+0.1f, 0.0f));
           break;
       }
   }
开发者ID:danguilliams,项目名称:OpenSGToolbox,代码行数:25,代码来源:07AnimationGroup.cpp

示例3: setupAnimation

void setupAnimation(void)
{
    //Color Keyframe Sequence
    KeyframeColorSequenceUnrecPtr ColorKeyframes = KeyframeColorSequenceColor3f::create();
    ColorKeyframes->addKeyframe(Color4f(1.0f,0.0f,0.0f,1.0f),0.0f);
    ColorKeyframes->addKeyframe(Color4f(0.0f,1.0f,0.0f,1.0f),2.0f);
    ColorKeyframes->addKeyframe(Color4f(0.0f,0.0f,1.0f,1.0f),4.0f);
    ColorKeyframes->addKeyframe(Color4f(1.0f,0.0f,0.0f,1.0f),6.0f);

    //Animator
    KeyframeAnimatorUnrecPtr TheAnimator = KeyframeAnimator::create();
    TheAnimator->setKeyframeSequence(ColorKeyframes);
    
    //Animation
    TheAnimation = FieldAnimation::create();
    TheAnimation->setAnimator(TheAnimator);
    TheAnimation->setInterpolationType(Animator::LINEAR_INTERPOLATION);
    TheAnimation->setCycling(-1);
	TheAnimation->setAnimatedMultiField(TutorialBackground, std::string("color"), 1);

    //Animation Listener
    TheAnimation->addAnimationListener(&TheAnimationListener);

    TheAnimation->attachUpdateProducer(TutorialWindow->editEventProducer());
    TheAnimation->start();
}
开发者ID:Langkamp,项目名称:OpenSGToolbox,代码行数:26,代码来源:03MFieldAnimation.cpp

示例4: keyPressed

 virtual void keyPressed(const KeyEventUnrecPtr e)
 {
     if(e->getKey() == KeyEvent::KEY_Q && e->getModifiers() & KeyEvent::KEY_MODIFIER_CONTROL)
     {
         TutorialWindow->closeWindow();
     }
 }
开发者ID:Langkamp,项目名称:OpenSGToolbox,代码行数:7,代码来源:04ShaderAnimation.cpp

示例5: setupAnimation

void setupAnimation(void)
{
	//Read animation data from XML file
	FCFileType::FCPtrStore NewContainers;
	NewContainers = FCFileHandler::the()->read(BoostPath("./Data/15TestAnimations.xml"));

	FCFileType::FCPtrStore::iterator Itor;
    for(Itor = NewContainers.begin() ; Itor != NewContainers.end() ; ++Itor)
    {
		if( (*Itor)->getType().isDerivedFrom(Animation::getClassType()))
		{
			//Set the animation to the one we just read in
			TheAnimation = (dynamic_pointer_cast<Animation>(*Itor));
		}
		else if( (*Itor)->getType() == (SimpleMaterial::getClassType()))
		{
			//Set torus material
			TheTorusMaterial = (dynamic_pointer_cast<SimpleMaterial>(*Itor));
			
			//Attach torus material to torus geometry
				TorusGeometry->setMaterial(TheTorusMaterial);
		}
    }

    TheAnimation->attachUpdateProducer(TutorialWindow->editEventProducer());
    TheAnimation->start();
}
开发者ID:Langkamp,项目名称:OpenSGToolbox,代码行数:27,代码来源:15LoadXMLAnimation.cpp

示例6: initAnimations

void initAnimations(FieldContainerUnrecPtr AnimatedObject, std::string AnimatedField)
{
	//Main Animation
	TheAnimation = createColorAnimation(AnimatedObject, AnimatedField);

    TheAnimation->attachUpdateProducer(TutorialWindow->editEventProducer());
    TheAnimation->start();
}
开发者ID:Langkamp,项目名称:OpenSGToolbox,代码行数:8,代码来源:04ShaderAnimation.cpp

示例7: keyPressed

   virtual void keyPressed(const KeyEventUnrecPtr e)
   {
	   //Exit
       if(e->getKey() == KeyEvent::KEY_Q && e->getModifiers() & KeyEvent::KEY_MODIFIER_COMMAND)
       {
           TutorialWindow->closeWindow();
       }

	   //Toggle animation
	   if(e->getKey() == KeyEvent::KEY_SPACE)
	   {
		   if(animationPaused)
			   animationPaused = false;
		   else
			   animationPaused = true;
	   }

	   //Toggle bind pose
	   if(e->getKey() == KeyEvent::KEY_B)
	   {
		   //Toggle skeleton
		   if(dynamic_cast<SkeletonDrawable*>(SkeletonNode->getCore())->getDrawBindPose() == false)
		   {
				 dynamic_cast<SkeletonDrawable*>(SkeletonNode->getCore())->setDrawBindPose(true);
		   } 
		   else
		   {
				 dynamic_cast<SkeletonDrawable*>(SkeletonNode->getCore())->setDrawBindPose(false);
		   }
	   }

	   //Toggle current pose
	   if(e->getKey() == KeyEvent::KEY_P)
	   {
		   //Toggle skeleton
		   if(dynamic_cast<SkeletonDrawable*>(SkeletonNode->getCore())->getDrawPose() == false)
		   {
				 dynamic_cast<SkeletonDrawable*>(SkeletonNode->getCore())->setDrawPose(true);
		   } 
		   else
		   {
				 dynamic_cast<SkeletonDrawable*>(SkeletonNode->getCore())->setDrawPose(false);
		   }
	   }

	   //Switch animation
	   if(e->getKey() == KeyEvent::KEY_1)
	   {
			TheCurrentAnimation = TheJointAnimation;
	   }
	   else if(e->getKey() == KeyEvent::KEY_2)
	   {
			TheCurrentAnimation = TheChildJointAnimation;
	   }
   }
开发者ID:msteners,项目名称:OpenSGToolbox,代码行数:55,代码来源:11BoneAnimation.cpp

示例8: setupAnimation

void setupAnimation(void)
{
    std::vector<BoostPath> _ImagePaths;
    _ImagePaths.push_back(BoostPath("./Data/Anim001.jpg"));
    _ImagePaths.push_back(BoostPath("./Data/Anim002.jpg"));
    _ImagePaths.push_back(BoostPath("./Data/Anim003.jpg"));
    _ImagePaths.push_back(BoostPath("./Data/Anim004.jpg"));
    _ImagePaths.push_back(BoostPath("./Data/Anim005.jpg"));

    //Make the textures
    for(UInt32 i(0) ; i<_ImagePaths.size(); ++i)
    {
        ImageUnrecPtr AnimFrameImage = ImageFileHandler::the()->read(_ImagePaths[i].string().c_str());
           
        _Images.push_back(AnimFrameImage);
    }
    
    TextureObjChunkUnrecPtr AnimFrameTexture = TextureObjChunk::create();
    AnimFrameTexture->setImage(_Images.front());

    //Box Material
    MaterialChunkUnrecPtr TheMaterialChunk = MaterialChunk::create();
    TheMaterialChunk->setAmbient(Color4f(0.4,0.4,0.4,1.0));
    TheMaterialChunk->setDiffuse(Color4f(0.8,0.8,0.8,1.0));
    TheMaterialChunk->setSpecular(Color4f(1.0,1.0,1.0,1.0));

    TheBoxMaterial = ChunkMaterial::create();
    TheBoxMaterial->addChunk(AnimFrameTexture);

    //Texture Keyframe Sequence
    KeyframeFCPtrSequenceUnrecPtr TextureKeyframes = KeyframeFCPtrSequenceImage::create();
    for(UInt32 i(0) ; i<_Images.size(); ++i)
    {
        TextureKeyframes->addKeyframe(_Images[i],static_cast<Real32>(i)*0.5f);
    }
    
    //Animator
    TutorialTextureAnimator = KeyframeAnimator::create();
    TutorialTextureAnimator->setKeyframeSequence(TextureKeyframes);
    
    //Animation
    TutorialTextureAnimation = FieldAnimation::create();
    TutorialTextureAnimation->setAnimator(TutorialTextureAnimator);
    TutorialTextureAnimation->setInterpolationType(Animator::STEP_INTERPOLATION);
    TutorialTextureAnimation->setCycling(-1);
    TutorialTextureAnimation->setAnimatedField(AnimFrameTexture,TextureObjChunk::ImageFieldId);

    //Animation Listener
    TutorialTextureAnimation->addAnimationListener(&TutorialTextureAnimationListener);

    TutorialTextureAnimation->attachUpdateProducer(TutorialWindow->editEventProducer());
    TutorialTextureAnimation->start();
}
开发者ID:rdgoetz,项目名称:OpenSGToolbox,代码行数:53,代码来源:05TextureAnimation.cpp

示例9: keyTyped

    virtual void keyTyped(const KeyEventUnrecPtr e)
    {
       if(e->getKey() == KeyEvent::KEY_Q && e->getModifiers() & KeyEvent::KEY_MODIFIER_CONTROL)
       {
           TheWindowEventProducer->closeWindow();
       }

       switch(e->getKey())
       {
       case KeyEvent::KEY_1:
       case KeyEvent::KEY_2:
       case KeyEvent::KEY_3:
       case KeyEvent::KEY_4:
       case KeyEvent::KEY_5:
       case KeyEvent::KEY_6:
       case KeyEvent::KEY_7:
       case KeyEvent::KEY_8:
       case KeyEvent::KEY_9:
           {
               UInt8 Index(e->getKeyChar() - '1');
               if(Index < Sounds.size())
               {
                   Sounds[Index]->play();
               }
           }
           break;
       case KeyEvent::KEY_P:
           SoundGroups[0]->pause();
           break;
       case KeyEvent::KEY_U:
           SoundGroups[0]->unpause();
           break;
       case KeyEvent::KEY_MINUS:
           {
                Real32 Volume(SoundGroups[0]->getVolume());
                Volume -= 0.1;
                if(Volume < 0.0) Volume = 0.0;
                SoundGroups[0]->setVolume(Volume);
           }
           break;
       case KeyEvent::KEY_EQUALS:
           {
                Real32 Volume(SoundGroups[0]->getVolume());
                Volume += 0.1;
                if(Volume > 1.0) Volume = 1.0;
                SoundGroups[0]->setVolume(Volume);
           }
           break;
       }
    }
开发者ID:Langkamp,项目名称:OpenSGToolbox,代码行数:50,代码来源:04XMLSoundLoading.cpp

示例10: keyPressed

   virtual void keyPressed(const KeyEventUnrecPtr e)
   {
	   //Exit
       if(e->getKey() == KeyEvent::KEY_Q && e->getModifiers() & KeyEvent::KEY_MODIFIER_CONTROL)
       {
           TutorialWindow->closeWindow();
       }

	   //Toggle animation
	   if(e->getKey() == KeyEvent::KEY_SPACE)
	   {
		   if(animationPaused)
			   animationPaused = false;
		   else
			   animationPaused = true;
	   }
   }
开发者ID:Langkamp,项目名称:OpenSGToolbox,代码行数:17,代码来源:15LoadXMLAnimation.cpp

示例11: keyPressed

 virtual void keyPressed(const KeyEventUnrecPtr e)
 {
     if(e->getKey() == KeyEvent::KEY_Q && e->getModifiers() & KeyEvent::KEY_MODIFIER_COMMAND)
     {
         TutorialWindow->closeWindow();
     }
     switch(e->getKey())
     {
     case KeyEvent::KEY_S:
          {
              allPhysicsBodies.push_back(buildSphere());
          }
          break;
     case KeyEvent::KEY_B:
          {
              allPhysicsBodies.push_back(buildBox());
          }
          break;
     case KeyEvent::KEY_E:
         makeExplosion(Pnt3f(0.0f,0.0f,-5.0f), 1280.0f);
         break;
     case KeyEvent::KEY_1:
         makeExplosion(Pnt3f(0.0f,0.0f,-5.0f), 20.0f);
         break;
     case KeyEvent::KEY_2:
         makeExplosion(Pnt3f(0.0f,0.0f,-5.0f), 80.0f);
         break;
     case KeyEvent::KEY_3:
         makeExplosion(Pnt3f(0.0f,0.0f,-5.0f), 320.0f);
         break;
     case KeyEvent::KEY_4:
         makeExplosion(Pnt3f(0.0f,0.0f,-5.0f), 1280.0f);
         break;
     case KeyEvent::KEY_5:
         makeExplosion(Pnt3f(0.0f,0.0f,-5.0f), 5120.0f);
         break;
     case KeyEvent::KEY_6:
         makeExplosion(Pnt3f(0.0f,0.0f,-5.0f), 20480.0f);
         break;
     }
 }
开发者ID:danguilliams,项目名称:OpenSGToolbox,代码行数:41,代码来源:05Explosion.cpp

示例12: setupAnimation

void setupAnimation(void)
{
    //Number Keyframe Sequence
    KeyframeNumberSequenceReal32UnrecPtr XTransKeyframes = KeyframeNumberSequenceReal32::create();
    XTransKeyframes->addKeyframe(1.0,0.0f);
    XTransKeyframes->addKeyframe(5.0,2.0f);
    XTransKeyframes->addKeyframe(-5.0,4.0f);
    XTransKeyframes->addKeyframe(1.0,6.0f);
    
    KeyframeNumberSequenceReal32UnrecPtr YRotKeyframes = KeyframeNumberSequenceReal32::create();
    YRotKeyframes->addKeyframe(0.0,0.0f);
    YRotKeyframes->addKeyframe(45.0,2.0f);
    YRotKeyframes->addKeyframe(0.0,4.0f);

    KeyframeNumberSequenceReal32UnrecPtr ZScaleKeyframes = KeyframeNumberSequenceReal32::create();
    ZScaleKeyframes->addKeyframe(1.0,0.0f);
    ZScaleKeyframes->addKeyframe(2.0,2.0f);
    ZScaleKeyframes->addKeyframe(3.0,4.0f);
    ZScaleKeyframes->addKeyframe(1.0,6.0f);

    //Animator
    TransformAnimatorUnrecPtr TheAnimator = TransformAnimator::create();
    TheAnimator->setXTranslationSequence(XTransKeyframes);
    TheAnimator->setXRotationSequence(YRotKeyframes);
    TheAnimator->setYRotationSequence(YRotKeyframes);
    //TheAnimator->setZRotationSequence(YRotKeyframes);
    TheAnimator->setZScaleSequence(ZScaleKeyframes);
    
    //Animation
    TheAnimation = FieldAnimation::create();
    TheAnimation->setAnimator(TheAnimator);
    TheAnimation->setInterpolationType(Animator::LINEAR_INTERPOLATION);
    TheAnimation->setCycling(2);
    TheAnimation->setAnimatedField(TorusNodeTrans, std::string("matrix"));

    //Animation Listener
    TheAnimation->addAnimationListener(&TheAnimationListener);

    TheAnimation->attachUpdateProducer(TutorialWindow->editEventProducer());
    TheAnimation->start();
}
开发者ID:msteners,项目名称:OpenSGToolbox,代码行数:41,代码来源:02TransformAnimation.cpp

示例13: main

// Initialize GLUT & OpenSG and set up the scene
int main(int argc, char **argv)
{
    // OSG init
    osgInit(argc,argv);

    // Set up Window
    TutorialWindow = createNativeWindow();

    //Initialize Window
    TutorialWindow->initWindow();

    TutorialWindow->setDisplayCallback(display);
    TutorialWindow->setReshapeCallback(reshape);

    //Add Window Listener
    TutorialKeyListener TheKeyListener;
    TutorialWindow->addKeyListener(&TheKeyListener);
    TutorialMouseListener TheTutorialMouseListener;
    TutorialMouseMotionListener TheTutorialMouseMotionListener;
    TutorialWindow->addMouseListener(&TheTutorialMouseListener);
    TutorialWindow->addMouseMotionListener(&TheTutorialMouseMotionListener);

    // Create the SimpleSceneManager helper
    mgr = new SimpleSceneManager;

    // Tell the Manager what to manage
    mgr->setWindow(TutorialWindow);

    //Setup the Animation
    setupAnimation();

    //Box Geometry
    GeometryUnrecPtr BoxGeometry = makeBoxGeo(1.0,1.0,1.0,1,1,1);
    BoxGeometry->setMaterial(TheBoxMaterial);
    
    NodeUnrecPtr BoxGeometryNode = Node::create();
    BoxGeometryNode->setCore(BoxGeometry);

    //Make Box Node
    NodeUnrecPtr BoxNode = Node::create();
    TransformUnrecPtr BoxNodeTrans;
    BoxNodeTrans = Transform::create();

    BoxNode->setCore(BoxNodeTrans);
    BoxNode->addChild(BoxGeometryNode);

    //Make Main Scene Node
    NodeUnrecPtr scene = Node::create();
    ComponentTransformUnrecPtr Trans;
    Trans = ComponentTransform::create();
    scene->setCore(Trans);

    // add the torus as a child
    scene->addChild(BoxNode);

    // tell the manager what to manage
    mgr->setRoot  (scene);

    // show the whole scene
    mgr->showAll();
    
    //Open Window
    Vec2f WinSize(TutorialWindow->getDesktopSize() * 0.85f);
    Pnt2f WinPos((TutorialWindow->getDesktopSize() - WinSize) *0.5);

    TutorialWindow->openWindow(WinPos,
                               WinSize,
                               "05TextureAnimation");

    //Main Loop
    TutorialWindow->mainLoop();

    osgExit();

    return 0;
}
开发者ID:rdgoetz,项目名称:OpenSGToolbox,代码行数:77,代码来源:05TextureAnimation.cpp

示例14: main

int main(int argc, char **argv)
{
    // OSG init
    osgInit(argc,argv);

    // Set up Window
    TutorialWindow = createNativeWindow();
    TutorialWindow->initWindow();

    TutorialWindow->setDisplayCallback(display);
    TutorialWindow->setReshapeCallback(reshape);

    //Add Window Listener
    TutorialKeyListener TheKeyListener;
    TutorialWindow->addKeyListener(&TheKeyListener);
    TutorialMouseListener TheTutorialMouseListener;
    TutorialMouseMotionListener TheTutorialMouseMotionListener;
    TutorialWindow->addMouseListener(&TheTutorialMouseListener);
    TutorialWindow->addMouseMotionListener(&TheTutorialMouseMotionListener);

    // Create the SimpleSceneManager helper
    mgr = new SimpleSceneManager;

    // Tell the Manager what to manage
    mgr->setWindow(TutorialWindow);


    //SkeletonDrawer System Material
    LineChunkUnrecPtr ExampleLineChunk = LineChunk::create();
    ExampleLineChunk->setWidth(2.0f);
    ExampleLineChunk->setSmooth(true);

    BlendChunkUnrecPtr ExampleBlendChunk = BlendChunk::create();
    ExampleBlendChunk->setSrcFactor(GL_SRC_ALPHA);
    ExampleBlendChunk->setDestFactor(GL_ONE_MINUS_SRC_ALPHA);

    MaterialChunkUnrecPtr ExampleMaterialChunk = MaterialChunk::create();
    ExampleMaterialChunk->setAmbient(Color4f(1.0f,1.0f,1.0f,1.0f));
    ExampleMaterialChunk->setDiffuse(Color4f(0.0f,0.0f,0.0f,1.0f));
    ExampleMaterialChunk->setSpecular(Color4f(0.0f,0.0f,0.0f,1.0f));

    ChunkMaterialUnrecPtr ExampleMaterial = ChunkMaterial::create();
    ExampleMaterial->addChunk(ExampleLineChunk);


    //Read skeleton from XML file
    FCFileType::FCPtrStore NewContainers;
    NewContainers = FCFileHandler::the()->read(BoostPath("./Data/16Skeleton.xml"));

    SkeletonUnrecPtr ExampleSkeleton;

    FCFileType::FCPtrStore::iterator Itor;
    for(Itor = NewContainers.begin() ; Itor != NewContainers.end() ; ++Itor)
    {
        //Only import skeleton data; we ignore anything else saved in the XML file
        if( (*Itor)->getType() == (Skeleton::getClassType()))
        {
            //Set the Skeleton to the one we just read in
            ExampleSkeleton = (dynamic_pointer_cast<Skeleton>(*Itor));
        }
    }

    //SkeletonDrawer
    SkeletonDrawableUnrecPtr ExampleSkeletonDrawable = SkeletonDrawable::create();
    ExampleSkeletonDrawable->setSkeleton(ExampleSkeleton);
    ExampleSkeletonDrawable->setMaterial(ExampleMaterial);

    //Skeleton Particle System Node
    NodeUnrecPtr SkeletonNode = Node::create();
    SkeletonNode->setCore(ExampleSkeletonDrawable);


    //Torus Node
    NodeUnrecPtr TorusNode = makeTorus(.5, 2, 32, 32);

    // Make Main Scene Node and add the Torus
    NodeUnrecPtr scene = Node::create();
    scene->setCore(Group::create());
    scene->addChild(SkeletonNode);
    //scene->addChild(TorusNode);
    scene->addChild(makeCoordAxis(10.0));

    mgr->setRoot(scene);
    mgr->turnHeadlightOff();

    // Show the whole Scene
    mgr->showAll();

    Vec2f WinSize(TutorialWindow->getDesktopSize() * 0.85f);
    Pnt2f WinPos((TutorialWindow->getDesktopSize() - WinSize) *0.5);
    TutorialWindow->openWindow(WinPos,
            WinSize,
            "16LoadXMLSkeleton");

    //Enter main Loop
    TutorialWindow->mainLoop();

    osgExit();

    return 0;
//.........这里部分代码省略.........
开发者ID:achvas88,项目名称:OpenSGToolbox,代码行数:101,代码来源:16LoadXMLSkeleton.cpp

示例15: keyPressed

    virtual void keyPressed(const KeyEventUnrecPtr e)
    {
        //Exit
        if(e->getKey() == KeyEvent::KEY_Q && e->getModifiers() & KeyEvent::KEY_MODIFIER_COMMAND)
        {
            TutorialWindow->closeWindow();
        }

        //Toggle animation
        if(e->getKey() == KeyEvent::KEY_SPACE)
        {
            if(animationPaused)
                animationPaused = false;
            else
                animationPaused = true;
        }

        //Toggle bind pose
        if(e->getKey() == KeyEvent::KEY_B)
        {
            if(e->getModifiers() & KeyEvent::KEY_MODIFIER_SHIFT)
            {
                //Toggle mesh
                if(UnboundGeometry->getTravMask() == 0)
                {
                    UnboundGeometry->setTravMask(1);
                } 
                else
                {
                    UnboundGeometry->setTravMask(0);
                }
            }
            else
            {
                //Toggle skeleton
                if(dynamic_cast<SkeletonDrawable*>(SkeletonNode->getCore())->getDrawBindPose() == false)
                {
                    dynamic_cast<SkeletonDrawable*>(SkeletonNode->getCore())->setDrawBindPose(true);
                } 
                else
                {
                    dynamic_cast<SkeletonDrawable*>(SkeletonNode->getCore())->setDrawBindPose(false);
                }
            }
        }

        //Toggle current pose
        if(e->getKey() == KeyEvent::KEY_P)
        {
            if(e->getModifiers() & KeyEvent::KEY_MODIFIER_SHIFT)
            {
                //Toggle mesh
                if(MeshNode->getTravMask() == 0)
                {
                    MeshNode->setTravMask(1);
                } 
                else
                {
                    MeshNode->setTravMask(0);
                }
            }
            else
            {
                //Toggle skeleton
                if(dynamic_cast<SkeletonDrawable*>(SkeletonNode->getCore())->getDrawPose() == false)
                {
                    dynamic_cast<SkeletonDrawable*>(SkeletonNode->getCore())->setDrawPose(true);
                } 
                else
                {
                    dynamic_cast<SkeletonDrawable*>(SkeletonNode->getCore())->setDrawPose(false);
                }
            }
        }
    }
开发者ID:msteners,项目名称:OpenSGToolbox,代码行数:75,代码来源:13MeshBlending.cpp


注:本文中的WindowEventProducerUnrecPtr类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。