Пример #1
0
void					CCOLEntry::parseCollisionMeshVertices(void)
{
	CDataReader *pDataReader = CDataReader::getInstance();
	eCOLVersion eCOLVersionValue = getCOLVersion() == nullptr ? COL_UNKNOWN : getCOLVersion()->getVersionId();
	vector<TVertex>& vecVertices = getCollisionMeshVertices();

	for (uint32 i = 0, j = getCollisionMeshVertexCount(); i < j; i++)
	{
		char szText1[500];
		TVertex vertex;
		if (eCOLVersionValue == COL_1)
		{
			vertex.m_x = pDataReader->readFloat32();
			vertex.m_y = pDataReader->readFloat32();
			vertex.m_z = pDataReader->readFloat32();
		}
		else
		{
			vertex.m_x = ((float32) pDataReader->readInt16()) / 128.0f;
			vertex.m_y = ((float32) pDataReader->readInt16()) / 128.0f;
			vertex.m_z = ((float32) pDataReader->readInt16()) / 128.0f;
		}
		vecVertices.push_back(vertex);
	}
}
Пример #2
0
void					CCOLEntry::parseShadowMeshVertices(void)
{
	CDataReader *pDataReader = CDataReader::getInstance();
	vector<TVertex>& vecVertices = getShadowMeshVertices();

	for (uint32 i = 0, j = getShadowMeshVertexCount(); i < j; i++)
	{
		TVertex vertex;
		vertex.m_x = ((float32) pDataReader->readInt16()) / 128.0f;
		vertex.m_y = ((float32) pDataReader->readInt16()) / 128.0f;
		vertex.m_z = ((float32) pDataReader->readInt16()) / 128.0f;
		vecVertices.push_back(vertex);
	}
}