-
Notifications
You must be signed in to change notification settings - Fork 40
RAM API Reference Events
This page describes how to use ramEvents.
ramEvents are not to be confused with ofEvents, which work differently. A ramEvent has a boolean state, which is set to true when it is fired.
ramBaseEvent is a base class for all RAMDanceToolkit events. Here is a small example of a new event class called "MyEvent".
class MyEvent : public ramBaseEvent
{
protected:
bool tick()
{
// do something...
}
};
When you call update() as implemented in ramBaseEvent, the boolean returned by tick() is returned to a caller. The cached value will be returned if you call update() many times in same frame.
// testApp.h
MyEvent event;
// testApp.cpp
void testApp::update()
{
if (event.update())
{
// do something...
}
}
ramCollisionEvent observes collision between ramPrimitive objects that are set to respond to a ramCollisionEvent. Other objects which also have collision detection include ramBox, ramLine etc.
Three trigger timings can be set to a ramCollisionEvent.
enum ramTriggerTiming
{
RAM_TRIGGER_UP,
RAM_TRIGGER_DOWN,
RAM_TRIGGER_BOTH
};
ramScheduledTimerEvent changes its state once per interval duration.
ramRandomTimerEvent changes its state once per interval duration, which is set randomly between min and max.

This Document by YCAM InterLab, Yoshito Onishi, Satoru Higa, Motoi Shimizu, and Kyle McDonald is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
This Wiki and API References (RAMDanceToolkit 1.0.0) is created on 2013-03-09