public override void WriteIntoNativeData(NativeTurtleData nativeData, TurtleNativeDataWriter writer)
 {
     writer.operators.Add(new TurtleOperationWithCharacter
     {
         characterInRootFile = scaleOperator,
         operation           = new TurtleOperation
         {
             operationType  = TurtleOperationType.SCALE_TRANSFORM,
             scaleOperation = new TurtleScaleOperation
             {
                 nonUniformScale    = Vector3.one,
                 defaultScaleFactor = defaultScaleAmount
             }
         }
     });
     writer.operators.Add(new TurtleOperationWithCharacter
     {
         characterInRootFile = thicknessScaleOperator,
         operation           = new TurtleOperation
         {
             operationType      = TurtleOperationType.SCALE_THICCNESS,
             thiccnessOperation = new TurtleThiccnessOperation
             {
                 defaultThicknessScale = defaultThicknessScale
             }
         }
     });
 }
        public override void WriteIntoNativeData(NativeTurtleData nativeData, TurtleNativeDataWriter writer)
        {
            foreach (var meshKey in meshKeys)
            {
                var organIndexes = new JaggedIndexing
                {
                    index = writer.indexInOrganTemplates
                };
                foreach (var templateWriter in meshKey.CachedOrganTemplates)
                {
                    templateWriter.WriteIntoNativeData(nativeData, writer);
                }

                organIndexes.length = (ushort)(writer.indexInOrganTemplates - organIndexes.index);

                writer.operators.Add(new TurtleOperationWithCharacter
                {
                    characterInRootFile = meshKey.Character,
                    operation           = new TurtleOperation
                    {
                        operationType = TurtleOperationType.ADD_ORGAN,
                        meshOperation = new TurtleMeshOperation
                        {
                            extraNonUniformScaleForOrgan = meshKey.ScalePerParameter,
                            scaleIsAdditional            = meshKey.ScaleIsAdditional,
                            isVolumetricScale            = meshKey.VolumetricScale,
                            doScaleMesh           = meshKey.ParameterScale,
                            doApplyThiccness      = meshKey.UseThickness,
                            organTemplateVariants = organIndexes,
                            volumetricValue       = meshKey.volumetricDurabilityValue
                        }
                    }
                });
            }
        }
Exemple #3
0
 public override void WriteIntoNativeData(NativeTurtleData nativeData, TurtleNativeDataWriter writer)
 {
     writer.operators.Add(new TurtleOperationWithCharacter
     {
         characterInRootFile = bendTowardsOperator,
         operation           = new TurtleOperation
         {
             operationType        = TurtleOperationType.BEND_TOWARDS,
             bendTowardsOperation = new TurtleBendTowardsOperation
             {
                 defaultBendDirection = defaultBendDirection.normalized,
                 defaultBendFactor    = defaultBendFactor
             }
         }
     });
 }
Exemple #4
0
 public override void WriteIntoNativeData(NativeTurtleData nativeData, TurtleNativeDataWriter writer)
 {
     foreach (var interactable in volumetricInteractors)
     {
         writer.operators.Add(new TurtleOperationWithCharacter
         {
             characterInRootFile = interactable.indicatorCharacter,
             operation           = new TurtleOperation
             {
                 operationType = TurtleOperationType.VOLUMETRIC_RESOURCE,
                 volumetricDiffusionOperation = new TurtleDiffuseVolumetricResource
                 {
                     diffusionDirection = interactable.diffusionDirection,
                     resourceLayerId    = interactable.resourceLayer.voxelLayerId,
                     diffusionConstant  = interactable.diffusionConstant,
                     diffusionCap       = interactable.diffusionCap
                 }
             }
         });
     }
 }
Exemple #5
0
        public override void WriteIntoNativeData(NativeTurtleData nativeData, TurtleNativeDataWriter writer)
        {
            foreach (var instantiable in instantiatableEntities)
            {
                var entity = TurtleSpawnEntitiesInstantiator.instance.GetEntityPrefab(instantiable.prefab);

                writer.operators.Add(new TurtleOperationWithCharacter
                {
                    characterInRootFile = instantiable.characterToSpawnFrom,
                    operation           = new TurtleOperation
                    {
                        operationType       = TurtleOperationType.INSTANTIATE_ENTITY,
                        instantiateOperator = new TurtleInstantiateEntityOperator
                        {
                            instantiableEntity = entity,
                            prefabTransform    = instantiable.prefab.transform.localToWorldMatrix
                        }
                    }
                });
            }
        }
Exemple #6
0
        public override void WriteIntoNativeData(NativeTurtleData nativeData, TurtleNativeDataWriter writer)
        {
            writer.operators.Add(new TurtleOperationWithCharacter
            {
                characterInRootFile = rollRight,
                operation           = new TurtleOperation
                {
                    operationType     = TurtleOperationType.ROTATE,
                    rotationOperation = new TurtleRotationOperation
                    {
                        unitEulerRotation = Vector3.right,
                        defaultTheta      = defaultRollTheta
                    }
                }
            });
            writer.operators.Add(new TurtleOperationWithCharacter
            {
                characterInRootFile = rollLeft,
                operation           = new TurtleOperation
                {
                    operationType     = TurtleOperationType.ROTATE,
                    rotationOperation = new TurtleRotationOperation
                    {
                        unitEulerRotation = Vector3.left,
                        defaultTheta      = defaultRollTheta
                    }
                }
            });


            writer.operators.Add(new TurtleOperationWithCharacter
            {
                characterInRootFile = turnRight,
                operation           = new TurtleOperation
                {
                    operationType     = TurtleOperationType.ROTATE,
                    rotationOperation = new TurtleRotationOperation
                    {
                        unitEulerRotation = Vector3.down,
                        defaultTheta      = defaultRollTheta
                    }
                }
            });
            writer.operators.Add(new TurtleOperationWithCharacter
            {
                characterInRootFile = turnLeft,
                operation           = new TurtleOperation
                {
                    operationType     = TurtleOperationType.ROTATE,
                    rotationOperation = new TurtleRotationOperation
                    {
                        unitEulerRotation = Vector3.up,
                        defaultTheta      = defaultRollTheta
                    }
                }
            });


            writer.operators.Add(new TurtleOperationWithCharacter
            {
                characterInRootFile = tiltUp,
                operation           = new TurtleOperation
                {
                    operationType     = TurtleOperationType.ROTATE,
                    rotationOperation = new TurtleRotationOperation
                    {
                        unitEulerRotation = Vector3.forward,
                        defaultTheta      = defaultRollTheta
                    }
                }
            });
            writer.operators.Add(new TurtleOperationWithCharacter
            {
                characterInRootFile = tiltDown,
                operation           = new TurtleOperation
                {
                    operationType     = TurtleOperationType.ROTATE,
                    rotationOperation = new TurtleRotationOperation
                    {
                        unitEulerRotation = Vector3.back,
                        defaultTheta      = defaultRollTheta
                    }
                }
            });
        }