Code Search for Developers
 
 
  

kdata.h from Spatial Knowledge Experiments at Krugle


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

Spatial Knowledge Experiments

A simulation of 3D virtual worlds for psychological experiments

Project homepage: http://sourceforge.net/projects/ske
Programming language(s): C,C++,Perl
License: other

  isense/
  joystick/
  Jamfile
  KImageCardinalDirection.h
  SKE.cpp
  SKE.h
  eulerangles.c
  eulerangles.h
  ikdraggable.cpp
  ikdraggable.h
  ikdraghandler.h
  ikmission.h
  ikxmlreader.h
  ikxmlwriter.h
  kappstate.cpp
  kappstate.h
  kbasedraggable.cpp
  kbasedraggable.h
  kbasedraghandler.cpp
  kbasedraghandler.h
  kblock.cpp
  kblock.h
  kblockId.h
  kblockid.cpp
  kcamera.cpp
  kcamera.h
  kcollision.cpp
  kcommandprocessor.cpp
  kcommandprocessor.h
  kconstant.cpp
  kconstant.h
  kcursor3d.cpp
  kcursor3d.h
  kdata.cpp
  kdata.h
  kdatalist.cpp
  kdatalist.h
  kdragmanager.cpp
  kdragmanager.h
  keventhandlermanager.cpp
  keventhandlermanager.h
  kflags.cpp
  kflags.h
  kimagecardinaldirection.cpp
  kkeys.cpp
  kkeys.h
  kkeystate.cpp
  kkeystate.h
  klandmark.cpp
  klandmark.h
  klandmarklist.cpp
  klandmarklist.h
  klight.cpp
  klight.h
  klightlist.cpp
  klightlist.h
  kmap.cpp
  kmap.h
  kmission.cpp
  kmission.h
  kmissiontype.cpp
  kmissiontype.h
  kmode.cpp
  kmode.h
  kmousemanager.cpp
  kmousemanager.h
  kobject3d.cpp
  kobject3d.h
  korientation.cpp
  korientation.h
  kpath.cpp
  kpath.h
  kpathfollower.cpp
  kpathfollower.h
  kplayer.cpp
  kplayer.h
  kposition.cpp
  kposition.h
  kquaternion.cpp
  kquaternion.h
  ksaveddatamanager.cpp
  ksaveddatamanager.h
  ksegment3.h
  ksign.cpp
  ksign.h
  ksprite3d.cpp
  ksprite3d.h
  ksprite3dlist.cpp
  ksprite3dlist.h
  kterrain.cpp
  kterrain.h
  kthing.cpp
  kthing.h
  kutil.cpp
  kutil.h
  kwireframe.cpp
  kwireframe.h
  kxmlhelper.h
  movement1d.h
  movement3d.h
  quattypes.h