Show kdata.h syntax highlighted
/*
Copyright (C) 2003, 2004 by Luca Cappa
Written by Luca Cappa groton@users.sourceforge.net
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __KDATA_H__
#define __KDATA_H__
#include "kquaternion.h"
class KQuaternion;
SCF_VERSION (KData, 0, 0, 1);
class KData : public csObject
{
protected:
csRef<iString> m_name;//optional name.
csVector3 m_position;//position in world space.
csVector3 m_velocity;// meters/seconds
int m_timestamp;//msecs
float m_meters;//meters :)
public:
KQuaternion m_bodyQ;
KQuaternion m_headQ;
KData () : m_position (0), m_velocity (0), m_timestamp (0), m_meters (0)
{
m_name = 0;
};
KData (csVector3& p_position,
const KQuaternion& p_bQ, const KQuaternion& p_hQ,
const csVector3& p_velocity,
float p_meters, int p_timestamp, const char* p_name =NULL):
m_position (p_position),
m_bodyQ (p_bQ), m_headQ (p_hQ),
m_velocity (p_velocity), m_timestamp (p_timestamp), m_meters (p_meters)
{
if (p_name != NULL)
m_name.AttachNew (new scfString (p_name));
else
m_name.AttachNew (new scfString ("null_name"));
};
~KData ()
{
};
iString* GetName ()
{
return m_name;
}
int GetTimestamp()
{
return m_timestamp;
}
float GetMeters()
{
return m_meters;
}
csVector3& GetVelocity ()
{
return m_velocity;
}
csVector3& GetPosition ()
{
return m_position;
}
KQuaternion& GetHeadAngles ()
{
return m_headQ;
}
const KQuaternion& GetBodyAngle ()
{
return m_bodyQ;
}
SCF_DECLARE_IBASE_EXT (csObject);
};
#endif // __KDATA_H__
See more files for this project here