/// <summary> /// Determines whether the specified <paramref name="unitOfWork"/> can be disposed. /// </summary> /// <param name="unitOfWork">The unit of work.</param> /// <returns> /// <c>true</c> if no <see cref="AmbientExists"/>; otherwise: /// <c>true</c> if the <see cref="AmbientUnitOfWorkDecorator.IsDisposable"/> and <paramref name="unitOfWork.Parent"/> is null; otherwise <c>false</c> /// </returns> /// <remarks></remarks> public virtual Boolean CanDisposeUnitOfWork(UnitOfWorkBase unitOfWork) { if (AmbientExists) { // Save the current disposable state of the ambient unit of work locally since further execution may affect it. var ambientIsDisposable = Ambient.IsDisposable; if (Ambient.Equals(unitOfWork)) { if (ambientIsDisposable) { AmbientUnitsOfWork.Pop(); } else { Ambient.Decrement(); } } if ((unitOfWork.Status == TransactionStatus.Committed || unitOfWork.Status == TransactionStatus.Aborted) || (ambientIsDisposable && unitOfWork.Parent == null)) { return(true); } return(false); } return(true); }
public MongodbAmbient(Ambient a) { Id = a.Id; Timestamp = a.Timestamp; Lumix = a.Lumix; Temperature = a.Temperature; }
public void Save(SaveContext saveContext) { var utility = saveContext.Utility; CGFXDebug.SaveStart(this, saveContext); EmissionF.Save(utility); AmbientF.Save(utility); DiffuseF.Save(utility); Specular0F.Save(utility); Specular1F.Save(utility); Constant0F.Save(utility); Constant1F.Save(utility); Constant2F.Save(utility); Constant3F.Save(utility); Constant4F.Save(utility); Constant5F.Save(utility); Emission.Save(utility); Ambient.Save(utility); Diffuse.Save(utility); Specular0.Save(utility); Specular1.Save(utility); Constant0.Save(utility); Constant1.Save(utility); Constant2.Save(utility); Constant3.Save(utility); Constant4.Save(utility); Constant5.Save(utility); utility.Write(CommandCache); }
/// <inheritdoc /> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; if (Ambient != null) { hashCode = hashCode * 59 + Ambient.GetHashCode(); } if (Diffuse != null) { hashCode = hashCode * 59 + Diffuse.GetHashCode(); } if (Specular != null) { hashCode = hashCode * 59 + Specular.GetHashCode(); } if (Roughness != null) { hashCode = hashCode * 59 + Roughness.GetHashCode(); } if (Fresnel != null) { hashCode = hashCode * 59 + Fresnel.GetHashCode(); } return(hashCode); } }
public void PlayMusicAmbient(bool submerge) { if (submerge) { if (JustSubmerge) { JustSubmerge = false; Ambient.stop(); Dispose(Ambient); Ambient.FileName = UnderWaterFileName; Ambient.play(true); Submerge.play(); } } else { if (!JustSubmerge) { JustSubmerge = true; Ambient.stop(); Dispose(Ambient); Ambient.FileName = AmbientFileName; Ambient.play(true); ToSurface.play(); } } }
protected override void WriteDataXML(XElement ele, ElderScrollsPlugin master) { XElement subEle; ele.TryPathTo("Sky/Upper", true, out subEle); SkyUpper.WriteXML(subEle, master); ele.TryPathTo("Fog", true, out subEle); Fog.WriteXML(subEle, master); ele.TryPathTo("Unused1", true, out subEle); Unused1.WriteXML(subEle, master); ele.TryPathTo("Ambient", true, out subEle); Ambient.WriteXML(subEle, master); ele.TryPathTo("Sunlight", true, out subEle); Sunlight.WriteXML(subEle, master); ele.TryPathTo("Sun", true, out subEle); Sun.WriteXML(subEle, master); ele.TryPathTo("Stars", true, out subEle); Stars.WriteXML(subEle, master); ele.TryPathTo("Sky/Lower", true, out subEle); SkyLower.WriteXML(subEle, master); ele.TryPathTo("Horizon", true, out subEle); Horizon.WriteXML(subEle, master); ele.TryPathTo("Unused2", true, out subEle); Unused2.WriteXML(subEle, master); }
/// <summary> /// Determines whether the specified <see cref="MaterialPalette"/> is equal to the current <see cref="UFLT.Records.MaterialPalette"/>. /// </summary> /// <param name='other'> /// The <see cref="MaterialPalette"/> to compare with the current <see cref="UFLT.Records.MaterialPalette"/>. /// </param> /// <returns> /// <c>true</c> if the specified <see cref="MaterialPalette"/> is equal to the current /// <see cref="UFLT.Records.MaterialPalette"/>; otherwise, <c>false</c>. /// </returns> public bool Equals(MaterialPalette other) { // Check color fields if (!Ambient.Equals(other.Ambient)) { return(false); } if (!Diffuse.Equals(other.Diffuse)) { return(false); } if (!Specular.Equals(other.Specular)) { return(false); } if (!Emissive.Equals(other.Emissive)) { return(false); } if (Mathf.Approximately(Shininess, other.Shininess)) { return(false); } if (Mathf.Approximately(Alpha, other.Alpha)) { return(false); } return(true); }
public async Task <IActionResult> PutAmbient([FromRoute] long id, [FromBody] Ambient ambient) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != ambient.Id) { return(BadRequest()); } _context.Entry(ambient).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AmbientExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public void build() { DestroyRenderAreaTexture(); texture = new Texture2D(200, 200); GameObject.Find("ViewRectangle").GetComponent <MeshRenderer> ().material.mainTexture = texture; vp = new ViewPlane(texture.width, texture.height, 1.0f, 100); background_color = Constants.black; tracer_ptr = new AreaLightTracer(this); Ambient ambLight = new Ambient(); ambLight.set_color(new Color(1, 1, 1, 1)); ambLight.scale_radiance(1.0f); set_ambient_light(ambLight); PerspectiveCamera pinhole_ptr1 = new PerspectiveCamera(); set_camera(pinhole_ptr1); Emissive ems = new Emissive(); ems.scale_radiance(40.0f); ems.set_ce(new Color(1, 0, 0, 1)); //Create Sky Object Sky sky = new Sky(); sky.sphereCenter = new Vector3(0, 0, 0); sky.sphereRad = 20000.0f; sky.set_material(ems); add_object(sky); //Create Environment Light Environment envLight = new Environment(); envLight.set_material(ems); envLight.SetSampler(new Regular(100)); add_light(envLight); Matte mat_ptr = new Matte(); mat_ptr.set_ka(0.25f); mat_ptr.set_kd(0.65f); mat_ptr.set_cd(new Color(1, 1, 0, 1)); Sphere sphere = new Sphere(); sphere.sphereCenter = new Vector3(-20, 0, 0); sphere.sphereRad = 30.0f; sphere.set_material(mat_ptr); add_object(sphere); render_scene(); }
public bool Equals(Material other) { return(Color.Equals(other.Color) && Ambient.Equals(other.Ambient) && Diffuse.Equals(other.Diffuse) && Specular.Equals(other.Specular) && Shininess.Equals(other.Shininess)); }
void Awake() { ambObjL = GameObject.Find("Amb_L"); ambObjR = GameObject.Find("Amb_R"); ambientChanL = ambObjL.GetComponent <Ambient>(); ambientChanR = ambObjR.GetComponent <Ambient>(); stemChan = GetComponentsInChildren <StemChannel>(); }
public void Dispose() { Diffuse?.Dispose(); Ambient?.Dispose(); Normal?.Dispose(); Specular?.Dispose(); Reflection?.Dispose(); }
/// <summary> /// Determines whether the specified <paramref name="unitOfWork"/> can be committed. /// </summary> /// <param name="unitOfWork">The unit of work.</param> /// <returns><c>true</c> if the specified unit of work can be committed; otherwise, <c>false</c>.</returns> /// <remarks> /// <para> /// Group 1 (if the <paramref name="unitOfWork"/> is <c>not</c> part of a <see cref="CompositeUnitOfWork"/>) /// <paramref name="unitOfWork"/>.Parent is NULL /// <c>true</c> if the <paramref name="unitOfWork"/> does not belong to a <see cref="CompositeUnitOfWork"/>; otherwise <c>false</c> /// AmbientExists - /// <c>true</c> if an ambient exists within a given scope; otherwise <c>false</c> /// (ie. per-thread <see cref="PerThreadAmbientContextManager"/> or per-request <see cref="PerRequestAmbientContextManager"/>) /// Ambient.IsCommittable /// true if there is only a single active session on the ambient context; otherwise, false /// </para> /// <para> /// Group 2 (if the <paramref name="unitOfWork"/> belongs to a <see cref="CompositeUnitOfWork"/> - ie. has a parent) /// Ambient.UnitOfWork.IsCommitting /// <c>true</c> if the ambient unit of work is currently being committed; otherwise <c>false</c> /// </para> /// </remarks> public virtual Boolean CanCommitUnitOfWork(UnitOfWorkBase unitOfWork) { return((unitOfWork.Parent == null && (AmbientExists && Ambient.Equals(unitOfWork) && Ambient.IsCommittable)) || Ambient.UnitOfWork.Status == TransactionStatus.Active); }
public override void Build() { vp = ViewPlane.Create(1024, 768, SystemOfCoordinates.SSC_INT); vp.NumSamples = 1; backgroundColor = ColorUtils.BLACK; tracer = new RayCast(this); Ambient a = new Ambient(); a.ScaleRadiance = 1.0f; AmbientLight = a; Pinhole pinhole = new Pinhole(new Vec3(0.0, 0.0, 20), new Vec3(0.0, 0.0, 0.0), new Vec3(0.0, 1.0, 0.0), 3600); Camera = pinhole; Directional l = new Directional(); l.SetDirection(-10, 20, 20); l.ScaleRadiance = 3.0f; l.Shadows = false; AddLight(l); int numSpheres = 1000000; double volume = 0.1 / numSpheres; double radius = Math.Pow(0.75 * volume / Math.PI, 0.333333); Grid grid = new Grid(); Rnd.SetRandSeed(15); for (int j = 0; j < numSpheres; j++) { Matte matte = new Matte(); matte.SetKa(0.25f); matte.SetKd(0.75f); matte.SetColor(new Vec3(Rnd.RandDouble(), Rnd.RandDouble(), Rnd.RandDouble())); Sphere sphere = new Sphere(); sphere.Radius = radius; sphere.SetCenter(1.0f - 2.0f * (float)Rnd.RandDouble(), 1.0f - 2.0f * (float)Rnd.RandDouble(), 1.0f - 2.0f * (float)Rnd.RandDouble()); sphere.Material = matte; grid.AddObject(sphere); } grid.SetupCells(); AddObject(grid); }
// Use this for initialization void Start() { instance = this; for (int i = 0; i < averageTracks; i++) { StartTrack(); } nextTime = GetNextTime(); }
public void StopAmbient() { if (Ambient != null) { Ambient.Stop(); GameObject.Destroy(Ambient.gameObject); Ambient = null; } }
public override void Define() { Ambient ambient = null; When() .Match <Ambient>(() => ambient, a => a.Lumix > 10.0); // highly eluminated area Then() .Do(ctx => ctx.Insert(new MongodbAmbient(ambient))); }
public override void Build() { vp = ViewPlane.Create(1024, 768, SystemOfCoordinates.SSC_INT); vp.NumSamples = 25; backgroundColor = ColorUtils.BLACK; tracer = new RayCast(this); Ambient a = new Ambient(); a.ScaleRadiance = 1.0f; AmbientLight = a; Pinhole pinhole = new Pinhole(new Vec3(0, 0, 65), new Vec3(0.0, 0.0, 0.0), new Vec3(0.0, 1.0, 0.0), 9000 /**24*/); Camera = pinhole; Directional light = new Directional(); light.SetDirection(-0.25f, 0.4f, 1.0f); light.ScaleRadiance = 2.5f; AddLight(light); //image Image image = new Image(); image.Load(PATH + "ppm/EarthLowRes.ppm"); //mapping SphericalMap sphericalMap = new SphericalMap(); //image based texture ImageTexture texture = new ImageTexture(image, sphericalMap); //textured material SV_Matte svMatte = new SV_Matte(); svMatte.SetKa(0.45f); svMatte.SetKd(0.65f); svMatte.SetCd(texture); Sphere s = new Sphere(); s.Material = svMatte; Instance earth = new Instance(s); earth.Material = svMatte; earth.RotateY(-72); earth.RotateX(40); earth.RotateZ(20); AddObject(earth); }
public void PlayAmbient(Ambient sound) { AudioClip newSample = AmbientSamples.Find(x => x.ambient.Equals(sound)).sample; if (!AmbientSound.sample.Equals(newSample)) { AmbientSound.SetSample(newSample); } AmbientSound.Play(); }
protected override void ReadDataXML(XElement ele, ElderScrollsPlugin master) { XElement subEle; if (ele.TryPathTo("Sky/Upper", false, out subEle)) { SkyUpper.ReadXML(subEle, master); } if (ele.TryPathTo("Fog", false, out subEle)) { Fog.ReadXML(subEle, master); } if (ele.TryPathTo("Unused1", false, out subEle)) { Unused1.ReadXML(subEle, master); } if (ele.TryPathTo("Ambient", false, out subEle)) { Ambient.ReadXML(subEle, master); } if (ele.TryPathTo("Sunlight", false, out subEle)) { Sunlight.ReadXML(subEle, master); } if (ele.TryPathTo("Sun", false, out subEle)) { Sun.ReadXML(subEle, master); } if (ele.TryPathTo("Stars", false, out subEle)) { Stars.ReadXML(subEle, master); } if (ele.TryPathTo("Sky/Lower", false, out subEle)) { SkyLower.ReadXML(subEle, master); } if (ele.TryPathTo("Horizon", false, out subEle)) { Horizon.ReadXML(subEle, master); } if (ele.TryPathTo("Unused2", false, out subEle)) { Unused2.ReadXML(subEle, master); } }
public override int GetHashCode() { return((int)( (Name.GetHashCode() * 3) + (Ambient.GetHashCode() * 5) + (Diffuse.GetHashCode() * 7) + (Specular.GetHashCode() * 11) + (Emissive.GetHashCode() * 13) + (Reflectivity * 17) + (Opacity * 19))); }
protected override void RefreshUniforms() { base.RefreshUniforms(); Program.SetUniformData("ambient", Renderer.GammaInput ? Ambient.GammaToLinear() : Ambient); Program.SetUniformData("emissive", Renderer.GammaInput ? Emissive.GammaToLinear() : Emissive); if (ShouldWrapAround) { Program.SetUniformData("wrapRGB", WrapRGB); } }
public ScriptScope EnterNameSpace(string name, Ambient ambient = Ambient.none) { var value = $"namespace {name}"; if (ambient != Ambient.none) { value = $"{ambient} {value}"; } return(this.EnterScope(value)); }
public ScriptScope EnterEnum(string name, Ambient ambient = Ambient.none) { var value = $"enum {name}"; if (ambient != Ambient.none) { value = $"{ambient} {value}"; } return(this.EnterScope(value)); }
public async Task <IActionResult> PostAmbient([FromBody] Ambient ambient) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.Ambients.Add(ambient); await _context.SaveChangesAsync(); return(CreatedAtAction("GetAmbient", new { id = ambient.Id }, ambient)); }
public override int GetHashCode() { int hashCode = -2043694805; hashCode = hashCode * -1521134295 + Ambient.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <Color> .Default.GetHashCode(Color); hashCode = hashCode * -1521134295 + Diffuse.GetHashCode(); hashCode = hashCode * -1521134295 + Shininess.GetHashCode(); hashCode = hashCode * -1521134295 + Specular.GetHashCode(); return(hashCode); }
public odfMaterialPropertySet Clone() { odfMaterialPropertySet prop = new odfMaterialPropertySet(); prop.Unknown1 = Unknown1; prop.Diffuse = new Color4(Diffuse.ToVector4()); prop.Ambient = new Color4(Ambient.ToVector4()); prop.Specular = new Color4(Specular.ToVector4()); prop.Emissive = new Color4(Emissive.ToVector4()); prop.SpecularPower = SpecularPower; return(prop); }
public override void Build() { vp = ViewPlane.Create(1024, 768, SystemOfCoordinates.SSC_INT); vp.NumSamples = 16; backgroundColor = ColorUtils.BLACK; tracer = new RayCast(this); Ambient a = new Ambient(); a.ScaleRadiance = 1.0f; AmbientLight = a; Pinhole pinhole = new Pinhole(new Vec3(100, 0, 100), new Vec3(0, 1, 0), new Vec3(0.0, 1.0, 0.0), 8000); Camera = pinhole; PointLight l = new PointLight(); l.Color = ColorUtils.WHITE; l.SetLocation(50, 50, 1); l.ScaleRadiance = 3.0f; l.Shadows = true; AddLight(l); Phong m = new Phong(); m.SetColor(new Vec3(0.75)); m.SetKa(0.25f); m.SetKd(0.8f); m.SetKs(0.15f); m.SetExp(50.0f); Instance ellipsoid = new Instance(new Sphere()); ellipsoid.Material = m; ellipsoid.Scale(2, 3, 1); ellipsoid.RotateX(-45); ellipsoid.Translate(0, 1, 0); AddObject(ellipsoid); //Plane p = new Plane(new Vec3(0, -10, 0), new Vec3(0, 1, 0)); //Matte pm = new Matte(); //pm.SetKa(0.25f); //pm.SetKd(0.75f); //pm.SetColor(new Vec3(0.3)); //p.Material = pm; //AddObject(p); }
public override int GetHashCode() { unchecked { var hashCode = Ambient.GetHashCode(); hashCode = (hashCode * 397) ^ Color.Truncate().GetHashCode(); hashCode = (hashCode * 397) ^ Diffuse.Truncate().GetHashCode(); hashCode = (hashCode * 397) ^ Shininess.Truncate().GetHashCode(); hashCode = (hashCode * 397) ^ Specular.Truncate().GetHashCode(); return(hashCode); } }
protected override void WriteData(ESPWriter writer) { SkyUpper.WriteBinary(writer); Fog.WriteBinary(writer); Unused1.WriteBinary(writer); Ambient.WriteBinary(writer); Sunlight.WriteBinary(writer); Sun.WriteBinary(writer); Stars.WriteBinary(writer); SkyLower.WriteBinary(writer); Horizon.WriteBinary(writer); Unused2.WriteBinary(writer); }
public void CreateAmbient (string name) { Ambient ambient = new Ambient (name); createdAmbients.Add (ambient); UpdateAreaTotal (); }
public bool CheckAmbientCategoryVerified (Ambient ambient, CheckSpaceConstants.CheckSpaceCategories category) { switch (category) { case CheckSpaceConstants.CheckSpaceCategories.Accoustic: return ambient.accousticInformation.verified; break; case CheckSpaceConstants.CheckSpaceCategories.Ceramic: return ambient.ceramicInformation.verified; break; case CheckSpaceConstants.CheckSpaceCategories.CeramicWall: return ambient.ceramicWallsInformation.verified; break; case CheckSpaceConstants.CheckSpaceCategories.Dimensions: return ambient.dimensionsInformation.verified; break; case CheckSpaceConstants.CheckSpaceCategories.Eletrics: return ambient.eletricsInformation.verified; break; case CheckSpaceConstants.CheckSpaceCategories.Frames: return ambient.framesInformation.verified; break; case CheckSpaceConstants.CheckSpaceCategories.Hidraulics: return ambient.hidraulicsInformation.verified; break; case CheckSpaceConstants.CheckSpaceCategories.PaintingCeiling: return ambient.paintingCeilingInformation.verified; break; case CheckSpaceConstants.CheckSpaceCategories.PaintingWall: return ambient.paintingWallInformation.verified; break; case CheckSpaceConstants.CheckSpaceCategories.WoodenFloor: return ambient.woodenFloorInformation.verified; break; case CheckSpaceConstants.CheckSpaceCategories.Sills: return ambient.sillsInformation.verified; break; case CheckSpaceConstants.CheckSpaceCategories.Peitoris: return ambient.peitorisInformation.verified; break; case CheckSpaceConstants.CheckSpaceCategories.TentosBaguetes: return ambient.tentosBaguetesInformation.verified; break; case CheckSpaceConstants.CheckSpaceCategories.FunctionalCeiling: return ambient.functionalCeilingInformation.verified; break; case CheckSpaceConstants.CheckSpaceCategories.FunctionalWall: return ambient.functionalWallInformation.verified; break; } return false; }
public static void PlayAmbient(Ambient a){ switch(a){ case Ambient.Birds: ambientPlayer.clip = ambientFiles[0]; break; case Ambient.Seashore: ambientPlayer.clip = ambientFiles[1]; break; case Ambient.WindHowl: ambientPlayer.clip = ambientFiles[2]; break; } }