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


C# IndexedMatrix.ToMatrix方法代码示例

本文整理汇总了C#中BulletXNA.LinearMath.IndexedMatrix.ToMatrix方法的典型用法代码示例。如果您正苦于以下问题:C# IndexedMatrix.ToMatrix方法的具体用法?C# IndexedMatrix.ToMatrix怎么用?C# IndexedMatrix.ToMatrix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BulletXNA.LinearMath.IndexedMatrix的用法示例。


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

示例1: DrawPrimitives

        private void DrawPrimitives(GameTime gameTime, ref IndexedMatrix view, ref IndexedMatrix projection)
        {
            Matrix mView = view.ToMatrix();
            Matrix mProj = projection.ToMatrixProjection();
            DrawPrimitives(gameTime, mView, mProj);

        }
开发者ID:ousttrue,项目名称:bullet-xna,代码行数:7,代码来源:XNA_ShapeDrawer.cs

示例2: RenderDebugLines

        public void RenderDebugLines(GameTime gameTime, ref IndexedMatrix view, ref IndexedMatrix projection)
        {
            m_debugEffect.World = Matrix.Identity;
            m_debugEffect.View = view.ToMatrix();
            m_debugEffect.Projection = projection.ToMatrixProjection();

            if (m_lineIndex > 0)
            {
                foreach (EffectPass pass in m_debugEffect.CurrentTechnique.Passes)
                {
                    pass.Apply();
                    m_game.GraphicsDevice.DrawUserPrimitives<VertexPositionColor>(PrimitiveType.LineList, m_lineVertices, 0, m_lineIndex / 2);
                }
            }
            m_lineIndex = 0;
        }
开发者ID:ousttrue,项目名称:bullet-xna,代码行数:16,代码来源:XNA_ShapeDrawer.cs

示例3: UpdateCamera

        //----------------------------------------------------------------------------------------------

        public virtual void UpdateCamera()
        {
            float rele = m_pitch;
            float razi = m_yaw;

            Quaternion rot = Quaternion.CreateFromAxisAngle(m_cameraUp.ToVector3(), razi);
            
            IndexedVector3 eyePos = new IndexedVector3();
            eyePos[m_forwardAxis] = -m_cameraDistance;

            IndexedVector3 forward = eyePos;
            if (forward.LengthSquared() < MathUtil.SIMD_EPSILON)
            {
                forward = new IndexedVector3(0,0,-1);
            }
            IndexedVector3 right = IndexedVector3.Cross(m_cameraUp, IndexedVector3.Normalize(forward));
            Quaternion roll = Quaternion.CreateFromAxisAngle(right.ToVector3(), -rele);
            rot.Normalize();
            roll.Normalize();

            IndexedMatrix m1 = IndexedMatrix.CreateFromQuaternion(rot);
            IndexedMatrix m2 = IndexedMatrix.CreateFromQuaternion(roll);
            IndexedMatrix m3 = m1 * m2;


            eyePos = new IndexedVector3(Vector3.Transform(eyePos.ToVector3(),(rot * roll)));

            //m_cameraTargetPosition = m_cameraPosition + eyePos;
            m_cameraPosition = eyePos;

            m_cameraPosition += m_cameraTargetPosition;

            if (m_glutScreenWidth == 0 && m_glutScreenHeight == 0)
                return;

            m_lookAt = IndexedMatrix.CreateLookAt(m_cameraPosition, m_cameraTargetPosition, m_cameraUp);
            Matrix t = Matrix.CreateLookAt(m_cameraPosition.ToVector3(), m_cameraTargetPosition.ToVector3(), m_cameraUp.ToVector3());
            Matrix t2 = m_lookAt.ToMatrix();

            if (t != t2)
            {
                int ibreak2 = 0;
            }


            int ibreak = 0;
        }
开发者ID:JohnLouderback,项目名称:illuminati-engine-xna,代码行数:49,代码来源:DemoApplication.cs


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