first commit
This commit is contained in:
47
include/framework/shape/shape_box.h
Normal file
47
include/framework/shape/shape_box.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 __NSHAPEBOX__
|
||||
#define __NSHAPEBOX__
|
||||
|
||||
|
||||
#include "shape/shape.h"
|
||||
|
||||
|
||||
/*!
|
||||
@short Box shape class.
|
||||
@author Emmanuel Julien (ejulien@gsworks.fr)
|
||||
*/
|
||||
struct nBoxShape : public nShape
|
||||
{
|
||||
Vector4 center;
|
||||
Vector4 half_d;
|
||||
|
||||
virtual Vector4 &GetCenter() const
|
||||
{ return center; }
|
||||
virtual float GetSupportDistance(const Vector4 &d) const
|
||||
{ return d.Abs().Dot(half_d); }
|
||||
|
||||
nSphereShape(const Vector4 &c, const Vector4 &d)
|
||||
{
|
||||
center = c;
|
||||
half_d = d;
|
||||
}
|
||||
nSphereShape()
|
||||
{
|
||||
center.Set(0, 0, 0);
|
||||
half_d.Set(0, 0, 0);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif // __NSHAPEBOX__
|
||||
Reference in New Issue
Block a user