示例#1
0
 protected virtual void OnSetTransform(CSetTransformEventArgs pEventArgs)
 {
     if (m_SetTransform != null)
     {
         m_SetTransform(this, pEventArgs);
     }
 }
示例#2
0
        /// <summary>
        /// Handle Matrix changed callback
        /// </summary>
        /// <param name="sender">Body</param>
        /// <param name="e">Event arguments</param>
        private void body_setTransform(object sender, CSetTransformEventArgs e)
        {
            Matrix3D matrix = e.Matrix;

            // first raise the Body's event
            BodyTransformEventArgs bodyArgs = null;
            if (Transforming != null)
            {
                bodyArgs = new BodyTransformEventArgs(matrix);
                Transforming(this, bodyArgs);
            }

            // if there's a world event and the body did not handle it, raise the world event.
            if (_world.CanRaiseBodyTransforming || ((bodyArgs != null) && !bodyArgs.Handled))
            {
                if (bodyArgs == null)
                    bodyArgs = new BodyTransformEventArgs(matrix);

                _world.RaiseBodyTransforming(this, bodyArgs);
            }

            // if there was an event what changed the args, update the body's matrix
            if ((bodyArgs != null) && bodyArgs.Changed)
            {
                matrix = bodyArgs.Matrix;
                _body.Matrix = matrix;
            }

            //_changingTransform = true;
            this.Transform = new MatrixTransform3D(matrix);
            //_changingTransform = false;
        }
示例#3
0
 protected virtual void OnSetTransform(CSetTransformEventArgs pEventArgs)
 {
     if (m_SetTransform != null)
     {
         m_SetTransform(this, pEventArgs);
     }
 }