Esempio n. 1
0
        public void DrawCylinder(float topRadius, float bottomRadius, float halfHeight, int upAxis, ref IndexedMatrix matrix, ref IndexedMatrix view, ref IndexedMatrix projection, ref IndexedVector3 color)
        {
            IndexedVector3 scale  = new IndexedVector3(topRadius, halfHeight, bottomRadius);
            IndexedMatrix  rotate = IndexedMatrix.Identity;

            if (upAxis == 0)
            {
                rotate = IndexedMatrix.CreateRotationZ(MathUtil.SIMD_HALF_PI);
            }
            if (upAxis == 1)
            {
                rotate = IndexedMatrix.CreateRotationY(MathUtil.SIMD_HALF_PI);
            }
            else if (upAxis == 2)
            {
                rotate = IndexedMatrix.CreateRotationX(MathUtil.SIMD_HALF_PI);
            }

            IndexedMatrix copy = matrix;

            copy._origin = IndexedVector3.Zero;
            copy         = copy * rotate;
            copy._origin = matrix._origin;

            ModelScalingData modelScalingData = new ModelScalingData(m_cylinderModel, scale, copy);

            modelScalingData.color = color;
            m_modelScalingData.Add(modelScalingData);
        }
Esempio n. 2
0
        //public void drawWireframeCube(float sideLength)
        //{
        //}


        public void DrawSolidSphere(float radius, int slices, int stacks, ref IndexedMatrix matrix, ref IndexedMatrix view, ref IndexedMatrix projection, ref IndexedVector3 color)
        {
            ModelScalingData modelScalingData = new ModelScalingData(m_sphereModel, new IndexedVector3(radius), matrix);

            modelScalingData.color = color;
            m_modelScalingData.Add(modelScalingData);
        }
Esempio n. 3
0
        public void DrawSolidCube(ref IndexedVector3 halfExtents, ref IndexedMatrix matrix, ref IndexedMatrix view, ref IndexedMatrix projection, ref IndexedVector3 color)
        {
            ModelScalingData modelScalingData = new ModelScalingData(m_cubeModel, halfExtents, matrix);

            modelScalingData.color = color;
            m_modelScalingData.Add(modelScalingData);
        }
Esempio n. 4
0
        public void DrawSolidCone(float height, float radius, ref IndexedMatrix matrix, ref IndexedMatrix view, ref IndexedMatrix projection, ref IndexedVector3 color)
        {
            IndexedVector3   scale            = new IndexedVector3(radius, height, radius);
            ModelScalingData modelScalingData = new ModelScalingData(m_coneModel, scale, matrix);

            modelScalingData.color = color;
            m_modelScalingData.Add(modelScalingData);
        }
Esempio n. 5
0
		public void DrawCylinder(float topRadius, float bottomRadius, float halfHeight, int upAxis, ref IndexedMatrix matrix, ref IndexedMatrix view, ref IndexedMatrix projection, ref IndexedVector3 color)
        {
			IndexedVector3 scale = new IndexedVector3(topRadius, halfHeight, bottomRadius);
			IndexedMatrix rotate = IndexedMatrix.Identity;

            if (upAxis == 0)
            {
                rotate = IndexedMatrix.CreateRotationZ(MathUtil.SIMD_HALF_PI);
            }
            if (upAxis == 1)
			{
				rotate = IndexedMatrix.CreateRotationY(MathUtil.SIMD_HALF_PI);
			}
			else if (upAxis == 2)
			{
				rotate = IndexedMatrix.CreateRotationX(MathUtil.SIMD_HALF_PI);
			}

			IndexedMatrix copy = matrix;
			copy._origin = IndexedVector3.Zero;
			copy = copy * rotate;
            copy._origin = matrix._origin;

			ModelScalingData modelScalingData = new ModelScalingData(m_cylinderModel, scale, copy);
			modelScalingData.color = color;
			m_modelScalingData.Add(modelScalingData);
		}
Esempio n. 6
0
		public void DrawSolidCone(float height, float radius, ref IndexedMatrix matrix, ref IndexedMatrix view, ref IndexedMatrix projection, ref IndexedVector3 color)
        {
			IndexedVector3 scale = new IndexedVector3(radius, height, radius);
			ModelScalingData modelScalingData = new ModelScalingData(m_coneModel, scale, matrix);
			modelScalingData.color = color;
			m_modelScalingData.Add(modelScalingData);
        }
Esempio n. 7
0
        //public void drawWireframeCube(float sideLength)
        //{
        //}


        public void DrawSolidSphere(float radius, int slices, int stacks, ref IndexedMatrix matrix, ref IndexedMatrix view, ref IndexedMatrix projection,ref IndexedVector3 color)
        {

			ModelScalingData modelScalingData = new ModelScalingData(m_sphereModel,new IndexedVector3(radius),matrix);
			modelScalingData.color = color;
			m_modelScalingData.Add(modelScalingData);
        }
Esempio n. 8
0
        public void DrawSolidCube(ref IndexedVector3 halfExtents, ref IndexedMatrix matrix, ref IndexedMatrix view, ref IndexedMatrix projection, ref IndexedVector3 color)
        {
			ModelScalingData modelScalingData = new ModelScalingData(m_cubeModel,halfExtents,matrix);
			modelScalingData.color = color;
			m_modelScalingData.Add(modelScalingData);
        }