public static ILrentObject addXMSH(string xmsh, string xcol, API_Device D, Vector3 pos, Quaternion rot, LrentFile z_File, bool a_Notify = true) { eCFile F = new eCFile(FileManager.GetFile("resources/emptyLevelEntity.bin")); eCDynamicEntity E = new eCDynamicEntity(F); E.GUID.Value = Guid.NewGuid(); EFile e0 = FileManager.GetFile(xmsh); //string x = FileManager.mapFilename(xmsh), x2 = FileManager.mapFilename(xcol); string x = "#G3:/" + xmsh, x2 = "#G3:/" + xcol; E.Name.pString = e0.Name.Replace(e0.Extension, "");//xmsh.Replace("._xmsh", "") //@"#G3:/data/raw/meshes/World//" + (E["eCMesh_PS"].Properties["MeshFileName"].Object as bCString).pString = x; E.Query<eCCollisionShape_PS>()[0].SetXColMesh(x2);//DonCamp_01_L01_COL._xcom E.Query<eCCollisionShape_PS>()[1].SetXColMesh(x2); ILrentObject O = new ILrentObject(z_File, E); O.LoadModels(D); E.ApplyBoundingVolume(GENOMEMath.toGENOME(O.Nodes[0].BoundingBox)); O.File.UpdateContextBox(); O.File.addObject(O); O.Position = pos; O.Rotation = rot; if(a_Notify) RisenWorld.OnEntityAdded(O); return O; }
private void button1_Click(object sender, EventArgs e) { LrentFile L = LrentFile.CreateNew(textBox1.Text + ".lrent", P.Device); SecFile S = SecFile.CreateNew(textBox1.Text + ".sec"); WrlFile W = WrlFile.CreateNew("World.wrl"); LrentFile _main = new LrentFile(FileManager.GetFile("SysDyn_{C3960F11-2A7F-42BA-B9F6-5D8BFA392E82}.lrent"), P.Device); W.AddSec("SysDyn_{C3960F11-2A7F-42BA-B9F6-5D8BFA392E82}.sec"); W.AddSec("_Intern"); _main.SaveFile(); W.AddSec(S); S.AddLrent(L); L.SaveFile(); S.SaveFile(); W.SaveFile(); this.P.loadSecs(FileManager.GetFiles(W.SecFiles.ToArray())); this.DialogResult = System.Windows.Forms.DialogResult.Yes; this.Close(); }
private void toolStripTextBox1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter && lastFile != null) { if (lastFile.Contains(".sec")) { SecFile S = new SecFile(FileManager.GetFile(lastFile)); string s = toolStripTextBox1.Text; if (!s.EndsWith(".lrent")) s = s + ".lrent"; LrentFile L = null; if (FileManager.GetFile(s).IsOpenable) L = new LrentFile(FileManager.GetFile(s), P.Device); else L = LrentFile.CreateNew(s, P.Device); S.AddLrent(L); S.SaveFile(); contextMenuStrip3.Close(); } else if (lastFile.Contains(".wrl")) { WrlFile W = new WrlFile(FileManager.GetFile(lastFile)); string s = toolStripTextBox1.Text; if (!s.EndsWith(".sec")) s = s + ".sec"; SecFile S = null; if (FileManager.GetFile(s).IsOpenable) S = new SecFile(FileManager.GetFile(s)); else S = SecFile.CreateNew(s); W.AddSec(S); W.SaveFile(); contextMenuStrip3.Close(); } } }
internal LrentFile GetCopyFile(LrentFile Original) { LrentFile f = (sceneControl1.getFile() != null) ? sceneControl1.getFile() : null; if (f != null) return f; else return Original; }
private void unmarkToolStripMenuItem_Click(object sender, EventArgs e) { editableFile = null; }
private void markAsEditableToolStripMenuItem_Click(object sender, EventArgs e) { editableFile = treeView1.SelectedNode.Tag as LrentFile; }
private void button3_Click(object sender, EventArgs e) { z_File = P.CurrFile; if (z_File == null) return; P.OnBufferClick = handleMouseDown2; label1.Text = "Please specify a location for the new entity."; label1.Visible = true; }
private void button2_Click(object sender, EventArgs e) { z_maxcounter = Math.Max(z_maxcounter, 2); z_File = P.CurrFile; if (z_File == null) return; P.OnBufferClick = handleMouseDown1; z_points.Clear(); label1.Text = "Please click twice to specify the location of the new path."; label1.Visible = true; }