示例#1
0
		// Token: 0x060027A2 RID: 10146 RVA: 0x000B8A31 File Offset: 0x000B6C31
		public static void _WriteCubicBezier3_None(NetworkWriter writer, CubicBezier3 value)
		{
			writer.Write(value.a);
			writer.Write(value.b);
			writer.Write(value.c);
			writer.Write(value.d);
		}
示例#2
0
 public LaneMarker(CubicBezier3 bezier1, CubicBezier3 bezier2, NetInfo info)
 {
     Node1 = new NodeWrapper(bezier1.Start.Point, info);
     //HelpersExtensions.AssertEqual(bezier1.End.Point, bezier2.Start.Point);
     MiddleNode = new NodeWrapper(bezier1.End.Point, info);
     Node2      = new NodeWrapper(bezier2.End.Point, info);
     Segment1   = new SegmentWrapper(Node1, MiddleNode, bezier1.Start.Dir, bezier1.End.Dir);
     Segment2   = new SegmentWrapper(MiddleNode, Node2, bezier2.Start.Dir, bezier2.End.Dir);
 }
示例#3
0
        // Token: 0x060017AF RID: 6063 RVA: 0x000706D0 File Offset: 0x0006E8D0
        private Vector3 EvaluatePositionAlongCurve(float positionDownBody)
        {
            float num = 0f;

            foreach (WormBodyPositions2.KeyFrame keyFrame in this.keyFrames)
            {
                float b = num;
                num += keyFrame.length;
                if (num >= positionDownBody)
                {
                    float        t     = Mathf.InverseLerp(num, b, positionDownBody);
                    CubicBezier3 curve = keyFrame.curve;
                    return(curve.Evaluate(t));
                }
            }
            if (this.keyFrames.Count > 0)
            {
                return(this.keyFrames[this.keyFrames.Count - 1].curve.Evaluate(1f));
            }
            return(Vector3.zero);
        }
示例#4
0
        private void AttemptToGenerateKeyFrame(Vector3 position)
        {
            if (!NetworkServer.active)
            {
                Debug.LogWarning("[Server] function 'System.Void RoR2.WormBodyPositions2::AttemptToGenerateKeyFrame(UnityEngine.Vector3)' called on client");
                return;
            }
            WormBodyPositions2.KeyFrame keyFrame = this.newestKeyFrame;
            CubicBezier3 curve  = CubicBezier3.FromVelocities(keyFrame.curve.p1, -keyFrame.curve.v1, position, -this.velocity * (this.keyFrameGenerationInterval * 0.25f));
            float        length = curve.ApproximateLength(50);

            WormBodyPositions2.KeyFrame keyFrame2 = new WormBodyPositions2.KeyFrame
            {
                curve  = curve,
                length = length,
                time   = WormBodyPositions2.GetSynchronizedTimeStamp()
            };
            if (keyFrame2.length >= 0f)
            {
                this.headDistance += keyFrame2.length;
                this.AddKeyFrame(ref keyFrame2);
            }
        }