Skip to content

Commit

Permalink
Correct the ArchitectorHand life step and del Otherandler for Mouse U…
Browse files Browse the repository at this point in the history
…ser Input Handler
  • Loading branch information
akindyakov committed Sep 21, 2013
1 parent 8a49ebe commit 0c4d489
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
9 changes: 5 additions & 4 deletions modules/heliumSceneObjects/src/heliumPreparedSceneObjects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,9 @@ HeliumTestBox::HeliumTestBox( double size_x, double size_y, double size_z,

HeliumSceneArchitecktHand::HeliumSceneArchitecktHand( PackagedSceneObject* pack )
: SceneObject(pack->getModel()->Clone()),
creatingObject(pack) {
//model = pack->getModel()->Clone(true, true);
//model->loadTexture(g_helium_resource_path + "/flame1.png");
}
creatingObject(pack) {}
// : SceneObject( new P::ScenePrimitive( P::ScenePrimitive::TYPE_BOX,1,1,1 )),
// creatingObject(pack) {}

HeliumSceneArchitecktHand::HeliumSceneArchitecktHand( HeliumPreparedSceneObjects id)
: SceneObject(NULL),
Expand All @@ -81,11 +80,13 @@ HeliumSceneArchitecktHand::~HeliumSceneArchitecktHand() {
}

void HeliumSceneArchitecktHand::lifeStep() {
std::cout << "HeliumSceneArchitecktHand::lifeStep()\n";
HeliumGameCore* gm = HeliumGlobal::getCurrentGame();
Polycode::Vector2 mouse = gm->getEngineCorePt()->getInput()->getMousePosition();
Polycode::RayTestResult rayRez = gm->getSceneWorldPt()->rayTest(mouse);
rayRez.position.y += model->bBox.y/2;
model->setPosition(rayRez.position);
std::cout << rayRez.position.x << ' ' << rayRez.position.y << ' ' << rayRez.position.z << '\n';
}

void HeliumSceneArchitecktHand::mouseCursor() {
Expand Down
3 changes: 0 additions & 3 deletions modules/userInput/include/heliumInputDipather.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,10 @@ class MouseMoveUserInput : public Polycode::EventHandler {
virtual ~MouseMoveUserInput() {}

void handleEvent(Polycode::Event*);
// not KeyHandler
void addEventHandler(MouseKeyHandler*){};
void setCameraMoving(bool){};
void setEnable(bool);
private:
MouseKeyHandler* cameraMove;
MouseKeyHandler* handler;
};

class MouseOtherUserInput : public Polycode::EventHandler {
Expand Down
3 changes: 0 additions & 3 deletions modules/userInput/src/heliumInputDipather.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,6 @@ void MouseMoveUserInput::handleEvent(Polycode::Event* e) {
if ( cameraMove != NULL ) {
cameraMove->process(mouse);
}
if ( handler != NULL ) {
handler -> process(mouse);
}
}

MouseOtherUserInput::MouseOtherUserInput() {
Expand Down
11 changes: 9 additions & 2 deletions tests/sceneWorldDevelop/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/

#include <iostream>
#include <exception>

#include <Polycode.h>
#include "PolycodeView.h"
Expand All @@ -33,9 +34,15 @@ APP_MAIN_FINCTION

std::cout << "Keys test start...\n";

// while (game->update()) { }
try {
game->game();

}
catch (std::exception e) {
std::cout << "Exception: " << e.what() << '\n';
}
catch (...) {
std::cout << "Unknoun exception\n";
}
std::cout << "Keys test finished!\n";
return 0;
}
Expand Down

0 comments on commit 0c4d489

Please sign in to comment.