Commit 51e2e145 authored by Nicolas Gilmard's avatar Nicolas Gilmard
Browse files

Fix issue #18

path assignment
parent 7f6372ad
......@@ -39,7 +39,7 @@ import java.util.Vector;
*
* @author Nicolas GILMARD [nicolas.gilmard@list.lu]
* @since 2.0
* @version 2.0.1
* @version 2.0.2
*/
@NonNullByDefault
public class TuioAdapter extends TuiAdapter implements TuioListener {
......@@ -114,18 +114,18 @@ public class TuioAdapter extends TuiAdapter implements TuioListener {
/**
* Convert a TUIO object into a tangibleObject
*
* @param tangibleObject
* @param tuioObject
* @pre tangibleObject != null
* @return tangibleObject with TuioObject values
*/
private TangibleObject convertTuioObjectToTangibleObject(TuioObject tangibleObject) {
Preconditions.checkArgument(tangibleObject != null, "The passed tangible cursor cannot be null!"); //$NON-NLS-1$
private TangibleObject convertTuioObjectToTangibleObject(TuioObject tuioObject) {
Preconditions.checkArgument(tuioObject != null, "The passed tangible cursor cannot be null!"); //$NON-NLS-1$
Vector<Point> tempPath = new Vector<>();
tangibleObject.getPath().forEach(path -> tempPath.addElement(new Point(path.getX(), path.getY(), tangibleObject.getAngle())));
tuioObject.getPath().forEach(path -> tempPath.addElement(new Point(path.getX(), path.getY(), path.getAngle(tuioObject))));
TangibleObject convertedTangibleObject = new TangibleObjectBuilder(tangibleObject.getSymbolID(), Type.OBJECT, tangibleObject.getPath().lastElement().getX(), tangibleObject.getPath().lastElement().getY()).withSeconds(tangibleObject.getTuioTime().getSeconds()).withMicroSeconds(tangibleObject.getTuioTime().getMicroseconds()).withxSpeed(tangibleObject.getXSpeed()).withySpeed(tangibleObject.getYSpeed()).withMotionSpeed(tangibleObject.getMotionSpeed()).withMotionAccel(tangibleObject.getMotionAccel()).withRotationSpeed(tangibleObject.getRotationSpeed()).withRotationAccel(tangibleObject.getRotationAccel()).withPath(tempPath).withState(tangibleObject.getTuioState()).build();
TangibleObject convertedTangibleObject = new TangibleObjectBuilder(tuioObject.getSymbolID(), Type.OBJECT, tuioObject.getPath().lastElement().getX(), tuioObject.getPath().lastElement().getY()).withSeconds(tuioObject.getTuioTime().getSeconds()).withMicroSeconds(tuioObject.getTuioTime().getMicroseconds()).withxSpeed(tuioObject.getXSpeed()).withySpeed(tuioObject.getYSpeed()).withMotionSpeed(tuioObject.getMotionSpeed()).withMotionAccel(tuioObject.getMotionAccel()).withRotationSpeed(tuioObject.getRotationSpeed()).withRotationAccel(tuioObject.getRotationAccel()).withPath(tempPath).withState(tuioObject.getTuioState()).build();
return convertedTangibleObject;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment