Inheritance: INotifyPropertyChanged
Example #1
0
 public CategoryDOMNode(string cat_name, WWorld world) : base(world)
 {
     CategoryName = cat_name;
     IsVisible    = true;
     IsRendered   = true;
     IsExpanded   = true;
 }
Example #2
0
        public WTransformGizmo(WWorld parentWorld)
        {
            m_world = parentWorld;

            SetMode(FTransformMode.Translation);
            SetTransformSpace(FTransformSpace.World);

            string[][] meshNames = new string[][]
            {
                new string[] { "TranslateCenter", "TranslateX", "TranslateY", "TranslateZ", "TranslateLinesXY", "TranslateLinesXZ", "TranslateLinesYZ" },
                new string[] { "RotateX", "RotateY", "RotateZ" },
                new string[] { "ScaleCenter", "ScaleX", "ScaleY", "ScaleZ", "ScaleLinesXY", "ScaleLinesXZ", "ScaleLinesYZ" }
            };

            m_gizmoMeshes = new SimpleObjRenderer[meshNames.Length][];
            for (int i = 0; i < m_gizmoMeshes.Length; i++)
            {
                m_gizmoMeshes[i] = new SimpleObjRenderer[meshNames[i].Length];

                for (int j = 0; j < m_gizmoMeshes[i].Length; j++)
                {
                    Obj obj = new Obj();
                    obj.Load("resources/editor/" + meshNames[i][j] + ".obj");
                    m_gizmoMeshes[i][j] = new SimpleObjRenderer(obj, new OpenTK.Vector4(1, 1, 1, 0.50f));
                    m_gizmoMeshes[i][j].FaceCullingEnabled = false;
                    m_gizmoMeshes[i][j].BlendingEnabled    = true;
                }
            }
        }
Example #3
0
        public SceneDataLoader(string fileName, WWorld world)
        {
            m_world = world;

            if (m_sActorDescriptors == null)
            {
                // Load the Actor Descriptors from disk.
                m_sActorDescriptors = new List <MapActorDescriptor>();
                foreach (var file in Directory.GetFiles("resources/templates/"))
                {
                    MapActorDescriptor descriptor = JsonConvert.DeserializeObject <MapActorDescriptor>(File.ReadAllText(file));
                    m_sActorDescriptors.Add(descriptor);
                }
            }

            m_reader    = new EndianBinaryReader(File.ReadAllBytes(fileName), System.Text.Encoding.ASCII, Endian.Big);
            m_chunkList = new List <ChunkHeader>();
            int chunkCount = m_reader.ReadInt32();

            for (int i = 0; i < chunkCount; i++)
            {
                string      fourCC = m_reader.ReadString(4);
                MapLayer    layer  = ChunkHeader.FourCCToLayer(ref fourCC);
                ChunkHeader chunk  = new ChunkHeader(fourCC, m_reader.ReadInt32(), m_reader.ReadInt32());
                chunk.Layer = layer;

                m_chunkList.Add(chunk);
            }

            var sortedList = m_chunkList.OrderBy(x => x.ChunkOffset);

            m_chunkList = new List <ChunkHeader>(sortedList);
        }
Example #4
0
        public WDOMNode(WWorld world)
        {
            m_world = world;

            m_children = new List <WDOMNode>();
            Transform  = new WTransform();
        }
Example #5
0
 public WActorEditor(WWorld world)
 {
     m_world          = world;
     m_selectionList  = new BindingList <WActorNode>();
     m_transformGizmo = new WTransformGizmo(m_world);
     SelectedObjects  = new WEditorSelectionAggregate(m_selectionList);
 }
Example #6
0
        public J3DNode(J3D model, WWorld world, string filename = "") : base(world)
        {
            m_model  = model;
            Name     = model.Name;
            Filename = filename;

            IsRendered = true;
        }
Example #7
0
        public WMap(WWorld parentWorld)
        {
            m_world     = parentWorld;
            m_sceneList = new BindingList <WScene>();

            // Set us to mid-day lighting by default.
            TimeOfDay = 0.5f;
        }
Example #8
0
        public WActorEditor(WWorld world)
        {
            m_world          = world;
            m_transformGizmo = new WTransformGizmo(m_world);

            EditorSelection = new Selection(m_world, this);
            EditorSelection.OnSelectionChanged += OnSelectionChanged;
        }
Example #9
0
 public WMap(WWorld parentWorld)
 {
     m_world     = parentWorld;
     m_sceneList = new ObservableCollection <WScene>();
     CollectionViewSource.GetDefaultView(m_sceneList).SortDescriptions.Add(new SortDescription("RoomIndex", ListSortDirection.Ascending));
     // Set us to mid-day lighting by default.
     TimeOfDay = 0.5f;
 }
Example #10
0
        public WActorEditor(WWorld world)
        {
            m_world          = world;
            m_transformGizmo = new WTransformGizmo(m_world);

            EditorSelection = new Selection(m_world, this);
            EditorSelection.OnSelectionChanged += OnSelectionChanged;

            DetailsViewModel = new WDetailsViewViewModel();
        }
Example #11
0
        public RoomTableEntryNode(FourCC fourCC, WWorld world) : base(fourCC, world)
        {
            LoadedRoomEntries = new AdvancedBindingList <RoomTableRoomSettings>();

            var room_entry = new RoomTableRoomSettings();

            room_entry.ActivateRoomWhenLoaded = true;
            room_entry.Unk2 = true;
            LoadedRoomEntries.Add(room_entry);
        }
Example #12
0
        public WDOMNode(WWorld world)
        {
            m_world = world;

            m_children        = new ObservableCollection <WDOMNode>();
            Transform         = new WTransform();
            VisibleProperties = new List <PropertyDefinition>();

            IsVisible = true;
        }
Example #13
0
        public RoomTableEntryNode(FourCC fourCC, WWorld world, EndianBinaryReader reader) : base(fourCC, world)
        {
            m_LoadedRoomIndices = new List <byte>();

            LoadedRoomCount = reader.ReadByte();
            ReverbAmount    = reader.ReadByte();
            TimePasses      = Convert.ToBoolean(reader.ReadByte());
            Unknown1        = reader.ReadByte();

            int table_offset = reader.ReadInt32();

            reader.BaseStream.Seek(table_offset, System.IO.SeekOrigin.Begin);

            for (int i = 0; i < LoadedRoomCount; i++)
            {
                m_LoadedRoomIndices.Add(reader.ReadByte());
            }
        }
Example #14
0
        public RoomTableEntryNode(FourCC fourCC, WWorld world, EndianBinaryReader reader) : base(fourCC, world)
        {
            LoadedRoomEntries = new AdvancedBindingList <RoomTableRoomSettings>();

            byte RoomCount = reader.ReadByte();

            ReverbAmount = reader.ReadByte();
            TimePasses   = Convert.ToBoolean(reader.ReadByte());

            reader.SkipByte(); // Padding byte

            int table_offset = reader.ReadInt32();

            reader.BaseStream.Seek(table_offset, System.IO.SeekOrigin.Begin);

            for (int i = 0; i < RoomCount; i++)
            {
                LoadedRoomEntries.AddNew(new object[] { reader });
            }
        }
        public SceneDataLoader(string fileName, WWorld world)
        {
            m_world     = world;
            m_reader    = new EndianBinaryReader(File.ReadAllBytes(fileName), System.Text.Encoding.ASCII, Endian.Big);
            m_chunkList = new List <ChunkHeader>();
            int chunkCount = m_reader.ReadInt32();

            for (int i = 0; i < chunkCount; i++)
            {
                string   fourCC = m_reader.ReadString(4);
                MapLayer layer  = ChunkHeader.FourCCToLayer(ref fourCC);

                FourCC      enumFourCC = FourCCConversion.GetEnumFromString(fourCC);
                ChunkHeader chunk      = new ChunkHeader(enumFourCC, m_reader.ReadInt32(), m_reader.ReadInt32());
                chunk.Layer = layer;

                m_chunkList.Add(chunk);
            }

            var sortedList = m_chunkList.OrderBy(x => x.ChunkOffset);

            m_chunkList = new List <ChunkHeader>(sortedList);
        }
