//public PerspectiveCamera(Transform c2w) { } override public float GenerateRay(CameraSample sample, out Ray ray) { Point3 Pras = new Point3(sample.imageX, sample.imageY, 0); //光栅坐标 Point3 Pcamera; Pcamera = RasterToCamera.Caculate(Pras);//光栅坐标转换为相机坐标 相机为原点 ray = new Ray(new Point3(0, 0, 0), LR.Normalize(new Vector(Pcamera)), 0.0f, 1.0f / 0); // Modify ray for depth of field if (lensRadius > 0.0) { // Sample point on lens float lensU, lensV; // ConcentricSampleDisk(sample.lensU, sample.lensV, &lensU, &lensV); //lensU *= lensRadius; //lensV *= lensRadius; // Compute point on plane of focus // float ft = focalDistance / ray->d.z; // Point Pfocus = (*ray)(ft); // // Update ray for effect of lens // ray->o = Point(lensU, lensV, 0.f); // ray->d = Normalize(Pfocus - ray->o); //} //ray->time = sample.time; //CameraToWorld(*ray, ray); } return(1.0f); }
public void FadeOut(LR direction) { currentFade?.Kill(); switch (direction) { case LR.L: if (material.GetFloat(Alpha0UVX) < material.GetFloat(Alpha1UVX)) { material.SetFloat(Alpha0UVX, 1 + fadeInOutGradationWidth); material.SetFloat(Alpha1UVX, 1); } currentFade = DOTween.Sequence() .Append(material.To(Alpha0UVX, 0, fadeOutDuration)) .Join(material.To(Alpha1UVX, -fadeInOutGradationWidth, fadeOutDuration)); break; case LR.R: if (material.GetFloat(Alpha0UVX) > material.GetFloat(Alpha1UVX)) { material.SetFloat(Alpha0UVX, -fadeInOutGradationWidth); material.SetFloat(Alpha1UVX, 0); } currentFade = DOTween.Sequence() .Append(material.To(Alpha0UVX, 1, fadeOutDuration)) .Join(material.To(Alpha1UVX, 1 + fadeInOutGradationWidth, fadeOutDuration)); break; } currentFade.GetPausable().AddTo(this); currentFade.AsHeros(); }
public static IntPtr CopyImage(IHandle hImage, IMAGE type, int cx, int cy, LR flags) { IntPtr result = CopyImage(hImage.Handle, type, cx, cy, flags); GC.KeepAlive(hImage); return(result); }
private void UpdateLineTarget() { try { if (HasLineSpawned && closestCollectable == null) { if (LR.GetComponent <LineRenderer>().enabled) { LR.GetComponent <LineRenderer>().enabled = false; } return; } if (closestCollectable != null) { if (!LR.GetComponent <LineRenderer>().enabled) { LR.GetComponent <LineRenderer>().enabled = true; } Vector3 position = new Vector3(player.transform.position.x, player.transform.position.y - 1f, player.transform.position.z); LR.GetComponent <LineRenderer>().SetPosition(0, position); LR.GetComponent <LineRenderer>().SetPosition(1, closestCollectable.transform.position); } } catch (Exception) { } }
/// <summary> /// This can be used to write a time zone to a PDI data stream /// </summary> /// <param name="tw">A <see cref="System.IO.TextWriter"/> derived class to which the time zone is /// written.</param> /// <param name="sb">A <see cref="System.Text.StringBuilder"/> used by the properties as a temporary /// buffer. This can be null if the TextWriter is a <see cref="System.IO.StringWriter"/>.</param> /// <remarks>This is called by <see cref="CalendarObject.ToString"/> as well as owning objects when they /// convert themselves to a string or write themselves to a PDI data stream.</remarks> /// <exception cref="ArgumentException">This is thrown if the TimeZoneId's Value property is null</exception> public override void WriteToStream(TextWriter tw, StringBuilder sb) { PropagateVersion(); tw.Write("BEGIN:VTIMEZONE\r\n"); // The TZID property is required. if (this.TimeZoneId.Value == null) { throw new ArgumentException(LR.GetString("ExTZIDCannotBeNull")); } BaseProperty.WriteToStream(timeZoneId, sb, tw); BaseProperty.WriteToStream(timeZoneUrl, sb, tw); BaseProperty.WriteToStream(lastMod, sb, tw); if (rules != null && rules.Count != 0) { foreach (ObservanceRule r in rules) { r.WriteToStream(tw, sb); } } if (customProps != null && customProps.Count != 0) { foreach (CustomProperty c in customProps) { BaseProperty.WriteToStream(c, sb, tw); } } tw.Write("END:VTIMEZONE\r\n"); }
void ShowPreview() { previewing = true; GOPreview = new GameObject(); foreach (CameraPoint CP in CamPoints) { GameObject NewSphere = GameObject.CreatePrimitive(PrimitiveType.Sphere); NewSphere.transform.position = CP.pos; NewSphere.transform.rotation = CP.rot; NewSphere.transform.localScale = NewSphere.transform.localScale / 2; NewSphere.transform.SetParent(GOPreview.transform); } //Smooth Curve SetSmoothCamPoints(); LineRenderer LR; if (gameObject.GetComponent <LineRenderer>()) { LR = gameObject.GetComponent <LineRenderer>(); } else { LR = GOPreview.AddComponent <LineRenderer>(); LR.SetWidth(.2f, .2f); LR.useWorldSpace = true; LR.material = AssetManager.Instance.dataViewMaterial; } LR.SetVertexCount(SmoothCamPoints.Count); for (int i = 0; i < SmoothCamPoints.Count; i++) { LR.SetPosition(i, SmoothCamPoints[i].pos); } }
//===================================================================== /// <summary> /// Collection indexer /// </summary> /// <param name="uniqueId">The unique ID of the item to get or set. When retrieving an item, null is /// returned if it does not exist in the collection.</param> /// <exception cref="ArgumentException">This is thrown if an attempt is made to set an item using a /// unique ID that does not exist in the collection.</exception> public VNote this[string uniqueId] { get { for (int idx = 0; idx < base.Count; idx++) { if (base[idx].UniqueId.Value == uniqueId) { return(base[idx]); } } return(null); } set { for (int idx = 0; idx < base.Count; idx++) { if (base[idx].UniqueId.Value == uniqueId) { base[idx] = value; return; } } throw new ArgumentException(LR.GetString("ExUIDNotFound")); } }
//===================================================================== /// <summary> /// Collection indexer /// </summary> /// <param name="propertyName">The name of the item to get or set. When retrieving an item, null is /// returned if it does not exist in the collection.</param> /// <exception cref="ArgumentException">This is thrown if an attempt is made to set an item using a name /// that does not exist in the collection.</exception> /// <remarks>The property name is case-insensitive</remarks> public CustomProperty this[string propertyName] { get { for (int idx = 0; idx < base.Count; idx++) { if (String.Compare(base[idx].Tag, propertyName, StringComparison.OrdinalIgnoreCase) == 0) { return(base[idx]); } } return(null); } set { for (int idx = 0; idx < base.Count; idx++) { if (String.Compare(base[idx].Tag, propertyName, StringComparison.OrdinalIgnoreCase) == 0) { base[idx] = value; return; } } throw new ArgumentException(LR.GetString("ExCPropIDNotFound")); } }
public Halfedge(Type _lock,Edge edge=null,LR lr=null) { if(_lock!=typeof(PrivateConstrutorEnforcer)){ Debug.LogError("halfedge constructor is private"); } init(edge,lr); }
//プレイヤーキャラクターをInputLRに動かします。 private bool Move(LR InputLR) { //体の向きの変更 if (looking != InputLR) { Std.Swap(ref to, ref from); looking = InputLR; } Look(to); //動作する向きの設定 float x = 0, y, z = 0; Vector3 moveArrow = Vector3.forward; if (IsGround) { moveArrow = Vector3.forward; } if (IsLadder && InputLR == LR.right) { moveArrow = Vector3.up; } else if (IsLadder && InputLR == LR.left && !IsGround) { moveArrow = Vector3.down; } //動作する速度の設定 x = (transform.TransformDirection(moveArrow) * speed).x; y = IsLadder ? (transform.TransformDirection(moveArrow)).y : rb.velocity.y; z = (transform.TransformDirection(moveArrow) * speed).z; rb.velocity = new Vector3(x, y, z); return(true); }
public override bool Intersect(Ray ray, ref DifferentialGeometry dg) { float A = ray.d.x * ray.d.x + ray.d.y * ray.d.y + ray.d.z * ray.d.z; float B = 2 * (ray.d.x * ray.o.x + ray.d.y * ray.o.y + ray.d.z * ray.o.z); float C = ray.o.x * ray.o.x + ray.o.y * ray.o.y + ray.o.z * ray.o.z - radius * radius; float[] t; if (!LR.Quadratic(A, B, C, out t)) { return(false); } if (t[0] > ray.maxt || t[1] < ray.mint) { return(false); } float thit = t[0]; if (t[0] < ray.mint) { thit = t[1]; if (thit > ray.maxt) { return(false); } } return(true); }
//debug code private void DebugReset() { transform.SetPositionAndRotation(def_p, def_q); from = def_f_CP; to = def_t_CP; looking = def_l; }
// float GenerateRay() public override float GenerateRay(CameraSample sample, out Ray ray) { Point3 Pras = new Point3(sample.imageX, sample.imageY); Point3 Pcamera = RasterToCamera.Caculate(Pras); ray = new Ray(Pcamera, new Vector(0, 0, 1), 0, LR.INFINITY);//正交相机方向固定 #region modify ray for depth of filed if (lensRadius > 0.0f) { // Sample point on lens float lensU = 0, lensV = 0; LR.ConcentricSampleDisk(sample.lensU, sample.lensV, ref lensU, ref lensV); lensU *= lensRadius; lensV *= lensRadius; // Compute point on plane of focus float ft = focalDistance / ray.d.z; Point3 Pfocus = ray.Transfer(ft); // Update ray for effect of lens ray.o = new Point3(lensU, lensV, 0.0f); ray.d = LR.Normalize(Pfocus - ray.o); } #endregion ray.time = sample.time; ray = CameraToWorld.Caculate(ray); return(1.0f); }
/// <summary> /// This version of the constructor is used when parsing vNote data that is to be stored in an existing /// vNote instance. /// </summary> /// <remarks>The properties in the passed vNote will be cleared</remarks> /// <param name="vNote">The existing vNote instance</param> /// <exception cref="ArgumentNullException">This is thrown if the specified vNote object is null</exception> protected VNoteParser(VNote vNote) : this() { currentNote = vNote ?? throw new ArgumentNullException(nameof(vNote), LR.GetString("ExParseNullObject", "vNote")); currentNote.ClearProperties(); vNotes.Add(vNote); }
public static void Endpoint(Edge e, LR lr, Site s) { e.Vertices[lr] = s; if (e.Vertices[LR.Other(lr)] == null) { return; } Out.Endpoint(e); }
private HalfEdge Initialize(Edge e, LR lr) { this.e = e; this.lr = lr; nextInPriorityQueue = null; v = null; return(this); }
public void ApplyRule(List <LinguisticVariable> LingVars) { foreach (LinguisticRule LR in linguisticRules) { LR.Apply(LingVars); } }
private static void SetRightSpeakerActive() { main.leftSpeaker.color = inactiveSpeaker; main.rightSpeaker.color = activeSpeaker; main.leftIcon.gameObject.SetActive(false); main.rightIcon.gameObject.SetActive(true); activeSpeakerSide = LR.RIGHT; }
public Form1() { InitializeComponent(); speed = 2; side = LR.Right; isStart = false; SizeGameObject = new Size(GameObject.Size.Width, GameObject.Size.Height); }
//リスポーン処理。最後に触れたSavePointの情報を用いて再誕します。 public void Respawn() { transform.position = SavePoint.transform.position; from = SavePoint.p_cp; to = SavePoint.t_cp; looking = SavePoint.look; Look(to); }
private Halfedge Init(Edge edge, LR lr) { this.edge = edge; leftRight = lr; nextInPriorityQueue = null; vertex = null; return(this); }
/// <summary> /// This version of the constructor is used when parsing vCard data that is to be stored in an existing /// vCard instance. /// </summary> /// <remarks>The properties in the passed vCard will be cleared</remarks> /// <param name="vCard">The existing vCard instance</param> /// <exception cref="ArgumentNullException">This is thrown if the specified vCard object is null</exception> protected VCardParser(VCard vCard) : this() { currentCard = vCard ?? throw new ArgumentNullException(nameof(vCard), LR.GetString("ExParseNullObject", "vCard")); currentCard.ClearProperties(); vCards.Add(vCard); }
/// <summary> /// This is used by the recurrence pattern control to update the current frequency when the radio buttons /// selection changes. /// </summary> /// <param name="frequency">The new frequency</param> public void SetFrequency(RecurFrequency frequency) { rf = frequency; // Set the interval label and enable or disable the ByDay instance control based on the frequency switch (rf) { case RecurFrequency.Yearly: // Day instance is disabled if ByMonth and ByMonthDay are use together or if ByWeekNo is used if (lbByMonth.CheckedItems.Count > 0) { udcDayInstance.Enabled = (txtByMonthDay.Text.Length == 0); } else { udcDayInstance.Enabled = (txtByWeekNo.Text.Length == 0); } lblInterval.Text = LR.GetString("APYearly"); break; case RecurFrequency.Monthly: // Day instance is disabled if ByMonthDay is specified udcDayInstance.Enabled = (txtByMonthDay.Text.Length == 0); lblInterval.Text = LR.GetString("APMonthly"); break; case RecurFrequency.Weekly: udcDayInstance.Enabled = false; lblInterval.Text = LR.GetString("APWeekly"); break; case RecurFrequency.Daily: udcDayInstance.Enabled = false; lblInterval.Text = LR.GetString("APDaily"); break; case RecurFrequency.Hourly: udcDayInstance.Enabled = false; lblInterval.Text = LR.GetString("APHourly"); break; case RecurFrequency.Minutely: udcDayInstance.Enabled = false; lblInterval.Text = LR.GetString("APMinutely"); break; case RecurFrequency.Secondly: udcDayInstance.Enabled = false; lblInterval.Text = LR.GetString("APSecondly"); break; } LoadByDayValues(); // By Week # is only used by the Yearly frequency txtByWeekNo.Enabled = (rf == RecurFrequency.Yearly); }
//===================================================================== /// <summary> /// This is used to retrieve the recurrence information into the passed recurrence object /// </summary> /// <param name="recurrence">The recurrence in which to store the settings.</param> /// <exception cref="ArgumentNullException">This is thrown if the passed recurrence object is null</exception> public void GetRecurrence(Recurrence recurrence) { if (recurrence == null) { throw new ArgumentNullException("recurrence", LR.GetString("ExRPRecurrenceIsNull")); } rpRecurrence.GetRecurrence(recurrence); }
public static LR Reverse(this LR self) { switch (self) { case LR.L: return(LR.R); default: return(LR.L); } }
/* Usage: run in Execute: * public override void Execute(BarHistory bars, int idx) * { * Color col = new Color(); * if (idx >= bars.Count-100) * { * if ( bars.Close[idx] > bars.Close[idx - 50]) * col = Color.Green; * else col = Color.Red; * * DrawLinRegChannel(idx, bars.AveragePriceHL, 45, 2, Color.FromArgb(30, col), PlotStyles.Line, 2); * } * } */ public static void DrawLinRegChannel(this UserStrategyBase obj, int bar, TimeSeries series, int period, double width, Color color, PlotStyles style, int line) { double Slope = (period - 1) * LRSlope.Series(series, period)[bar]; double Intercept = LR.Series(series, period)[bar]; width *= StdError.Series(series, period)[bar]; obj.DrawLine(bar - (period - 1), Intercept - Slope - width, bar, Intercept - width, color, 1); obj.DrawLine(bar - (period - 1), Intercept - Slope + width, bar, Intercept + width, color, 1); }
//リスポーン処理。最後に触れたSavePointの情報を用いて再誕します。 public void Respawn() { transform.position = SavePoint.transform.position; from = SavePoint.p_cp; to = SavePoint.t_cp; looking = SavePoint.look; rb.velocity = Vector3.zero; Look(to); }
protected override void OnNavigatedTo(NavigationEventArgs e) { LRAnalyzer = new LR((Grammar)e.Parameter); WaitForLRDerivs.Visibility = Visibility.Visible; ToSheet.Visibility = Visibility.Collapsed; new Task(BuildLRAnalysisSheet).Start(); }
private Site RightRegion(Halfedge he, Site bottomMostSite) { Edge edge = he.edge; if (edge == null) { return(bottomMostSite); } return(edge.Site(LR.Other(he.leftRight))); }
public void ReallyDispose() { edgeListLeftNeighbor = null; edgeListRightNeighbor = null; nextInPriorityQueue = null; edge = null; leftRight = null; vertex = null; pool.Enqueue(this); }
public void SetNose(int id, LR lr, double cx, double cy, double size, bool flip, double?posY = null) { Nose.Id = id; Nose.LR = lr; Nose.CX = cx; Nose.CY = cy; Nose.Size = size; Nose.Flip = flip; Nose.PosY = posY; }
/// <summary> /// Delete a holiday from the list box /// </summary> private void btnRemove_Click(object sender, System.EventArgs e) { if(lbHolidays.SelectedIndex == -1) MessageBox.Show(LR.GetString("EditHMSelectHoliday")); else { holidays.RemoveAt(lbHolidays.SelectedIndex); this.LoadHolidayList(); } }
public static Halfedge create(Edge edge,LR lr) { if(_pool.Count>0){ Halfedge ret=_pool[_pool.Count-1].init(edge,lr); _pool.RemoveAt(_pool.Count-1); return ret; } else{ return new Halfedge (typeof(PrivateConstrutorEnforcer),edge,lr); } }
public void dispose() { if(edgeListLeftNeighbor|| edgeListRightNeighbor){ return; } if(nextInPriorityQueue){ return; } edge=null; leftRight=null; vertex=null; _pool.RemoveAt(_pool.Count-1); }
public static extern IntPtr LoadImage(Microsoft.Win32.SafeHandles.SafeLibraryHandle hInst, [MarshalAs(UnmanagedType.LPTStr)] string lpszName, IMAGE uType, int cxDesired, int cyDesired, LR fuLoad);
public Site site(LR leftRight) { return _site[leftRight]; }
public static Side Other(LR.Side leftRight) { return leftRight == LR.Side.LEFT ? LR.Side.RIGHT : LR.Side.LEFT; }
private Halfedge init(Edge edge,LR lr) { this.edge=edge; leftRight=lr; nextInPriorityQueue=null; vertex=null; return this; }
public void reallyDispose() { edgeListLeftNeighbor = null; edgeListRightNeighbor = null; nextInPriorityQueue = null; edge = null; leftRight = null; vertex = null; _pool.RemoveAt(_pool.Count-1); }
public static LR Other(LR leftRight) { return leftRight == LEFT ? RIGHT : LEFT; }
public static extern IntPtr LoadImage(IntPtr hInst, IntPtr lpszName, IMAGE uType, int cxDesired, int cyDesired, LR fuLoad);
public Vertex vertex(LR leftRight) { return (leftRight==LR.LEFT)?_leftVertex:_rightVertex; }
public static extern IntPtr LoadImage(Microsoft.Win32.SafeHandles.SafeLibraryHandle hInst, IntPtr lpszName, IMAGE uType, int cxDesired, int cyDesired, LR fuLoad);
public void setVertex(LR leftRight,Vertex v) { if(leftRight==LR.LEFT){ _leftVertex=v; }else{ _rightVertex=v; } }
public static extern IntPtr CreateIconFromResourceEx(IntPtr pbIconBits, uint cbIconBits, [MarshalAs(UnmanagedType.Bool)] bool fIcon, uint dwVersion, int cxDesired, int cyDesired, LR uFlags);
public static extern int LookupIconIdFromDirectoryEx(IntPtr presbits, [MarshalAs(UnmanagedType.Bool)] bool fIcon, int cxDesired, int cyDesired, LR Flags);
public static extern IntPtr LoadImage(IntPtr hInst, [MarshalAs(UnmanagedType.LPTStr)] string lpszName, IMAGE uType, int cxDesired, int cyDesired, LR fuLoad);
public static LR Other(LR leftRight) { return leftRight == Left ? Right : Left; }
private void CheckLR(Skeleton s) { float shoulderRawLR = s.Joints[JointType.ShoulderRight].Position.Z - s.Joints[JointType.ShoulderLeft].Position.Z; if (shoulderRawLR >= 0.15) { shoulderLR = LR.right; } else if (shoulderRawLR <= -0.15) { shoulderLR = LR.left; } else { shoulderLR = LR.front; } }