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


C# FrameEvent类代码示例

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


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

示例1: ExampleApp_FrameStarted

        protected override bool ExampleApp_FrameStarted(FrameEvent evt)
        {
            if(base.ExampleApp_FrameStarted(evt) == false )
                return false;

            if( inputKeyboard.IsKeyDown( MOIS.KeyCode.KC_N ) )
            {
                pThrusters.SetDefaultDimensions( fDefDim + 0.25f, fDefDim + 0.25f );
                fDefDim += 0.25f;
            }

            if( inputKeyboard.IsKeyDown( MOIS.KeyCode.KC_M ) )
            {
                pThrusters.SetDefaultDimensions( fDefDim - 0.25f, fDefDim - 0.25f );
                fDefDim -= 0.25f;
            }

            if( inputKeyboard.IsKeyDown( MOIS.KeyCode.KC_H ) )
            {
                pThrusters.GetEmitter( 0 ).ParticleVelocity = fDefVel + 1;
                pThrusters.GetEmitter( 1 ).ParticleVelocity = fDefVel + 1;
                fDefVel += 1;
            }

            if( inputKeyboard.IsKeyDown( MOIS.KeyCode.KC_J ) && !( fDefVel < 0.0f ) )
            {
                pThrusters.GetEmitter( 0 ).ParticleVelocity = fDefVel - 1;
                pThrusters.GetEmitter( 1 ).ParticleVelocity = fDefVel - 1;
                fDefVel -= 1;
            }

            return true;
        }
开发者ID:andyhebear,项目名称:mogresdk,代码行数:33,代码来源:SkyBoxApplication.cs

示例2: PreSimulate

        /// <summary>
        /// We can't use constraints because otherwise we wouldn't be able to do loops.
        /// </summary>
        void PreSimulate(DiscreteDynamicsWorld world, FrameEvent evt)
        {
            // if the kart's gone, then we can get rid of this handler too
            if (kart == null || kart.Vehicle.IsDisposed) {
                Detach();
                return;
            }
            // don't self-right if we're paused
            else if (Pauser.IsPaused)
                return;

            // so first we get the kart's orientation
            // then we basically get its local Y axis and average it with the global Y axis to make more of a smooth transition
            Vector3 locY = kart.ActualOrientation.YAxis;

            // first of all, if we're self righted enough, we can get rid of this handler
            if (locY.DirectionEquals(Vector3.UNIT_Y, closeEnoughToUp)) { // 3 degrees
                //Detach();
                return;
            }

            // stop it spinning
            kart.Body.AngularVelocity = Vector3.ZERO;

            // update its rotation to point upwards
            var quat = kart.ActualOrientation;
            // make the x and z factors smaller, so that all that's left at the end is the Y pointing upwards
            quat.x *= 0.92f;
            quat.z *= 0.92f;
            quat.Normalise();

            // then update the body's transform
            kart.Body.SetOrientation(quat);
        }
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:37,代码来源:SelfRighter.cs

示例3: Update

 public override void Update(FrameEvent evt)
 {
     Animate(evt);
     //Here goes the collision detection with the player
     // (ignore until week 8) ...
     base.Update(evt);
 }
开发者ID:Bobbylon5,项目名称:Mogre14,代码行数:7,代码来源:CollectableGun.cs

示例4: FrameStarted

        bool FrameStarted(FrameEvent evt)
        {
            if (PhysicsMain.DrawLines) {

                MogreDebugDrawer.Singleton.Build();
            }
            return true;
        }
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:8,代码来源:DebugDrawerHandler.cs

示例5: ExampleApp_FrameStarted

        protected override bool ExampleApp_FrameStarted(FrameEvent evt)
        {
            // Rotate fountains
            mFountainNode.Yaw(evt.timeSinceLastFrame * 30);

            // Call default
            return base.ExampleApp_FrameStarted(evt);
        }
开发者ID:andyhebear,项目名称:mogresdk,代码行数:8,代码来源:SmokeApplication.cs

