public void Read(Stream stream) { using BinaryReader reader = new BinaryReader(stream); idx = reader.ReadUInt32(); type = EnumUtils.intToEnum <LightType>(reader.ReadInt32()); color = FColor.ReadNew(reader); flags = EnumUtils.intToFlags <LightFlags>(reader.ReadUInt32()); pos = new Vector3(); vec = new Vector3(); radius = 0.0f; switch (type) { case LightType.Directional: pos = reader.ReadVector3(); vec = reader.ReadVector3(); break; case LightType.Point: radius = reader.ReadSingle(); pos = reader.ReadVector3(); break; case LightType.Spot: radius = reader.ReadUInt32(); pos = reader.ReadVector3(); vec = reader.ReadVector3(); break; } }
protected Light(LightFlags flags, Transform lightToWorld, MediumInterface mediumInterface, int nSamples) { Flags = flags; NumSamples = nSamples; MediumInterface = mediumInterface; LightToWorld = lightToWorld; WorldToLight = lightToWorld.Inverse(); }
public LightData(Int32 Time, UInt32 Radius, Color Color, LightFlags Flags, Single FalloffExponent, Single FOV, UInt32 Value, Single Weight) { this.Time = Time; this.Radius = Radius; this.Color = Color; this.Flags = Flags; this.FalloffExponent = FalloffExponent; this.FOV = FOV; this.Value = Value; this.Weight = Weight; }
public LightData(string Tag = null) : base(Tag) { Time = new Int32(); Radius = new UInt32(); Color = new Color(); Flags = new LightFlags(); FalloffExponent = new Single(); FOV = new Single(); Value = new UInt32(); Weight = new Single(); }
public void Load(BinaryReaderBE reader) { Type = (LightType)reader.ReadInt16(); Flags = (LightFlags)reader.ReadUInt16(); Phase = reader.ReadInt16(); PrimaryActive.Load(reader); SecondaryActive.Load(reader); BecomingActive.Load(reader); PrimaryInactive.Load(reader); SecondaryInactive.Load(reader); BecomingInactive.Load(reader); TagIndex = reader.ReadInt16(); reader.BaseStream.Seek(4 * 2, SeekOrigin.Current); // unused }
public void Initialize(LightFlags lightFlags) { if (lightFlags.HasFlag(LightFlags.Flicker)) { lightFlickerMode = LightFlickerMode.Flicker; } else if (lightFlags.HasFlag(LightFlags.FlickerSlow)) { lightFlickerMode = LightFlickerMode.FlickerSlow; } else if (lightFlags.HasFlag(LightFlags.Pulse)) { lightFlickerMode = LightFlickerMode.Pulse; } else if (lightFlags.HasFlag(LightFlags.PulseSlow)) { lightFlickerMode = LightFlickerMode.PulseSlow; } }