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


C# IndexedVector3.ToVector3方法代码示例

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


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

示例1: DrawLine

        public override void DrawLine(ref IndexedVector3 from, ref IndexedVector3 to, ref IndexedVector3 fromColor, ref IndexedVector3 toColor)
        {
            if (m_lineIndex < m_lineVertexMaxSize - 2)
            {
                m_lineVertices[m_lineIndex].Position = from.ToVector3();
                m_lineVertices[m_lineIndex++].Color = new Color(fromColor.ToVector3());

                m_lineVertices[m_lineIndex].Position = to.ToVector3();
                m_lineVertices[m_lineIndex++].Color = new Color(toColor.ToVector3());
            }
        }
开发者ID:ousttrue,项目名称:bullet-xna,代码行数:11,代码来源:XNA_ShapeDrawer.cs

示例2: DrawText

        public void DrawText(String text, ref IndexedVector3 position, ref IndexedVector3 color)
        {
            TextPositionColor tpc = new TextPositionColor();
            tpc.m_text = text;
            tpc.m_position = new Vector2(position.X, position.Y);
            tpc.m_color = new Color(color.ToVector3());

            m_textPositionColours.Add(tpc);
        }
开发者ID:ousttrue,项目名称:bullet-xna,代码行数:9,代码来源:XNA_ShapeDrawer.cs

示例3: GetTexture

		private Texture2D GetTexture(ref IndexedVector3 color)
		{
			if(!m_colorMap.ContainsKey(color))
			{
				Texture2D newTexture = new Texture2D(m_game.GraphicsDevice,1,1);
				Color[] colorData = new Color[1];
				newTexture.GetData<Color>(colorData);
				colorData[0] = new Color(color.ToVector3());
				newTexture.SetData(colorData);
				m_colorMap[color] = newTexture;
			}
			return m_colorMap[color];
		}
开发者ID:ousttrue,项目名称:bullet-xna,代码行数:13,代码来源:XNA_ShapeDrawer.cs

示例4: AddVertex

 private void AddVertex(ref IndexedVector3 vec, ref IndexedVector3 normal, ref Vector2 tex)
 {
     if(m_texturedVertexCount < m_textureVertexMaxSize-1)
     {
         m_texturedVertices[m_texturedVertexCount++] = new VertexPositionNormalTexture(vec.ToVector3(), normal.ToVector3(),tex);
     }
 }
开发者ID:ousttrue,项目名称:bullet-xna,代码行数:7,代码来源:XNA_ShapeDrawer.cs

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