Exemple #1
0
        /// \cond
        protected override void Synchronize()
        {
            base.Synchronize();

            // Syncronize the mesh data.
            if (data != null)
            {
                if (data.volumeHandle.HasValue)
                {
                    CubiquityDLL.UpdateVolumeMC(data.volumeHandle.Value);

                    if (CubiquityDLL.HasRootOctreeNodeMC(data.volumeHandle.Value) == 1)
                    {
                        uint rootNodeHandle = CubiquityDLL.GetRootOctreeNodeMC(data.volumeHandle.Value);

                        if (rootOctreeNodeGameObject == null)
                        {
                            rootOctreeNodeGameObject = OctreeNode.CreateOctreeNode(rootNodeHandle, gameObject);
                        }

                        OctreeNode rootOctreeNode     = rootOctreeNodeGameObject.GetComponent <OctreeNode>();
                        int        nodeSyncsPerformed = rootOctreeNode.syncNode(maxNodesPerSync, gameObject);

                        // If no node were syncronized then the mesh data is up to
                        // date and we can set the flag to convey this to the user.
                        isMeshSyncronized = (nodeSyncsPerformed == 0);
                    }
                }
            }
        }