/// <summary> /// Copy Current Instance and Change to Current GraphicsDevice Viewport /// </summary> /// <param name="gd"></param> /// <returns></returns> public object Clone(GraphicsDevice gd) { SLCamera cam = new SLCamera(); cam.SetCamera(Position, Target, Up, projectionType, FoV, NearPlane, FarPlane, gd.Viewport); return(cam); }
/// <summary> /// Init with Custom VideoPara and Configuration /// </summary> /// <param name="distance2display"></param> /// <param name="displayratio"></param> /// <param name="displaysize"></param> /// <param name="camera"></param> /// <param name="unit"></param> /// <param name="gd"></param> /// <param name="service"></param> /// <param name="path"></param> /// <param name="videopara"></param> public SLVideo(float distance2display, float displayratio, float displaysize, SLCamera camera, Unit unit, GraphicsDevice gd, IServiceProvider service, string path, VideoPara videopara) : base(distance2display, displayratio, displaysize, gd, camera, unit) { Para = videopara; LoadContent(service, path, videopara.BasePara.contentname); Init(gd); }
/// <summary> /// Set Configuration Parameters /// </summary> /// <param name="distance2display"></param> /// <param name="displayratio"></param> /// <param name="displaysize"></param> /// <param name="fullscreen_w_pixel"></param> /// <param name="fullscreen_h_pixel"></param> /// <param name="camera"></param> /// <param name="unit"></param> public void SetConfig(float distance2display, float displayratio, float displaysize, int fullscreen_w_pixel, int fullscreen_h_pixel, SLCamera camera, Unit unit) { this.distance2Display = distance2display; this.displayRatio = displayratio; this.displaySize = displaysize; this.display_W_pixel = fullscreen_w_pixel; this.display_H_pixel = fullscreen_h_pixel; this.globalCamera = camera.Clone() as SLCamera; this.unit = unit; }
/// <summary> /// Init with Custom PrimitivePara and Configuration /// </summary> /// <param name="distance2display"></param> /// <param name="displayratio"></param> /// <param name="displaysize"></param> /// <param name="camera"></param> /// <param name="unit"></param> /// <param name="gd"></param> /// <param name="primitivepara"></param> public Primitive(float distance2display, float displayratio, float displaysize, SLCamera camera, Unit unit, GraphicsDevice gd, PrimitivePara primitivepara) : base(distance2display, displayratio, displaysize, gd, camera, unit) { Para = primitivepara; Init(gd); }
/// <summary> /// Initialize Vision Stimulus /// </summary> /// <param name="distance2display"></param> /// <param name="displayratio"></param> /// <param name="displaysize"></param> /// <param name="fullscreen_w_pixel"></param> /// <param name="fullscreen_h_pixel"></param> /// <param name="camera"></param> /// <param name="unit"></param> public VisionStimulus(float distance2display, float displayratio, float displaysize, int fullscreen_w_pixel, int fullscreen_h_pixel, SLCamera camera, Unit unit) { InitVS(distance2display, displayratio, displaysize, fullscreen_w_pixel, fullscreen_h_pixel, camera, unit); }
/// <summary> /// Initialize Vision Stimulus Configuration /// </summary> /// <param name="distance2display"></param> /// <param name="displayratio"></param> /// <param name="displaysize"></param> /// <param name="fullscreen_w_pixel"></param> /// <param name="fullscreen_h_pixel"></param> /// <param name="camera"></param> /// <param name="unit"></param> public void InitVS(float distance2display, float displayratio, float displaysize, int fullscreen_w_pixel, int fullscreen_h_pixel, SLCamera camera, Unit unit) { if ((this.distance2Display != distance2display) || (this.displayRatio != displayratio) || (this.displaySize != displaysize) || (this.display_W_pixel != fullscreen_w_pixel) || (this.display_H_pixel != fullscreen_h_pixel) || (!this.globalCamera.Equals(camera)) || (this.unit != unit)) { SetConfig(distance2display, displayratio, displaysize, fullscreen_w_pixel, fullscreen_h_pixel, camera, unit); Config(); } }
/// <summary> /// Initialize Vision Stimulus According to Current GraphicsDevice Fullscreen Resolution, /// and Set Internal GraphicsDevice Reference /// </summary> /// <param name="distance2display"></param> /// <param name="displayratio"></param> /// <param name="displaysize"></param> /// <param name="gd"></param> /// <param name="camera"></param> /// <param name="unit"></param> public VisionStimulus(float distance2display, float displayratio, float displaysize, GraphicsDevice gd, SLCamera camera, Unit unit) : this(distance2display, displayratio, displaysize, gd.DisplayMode.Width, gd.DisplayMode.Height, camera, unit) { gdRef = gd; }
/// <summary> /// Init Bar with Custom BarPara and Configuration /// </summary> /// <param name="distance2display"></param> /// <param name="displayratio"></param> /// <param name="displaysize"></param> /// <param name="camera"></param> /// <param name="unit"></param> /// <param name="gd"></param> /// <param name="barpara"></param> public Bar(float distance2display, float displayratio, float displaysize, SLCamera camera, Unit unit, GraphicsDevice gd, BarPara barpara) : base(distance2display, displayratio, displaysize, gd, camera, unit) { Para = barpara; Init(gd); }
/// <summary> /// Init SLQuad with Custom Quad Parameters and Configuration /// </summary> /// <param name="distance2display"></param> /// <param name="displayratio"></param> /// <param name="displaysize"></param> /// <param name="camera"></param> /// <param name="unit"></param> /// <param name="gd"></param> /// <param name="service"></param> /// <param name="path"></param> /// <param name="quad"></param> public SLQuad(float distance2display, float displayratio, float displaysize, SLCamera camera, Unit unit, GraphicsDevice gd, IServiceProvider service, string path, Quad quad) : base(distance2display, displayratio, displaysize, gd, camera, unit) { Para = quad; LoadContent(service, path, quad.BasePara.contentname); Init(gd); }
/// <summary> /// Copy Current Instance and Change to Current GraphicsDevice Viewport /// </summary> /// <param name="gd"></param> /// <returns></returns> public object Clone(GraphicsDevice gd) { SLCamera cam = new SLCamera(); cam.SetCamera(Position, Target, Up, projectionType, FoV, NearPlane, FarPlane, gd.Viewport); return cam; }
/// <summary> /// Init with Custom ModelPara and Configuration /// </summary> /// <param name="distance2display"></param> /// <param name="displayratio"></param> /// <param name="displaysize"></param> /// <param name="camera"></param> /// <param name="unit"></param> /// <param name="gd"></param> /// <param name="service"></param> /// <param name="path"></param> /// <param name="modelpara"></param> public SLModel(float distance2display, float displayratio, float displaysize, SLCamera camera, Unit unit, GraphicsDevice gd, IServiceProvider service, string path, ModelPara modelpara) : base(distance2display, displayratio, displaysize, gd, camera, unit) { Para = modelpara; LoadContent(service, path, modelpara.modelname); Init(gd); }