public DrawState(PinchDraw parent) { _parent = parent; _smoothedPosition = new SmoothedVector3(); _smoothedPosition.delay = parent._smoothingDelay; _smoothedPosition.reset = true; }
//Custom color picker using Leap motion hand detection see portfolio VR Draw demo //sets colors to starting black position---------------------------------------------------- void Awake() { pinchdraw = GameObject.Find("Pinch Drawing").GetComponent <PinchDraw>(); linecolor = Color.black; RedLerp(); GreenGradient(); BlueGradient(); ChangeColor(); }
void MakeDrawStateRPCs(int numDrawStates) { PinchDraw pd = gameObject.GetComponent <PinchDraw>(); drawStateRPCs = new List <DrawStateRPC>(); for (int i = 0; i < numDrawStates; i++) { DrawStateRPC drawStateRPC = new DrawStateRPC(pd._material, pd._minSegmentLength, pd._drawResolution, pd.DrawColor, pd.DrawRadius, pd._smoothingDelay); drawStateRPCs.Add(drawStateRPC); } }
protected virtual void Awake() { if (GetComponent <IHandModel>() != null) { Debug.LogWarning("LeapPinchDetector should not be attached to the IHandModel's transform. It should be attached to its own transform."); } if (_handModel == null) { Debug.LogWarning("The HandModel field of LeapPinchDetector was unassigned and the detector has been disabled."); enabled = false; } Transform pinchDrawing = transform.root.Find("Pinch Drawing"); PinchDraw pinchDraw = pinchDrawing.transform.GetComponent("PinchDraw") as PinchDraw; PinchDetector pinchDetector = transform.GetComponent("PinchDetector") as PinchDetector; if (pinchDetector != null) { pinchDraw.AddPinchDetector(pinchDetector); } }