class trackball :A prototype 2D manipulator. Drag the mouse to modify a scaleable_2d. Typically that would be Scene.rotation_actuator.< mouse : < affect : Event.mouse_listener -> unit; .. >;
ticker : < affect : Event.frame_listener -> 'a; .. >; .. > ->object..end
** note: trackball is broken because the actuator system is in need of upkeeping **
The following code creates a cube that can be rotated by dragging the mouse.
open FatCaml.Application
let event_dispatcher = display_singleton#event_dispatcher in
let cube = new cube and
rotation = new rotation_actuator and
trackball = new trackball event_dispatcher in
trackball#affect (rotation :> scaleable_2d)
rotation#affect (cube :> gl_node) ;
val mutable autospin : boolval mutable dx : intval mutable dy : intmethod mouse_pressed : Sdlevent.mousebutton_event -> unitmethod mouse_released : Sdlevent.mousebutton_event -> unitmethod mouse_moved : Sdlevent.mousemotion_event -> unitmethod mouse_dragged : Sdlevent.mousemotion_event -> unitmethod do_tick : unit