//public Delegate RenderingCallback; public void PlayerPhysicsUpdatedCallback() { Viewer = new Position(); ViewerCell = new ObjCell(); ViewerSoughtPosition = new Position(); GameFOV = 1.5707963705062866f; }
/// <summary> /// Returns a list of objects that are currently visible from a cell /// </summary> public List <PhysicsObj> GetVisibleObjects(ObjCell cell, VisibleObjectType type = VisibleObjectType.All) { if (PhysicsObj.CurLandblock == null || cell == null) { return(new List <PhysicsObj>()); } // use PVS / VisibleCells for EnvCells not seen outside // (mostly dungeons, also some large indoor areas ie. caves) if (cell is EnvCell envCell && !envCell.SeenOutside) { return(GetVisibleObjects(envCell, type)); } // use current landblock + adjacents for outdoors, // and envcells seen from outside (all buildings) var visibleObjs = new List <PhysicsObj>(PhysicsObj.CurLandblock.ServerObjects); var adjacents = PhysicsObj.CurLandblock.get_adjacents(); if (adjacents != null) { foreach (var adjacent in adjacents) { visibleObjs.AddRange(adjacent.ServerObjects); } } return(ApplyFilter(visibleObjs, type).Where(i => i.ID != PhysicsObj.ID && (!(i.CurCell is EnvCell indoors) || indoors.SeenOutside)).ToList()); }
public void remove_cell(ObjCell cell) { if (Cells.ContainsKey(cell.ID)) { Cells.Remove(cell.ID); NumCells--; } }
public void add_cell(uint cellID, ObjCell cell) { if (!Cells.ContainsKey(cellID)) { Cells.Add(cellID, cell); NumCells++; } }
public void remove_cell(ObjCell cell) { Cells.Remove(cell); NumCells = Cells.Count; }
public void add_cell(int cellID, ObjCell cell) { Cells.Add(cell); NumCells++; }