public Camera(Vector3 pos, Matrix proj) { Projection = proj; View = Matrix.CreateLookAt(pos, pos + new Vector3(0, 0, -1), Vector3.Up); this.pos = pos; this.vel = Vector3.Zero; tilt = Vector2.Zero; maxVel = 100f; dampingFactor = 0.85f; accFactor = 25f; zoomSpeed = 10f; tiltAmount = 3f; tiltLocked = false; lastState = new GamePadState(); target = null; }
public void SetTarget(GameObject g) { target = g; }
public int GetGridYOf(GameObject g) { return (int)g.GetBounds().Center.Y; }
public void RegisterGridObject(GameObject g) { Circle c = g.GetBounds(); int xMin = (int)(c.Center.X - c.Radius); int xMax = (int)(c.Center.X + c.Radius); int yMin = (int)(c.Center.Y - c.Radius); int yMax = (int)(c.Center.Y + c.Radius); xMin = (int)Math.Max(xMin, 0f); yMin = (int)Math.Max(yMin, 0f); xMax = (int)Math.Min(xMax, width-1); yMax = (int)Math.Min(yMax, height-1); for (int i = xMin; i <= xMax; i++) { for (int j = yMin; j <= yMax; j++) { objectMap[i, j].Add(g); } } }
public void AddRadioObject(GameObject g) { radioObjects.Add(g); }
public void AddVisibleObject(GameObject g) { visibleObjects.Add(g); }