public void SetCenteringForMeshGroup(MeshGroup meshGroup)
		{
			AxisAlignedBoundingBox bounds = meshGroup.GetAxisAlignedBoundingBox();
			Vector3 boundsCenter = (bounds.maxXYZ + bounds.minXYZ) / 2;
			centering = Matrix4X4.CreateTranslation(-boundsCenter);
			// and move the translation back so the part does not move
			translation *= Matrix4X4.CreateTranslation(boundsCenter);
		}
示例#2
0
		static AxisAlignedBoundingBox GetAxisAlignedBoundingBox(MeshGroup meshGroup, Matrix4X4 transform)
		{
			return meshGroup.GetAxisAlignedBoundingBox(transform);
		}