00001
00002
00003 #ifndef _MOUSE_H_INCLUDED_
00004 #define _MOUSE_H_INCLUDED_
00005
00006 #include "error.h"
00007
00008
00009 class NxActor;
00010
00011
00012 class Mouse
00013 {
00014 public:
00015
00016
00017
00018 Mouse( NxReal size, NxReal mouseOperatingHight, NxReal pickedActorLiftUp );
00019 ~Mouse();
00020
00021
00022 ERR_TYPE moveTo( NxU32 x, NxU32 y );
00023
00024 ERR_TYPE pickActorElasticStrap( NxActor* actor );
00025
00026 ERR_TYPE pickActorFixed( NxActor* actor );
00027
00028 ERR_TYPE dropActor();
00029
00030
00031
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_