Ejemplo n.º 1
0
        //------------------------------------------------------------------------------
        // create the octree ajacent cells
        public void OctreeSurface(ref SurfaceController SC, ref double PP)
        {
            Trace.WriteLine("_Octree-CreatingSurf-Start");
            // create first surface
            Surface s = null;
            // list of ID's of nodes which have been added to a surface
            List <int> used = new List <int>(_leafs.Count);

            // loop through all leafs
            foreach (OctreeLeaf l in _leafs)
            {
                // if the leaf has point
                if (l.NumPts > 0)
                {
                    // have we used this leaf in a surface
                    if (!used.Contains(l.ID))
                    {
                        s = new Surface(SC.SurfCOUNT);
                        inAdjplane(l, ref s, ref used);
                        used.Add(l.ID);
                        SC.AddSurface(s);
                    }

                    if (used.Count == _leafs.Count)
                    {
                        break;// we have assigned all the leaves
                    }
                }// NumPts
            }// for each

            SC.SurfaceTests(_leafs, ref PP, _Count);
            Trace.WriteLine("_Octree-CreatingSurf-End");
        }
Ejemplo n.º 2
0
 private void Awake()
 {
     rigid            = GetComponent <Rigidbody2D>();
     surface          = GetComponent <SurfaceController>();
     events           = new Events();
     originalVelocity = Vector3.down;
 }
Ejemplo n.º 3
0
        //------------------------------------------------------------------------------
        public Scene()
        {
            _Ot           = new Octree();
            _Sc           = new SurfaceController();
            _ray          = new Ray();
            _c            = new Vectors();
            _Offeset      = new Vectors();
            _OffesetOrtho = new Vectors(0.0, 0.0, 0.0);

            _modelMatrix = new double[16];
            _drawMode    = Scene.eDrawMode.eDM_CENTERS;
            _dataSrc     = "";
        }
        public static IPublishedContent GetCurrentData(this SurfaceController controller)
        {
            if (controller == null)
            {
                throw new ArgumentNullException("controller");
            }

            if (controller.ControllerContext != null && controller.ControllerContext.RouteData.Values.ContainsKey(TemplateExtensions.CurrentDataToken))
            {
                var id            = controller.ControllerContext.RouteData.Values[TemplateExtensions.CurrentDataToken];
                var umbracoHelper = new UmbracoHelper(UmbracoContext.Current);
                return(umbracoHelper.TypedContent(id));
            }

            return(null);
        }
Ejemplo n.º 5
0
 private void Start()
 {
     oscManager        = FindObjectOfType <OscManager>();
     surfaceController = FindObjectOfType <SurfaceController>();
 }