Ejemplo n.º 1
0
 // Constructor
 public RFRadial(RFRadial src)
 {
     centerAxis      = src.centerAxis;
     radius          = src.radius;
     divergence      = src.divergence;
     restrictToPlane = src.restrictToPlane;
     rings           = src.rings;
     focus           = src.focus;
     focusStr        = src.focusStr;
     randomRings     = src.randomRings;
     rays            = src.rays;
     randomRays      = src.randomRays;
     twist           = src.twist;
 }
Ejemplo n.º 2
0
        // Copy from
        void CopyFrom(RayfireShatter shatter)
        {
            type = shatter.type;

            voronoi   = new RFVoronoi(shatter.voronoi);
            splinters = new RFSplinters(shatter.splinters);
            slabs     = new RFSplinters(shatter.slabs);
            radial    = new RFRadial(shatter.radial);
            custom    = new RFCustom(shatter.custom);
            slice     = new RFSlice(shatter.slice);
            tets      = new RFTets(shatter.tets);

            mode = shatter.mode;
            material.CopyFrom(shatter.material);
            clusters = new RFShatterCluster(shatter.clusters);
            advanced = new RFShatterAdvanced(shatter.advanced);
        }
Ejemplo n.º 3
0
        // Set Radial
        static void SetRadial(RFShatter shatter, RFRadial radial, Transform tm, Vector3 centerPos, Quaternion centerDirection)
        {
            // Set radial properties
            shatter.SetFragmentParameter(RFShatter.FragmentParams.type, (int)RFShatter.FragmentType.voronoi);
            shatter.SetFragmentParameter(RFShatter.FragmentParams.voronoi_type, (int)RFShatter.VoronoiType.radial);
            shatter.SetFragmentParameter(RFShatter.FragmentParams.voronoi_rad_radius, radial.radius);
            shatter.SetFragmentParameter(RFShatter.FragmentParams.voronoi_rad_divergence, radial.divergence);
            shatter.SetFragmentParameter(RFShatter.FragmentParams.voronoi_rad_restrict, radial.restrictToPlane);
            shatter.SetFragmentParameter(RFShatter.FragmentParams.voronoi_rad_rings_count, radial.rings);
            shatter.SetFragmentParameter(RFShatter.FragmentParams.voronoi_rad_rings_focus, radial.focus);
            shatter.SetFragmentParameter(RFShatter.FragmentParams.voronoi_rad_rings_strenght, radial.focusStr);
            shatter.SetFragmentParameter(RFShatter.FragmentParams.voronoi_rad_rings_random, radial.randomRings);
            shatter.SetFragmentParameter(RFShatter.FragmentParams.voronoi_rad_rays_count, radial.rays);
            shatter.SetFragmentParameter(RFShatter.FragmentParams.voronoi_rad_rays_random, radial.randomRays);
            shatter.SetFragmentParameter(RFShatter.FragmentParams.voronoi_rad_rays_twist, radial.twist);

            // Get direction axis
            Vector3 directionAxis = DirectionAxis(radial.centerAxis);
            Vector3 centerRot     = tm.rotation * centerDirection * directionAxis;

            shatter.SetCenterParameter(centerPos, tm, centerRot);
        }