コード例 #1
0
 // Adds a path knot of type knotType to the path owned by widget at the
 // transform defined by spawnXf.
 public CreatePathKnotCommand(CameraPathWidget widget, CameraPathKnot.Type knotType,
                              PathT pathT, TrTransform spawnXf,
                              BaseCommand parent = null)
     : base(parent)
 {
     m_Widget   = widget;
     m_KnotType = knotType;
     m_SpawnXf  = spawnXf;
     m_PathT    = pathT;
 }
コード例 #2
0
  public void AddPathConstrainedKnot(CameraPathKnot.Type type, Vector3 pos, Quaternion rot) {
    // Determine the position knot and path t for this new knot.
    Vector3 error = Vector3.zero;

    if (m_Path.ProjectPositionOnToPath(pos, out PathT pathT, out error)) {
      // For PositionKnots, validT is the position in the position list.
      if (type == CameraPathKnot.Type.Position) {
        pathT = new PathT(pathT.T + 1.0f);
      }

      SketchMemoryScript.m_Instance.PerformAndRecordCommand(new CreatePathKnotCommand(
          this, type, pathT, TrTransform.TR(pos, rot)));
    }
  }