+/**
+ * Confine actor to the x axis boundaries of reference actor (e.g. Parent)
+ */
+struct ParentXAxisConstraint
+{
+ /**
+ * Confinement constraint constructor.
+ */
+ ParentXAxisConstraint( float handlesMidPoint = 0.0f )
+ : mHandlesMidPoint( handlesMidPoint )
+ {
+ }
+
+ float operator()( const float constXPosition,
+ const PropertyInput& localWidthProperty,
+ const PropertyInput& anchorPointXProperty )
+ {
+ const float size = localWidthProperty.GetFloat();
+ const float anchor = anchorPointXProperty.GetFloat();
+
+ float newPosition = Clamp( mHandlesMidPoint, constXPosition - size * anchor , constXPosition + size * anchor);
+
+ return newPosition;
+ }
+
+ float mHandlesMidPoint;
+};
+
+