Skip to content

Commit

Permalink
Merge branch 'feature_28' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
akindyakov committed Sep 27, 2013
2 parents 20e03ae + 16793fe commit a0ecd13
Show file tree
Hide file tree
Showing 15 changed files with 440 additions and 175 deletions.
6 changes: 6 additions & 0 deletions modules/heliumGameCore/include/heliumObjectsWorldIntefrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ class IHeliumObjectsWorld {
* @param Object index
*/
virtual void signOutObject( ObjectsIdType )=0;

/**
* @brief Delete object from scene and from memory
* @param Object index
*/
virtual void delayedSignOut( ObjectsIdType )=0;
};

#endif // HELIUM_OBJECTS_WORLD_INTEFRACE_INCLUDED
Expand Down
4 changes: 2 additions & 2 deletions modules/heliumSceneObjects/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ INCLUDE( heliumIncludes )

SET ( heliumSceneObjects_SRCS
${HELIUM_MODULES_DIR}/heliumSceneObjects/src/heliumSceneObjects.cpp
${HELIUM_MODULES_DIR}/heliumSceneObjects/src/heliumPrepared3DObjects.cpp
${HELIUM_MODULES_DIR}/heliumSceneObjects/src/heliumPreparedSceneObjects.cpp
)

SET ( heliumSceneObjects_HDRS
${HELIUM_MODULES_DIR}/heliumSceneObjects/include/heliumSceneObjects.h
${HELIUM_MODULES_DIR}/heliumSceneObjects/include/heliumPrepared3DObjects.h
${HELIUM_MODULES_DIR}/heliumSceneObjects/include/heliumPreparedSceneObjects.h
)

ADD_LIBRARY ( heliumSceneObjects STATIC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@

typedef enum {
PREPARED_3D_UNKNOWN = 0,
PREPARED_3D_HELIUM_556_BULLET_BOX = 1,
PREPARED_3D_LAST
} HeliumPrepared3D;
} HeliumPreparedSceneObjects;


