예제 #1
0
파일: TilePicker.cs 프로젝트: yooyke/work
        public override void Unload()
        {
            if (Root.Children.Length > 0)
                Root.RemoveAll();

            node = null;

            base.Unload();
        }
예제 #2
0
파일: Prim.cs 프로젝트: yooyke/work
        private void UpdateBoundingBox(MeshSceneNode node)
        {
            if (node == null)
                return;

            Mesh mesh = node.GetMesh();
            if (mesh == null)
                return;

            Box3D box = new Box3D(0, 0, 0, 0, 0, 0);
            for (int i = 0; i < mesh.MeshBufferCount; i++)
            {
                mesh.GetMeshBuffer(i).RecalculateBoundingBox();
                box.AddInternalBox(mesh.GetMeshBuffer(i).BoundingBox);
            }
            mesh.BoundingBox = box;
        }
예제 #3
0
 private void GeneratePickTile()
 {
     AnimatedMesh animMesh = Reference.SceneManager.GetMesh(Util.ApplicationDataDirectory + @"/media/models/tile.x");
     if (animMesh != null)
     {
         Mesh mesh = animMesh.GetMesh(0);
         pickSceneNode = Reference.SceneManager.AddMeshSceneNode(mesh, ParentNode, -1);
         pickSceneNode.TriangleSelector = Reference.SceneManager.CreateTriangleSelector(mesh, pickSceneNode);
         pickSceneNode.TriangleSelector.Drop();
         pickSceneNode.SetMaterialType(MaterialType.TransparentAlphaChannel);
     }
 }
예제 #4
0
파일: TilePicker.cs 프로젝트: yooyke/work
        private void CreatePicker()
        {
            string path = Path.Combine(dir, "tile.x");

            if (File.Exists(path))
            {
                AnimatedMesh mesh = Render.Scene.GetMesh(path);
                if (mesh != null)
                    node = Render.Scene.AddMeshSceneNode(mesh.GetMesh(0), Root, -1);

                if (node != null)
                {
                    node.TriangleSelector = Render.Scene.CreateTriangleSelector(mesh.GetMesh(0), node);
                    node.SetMaterialType(MaterialType.TransparentAlphaChannel);
                    node.Rotation = Util.ROTATION_OFFSET;
                }
            }
        }