first commit
This commit is contained in:
47
include/framework/shape/shape_sphere.h
Normal file
47
include/framework/shape/shape_sphere.h
Normal file
@ -0,0 +1,47 @@
|
||||
/*
|
||||
|
||||
nEngine
|
||||
Emmanuel Julien 2000-2010
|
||||
All Rights Reserved
|
||||
|
||||
http://www.gamestart3d.com
|
||||
Please refer to the included license.txt for license informations.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __NSHAPESPHERE__
|
||||
#define __NSHAPESPHERE__
|
||||
|
||||
|
||||
#include "shape/shape.h"
|
||||
|
||||
|
||||
/*!
|
||||
@short Sphere shape class.
|
||||
@author Emmanuel Julien (ejulien@gsworks.fr)
|
||||
*/
|
||||
struct nSphereShape : public nShape
|
||||
{
|
||||
Vector4 center;
|
||||
float radius;
|
||||
|
||||
virtual Vector4 &GetCenter() const
|
||||
{ return center; }
|
||||
virtual float GetSupportDistance(const Vector4 &) const
|
||||
{ return radius; }
|
||||
|
||||
nSphereShape(const Vector4 &c, float r)
|
||||
{
|
||||
center = c;
|
||||
radius = r;
|
||||
}
|
||||
nSphereShape()
|
||||
{
|
||||
center.Set(0, 0, 0);
|
||||
radius = 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif // __NSHAPESPHERE__
|
||||
Reference in New Issue
Block a user