protected void EmitValue(PointData pointValue)
 {
     EventHandler<LMWidgets.EventArg<PointData>> handler = PointEvent;
                 if (handler != null) {
                         handler (this, new LMWidgets.EventArg<PointData> (pointValue));
                 }
 }
Beispiel #2
0
				public bool Equals (PointData p)
				{
						if (!p.HasData && !HasData)
								return true;
						if (p.HasData != HasData)
								return false;
						return p.Point == Point;
				}
/*
 * value is a world space point
 */
        PointData ConstrainPointData(PointData value)
        {
            if (!value.HasData)
            {
                return(value);
            }
            Vector3 localValue = Constrainer.transform.InverseTransformPoint(value.Point);

            //	BoxCollider coll = (BoxCollider)Constrainer.collider;
            //	Bounds b = coll.bounds;
            //	Debug.Log (string.Format ("Constraining point {0} (local {1}) to {2} .. {3}", value.Point, localValue, b.min, b.max));
            localValue.x = Mathf.Clamp(localValue.x, MinLocalX, MaxLocalX);
            localValue.y = Mathf.Clamp(localValue.y, MinLocalY, MaxLocalY);
            localValue.z = Mathf.Clamp(localValue.z, MinLocalZ, MaxLocalZ);
            Vector3 valueOut = Constrainer.transform.TransformPoint(localValue);

            //Debug.Log (string.Format ("... result:{0} (global {1})", localValue, valueOut));

            return(new PointData(valueOut));
        }