示例6: Skeletal_FrameStarted

        bool Skeletal_FrameStarted(FrameEvent evt)
        {
            for (int i = 0; i < NUM_ROBOTS; ++i)
            {
                _animState[i].AddTime(evt.timeSinceLastFrame * _animationSpeed[i]);
            }

            return true;
        }
开发者ID:andyhebear,项目名称:likeleon,代码行数:9,代码来源:Skeletal.cs

示例7: Update

        public virtual void Update(FrameEvent frameEvent)
        {
            //if (State.MainWindow.RenderWindowFocused == false) return;

            State.InputManger.Capture();

            Rotate(YawAngle(), PitchAngle());

            Translate(GetTranslation() * frameEvent.timeSinceLastFrame);
        }
开发者ID:crescent,项目名称:SubmarineSim3D,代码行数:10,代码来源:ControlState.cs

示例8: Update

        public virtual void Update(FrameEvent evt)
        {
            // Projectile collision detection goes here
            // (ignore until week 8) ...

            if (!remove && time.Milliseconds > maxTime)
            {
                Dispose();
                remove = true;
            }
        }
开发者ID:Bobbylon5,项目名称:Mogre14,代码行数:11,代码来源:Projectile.cs

示例9: UpdateCamera

        protected override bool UpdateCamera(FrameEvent evt)
        {
            base.UpdateCamera(evt);

            Vector3 displacement = CameraNode._getDerivedPosition() - TargetNode.Position;

            TargetNode.Orientation = CameraNode.Orientation;
            TargetNode.Translate(displacement * _cameraTightness * evt.timeSinceLastFrame);

            return true;
        }
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:11,代码来源:SmoothFreeCamera.cs

示例10: ExampleApp_FrameStarted

        protected override bool ExampleApp_FrameStarted(FrameEvent evt)
        {
            if(base.ExampleApp_FrameStarted(evt) == false )
                return false;

            // Rotate fountains
            mFountainNode.Yaw(new Degree(evt.timeSinceLastFrame * 30));

            // Call default
            return true;
        }
开发者ID:andyhebear,项目名称:mogresdk,代码行数:11,代码来源:ParticleApplication.cs

示例11: ExampleApp_FrameStarted

        protected override bool ExampleApp_FrameStarted(FrameEvent evt)
        {
            if(base.ExampleApp_FrameStarted(evt) == false )
                return false;

            foreach (AnimationState ani in this.mAnimStateList)
            {
                ani.AddTime(evt.timeSinceLastFrame);
            }

            return true;
        }
开发者ID:andyhebear,项目名称:mogresdk,代码行数:12,代码来源:LightingApplication.cs

示例12: Update

        public override void Update(FrameEvent frameEvent)
        {
            if (!State.MainWindow.IsRenderWindowFocused) return;

            State.InputManger.Capture();

            bool leftButtonDown = State.InputManger.MouseState.ButtonDown(MouseButtonID.MB_Left);
            bool rightButtonDown = State.InputManger.MouseState.ButtonDown(MouseButtonID.MB_Right);

            bool ctrl = State.InputManger.InputKeyboard.IsKeyDown(KeyCode.KC_LCONTROL);
            bool shift = State.InputManger.InputKeyboard.IsKeyDown(KeyCode.KC_LSHIFT);
            bool alt = State.InputManger.InputKeyboard.IsKeyDown(KeyCode.KC_LMENU);

            Vector3 amount = GetTranslation()*frameEvent.timeSinceLastFrame;

            if (ctrl && shift)
            {
                State.SelectedNode.Rotate(amount.x/5.0f, amount.z/5.0f);
                State.SelectedNode.Rotate(5.0f*YawAngle(), 5.0f*PitchAngle());
                //State.SelectedNode.MoveForward(amount);
            }
            else if (ctrl)
            {
                State.SelectedNode.Translate(amount);
                State.SelectedNode.Translate(10.0f*new Vector3(-YawAngle().ValueRadians, 0, PitchAngle().ValueRadians));
            }
            else if (shift)
            {
                State.SelectedNode.Translate(new Vector3(amount.x, amount.z, amount.y));
                State.SelectedNode.Translate(10.0f*new Vector3(-YawAngle().ValueRadians, -PitchAngle().ValueRadians, 0));
            }
            else if (alt)
            {
                State.SelectedNode.Scale = 1 + amount.z/2;
                State.SelectedNode.Scale = 1 + 2*PitchAngle().ValueRadians;
            }
            else if (leftButtonDown)
            {
                Translate(amount);
                Rotate(YawAngle(), PitchAngle());
            }
            else
            {
                Translate(amount);
            }

            //Joystick rotation
            if (State.InputManger.InputJoyStick != null)
                Rotate(RotateJoystickAxis(3, true), RotateJoystickAxis(2, true));

            //base.Update(frameEvent);
            State.MainWindow.UpdatePropertyTreeGrid();
        }
