Ejemplo n.º 1
0
void	Compress	(NodeCompressed& Dest, vertex& Src, hdrNODES& H)
{
	// Compress plane (normal)
	Dest.plane	= pvCompress	(Src.Plane.n);
	
	// Compress position
	CNodePositionCompressor(Dest.p,Src.Pos,H);
//	CompressPos	(Dest.p1,Src.P1,H);
	
	// Sector
	// R_ASSERT(Src.sector<=255);
	// Dest.sector = BYTE(Src.sector);

	// Light & Cover
	CNodeCompressed().compress_node(Dest,Src);
//	Dest.cover[0]	= CompressCover(Src.cover[0]);
//	Dest.cover[1]	= CompressCover(Src.cover[1]);
//	Dest.cover[2]	= CompressCover(Src.cover[2]);
//	Dest.cover[3]	= CompressCover(Src.cover[3]);
	Dest.cover0		= compress(Src.cover[0],15);
	Dest.cover1		= compress(Src.cover[1],15);
	Dest.cover2		= compress(Src.cover[2],15);
	Dest.cover3		= compress(Src.cover[3],15);
//	Msg				("[%.3f -> %d][%.3f -> %d][%.3f -> %d][%.3f -> %d]",
//		Src.cover[0],Dest.cover0,
//		Src.cover[1],Dest.cover1,
//		Src.cover[2],Dest.cover2,
//		Src.cover[3],Dest.cover3
//		);

	// Compress links
//	R_ASSERT	(Src.neighbours.size()<64);
//	Dest.links	= BYTE(Src.neighbours.size());
}
Ejemplo n.º 2
0
IC CNodePositionConverter::CNodePositionConverter(const SNodePositionOld &Psrc, hdrNODES &m_header, NodePosition &np)
{
	Fvector		Pdest;
	Pdest.x		= float(Psrc.x)*m_header.size;
	Pdest.y		= (float(Psrc.y)/65535)*m_header.size_y + m_header.aabb.min.y;
	Pdest.z		= float(Psrc.z)*m_header.size;
	CNodePositionCompressor(np,Pdest,m_header);
	np.y		(Psrc.y);
}