33 PickResult() : geometry(nullptr), distance(0), hit(false) {}
54 friend class EventManager;
74 KEY_BackSpace = 0xFF08,
76 KEY_Linefeed = 0xFF0A,
80 KEY_Scroll_Lock = 0xFF14,
96 KEY_Page_Down = 0xFF56,
105 KEY_Execute = 0xFF62,
114 KEY_Mode_switch = 0xFF7E,
115 KEY_Script_switch = 0xFF7E,
116 KEY_Num_Lock = 0xFF7F,
120 KEY_KP_Space = 0xFF80,
122 KEY_KP_Enter = 0xFF8D,
127 KEY_KP_Home = 0xFF95,
128 KEY_KP_Left = 0xFF96,
130 KEY_KP_Right = 0xFF98,
131 KEY_KP_Down = 0xFF99,
132 KEY_KP_Prior = 0xFF9A,
133 KEY_KP_Page_Up = 0xFF9A,
134 KEY_KP_Next = 0xFF9B,
135 KEY_KP_Page_Down = 0xFF9B,
137 KEY_KP_Begin = 0xFF9D,
138 KEY_KP_Insert = 0xFF9E,
139 KEY_KP_Delete = 0xFF9F,
140 KEY_KP_Equal = 0xFFBD,
141 KEY_KP_Multiply = 0xFFAA,
143 KEY_KP_Separator = 0xFFAC,
144 KEY_KP_Subtract = 0xFFAD,
145 KEY_KP_Decimal = 0xFFAE,
146 KEY_KP_Divide = 0xFFAF,
204 KEY_Shift_L = 0xFFE1,
205 KEY_Shift_R = 0xFFE2,
206 KEY_Control_L = 0xFFE3,
207 KEY_Control_R = 0xFFE4,
208 KEY_Caps_Lock = 0xFFE5,
209 KEY_Shift_Lock = 0xFFE6,
215 KEY_Super_L = 0xFFEB,
216 KEY_Super_R = 0xFFEC,
217 KEY_Hyper_L = 0xFFED,
222 MODKEY_LEFT_SHIFT = 0x0001,
223 MODKEY_RIGHT_SHIFT = 0x0002,
224 MODKEY_LEFT_CTRL = 0x0004,
225 MODKEY_RIGHT_CTRL = 0x0008,
226 MODKEY_LEFT_ALT = 0x0010,
227 MODKEY_RIGHT_ALT = 0x0020,
228 MODKEY_LEFT_META = 0x0040,
229 MODKEY_RIGHT_META = 0x0080,
230 MODKEY_LEFT_SUPER = 0x0100,
231 MODKEY_RIGHT_SUPER = 0x0200,
232 MODKEY_LEFT_HYPER = 0x0400,
233 MODKEY_RIGHT_HYPER = 0x0800,
234 MODKEY_NUM_LOCK = 0x1000,
235 MODKEY_CAPS_LOCK = 0x2000,
236 MODKEY_CTRL = (MODKEY_LEFT_CTRL | MODKEY_RIGHT_CTRL),
237 MODKEY_SHIFT = (MODKEY_LEFT_SHIFT | MODKEY_RIGHT_SHIFT),
238 MODKEY_ALT = (MODKEY_LEFT_ALT | MODKEY_RIGHT_ALT),
239 MODKEY_META = (MODKEY_LEFT_META | MODKEY_RIGHT_META),
240 MODKEY_SUPER = (MODKEY_LEFT_SUPER | MODKEY_RIGHT_SUPER),
241 MODKEY_HYPER = (MODKEY_LEFT_HYPER | MODKEY_RIGHT_HYPER)
246 Y_INCREASING_DOWNWARDS
265 MOUSE_PASSIVE_MOTION = 4,
268 DEFAULT = MOUSE_BUTTON | KEYBOARD | UPDATE,
269 ALL = MOUSE_BUTTON | MOUSE_MOTION | MOUSE_PASSIVE_MOTION | KEYBOARD | UPDATE
277 virtual void setMask(
int f);
287 virtual bool mouseDragged( MouseButtonMask buttonMask,
float x,
float y );
293 virtual bool mouseMoved(
float x,
float y );
300 virtual bool mouse( MouseButtonMask button, MouseState state,
float x,
float y );
309 virtual bool keyboard(
int key,
unsigned int modKeyMask,
float x,
float y,
bool keydown );
315 virtual void update(
float x,
float y );
335 bool _mouseMoved(
float x,
float y );
339 bool _keyboard(
int key,
unsigned int modKeyMask,
float x,
float y,
bool keydown );
341 void _update(
float x,
float y );
402 return keyboard( key, modKeyMask, x, y, keydown );
#define AGXPHYSICS_EXPORT
An EventListener can be associated to a Simulation and triggered upon various events.
virtual void setMask(int f)
Specifies a bit mask which determines which event types that will activate this listener.
Derive from this class to implement a listener for simulation GuiEvents.
bool _mouse(MouseButtonMask buttonMask, MouseState state, float x, float y)
virtual bool mouseDragged(MouseButtonMask buttonMask, float x, float y)
Called when one or more mouse buttons are pressed and moved.
size_t findIntersectGeometryIndex(const agxCollide::LocalGeometryContactVector &geometryContacts, bool onlyDynamic)
agx::AffineMatrix4x4 m_directTransform
GuiEventListener(ActivationMask mask=DEFAULT)
Default constructor, sets the default activation mask to all (POST_STEP and PRE_STEP) events.
virtual void setMask(int f)
Specifies a bitmask which determines which event types that will activate this listener.
ActivationMask
Defines the event states for which a listener will be activated, a mask can be bitwise OR:ed from the...
bool _mouseMoved(float x, float y)
virtual bool mouseMoved(float x, float y)
virtual bool mouse(MouseButtonMask button, MouseState state, float x, float y)
virtual ~GuiEventListener()
bool _keyboard(int key, unsigned int modKeyMask, float x, float y, bool keydown)
virtual void setInverseTransform(const agx::AffineMatrix4x4 &inverseTransform)
void _update(float x, float y)
virtual void update(float x, float y)
Called once per simulation frame.
agxSDK::PickResult intersect(const agx::Vec3 &start, const agx::Vec3 &end, bool onlyDynamics)
Shoot a ray from start to end into the space and calculate the closest geometry.
virtual bool keyboard(int key, unsigned int modKeyMask, float x, float y, bool keydown)
agx::AffineMatrix4x4 m_inverseTransform
bool _mouseDragged(MouseButtonMask buttonMask, float x, float y)
Pointer to a entity instance of type Physics.Particle.
Smart pointer for handling referenced counted objects.
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
agx::ref_ptr< GuiEventListener > GuiEventListenerRef
LinearProbingHashSetImplementation< KeyT, HashT >::iterator end(LinearProbingHashSetImplementation< KeyT, HashT > &set)
agx::observer_ptr< agxCollide::Geometry > geometry
agx::Physics::ParticlePtr particle