API reference

mintguy

Interaction Library


getNewTouchPoints()

Returns new touch points which are not registered with another interaction yet

#Loops touchpoints if there is a intersection with object
#register the object and go to next state in scxml
touchPoints = mint.getNewTouchPoints()
for touchPoint in touchPoints:
intersectedObject = mint.getFirstIntersectedObject(touchPoint)
if intersectedObject is not -1:
mint.registerObject(intersectedObject, touchPoint)
mint.signalTransition()

getRegisteredTouchPoints()

Returns the touch points which are already registered with the current interaction

#!Gets Touchpoints if more than one make transition
touchPoints = mint.getRegisteredTouchPoints()
if len(touchPoints) > 0:
mint.signalTransition()

getRegisteredObjects()

Returns a list of MintObjects which are currently registered with this interaction

#Rotates Objects on Scaling 
objects = mint.getRegisteredObjects()
for object in objects:
angle = mint.getUniformScaling(object)*360
mint.rotateEvent(object, angle)

getTouchPointsForObject(MintObject mintObj)

Returns the list of touch points which are registered with the passed MintObject


getIntersectedObjects(TouchPoint tp)

Returns all objects which are intersected by the passed touch point


getFirstIntersectedObject(TouchPoint tp)

Returns the intersected object which is on top/closes to the camera

#Loops touchpoints if there is a intersection with object
#register the object and go to next state in scxml
touchPoints = mint.getNewTouchPoints()
for touchPoint in touchPoints:
intersectedObject = mint.getFirstIntersectedObject(touchPoint)
if intersectedObject is not -1:
mint.registerObject(intersectedObject, touchPoint)
mint.signalTransition()

getClosestTouchPoint(MintObject obj)

Returns the closest available touch point for the passed MintObject


getClosestTouchPoint(MintObject obj, int distInPixels)

Gets the touch point closest to the specified MintObject within the passed distance in pixels


getClosestTouchPoints(MintObject obj, int nrTPs)

Returns at the maximum the specified number of available touch points which are closest to the passed MintObject


getClosestTouchPoints(MintObject obj, int nrTPs, int distInPixels)

Returns at the maximum the specified number of available touch points which are closest to the passed MintObject and additionally within the specified range in pixels


getAxis(TouchPointList tpList)

Returns a value of the Axis enumeration describing the axis specified by the passed touch points. At least 2 touch points have to be in the passed list otherwise the value INVALID will be returned


getAngle(TouchPointList tpList)

Returns the average angle enclosed by the passed touch points. (This angle is used by getAxis() to determine the specified axis.)


getTranslation(TouchPointList tpList)

Returns the average translation (Vec3) of the passed touch points


getTranslation(MintObject mintObj)

Returns the average translation (Vec3) of the touch points which are registered with the specified object

#gets the translation and sends a translateEvent
objects = mint.getRegisteredObjects()
for object in objects:
translation = mint.getTranslation(object)
mint.translateEvent(object, translation)

getRotation(TouchPoint tp1, TouchPoint tp2)

Returns the rotation in degrees performed by the two touch points since the last frame


getRotation(MintObject mintObj)

Returns the rotation in degrees performed by the touch points which are registered with the specified MintObject


getRotation(TouchPointList tpList)

Returns the rotation in degrees performed by the passed touch points since the last frame


getUniformScaling(TouchPoint tp1, TouchPoint tp2)

Returns the uniform scaling value resulting from the movement of the passed touch points since the last frame


getUniformScaling(TouchPointList tpList)

Returns the uniform scaling value resulting from the movement of the passed touch points since the last frame


getUniformScaling(MintObject mintObj)

Returns the uniform scaling value resulting from the movement of the touch points which are registered with the passed object

#Rotates Objects on Scaling 
objects = mint.getRegisteredObjects()
for object in objects:
angle = mint.getUniformScaling(object)*360
mint.rotateEvent(object, angle)

getOneFingerUniformScaling(TouchPoint)

Calculates a uniform scaling value based on the movement of one sole touch point


getScaling(TouchPoint tp1, TouchPoint tp2)

Returns the uniform scaling value resulting from the movement of the passed touch points since the last frame


getScaling(TouchPointList tpList)

Returns the uniform scaling value resulting from the movement of the passed touch points since the last frame


getScaling(MintObject mintObj)

Returns the scaling values (Vec2) resulting from the movement of the touch points which are registered with the passed object


getDragRotation(MintObject mintObj)

Returns a trackball like rotation transformation for a 3D object base on the input of a single touch point

objects = mint.getRegisteredObjects()
for object in objects:
trafo = mint.getDragRotation(object)
mint.rotateEvent(object, trafo)

registerTouchPoint(TouchPoint tp, MintObject mintObj)

Registers a touch point with an object for the current interaction. Both, the touch point and the object, are then owned by this interaction until they are released again


registerTouchPoints(TouchPointList tpList, MintObject mintObj)

Registers a list of touch points with an object for the current interaction. Both, the touch points and the object, are then owned by this interaction until they are released again


registerObject(MintObject mintObj, TouchPoint tp)

Registers the passed object/touch point pair with the current interaction

#Loops touchpoints if there is a intersection with object
#register the object and go to next state in scxml
touchPoints = mint.getNewTouchPoints()
for touchPoint in touchPoints:
intersectedObject = mint.getFirstIntersectedObject(touchPoint)
if intersectedObject is not -1:
mint.registerObject(intersectedObject, touchPoint)
mint.signalTransition()

isObjectRegistered(MintObject mintObj)

