Game of Ur 0.3.3
This is a computer adaptation of Game of Ur, written in C++ mainly using SDL and OpenGL.
Loading...
Searching...
No Matches
IUsePointer Class Reference

The interface used by aspects, objects, which cast pointer rays to interact with objects present in the world. More...

#include <interface_pointer_callback.hpp>

Inheritance diagram for IUsePointer:
QueryClick

Public Member Functions

 ~IUsePointer ()=default
 Virtual IUsePointer destructor, so that subclasses can use their own.
 

Protected Member Functions

bool leftClickOn (ILeftClickable &clickable, glm::vec4 clickLocation)
 Calls the left mouse button press (or equivalent) callback on an object.
 
bool leftReleaseOn (ILeftClickable &clickable, glm::vec4 clickLocation)
 Calls the left mouse button release (or equivalent) callback on an object.
 
bool pointerEnter (IHoverable &hoverable, glm::vec4 hoverLocation)
 Callback for when a pointer enters a region containing an object.
 
bool pointerLeave (IHoverable &hoverable)
 Callback for when a pointer leaves a region containing an object.
 

Detailed Description

The interface used by aspects, objects, which cast pointer rays to interact with objects present in the world.

This interface will usually be attached to an aspect associated with a camera object.

Contains methods to invoke pointer event callbacks on objects that implement IRightClickable, ILeftClickable, and IHoverable.

The responsibility of actually conducting the raycast falls on the aspect implementing this interface itself.

Member Function Documentation

◆ leftClickOn()

bool IUsePointer::leftClickOn ( ILeftClickable & clickable,
glm::vec4 clickLocation )
inlineprotected

Calls the left mouse button press (or equivalent) callback on an object.

Parameters
clickableThe aspect with a left click callback.
clickLocationThe 3D world coordinates where the object was clicked.
Return values
trueThe object handled the left mouse button press.
falseThe object did not handle the left mouse button press.

◆ leftReleaseOn()

bool IUsePointer::leftReleaseOn ( ILeftClickable & clickable,
glm::vec4 clickLocation )
inlineprotected

Calls the left mouse button release (or equivalent) callback on an object.

Parameters
clickableThe aspect with the left click callback.
clickLocationThe 3D world coordinates where the object was clicked.
Return values
trueThe object handled the left mouse button release.
falseThe object did nothing with the left mouse button release.

◆ pointerEnter()

bool IUsePointer::pointerEnter ( IHoverable & hoverable,
glm::vec4 hoverLocation )
inlineprotected

Callback for when a pointer enters a region containing an object.

Parameters
hoverableThe aspect with the hover callback.
hoverLocationThe location at which the pointer entered the object's region.
Return values
trueThe object handled the pointer enter event.
falseThe object did nothing with the pointer enter event.

◆ pointerLeave()

bool IUsePointer::pointerLeave ( IHoverable & hoverable)
inlineprotected

Callback for when a pointer leaves a region containing an object.

Parameters
hoverableThe aspect with the hover callback.
Return values
trueThe object handled the pointer leave event.
falseThe object did nothing with the pointer leaving event.

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