- actor.ApplyConstraint( Constraint::New<Vector3>( property, Source( detector, PanGestureDetector::Property::ScreenPosition ),
- Source( detector, PanGestureDetector::Property::ScreenDisplacement ),
- Source( detector, PanGestureDetector::Property::ScreenVelocity ),
- Source( detector, PanGestureDetector::Property::LocalPosition ),
- Source( detector, PanGestureDetector::Property::LocalDisplacement ),
- Source( detector, PanGestureDetector::Property::LocalVelocity ),
- PanConstraint( constraintData ) ) );
+ Constraint constraint = Constraint::New<Vector3>( actor, property, PanConstraint( constraintData ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_POSITION ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_DISPLACEMENT ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::SCREEN_VELOCITY ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_POSITION ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_DISPLACEMENT ) );
+ constraint.AddSource( Source( detector, PanGestureDetector::Property::LOCAL_VELOCITY ) );
+ constraint.Apply();