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; }
public override void Activate() { hashedObject = P.CurrNode; button1.Visible = P.CurrNode.getSet<gCNavZone_PS_Wrapper>() != null || P.CurrNode.getSet<gCNegZone_PS_Wrapper>() != null; button2.Visible = P.CurrNode is RisenNavStick; button3.Visible = P.CurrNode.getSet<gCNavZone_PS_Wrapper>() != null || P.CurrNode.getSet<gCNegZone_PS_Wrapper>() != null; button4.Visible = P.CurrNode is RisenNavStick; label1.Visible = false; }
public override void Activate() { hashedObject = P.CurrNode; button1.Visible = P.CurrNode.getSet<gCPrefPath_PS_Wrapper>() != null || P.CurrNode.getSet<gCNavPath_PS_Wrapper>() != null; button2.Visible = P.CurrNode is RisenNavStick; button4.Visible = P.CurrNode is RisenNavStick; label1.Visible = false; if (P.CurrNode is RisenNavStick) { numericUpDown1.Visible = true; numericUpDown1.Value = (decimal)(P.CurrNode as RisenNavStick).radius; } }
public void DrawBox(ILrentObject o, RenderInformation RI, bool abs) { Vector3 p = o.BoundingBox_LOCAL.Center(); Matrix m_World = Matrix.Scaling(o.BoundingBox.Size() / 2.0f) * Matrix.Translation(o.BoundingBox.Center()); if(!abs) m_World = Matrix.Scaling(o.BoundingBox_LOCAL.Size() / 2.0f) * (Matrix.Translation(p) * Matrix.RotationQuaternion(o.Rotation)) * Matrix.Translation(o.Position); Matrix m_WorldViewProjection = m_World * RI.ViewMatrix * RI.ProjectionMatrix; LineDrawer.Variables["WorldViewProj"].SetVariable(m_WorldViewProjection); LineDrawer.Variables["Color"].SetVariable(new Color4(abs ? Color.Red : Color.Sienna).ToVector4()); mBuffer.DrawBufferIndexed(LineDrawer.Techniques[0].Passes[0]); }
private void BTN_CLICK_Copy(object sender, EventArgs e) { if (CurrNode == null || !BackBufferControl.Focused || CurrNode is RisenNavStick) return; //Clipboard.SetText(CurrNode.ToString()); lastCopy = CurrNode; }
public GrassNode(List<GraphicNode> gs, API_Device D, ILrentObject a_Obj) : base(gs, true) { this.D = D; ManagedWorld.NodeLibrary.RemoveNode(this); }
void AddObject(ILrentObject e) { TreeNode t = groups[e.File].Nodes.Add(e.Name); t.Tag = e; if(updateNode(e)) objs.Add(t); }
bool updateNode(ILrentObject o) { if (fC.pSFilter != null && o.getAccessor(fC.pSFilter) == null) return false; if (fC.filterNamePart != null && !o.Name.Contains(fC.filterNamePart)) return false; return true; }
void RisenWorld_EntityDeleted(ILrentObject a_Entity) { DeleteObject(a_Entity); }
void DeleteObject(ILrentObject e) { TreeNode t = null; for (int i = 0; i < objs.Count; i++) if (objs[i].Tag == e) { t = objs[i]; objs.RemoveAt(i); } if (lSelection != null && lSelection.Tag == e) lSelection = null; t.Remove(); }
void BackBufferControl_MouseDown(object sender, MouseEventArgs e) { if (Environment.TickCount - lastDown < 100) return; lastDown = Environment.TickCount; if (z_points.Count >= z_maxcounter || e.Button != System.Windows.Forms.MouseButtons.Left) return; z_points.Add(P.GetNewStartPosition(ManagedWorld.NodeLibrary.Camera.Position_ABS)); if (z_points.Count == z_maxcounter) { P.OnBufferClick = null; label1.Visible = false; Vector3 pos = Vector3.Zero; for (int i = 0; i < z_maxcounter; i++) pos += z_points[i]; pos /= (float)z_maxcounter; eCFile F = new eCFile(FileManager.GetFile("resources/emptyZone.bin")); eCDynamicEntity E = new eCDynamicEntity(F); E.GUID.Value = Guid.NewGuid(); E.SetRotation_ST(Quaternion.Identity); E.SetPosition_ST(Vector3.Zero); bTObjArray<SlimDX.Vector3> Points = E[0].Properties["Point"].Object as bTObjArray<SlimDX.Vector3>; Points.Clear(); float mR = 0.0f; for (int i = 0; i < z_maxcounter; i++) { Points.Add( GENOMEMath.toGENOME(z_points[i] - pos)); mR = Math.Max(mR, Points[i].Length()); } E[0].Properties["Radius"].Object = mR; E[0].Properties["RadiusOffset"].Object = new Vector3(0.0f); ILrentObject v_NewObj = new ILrentObject(z_File, E); v_NewObj.Matrix = Matrix.Translation(pos); v_NewObj.LoadModels(P.Device); v_NewObj.File.addObject(v_NewObj); RisenWorld.OnEntityAdded(v_NewObj); Code.Renderer.NavRenderer.DrawAllNav = true; v_NewObj.Position = v_NewObj.Position; v_NewObj.getSet<gIZone>().CalculateCenter(); } }