public void Copy(GLight other)
 {
     this.m_position    = other.m_position;
     this.m_orientation = other.m_orientation;
     this.m_style       = other.m_style;
     this.m_flare       = other.m_flare;
     this.m_color_index = other.m_color_index;
     this.m_intensity   = other.m_intensity;
     this.m_range       = other.m_range;
     this.m_spot_angle  = other.m_spot_angle;
 }
        public GLight AddPointLight(Vector3 pos, LightFlare flare, int color_index, float intensity, float range, bool shadow = true)
        {
            GLight l = new GLight();

            l.m_style       = (shadow ? LightStyle.POINT : LightStyle.POINT_NO_SHADOW);
            l.m_flare       = flare;
            l.m_color_index = color_index;
            l.m_intensity   = intensity;
            l.m_range       = range;
            l.m_position    = pos;
            this.m_light.Add(l);
            return(l);
        }
示例#3
0
 public void Copy(DLight src)
 {
     enabled     = src.enabled;
     position    = src.position;
     style       = src.style;
     flare       = src.flare;
     _rot_yaw    = src._rot_yaw;
     _rot_pitch  = src._rot_pitch;
     color_index = src.color_index;
     intensity   = src.intensity;
     range       = src.range;
     angle       = src.angle;
     _rotation   = src._rotation;
 }
示例#4
0
 public DLight(Vector3 pos)
 {
     enabled     = false;
     position    = Vector3.Zero;
     style       = LightStyle.POINT;
     flare       = LightFlare.NONE;
     _rot_yaw    = 0f;
     _rot_pitch  = 0f;
     color_index = 0;
     intensity   = 1f;
     range       = 10f;
     angle       = 45f;
     _rotation   = CalculateRotationMatrix(this);
 }
        public GLight AddSpotLight(Vector3 pos, Matrix4 orient, float spot_angle, LightFlare flare, int color_index, float intensity, float range, bool shadow = true)
        {
            GLight l = new GLight();

            l.m_style       = (shadow ? LightStyle.SPOT : LightStyle.SPOT_NO_SHADOW);
            l.m_flare       = flare;
            l.m_color_index = color_index;
            l.m_intensity   = intensity;
            l.m_range       = range;
            l.m_spot_angle  = spot_angle;
            l.m_position    = pos;
            l.m_orientation = orient;
            this.m_light.Add(l);
            return(l);
        }
示例#6
0
        public DLight(JObject root)
        {
            enabled = root["enabled"].GetBool(false);
            style   = root["style"].GetEnum <LightStyle>(LightStyle.SPOT);
            flare   = root["flare"].GetEnum <LightFlare>(LightFlare.NONE);

            position   = root["position"].GetVector3(Vector3.Zero);
            _rot_yaw   = root["rot_yaw"].GetFloat(0f);
            _rot_pitch = root["rot_pitch"].GetFloat(0f);

            color_index = root["color_index"].GetInt(0);

            intensity = root["intensity"].GetFloat(1f);
            range     = root["range"].GetFloat(1f);
            angle     = root["angle"].GetFloat(45f);

            // Note: The above wrote directly to the backing values (_rot_yaw, _rot_pitch and _angle), so
            // we are responsible for updating the backing for _rotation. This was done so we didn't recalculate
            // rotation for each of those properties
            _rotation = CalculateRotationMatrix(this);
        }
示例#7
0
 public void CycleFlare()
 {
     flare = (LightFlare)(((int)flare + 1) % (int)LightFlare.NUM);
 }