Example #16
0
 public WRoom(WWorld world, int roomIndex) : base(world)
 {
     RoomIndex  = roomIndex;
     IsRendered = true;
 }
Example #17
0
        public WScene(WWorld world) : base(world)
        {
            m_fourCCGroups = new Dictionary <FourCC, WDOMNode>();

            // We're going to iterate through the enum values to create DOM nodes for them.
            // We're skipping all of the actors, scaleable objects, and treasure chests though, because they're special.
            foreach (FourCC f in Enum.GetValues(typeof(FourCC)))
            {
                // Skip Actors/Scaleable Objects/Treasure Chests
                if (f.ToString().Contains("ACT") || f.ToString().Contains("SCO") || f.ToString().Contains("TRE") || f == FourCC.NONE)
                {
                    continue;
                }

                if (!m_fourCCLocations.ContainsKey(f) || this is WStage && m_fourCCLocations[f] == SourceScene.Stage || this is WRoom && m_fourCCLocations[f] == SourceScene.Room)
                {
                    m_fourCCGroups[f] = new WDOMGroupNode(f, m_world);
                }
            }

            // To handle the fact that actors/scaleable/treasure chests have layers, we're going to create DOM nodes using
            // the default layer's FourCC (ACTR/SCOB/TRES). This DOM node won't interact directly with the entities, rather
            // it will be the parent node of the nodes that do. WDOMGroupNode.ToString() is overridden to return a more general
            // description of them ("ACTR (Actors)", etc) instead of the FourCC's FourCCConversion.GetDescriptionFromEnum() value.
            m_fourCCGroups[FourCC.ACTR] = new WDOMGroupNode(FourCC.ACTR, m_world);
            m_fourCCGroups[FourCC.SCOB] = new WDOMGroupNode(FourCC.SCOB, m_world);
            m_fourCCGroups[FourCC.TRES] = new WDOMGroupNode(FourCC.TRES, m_world);

            // Now we add the default layer for each object type. WDOMLayeredGroupNode directly interacts with the entities.
            WDOMLayeredGroupNode actrDefLayer = new WDOMLayeredGroupNode(FourCC.ACTR, MapLayer.Default, m_world);

            actrDefLayer.SetParent(m_fourCCGroups[FourCC.ACTR]);

            WDOMLayeredGroupNode scobDefLayer = new WDOMLayeredGroupNode(FourCC.SCOB, MapLayer.Default, m_world);

            scobDefLayer.SetParent(m_fourCCGroups[FourCC.SCOB]);

            WDOMLayeredGroupNode tresDefLayer = new WDOMLayeredGroupNode(FourCC.TRES, MapLayer.Default, m_world);

            tresDefLayer.SetParent(m_fourCCGroups[FourCC.TRES]);

            // Now we add layers 0 to 11 for each object type.
            // Note that we do (i + 1) for the MapLayer cast in order to skip the Default enum value.
            for (int i = 0; i < 12; i++)
            {
                WDOMLayeredGroupNode actrLayer = new WDOMLayeredGroupNode(FourCCConversion.GetEnumFromString($"ACT{ i.ToString("x") }"), (MapLayer)i + 1, m_world);
                actrLayer.SetParent(m_fourCCGroups[FourCC.ACTR]);

                WDOMLayeredGroupNode scobLayer = new WDOMLayeredGroupNode(FourCCConversion.GetEnumFromString($"SCO{ i.ToString("x") }"), (MapLayer)i + 1, m_world);
                scobLayer.SetParent(m_fourCCGroups[FourCC.SCOB]);

                WDOMLayeredGroupNode tresLayer = new WDOMLayeredGroupNode(FourCCConversion.GetEnumFromString($"TRE{ i.ToString("x") }"), (MapLayer)i + 1, m_world);
                tresLayer.SetParent(m_fourCCGroups[FourCC.TRES]);
            }

            /*m_fourCCGroups["ACTR (Actors)"] = new WDOMGroupNode("ACTR (Actors)", m_world);
             * WDOMGroupNode actrDefault = new WDOMGroupNode("ACTR", m_world);
             * actrDefault.SetParent(m_fourCCGroups["ACTR (Actors)"]);
             *
             * m_fourCCGroups["SCOB (Scaleable Objects)"] = new WDOMGroupNode("SCOB (Scaleable Objects)", m_world);
             * WDOMGroupNode scobDefault = new WDOMGroupNode("SCOB", m_world);
             * scobDefault.SetParent(m_fourCCGroups["SCOB (Scaleable Objects)"]);
             *
             * m_fourCCGroups["TRES (Treasure Chests)"] = new WDOMGroupNode("TRES (Treasure Chests)", m_world);
             * WDOMGroupNode tresDefault = new WDOMGroupNode("TRES", m_world);
             * tresDefault.SetParent(m_fourCCGroups["TRES (Treasure Chests)"]);
             *
             * for (int i = 0; i < 12; i++)
             * {
             *  WDOMGroupNode actX = new WDOMGroupNode($"ACT{ i.ToString("x") }", m_world);
             *  actX.SetParent(m_fourCCGroups["ACTR (Actors)"]);
             *
             *  WDOMGroupNode scoX = new WDOMGroupNode($"SCO{ i.ToString("x") }", m_world);
             *  scoX.SetParent(m_fourCCGroups["SCOB (Scaleable Objects)"]);
             *
             *  WDOMGroupNode treX = new WDOMGroupNode($"TRE{ i.ToString("x") }", m_world);
             *  treX.SetParent(m_fourCCGroups["TRES (Treasure Chests)"]);
             * }*/
        }
