0ad/source/dcdt/se/sr_sphere.cpp
janwas 5bf9bca9ef fix/disable warnings.
there are too many W4 and "potentially uninitialized", so those are
disabled by 0ad_warning_disable.h.

the silly "int x = strlen" and very dangerous "int x = (void*)p" (and
vice versa) problems are fixed.

This was SVN commit r5526.
2007-12-23 12:18:57 +00:00

37 lines
865 B
C++

#include "precompiled.h"
#include "0ad_warning_disable.h"
# include "sr_sphere.h"
# include "sr_box.h"
//================================== SrSphere ====================================
const char* SrSphere::class_name = "Sphere";
SrSphere::SrSphere () : center(SrPnt::null)
{
radius = 1.0f;
}
SrSphere::SrSphere ( const SrSphere& s ) : center(s.center)
{
radius = s.radius;
}
void SrSphere::get_bounding_box ( SrBox& box ) const
{
SrVec r ( radius, radius, radius );
box.set ( center-r, center+r );
}
SrOutput& operator<< ( SrOutput& o, const SrSphere& sph )
{
return o << sph.center << ' ' << sph.radius;
}
SrInput& operator>> ( SrInput& in, SrSphere& sph )
{
return in >> sph.center >> sph.radius;
}
//================================ EOF =================================================