开发者ID:crescent,项目名称:SubmarineSim3D,代码行数:53,代码来源:EditorControlState.cs

示例13: FrameStarted

        /// <summary>
        /// Apply a force every frame (can probably reduce this) to the player
        /// </summary>
        bool FrameStarted(FrameEvent evt)
        {
            // if someone is typing something into a text box, we don't want to move around!
            if (LKernel.Get<InputSwallowerManager>().IsSwallowed())
                return true;

            var player = LKernel.Get<PlayerManager>().MainPlayer;
            if (player != null) {
                player.Actor.AddForceAtLocalPos(keyboardHandler.MovementVector * player.Kart.MoveSpeed, Vector3.ZERO);
            }

            return true;
        }
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:16,代码来源:PlayerMovementHandler.cs

示例14: FrameStarted

 /// <summary>
 /// update all of our animations, but only if we aren't paused
 /// </summary>
 bool FrameStarted(FrameEvent evt)
 {
     if (!Pauser.IsPaused) {
         foreach (AnimationBlender b in blenders) {
             if (!b.Source.HasEnded)
                 b.AddTime(evt.timeSinceLastFrame);
         }
         foreach (AnimationState state in states) {
             if (!state.HasEnded)
                 state.AddTime(evt.timeSinceLastFrame);
         }
     }
     return true;
 }
开发者ID:CisciarpMaster,项目名称:PonyKart,代码行数:17,代码来源:AnimationManager.cs

示例15: ExampleApp_FrameStarted

        protected override bool ExampleApp_FrameStarted(FrameEvent evt)
        {
            // Change curvature / tiling
            // Delay timer to stop too quick updates of curvature
            float timeDelay = 0;

            bool updateSky;
            updateSky = false;

            if(!base.ExampleApp_FrameStarted(evt))
                return false;

            if (inputKeyboard.IsKeyDown(MOIS.KeyCode.KC_H) && timeDelay <= 0)
            {
                mCurvature += 1;
                timeDelay = 0.1f;
                updateSky = true;
            }
            if (inputKeyboard.IsKeyDown(MOIS.KeyCode.KC_G) && timeDelay <= 0)
            {
                mCurvature -= 1;
                timeDelay = 0.1f;
                updateSky = true;
            }

            if (inputKeyboard.IsKeyDown(MOIS.KeyCode.KC_U) && timeDelay <= 0)
            {
                mTiling += 1;
                timeDelay = 0.1f;
                updateSky = true;
            }
            if (inputKeyboard.IsKeyDown(MOIS.KeyCode.KC_Y) && timeDelay <= 0)
            {
                mTiling -= 1;
                timeDelay = 0.1f;
                updateSky = true;
            }

            if (timeDelay > 0)
                timeDelay -= evt.timeSinceLastFrame;

            if (updateSky)
            {
                sceneMgr.SetSkyDome(true, "Examples/CloudySky", mCurvature, mTiling);
            }

            return true;
        }
开发者ID:andyhebear,项目名称:mogresdk,代码行数:48,代码来源:SkyDomeApplication.cs


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