/// <summary> /// Initializes a new instance of the <see cref="LoadingScreenTask"/> class. /// </summary> /// <param name="ToLoadScreen">To load screen.</param> /// <param name="contentManager">The content manager.</param> /// <param name="engine">The engine.</param> /// <param name="LoadingScreen">The loading screen.</param> public LoadingScreenTask(IScreen ToLoadScreen, IContentManager contentManager, EngineStuff engine, IScreen LoadingScreen) { this.ToLoadScreen = ToLoadScreen; this.engine = engine; this.contentManager = contentManager; this.LoadingScreen = LoadingScreen; }
public Player(IScreen screen, Vector3 position, Matrix rotation, SimpleModel model, float width, float height, Boolean useThirdPerson = false) : base(screen, position, rotation, width, height, new Vector3(1F)) { this.height = height * scale.Y; charecter.CharacterController.HorizontalMotionConstraint.Speed = 50; charecter.CharacterController.HorizontalMotionConstraint.MaximumForce = 10000; charecter.CharacterController.JumpSpeed = 35; mod = model; obj = new IObject(Materials.dMaterial, mod, charecter); Mouse.SetPosition(EngineSettings.graphicInfo.BackBufferWidth / 2, EngineSettings.graphicInfo.BackBufferHeight / 2); bstate = Mouse.GetState(); rotSpeed = 0.05F; zoomDistance = 50; camera = new PlayerCamera(obj, (height / 2)); camera.HorizontalOffset = -camera.HorizontalOffset; UpdateCamera(); firstPerson = !useThirdPerson; this.Start(); }
public SpotLightCircularUpdater(IScreen screen, SpotLightPE pl, float speed, float radius, float initialAngle, bool clockwise) : base(screen) { speedAcumullated = initialAngle; this.sl = pl; center = pl.Direction; this.speed = speed * 0.05f; this.radius = radius; this.clockwise = clockwise; this.Start(); ///Start to call the update }
private void init(IScreen IScreen) { this.IScreen = IScreen; _aspectRatio = IScreen.GraphicInfo.Viewport.AspectRatio; _projection = Matrix.CreatePerspectiveFieldOfView(_fieldOdView, _aspectRatio, _nearPlane, _farPlane); this._frustrum = new BoundingFrustum(_view * _projection); { IScreen.BindInput(new SimpleConcreteGestureInputPlayable(Microsoft.Xna.Framework.Input.Touch.GestureType.FreeDrag, (sample) => { this.RotationInY += sample.Delta.Y * 0.001f; this.RotationInX += sample.Delta.X * 0.001f; } )); IScreen.BindInput(new SimpleConcreteGestureInputPlayable(Microsoft.Xna.Framework.Input.Touch.GestureType.Pinch, (sample) => { // if (lastDistance != 0) { // get the current and previous locations of the two fingers Vector2 a = sample.Position; Vector2 aOld = sample.Position - sample.Delta; Vector2 b = sample.Position2; Vector2 bOld = sample.Position2 - sample.Delta2; // figure out the distance between the current and previous locations float d = Vector2.Distance(a, b); float dOld = Vector2.Distance(aOld, bOld); // calculate the difference between the two and use that to alter the scale float scaleChange = (d - dOld) * .5f; this.Radius -= scaleChange; //cam.AspectRatio = GraphicInfo.BackBufferWidth / GraphicInfo.BackBufferHeight; //float dist = (sample.Position - sample.Position2).Length(); //CameraUpdate.Radius += (dist - lastDistance) * 0.5f; //lastDistance = dist; } } )); } }
public Person(IScreen screen, Vector3 position, Matrix rotation, float width, float height, Vector3 scale) : base(screen) { health = 0; mana = 0; strength = 0; stamina = 0; luck = 0; wisdom = 0; intelligence = 0; agility = 0; backpack = new Backpack (); charecter = new FullCharacterObject (position, rotation, height, width, scale, 0, 120); }
/// <summary> /// Initializes a new instance of the <see cref="IScreenUpdateable"/> class. /// </summary> /// <param name="owner">The screen owner.</param> public IScreenUpdateable(IScreen owner) { this.owner = owner; EntityMapper.getInstance().AddEntity(this); Enabled = false; }
public void ChangeDemo(InputPlayableKeyBoard ipk) { if(this.ScreenState == PloobsEngine.SceneControl.ScreenState.Active) this.ScreenState = ScreenState.Hidden; if (active != null) ScreenManager.RemoveScreen(active); active = GetScreen(screenList[index % screenList.GetLength(0)]); ScreenManager.AddScreen(active); index++; }
public RotatingCamera(IScreen IScreen) { init(IScreen); }
/// <summary> /// Initializes a new instance of the <see cref="CameraFirstPerson"/> class. /// </summary> /// <param name="lrRot">The leftright rotation.</param> /// <param name="udRot">The updown rotation.</param> /// <param name="startingPos">The starting pos.</param> /// <param name="viewport">The viewport.</param> public RotatingCamera(IScreen IScreen, Vector3 center) { this.center = center; init(IScreen); IScreen.GraphicInfo.OnGraphicInfoChange += GraphicInfo_OnGraphicInfoChange; }
/// <summary> /// Construtor /// </summary> /// <param name="screen">Screen Associada</param> /// <param name="OnLoopReverse">Se a interpolacao deve ser ciclica (0 -> 1 -> 0 -> 1 .... )</param> public UnitLightInterpolator(IScreen screen,bool OnLoopReverse) : base(screen) { this.onLoopReverse = OnLoopReverse; }
/// <summary> /// CameraRecordPath /// </summary> /// <param name="screen">The screen.</param> /// <param name="cam">The cam.</param> /// <param name="CurveLoopType">Attenuation in the path curves</param> public CameraRecordPath(IScreen screen, ICamera cam, CurveLoopType CurveLoopType) : base(screen) { this.cam = cam; data = new CameraPathData(CurveLoopType); }
public CameraRecordPath(IScreen screen, ICamera cam) : base(screen) { this.cam = cam; }
public PointLightCircularUpdater(IScreen screen) : base(screen) { }
public void ChangeDemo(InputPlayableKeyBoard ipk) { ///lazy ways of cycling between demos ///just remove everything and load the righ screen if (active is LoadingScreen || (active != null && active.IsLoaded == false)) return; //if(this.ScreenState == PloobsEngine.SceneControl.ScreenState.Active) // this.ScreenState = ScreenState.Hidden; foreach (var item in ScreenManager.GetScreens()) { ScreenManager.RemoveScreen(item); } active = GetScreen(screenList[index % screenList.GetLength(0)]); ScreenManager.AddScreen(active,new LoadingScreen()); index++; }