예제 #1
0
        public void Init(SplineCache splineCache, float3[][][] crossSections, float meshCellLength, float3 positionOffset = default, LerpValue[] lerpValues = null)
        {
            this.splineCache = splineCache;
            meshVertexOffset = positionOffset;

            int rowNum = Mathf.CeilToInt(splineCache.Distance / meshCellLength);

            generationHandler.InitSubmeshEdges(meshCellLength, rowNum, splineCache.Distance);

            for (int submesh = 0; submesh < crossSections.Length; ++submesh)
            {
                foreach (float3[] cross in crossSections[submesh])
                {
                    generationHandler.AddSubmeshEdge(submesh, cross);
                }
            }

            float maxWidth = 0;

            foreach (var submeshCross in crossSections)
            {
                foreach (var cross in submeshCross)
                {
                    maxWidth = math.max(maxWidth, CalculateCrossSectionWidth(cross));
                }
            }

            SplineModifier.Init(this.splineCache, meshCellLength, lerpValues);

            Inited();
        }
예제 #2
0
        public void Init(SplineCache splineCache, float transformStepDistance, LerpValue[] lerpValues = null)
        {
            SplineCache           = splineCache;
            TransformStepDistance = transformStepDistance;
            LerpValues            = lerpValues;

            Inited();
        }
예제 #3
0
            public static JobHandle Schedule(SplineCache spline, NativeArray <PointTransform> transforms, float transfromStepDistance, int innerBatchCount, JobHandle dependOn)
            {
                var generateTransforms = new GenerateTransforms
                {
                    cacheStepDistance     = spline.CacheStepDistance,
                    transfromStepDistance = transfromStepDistance,
                    splineCachePositions  = spline.Positions,
                    transforms            = transforms
                };

                return(generateTransforms.Schedule(transforms.Length, innerBatchCount, dependOn));
            }
예제 #4
0
        public void Init(SplineCache splineCache, int cellColCount, float meshCellWidth, float meshCellLength, float3 positionOffset = default, LerpValue[] lerpValues = null)
        {
            this.splineCache = splineCache;
            meshVertexOffset = positionOffset;

            int rowNum = Mathf.CeilToInt(splineCache.Distance / meshCellLength);

            generationHandler.InitSimpleGrid(meshCellWidth, meshCellLength, cellColCount, rowNum, splineCache.Distance);

            SplineModifier.Init(this.splineCache, meshCellLength, lerpValues);

            Inited();
        }
예제 #5
0
        public void InitForMultipleSubmeshes(SplineCache splineCache, float meshCellLength, float3 positionOffset = default, LerpValue[] lerpValues = null)
        {
            this.splineCache = splineCache;
            meshVertexOffset = positionOffset;

            int rowNum = Mathf.CeilToInt(splineCache.Distance / meshCellLength) + 1;

            generationHandler.InitSubmeshEdges(meshCellLength, rowNum, splineCache.Distance);

            SplineModifier.Init(this.splineCache, meshCellLength, lerpValues);

            Inited();
        }