struct HeliumTestBarrel : public PackagedSceneObject {
Expand All @@ -36,5 +37,45 @@ struct HeliumTestBox : public PackagedSceneObject {
~HeliumTestBox() {}
};

struct Helium556BulletBox : public PackagedSceneObject {
Helium556BulletBox( double pos_x, double pos_y, double pos_z, double size );
};

class HeliumSceneArchitecktHand : public SceneObject {
public:

/**
* @brief Create null hand and if click - > object will be picked up from the scene
*/
HeliumSceneArchitecktHand(IHeliumObjectsWorld::ObjectsIdType id=0);


~HeliumSceneArchitecktHand();

void lifeStep();

/**
* @brief
*/
void mousePoint( int button, bool upDown, Polycode::Vector2 mouse );

/**
* @brief
*/
void mouseDoubleClick();

private:
IHeliumObjectsWorld::ObjectsIdType creatingObject;

};

class HeliumSceneArchitecktHandPack : public PackagedSceneObject {
public:

HeliumSceneArchitecktHandPack( IHeliumObjectsWorld::ObjectsIdType id=0);

~HeliumSceneArchitecktHandPack();
};

#endif // HELIUM_PREPARED_3D_OBJECTS_INCLUDED

75 changes: 66 additions & 9 deletions modules/heliumSceneObjects/include/heliumSceneObjects.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#ifndef HELIUM_SCENE_OBJECTS_INCLUDED
#define HELIUM_SCENE_OBJECTS_INCLUDED

#include <list>
#include <set>
#include <map>

Expand Down Expand Up @@ -102,7 +103,12 @@ class SceneObject {
/**
* @brief
*/
virtual void mouseClick( bool upDown ) {}
virtual void mouseClick( int button, bool upDown ) {}

/**
* @brief
*/
virtual void mousePoint( int button, bool upDown, Polycode::Vector2 mouse ) {}

/**
* @brief
Expand All @@ -116,6 +122,11 @@ class SceneObject {
return model;
}

/**
* @brief
*/
IHeliumObjectsWorld::ObjectsIdType getId()const;

protected:
Polycode::SceneEntity* model;
};
Expand Down Expand Up @@ -158,11 +169,17 @@ class SceneObjectsWorld : public IHeliumObjectsWorld {


/**
* @brief Delete object from scene and from memory
* @brief Immediately delete helium scene object from scene and from memory
* @param Object index
*/
void signOutObject( IHeliumObjectsWorld::ObjectsIdType );

/**
* @brief Delete object from scene and from memory
* @param Object index
*/
void delayedSignOut( IHeliumObjectsWorld::ObjectsIdType );

/**
* @brief add helium scene object to sceneWorld
* @param pointer to PackagedSceneObjects, you must to destruct after that
Expand All @@ -173,15 +190,30 @@ class SceneObjectsWorld : public IHeliumObjectsWorld {
typedef std::pair< IHeliumObjectsWorld::ObjectsIdType, SceneObject* > AlifePairType;

/**
*
*
*/
void setCameraMovingDirection(Polycode::Vector2 dir);
void cameraHorizonMovingDirection(Polycode::Vector2 dir);

/**
*
*/
Polycode::RayTestResult rayTest(Polycode::Vector2);

/**
*
*/
IHeliumObjectsWorld::ObjectsIdType getObjectIdByEntity(Polycode::SceneEntity* entity)const;

/**
* @brief add id of object to queue of mouse point click
*/
void addObjectToMousePointQueue(IHeliumObjectsWorld::ObjectsIdType);

/**
* @brief warp object to point, if it exist of course
*/
void warpTo(IHeliumObjectsWorld::ObjectsIdType, Polycode::Vector3, bool resetRotation=true);

protected:
Polycode::PhysicsScene* engineScene;
Polycode::Vector2 horisontalVectorMove;
Expand All @@ -193,14 +225,32 @@ class SceneObjectsWorld : public IHeliumObjectsWorld {
//!> container of alife objects, have reactions and posible have behavior
std::map< IHeliumObjectsWorld::ObjectsIdType, SceneObject* > alifeObjects;
typedef std::map< IHeliumObjectsWorld::ObjectsIdType, SceneObject* >::iterator AlifeIterator;


std::set< IHeliumObjectsWorld::ObjectsIdType > queueToMousePoint;
std::list< IHeliumObjectsWorld::ObjectsIdType > delayedSignOutObjects;

private:
/**
* @return True - if the queue in mot empty, otherwise False
*/
bool checkQueueToMousePointClick( int button, bool upDown, Polycode::Vector2 mouse );
void checkDelayedSignOutObject();

/**
* @param
*/
void addPackagedToEngineScene( PackagedSceneObject* obj );

void engineSceneWarpTo( Polycode::SceneEntity* obj, Polycode::Vector3 point, bool resetRotation );
};

/**
*
*/
class PackagedSceneObject {
public:
PackagedSceneObject() {}
PackagedSceneObject();
virtual ~PackagedSceneObject(){};

/**
Expand Down Expand Up @@ -247,7 +297,7 @@ class PackagedSceneObject {
POLY_ENTITY_PHYSICAL,
POLY_ENTITY_EMPTY
} PolySceneEntityType;

/**
* @brief
*/
Expand All @@ -264,13 +314,18 @@ class PackagedSceneObject {
IHeliumObjectsWorld::ObjectsIdType getId()const;

/**
* @brief
* @return Polycode::SceneEntity pointer
*/
Polycode::SceneEntity* getModel()const;


/**
* @return necessary to add to mouse point queue by default
*/
bool getToMousePointQueue()const;

protected:
//!> Pointer to PolySceneObject helium wrap
SceneObject* heliumAlife;
SceneObject* heliumObject;

int alife;
PolySceneEntityType entityType;
Expand All @@ -281,6 +336,8 @@ class PackagedSceneObject {
Number restitution;
int group;
bool compoundChildren;

bool addToMousePointQueue;
};

/**
Expand Down
74 changes: 0 additions & 74 deletions modules/heliumSceneObjects/src/heliumPrepared3DObjects.cpp

This file was deleted.

Loading

0 comments on commit a0ecd13

Please sign in to comment.