override public Capture ForceEndCapture(InputState input, CaptureData data) { SurfaceBrushTool tool = context.ToolManager.GetActiveTool((int)data.which) as SurfaceBrushTool; tool.EndBrushStroke(); return(Capture.End); }
public virtual ITool Build(FScene scene, List <SceneObject> targets) { DMeshSO target = targets[0] as DMeshSO; SurfaceBrushTool tool = new_tool(scene, target); tool.Radius = InitialRadius.Clone(); return(tool); }
void update_last_hit(SurfaceBrushTool tool, Ray3f rayW) { SORayHit soHit; if (tool.Target.FindRayIntersection(rayW, out soHit)) { lastHitPosW = soHit.hitPos; lastHitTID = soHit.hitIndex; } }
bool update_last_hit(SurfaceBrushTool tool, Ray3f rayW) { SORayHit soHit; if (tool.Target.FindRayIntersection(rayW, out soHit)) { lastHitFrameW = new Frame3f(soHit.hitPos, soHit.hitNormal); lastHitTID = soHit.hitIndex; return(true); } return(false); }
override public Capture BeginCapture(InputState input, CaptureSide eSide) { //Ray3f sideRay = (eSide == CaptureSide.Left) ? input.vLeftSpatialWorldRay : input.vRightSpatialWorldRay; Frame3f sideHandF = (eSide == CaptureSide.Left) ? input.LeftHandFrame : input.RightHandFrame; sideHandF.Origin += SceneGraphConfig.VRHandTipOffset * sideHandF.Z; SurfaceBrushTool tool = context.ToolManager.GetActiveTool((int)eSide) as SurfaceBrushTool; // [RMS] old oculus hack that was not very nice... //bool bTouchingStick = // (eSide == CaptureSide.Left) ? input.bLeftStickTouching : input.bRightStickTouching; //tool.ActiveBrush = (bTouchingStick) ? // SurfaceBrushTool.BrushTool.Smooth : SurfaceBrushTool.BrushTool.SoftMove; tool.BeginBrushStroke(sideHandF, lastHitTID); return(Capture.Begin(this, eSide)); }
override public Capture UpdateCapture(InputState input, CaptureData data) { SurfaceBrushTool tool = context.ToolManager.GetActiveTool((int)data.which) as SurfaceBrushTool; // [RMS] this is a hack for trigger+shoulder grab gesture...really need some way // to interrupt captures!! if ((data.which == CaptureSide.Left && input.bLeftShoulderPressed) || (data.which == CaptureSide.Right && input.bRightShoulderPressed)) { tool.EndBrushStroke(); return(Capture.End); } Vector2f vStick = (data.which == CaptureSide.Left) ? input.vLeftStickDelta2D : input.vRightStickDelta2D; if (vStick[1] != 0) { tool.Radius.Add(fDimension.World(vStick[1] * resize_speed(ref input))); } //Ray3f sideRay = (data.which == CaptureSide.Left) ? input.vLeftSpatialWorldRay : input.vRightSpatialWorldRay; Frame3f sideHandF = (data.which == CaptureSide.Left) ? input.LeftHandFrame : input.RightHandFrame; sideHandF.Origin += SceneGraphConfig.VRHandTipOffset * sideHandF.Z; //tool.UpdateDraw_Spatial(sideRay, sideHandF); bool bReleased = (data.which == CaptureSide.Left) ? input.bLeftTriggerReleased : input.bRightTriggerReleased; if (bReleased) { tool.EndBrushStroke(); return(Capture.End); } else { tool.UpdateBrushStroke(sideHandF, lastHitTID); return(Capture.Continue); } }
public SurfaceBrushTool_2DInputBehavior(SurfaceBrushTool tool, FContext s) { this.tool = tool; context = s; }
public SurfaceBrushTool_SpatialBehavior(SurfaceBrushTool tool, FContext s) { context = s; this.tool = tool; }