Show klandmark.h syntax highlighted
/*
Copyright (C) 2003, 2004, 2005 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 __KLANDMARK_H__
#define __KLANDMARK_H__
struct iEngine;
struct iGraphics3D;
struct iMaterialWrapper;
struct iMeshWrapper;
class csTransform;
struct iPolygon3D;
struct iCollideSystem;
struct iCollider;
class csVector3;
class BlockId;
class KFlags;
class csBox3;
class KThing;
struct KSprite3D;
#include "kbasedraghandler.h"
#include "kbasedraggable.h"
#include "kutil.h"
#include "ske.h"
SCF_VERSION (KLandmark, 0, 0, 1);
class KLandmark : public csObject, public iKXMLReader, public iKXMLWriter
{
private:
csVector3 m_position;
float m_yRotation;
bool m_visible;
csRefArray<KSprite3D> m_ksprite3dList;
csArray<csVector3> m_offsets;
char* m_name;
//
//Methods for iDragHandler interface.
bool Drag (float p_x, float p_y, const csVector3&, DRAG_TYPE);
bool Undrag (float p_x, float p_y);
bool HandlerDrag (float, float);
public:
//
//ctor
KLandmark ();
//
//dtor
virtual ~KLandmark ();
void Release ();
void AddKSprite3D (KSprite3D* p_kthing, const csVector3& p_offset =csVector3(0,0,0));
void SetName (char const* p_name);
char const* GetName ();
csVector3& GetOffset (int p_i);
csBox3 GetBoundingBox ();
csVector3 GetSize ();
void SetSize (const csVector3&);
void SetPosition (csVector3 const&);
csVector3 const& GetPosition ();
float GetYRotation ();
void SetYRotation (float);
void SetSector (iSector* p_sector);
void SetMaterial (const char* p_mat);
void SetVisible (bool p_visible);
bool IsVisible ();
void CreateColliders (iCollideSystem* p_cS, csRefArray<iCollider>& p_c);
void DetachColliders (iCollideSystem* p_cS);
void AttachColliders (iCollideSystem* p_cS);
void GetReversibleTransform (csArray<csReversibleTransform>& p_rT);
SCF_DECLARE_IBASE_EXT (csObject);
//
//KLocalDragHandler class. Here we dont use an embedded interface to avoid
//circular references.
struct KLocalDragHandler : public KBaseDragHandler
{
private:
KLandmark* m_parent;
public:
SCF_DECLARE_IBASE;
KLocalDragHandler (KLandmark* p_parent)
{
SCF_CONSTRUCT_IBASE (0);
m_parent = p_parent;
}
virtual ~KLocalDragHandler ()
{
SCF_DESTRUCT_IBASE();
}
bool HandleDrag (float p_x, float p_y);
}* scfiKLocalDragHandler;
//
//KLocalDraggable class. Here we dont use an embedded interface to avoid
//circular references.
struct KLocalDraggable : public KBaseDraggable
{
private:
KLandmark* m_parent;
public:
SCF_DECLARE_IBASE;
KLocalDraggable (KLandmark* p_lm)
{
SCF_CONSTRUCT_IBASE (0);
m_parent = p_lm;
}
~KLocalDraggable ()
{
SCF_DESTRUCT_IBASE ();
}
const csRefArray<iMeshWrapper> GetMeshWrappers () const;
} *scfiKLocalDraggable;
//
//iKXMLWriter/Reader
bool Write (iDocumentNode* p_node) const;
bool Read (iDocumentNode* p_node);
};
#endif
See more files for this project here