コード例 #1
0
        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;
            }
        }
コード例 #2
0
 protected Light(LightFlags flags, Transform lightToWorld, MediumInterface mediumInterface, int nSamples)
 {
     Flags           = flags;
     NumSamples      = nSamples;
     MediumInterface = mediumInterface;
     LightToWorld    = lightToWorld;
     WorldToLight    = lightToWorld.Inverse();
 }
コード例 #3
0
 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;
 }
コード例 #4
0
 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();
 }
コード例 #5
0
ファイル: Light.cs プロジェクト: deramscholzara/ForgePlus
 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
 }
コード例 #6
0
 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;
     }
 }