mouse.h

00001 
00002 // protect multiple inclusion
00003 #ifndef _MOUSE_H_INCLUDED_
00004 #define _MOUSE_H_INCLUDED_
00005 
00006 #include "error.h"
00007 
00008 // forward declaration to prevent #include here
00009 class NxActor;
00010 
00011 
00012 class Mouse
00013 {
00014 public:
00015         // size = length of each side of our mouseActor
00016         // mouseOperatingHight = virtual plane Y-hight where mouse moves on
00017         // pickedActorLiftUp = picked actors will be lift up from ther original position
00018         Mouse( NxReal size, NxReal mouseOperatingHight, NxReal pickedActorLiftUp );
00019         ~Mouse();
00020 
00021         // set new position on virtual plane, transformed from screen x/y
00022         ERR_TYPE moveTo( NxU32 x, NxU32 y );
00023         // lift actor and create joint with our mouseActor, joint is an "elastic strap"
00024         ERR_TYPE pickActorElasticStrap( NxActor* actor );
00025         // lift actor and create joint with our mouseActor, joint is a "fixed connection"
00026         ERR_TYPE pickActorFixed( NxActor* actor );
00027         // release joint with active actor
00028         ERR_TYPE dropActor();
00029         // returns valid NxActor if mouse raycast hits an actor in the scene
00030         // transformed from screen x/y
00031         // NULL otherwise 
00032         NxActor* actorHit( NxU32 inX, NxU32 inY );
00033 
00034 private:
00035         ERR_TYPE createMouseActor( NxReal size );
00036         ERR_TYPE createDistanceJoint( NxActor* actor, NxVec3 position );
00037         ERR_TYPE createSphericalJoint( NxActor* actor, NxVec3 position );
00038         NxVec3 getRayIntersectionWithTable( irr::core::line3df line );
00039         line3df getCameraToTableRay( irr::s32 mouseX, irr::s32 mouseY );
00040 
00041         NxActor* mouseActor;
00042         NxJoint* joint;
00043         NxReal mouseOperatingHight;
00044         NxReal pickedActorLiftUp;
00045 };
00046 
00047 
00048 #endif // #ifndef _MOUSE_H_INCLUDED_

Generated on Sun Dec 2 03:10:23 2007 for TableTop by  doxygen 1.5.4