예제 #1
0
        /*!
         * Used to apply a transformation directly to all the vertices and normals in
         * this mesh.
         * \param[in] transform The 4x4 transformation matrix to apply to the vertices and normals in this mesh.  Normals are only affected by the rotation portion of this matrix.
         */
        public void Transform(Matrix44 transform)
        {
            var rotation = new Matrix44(transform.GetRotation());

            //Apply the transformations
            for (var i = 0; i < vertices.Count; ++i)
            {
                vertices[i] = transform * vertices[i];
            }
            for (var i = 0; i < normals.Count; ++i)
            {
                normals[i] = rotation * normals[i];
            }
            CalcAxisAlignedBox(vertices, out center, out radius);
        }