Example #1
0
void MeshLoader_v0::ReadBounds(MeshPtr mesh, DataStreamPtr & stream)
{
    Vec3 vMin, vMax, vCenter;
    float fRadius;

    stream->Read(&vMin, sizeof(Vec3));
    stream->Read(&vMax, sizeof(Vec3));

    stream->Read(&vCenter, sizeof(Vec3));
    stream->Read(&fRadius, sizeof(float));

    mesh->SetAabb(vMin, vMax);
    mesh->SetBoundingSphere(vCenter, fRadius);
}
Example #2
0
void MeshLoader_v1::ReadBounds(MeshPtr mesh, DataStreamPtr & stream)
{
	int iVerison;
	Vec3 vMin, vMax, vCenter;
	float fRadius;

	stream->Read(&iVerison, sizeof(int));

	d_assert (iVerison == K_Bound_Version);

	stream->Read(&vMin, sizeof(Vec3));
	stream->Read(&vMax, sizeof(Vec3));

	stream->Read(&vCenter, sizeof(Vec3));
	stream->Read(&fRadius, sizeof(float));

	mesh->SetAabb(vMin, vMax);
	mesh->SetBoundingSphere(vCenter, fRadius);
}