Returns whether the passed object is registered with the current interaction


setObjectOnTop(MintObject mintObj)

Sets the passed object on top. Only for 2D


signalTransition()

Causes a transition to the target state of the currently active state of the Gesture State Machine as described in the interaction's SCXML file


unregisterAll()

Unregisters all touch points and objects which are registered with the current interaction


selectEvent(MintObject mintObj)

Sends a selection event for the specified object to the application

#Sends out a selectEvent
objects = mint.getRegisteredObjects()
for object in objects:
mint.selectEvent(object)

releaseEvent(MintObject mintObj)

Sends a release event for the specified object to the application


translateEvent(MintObject mintObj, Vec3 translation)

Sends a transform event containing the new position for the specified object to the application

#gets the translation and sends a translateEvent
objects = mint.getRegisteredObjects()
for object in objects:
translation = mint.getTranslation(object)
mint.translateEvent(object, translation) )

rotateEvent(MintObject mintObj, double angle)

Sends a transform event for the specified object to the application. A 2D object is rotated around the z-axis while a 3D object will be rotated around all axes by the given euler angle

#Rotates Objects on Scaling 
objects = mint.getRegisteredObjects()
for object in objects:
angle = mint.getUniformScaling(object)*360
mint.rotateEvent(object, angle)

rotateEvent(MintObject mintObj, Vec3 angles)

Sends a transform event for the specified object to the application. Both 2D and 3D objects will be rotated around all axes by the given euler angles


rotateEvent(MintObject mintObj, Matrix rotMatrix)

Sends a transform event for the specified object to the application. Both 2D and 3D objects will be rotated as described by the passed matrix


rotateEvent(MintObject mintObj, Quaternion quat)

Sends a transform event for the specified object to the application. Both 2D and 3D objects will be rotated as described by the passed quaternion


rotateEvent(MintObject mintObj, Trafo trafo)

Sends a transform event for the specified object to the application. Both 2D and 3D objects will be rotated around all axes as described by the passed Trafo object


scaleEvent(MintObject mintObj, double scale)

Sends a transform event for the specified object to the application. Both 2D and 3D objects will be uniformly scaled in all directions by the passed amount

#Gets the uniform scaling for registerdObjects 
#and sends out scaleEvent
objects = mint.getRegisteredObjects()
for object in objects:
size = mint.getUniformScaling(object)
mint.scaleEvent(object, size)

scaleEvent(MintObject mintObj, Vec2 scale)

Sends a transform event for the specified object to the application. Both 2D and 3D objects will be scaled in x- and y-direction by the passed amount


scaleEvent(MintObject mintObj, Vec3 scale)

Sends a transform event for the specified object to the application. Both 2D and 3D objects will be scaled in all directions by the specified amount


transformEvent(MintObject mintObj, Trafo trafo)

Sends a transform event for the specified object to the application. The passed Trafo object can be applied to 2D as well as 3D objects

mintguy

Types


class Point: Represents a two dimensional point

Members

Point(double x, double y)

Creates a point with corresponding x- and y-coordinate

Variables

double X

The x-coordinate of the point

double Y

The y-coordinate of the point


class Vec2: Represents a two dimensional vector

Members

Vec2(double x, double y)

Creates a vector with corresponding x- and y-direction

length()

Returns the length of the vector

lengthSquared()

Returns the squared length of the vector

normalize()

Returns a normalized version of the vector

Operators

[]

For getting and setting the values of the vector


class Vec3: Represents a three dimensional vector

Members

Vec3(double x, double y, double z)

Creates a vector with corresponding x-,y- and z-direction

length()

Returns the length of the vector

lengthSquared()

Returns the squared length of the vector

normalize()

Returns a normalized version of the vector

Operators

[]

For getting and setting the values of the vector


class Trafo: represents the transformation values of an object including position, rotation and size

Members

Trafo (Vec3 position)

Creates a transformation with the passed position

Trafo (Vec3 position, Vec3 rotation, Vec3 size)

Creates a transformation with the passed position, rotation (euler angles) and size

Trafo (Matrix transformation)

Creates a transformation with the passed transformation matrix

translate (Vec3 translation)

Performs the given translation and returns the new position

Variables

VEC3 rotation

Gets and sets the rotation in euler angles

double rotationX

Gets and sets the rotation around the x-axis in euler angles

double rotationY

Gets and sets the rotation around the y-axis in euler angles

double rotationZ

Gets and sets the rotation around the z-axis in euler angles

VEC3 position

Gets and sets the three dimensional position

double positionX

Gets and sets the position in x-direction

double positionY

Gets and sets the position in y-direction

double positionZ

Gets and sets the position in z-direction

Vec3 size

Gets and sets the size

double sizeX

Gets and sets the x-size

double sizeY

Gets and sets the y-size

double sizeZ

Gets and sets the z-size


class MintObject: An instance of a MintObject which is an interactive application object managed by MINT

Members

Not constructible in Python

isSelected bool

Returns whether the object is currently selected

Variables

Trafo trafo (read only)

Gets the current transformation of the object


enum Axis: Enumerates the coordinate system axes X, Y and Z

Members

X The x-axis

Y The y-axis

Z The z-axis

INVALID Represents a invalid enum value


enum Plane: Enumeration for different plane alignments that can be specified when creating a plane

Members

XY Alignment with the XY plane of the coordinate system

XZ Alignment with the XZ plane of the coordinate system

YZ Alignment with the YZ plane of the coordinate system

BILLBOARD Alignment as billboard with the currently used camera