Esempio n. 1
0
        // OnUpdate() is called once per frame.
        protected override void OnUpdate(TimeSpan deltaTime)
        {
            // Synchronize graphics <--> physics.
            if (_meshNode != null)
            {
                // Update SceneNode.LastPoseWorld - this is required for some effects,
                // like object motion blur.
                _meshNode.SetLastPose(true);

                _meshNode.PoseWorld = _rigidBody.Pose;
            }
        }
Esempio n. 2
0
        public override void Update(GameTime gameTime)
        {
            // Store the current time. (The value is is used in ComputeFurDisplacement.)
            _time = gameTime.TotalGameTime;

            // Update SceneNode.LastPoseWorld - this is required for some effects
            // like object motion blur.
            _meshNode.SetLastPose(true);

            // Synchronize graphics <--> physics.
            _meshNode.PoseWorld = _rigidBody.Pose;

            _graphicsScreen.DebugRenderer.Clear();
        }
        public override void Update(GameTime gameTime)
        {
            // Update SceneNode.LastPoseWorld (required for optional effects, like motion blur).
            _meshNode0.SetLastPose(true);
            _meshNode1.SetLastPose(true);

            // Synchronize pose of rigid body and model.
            _meshNode0.PoseWorld = _rigidBody0.Pose;
            _meshNode1.PoseWorld = _rigidBody1.Pose;

            // The particle system nodes are attached to the mesh nodes. Their pose is
            // updated automatically.

            // _particleSystem0 is relative to world space, we need to update its
            // pose explicitly.
            _particleSystem0.Pose = _rigidBody0.Pose;

            // Synchronize particles <-> graphics.
            _particleSystemNode0.Synchronize(GraphicsService);
            _particleSystemNode1.Synchronize(GraphicsService);

            Profiler.AddValue("ParticleCount", ParticleHelper.CountNumberOfParticles(ParticleSystemService.ParticleSystems));
        }