You.i Engine
CYIActionEvent Class Reference

Detailed Description

Stores data related to a user Action event.

Action events represent any type of mouse or touchscreen events issued by the user.

#include <event/YiActionEvent.h>

Inheritance diagram for CYIActionEvent:

Public Types

enum  YI_BUTTON_TYPE {
  YI_LEFT_BUTTON,
  YI_RIGHT_BUTTON,
  YI_MIDDLE_BUTTON,
  YI_NO_BUTTON
}
 

Public Member Functions

 CYIActionEvent (YI_EVENT_TYPE eventType)
 
 CYIActionEvent (const CYIActionEvent &rOther)=default
 
virtual ~CYIActionEvent ()
 
virtual std::unique_ptr< CYIEventClone () const override
 
- Public Member Functions inherited from CYIEvent
 CYIEvent (YI_EVENT_TYPE eventType)
 
 CYIEvent (const CYIEvent &rOther)
 
virtual ~CYIEvent ()
 
const CYIStringGetName () const
 
YI_EVENT_TYPE GetType () const
 
void SetType (YI_EVENT_TYPE eventType)
 
bool IsActionEvent () const
 
std::unique_ptr< CYIActionEventCloneAsActionEvent () const
 
bool IsKeyEvent () const
 
std::unique_ptr< CYIKeyEventCloneAsKeyEvent () const
 
bool IsFocusEvent () const
 
std::unique_ptr< CYIFocusEventCloneAsFocusEvent () const
 
bool IsTrackpadEvent () const
 
std::unique_ptr< CYITrackpadEventCloneAsTrackpadEvent () const
 
- Public Member Functions inherited from CYIScriptableObject
 CYIScriptableObject ()
 
 CYIScriptableObject (const CYIScriptableObject &other)
 
CYIScriptableObjectoperator= (const CYIScriptableObject &other)
 
virtual ~CYIScriptableObject ()
 
CYIBindingImplementationGetBindingImplementation () const
 
void SetBindingImplementation (CYIBindingImplementation *pBindingImplementation)
 
virtual const CYIRuntimeTypeInfoGetRuntimeTypeInfoForScriptObject () const
 

Public Attributes

int32_t m_nX
 
int32_t m_nY
 
int32_t m_nFlippedY
 
int32_t m_nWheelDelta
 
uint8_t m_uButton
 
bool m_bIsHoverType
 
uint8_t m_uPointerID
 
CYIRay m_Ray
 
glm::vec3 m_vLocalSpaceLocation
 
- Public Attributes inherited from CYIEvent
CYIEventTargetm_pTarget
 
CYIEventTargetm_pCurrentTarget
 
YI_EVENT_PHASE m_ePhase
 
bool m_bCanCancel
 
bool m_bCanBubble
 
bool m_bCanCapture
 
bool m_bStopPropagation
 
bool m_bHandled
 
uint64_t m_uEventTimeMs
 

Member Enumeration Documentation

Enumerator
YI_LEFT_BUTTON 
YI_RIGHT_BUTTON 
YI_MIDDLE_BUTTON 
YI_NO_BUTTON 

Constructor & Destructor Documentation

CYIActionEvent::CYIActionEvent ( YI_EVENT_TYPE  eventType)

Constructs an action event from the given event type. Will assert if the type is not an action event.

CYIActionEvent::CYIActionEvent ( const CYIActionEvent rOther)
default
virtual CYIActionEvent::~CYIActionEvent ( )
virtual

Member Function Documentation

virtual std::unique_ptr<CYIEvent> CYIActionEvent::Clone ( ) const
overridevirtual

Reimplemented from CYIEvent.

Member Data Documentation

bool CYIActionEvent::m_bIsHoverType

True if the action event is a hover event. An example would be a mouse over event.

int32_t CYIActionEvent::m_nFlippedY

The y location of the event in flipped screen coordinates.

int32_t CYIActionEvent::m_nWheelDelta

If the action is YI_ACTION_WHEEL then this is the distance the wheel has rotated since the last YI_ACTION_WHEEL event. A positive value indicates that the wheel was rotated forward. This is typically 0 for all other event types.

int32_t CYIActionEvent::m_nX

The x location of the event in screen coordinates.

int32_t CYIActionEvent::m_nY

The y location of the event in screen coordinates.

CYIRay CYIActionEvent::m_Ray

The ray is used for picking. The ray is created from the screen coordinates of the event, but as the scene tree is traversed, the ray is tranformed into each node's local space.

uint8_t CYIActionEvent::m_uButton

The CYIActionEvent::YI_BUTTON_TYPE that was used.

uint8_t CYIActionEvent::m_uPointerID

The pointer ID literally refers to a finger on a multi-touch device. Currently this is only supported by Android. For example: if two fingers are down on the tablet, the indexes 0 and 1 are assigned respectively. Then when the user lifts the first finger placed on the tablet the index for the remaining finger would be 1.

glm::vec3 CYIActionEvent::m_vLocalSpaceLocation

Location of the event in local coordinates. This is determined by intersecting CYIActionEvent::m_Ray with the current target node's mesh, and is updated as the scene tree is traversed. This is 0 if the current target node has no mesh.


The documentation for this class was generated from the following file: