My Project
MetaObject.h
1 #pragma once
2 #include "ShapeAABB.h"
3 
4 namespace ParaEngine
5 {
6  class MetaWorldFragment;
7  struct DataGrid;
8 
13  class MetaObject : public CRefCountedOne
14  {
15  public:
16  MetaObject(MetaWorldFragment *wf, const Vector3& position)
17  : mPosition(position), mMetaWorldFragment(wf) {}
19  : mPosition(0,0,0), mMetaWorldFragment(wf) {}
20 
21  virtual ~MetaObject() {}
22 
24  virtual void updateDataGrid(DataGrid* dataGrid) = 0;
26  const Vector3& getPosition() const {return mPosition; }
28  void setPosition(const Vector3& position) {mPosition = position; }
30  MetaWorldFragment* getMetaWorldFragment() const {return mMetaWorldFragment; }
32  // virtual bool intersects(const CShapeAABB& aabb) const = 0;
33  virtual CShapeAABB getAABB() const = 0;
34 
35  protected:
36  Vector3 mPosition;
37  // the parent mMetaWorldFragment who owns this meta object
38  MetaWorldFragment* mMetaWorldFragment;
39  };
40 
41  typedef asset_ptr<MetaObject> MetaObjectPtr;
42 }
43 
MetaWorldFragment * getMetaWorldFragment() const
Returns the MetaWorldFragment* of the meta object.
Definition: MetaObject.h:30
void setPosition(const Vector3 &position)
Sets the position of the meta object.
Definition: MetaObject.h:28
Abstract class defining the interface for meta objects to be used with MetaObjectDataGrid.
Definition: MetaObject.h:13
A MetaWorldFragment is the basic building block of the world.
Definition: MetaWorldFragment.h:17
Base class for a reference counted asset.
Definition: PERef.h:55
different physics engine has different winding order.
Definition: EventBinding.h:32
Class providing a 3d grid of data values and methods for accessing and modifying it.
Definition: DataGrid.h:14
Standard 3-dimensional vector.
Definition: ParaVector3.h:16
AABB-related code.
Definition: ShapeAABB.h:11
const Vector3 & getPosition() const
Returns the position of the meta object.
Definition: MetaObject.h:26
virtual void updateDataGrid(DataGrid *dataGrid)=0
Tells the meta object to update the data grid.
virtual CShapeAABB getAABB() const =0
Checks for overlap with an AABB.