/** * This constructor takes the atttibutes of the provided TuioContainer * and assigs these values to the newly created TuioContainer. * * @param tcon the TuioContainer to assign */ public TuioContainer(TuioContainer tcon) : base(tcon) { session_id = tcon.getSessionID(); x_speed = 0.0f; y_speed = 0.0f; motion_speed = 0.0f; motion_accel = 0.0f; path = new List <TuioPoint>(); path.Add(new TuioPoint(currentTime, xpos, ypos)); state = TUIO_ADDED; }
/** * Takes the atttibutes of the provided TuioContainer * and assigs these values to this TuioContainer. * The TuioTime time stamp of this TuioContainer remains unchanged. * * @param tcon the TuioContainer to assign */ public void update(TuioContainer tcon) { base.update(tcon.getX(), tcon.getY()); x_speed = tcon.getXSpeed(); y_speed = tcon.getYSpeed(); motion_speed = (float)Math.Sqrt(x_speed * x_speed + y_speed * y_speed); motion_accel = tcon.getMotionAccel(); path.Add(new TuioPoint(currentTime, xpos, ypos)); if (motion_accel > 0) { state = TUIO_ACCELERATING; } else if (motion_accel < 0) { state = TUIO_DECELERATING; } else { state = TUIO_STOPPED; } }