Example #18
0
 public WStage(WWorld world) : base(world)
 {
     IsRendered = true;
 }
Example #19
0
 // Constructor
 public Foliage(FourCC fourCC, WWorld world) : base(fourCC, world)
 {
 }
Example #20
0
 public J3DNode(J3D model, WWorld world) : base(world)
 {
     m_model = model;
 }
Example #21
0
 // Constructor
 public TriggerRegion(FourCC fourCC, WWorld world) : base(fourCC, world)
 {
     m_RegionAreaModel = WResourceManager.LoadObjResource("resources/editor/EditorCube.obj", new OpenTK.Vector4(1, 1, 1, 1), true, false);
     DisableRotationAndScaleForRaycasting = true;
 }
Example #22
0
 public WSkyboxNode(WWorld world) : base(world)
 {
     IsVisible = false;
     m_colors  = new EnvironmentLightingSkyboxPalette();
 }
Example #23
0
 public WStage(WWorld world) : base(world)
 {
 }
Example #24
0
 public WRoom(WWorld world, int roomIndex) : base(world)
 {
     RoomIndex    = roomIndex;
     m_roomModels = new List <J3D>();
     IsRendered   = true;
 }
Example #25
0
 public WSkyboxNode(WWorld world) : base(world)
 {
     IsVisible = false;
     m_colors  = new LightingSkyboxColors();
 }
Example #26
0
 public J3DNode(J3D model, WWorld world) : base(world)
 {
     m_model    = model;
     Name       = model.Name;
     IsRendered = true;
 }
Example #27
0
 public WScene(WWorld world) : base(world)
 {
 }
Example #28
0
        private J3DNode m_vrBackCloud; // Cloud Layer

        public WSkyboxNode(WWorld world) : base(world)
        {
            IsVisible = false;
        }
Example #29
0
 public WActorNode(string fourCC, WWorld world) : base(world)
 {
     Properties     = new List <IPropertyValue>();
     FourCC         = fourCC;
     ColorOverrides = new TevColorOverride();
 }
Example #30
0
        private J3DNode m_vrBackCloud; // Cloud Layer

        public WSkyboxNode(WWorld world) : base(world)
        {
        }