Example #1
0
        public void Activate(bool activate, bool force = false)
        {
            if((activate && !Activated) || force)
            {
                Activated = true;

                var lightParams = new LightParams();
                lightParams.lightStyle = LightStyle;
                lightParams.origin = Vec3.Zero;
                lightParams.lightFrustumAngle = 45;
                lightParams.radius = Radius;
                lightParams.coronaScale = CoronaScale;
                lightParams.coronaIntensity = CoronaIntensity;
                lightParams.coronaDistSizeFactor = CoronaDistSizeFactor;
                lightParams.coronaDistIntensityFactor = CoronaDistIntensityFactor;

                lightParams.color = DiffuseColor;
                lightParams.specularMultiplier = SpecularMultiplier;

                lightParams.hdrDynamic = HDRDynamic;

                LoadLight(lightParams, LightSlot);
            }
            else
            {
                Activated = false;
                FreeSlot(LightSlot);
            }
        }
Example #2
0
        public override void OnSpawn()
        {
            var light = new LightParams
            {
                radius = 5,
                color = Color.Red,
                hdrDynamic = 2
            };

            LoadLight(light);
            LoadObject("objects/effects/particle_effects/bubble/3dbubble.cgf");

            ReceiveUpdates = true;
        }
Example #3
0
 /// <summary>
 /// Loads a light source to the specified slot, or to the next available slot.
 /// </summary>
 /// <param name="parameters">New params of the light source we wish to load</param>
 /// <param name="slot">Slot we want to load the light into, if -1 chooses the next available slot.</param>
 /// <returns>The slot where the light source was loaded, or -1 if loading failed.</returns>
 public int LoadLight(LightParams parameters, int slot = 1)
 {
     return(NativeEntityMethods.LoadLight(this.GetIEntity(), slot, parameters));
 }
Example #4
0
 /// <summary>
 /// Loads a light source to the specified slot, or to the next available slot.
 /// </summary>
 /// <param name="parameters">New params of the light source we wish to load</param>
 /// <param name="slot">Slot we want to load the light into, if -1 chooses the next available slot.</param>
 /// <returns>The slot where the light source was loaded, or -1 if loading failed.</returns>
 public int LoadLight(LightParams parameters, int slot = 1)
 {
     return NativeEntityMethods.LoadLight(this.GetIEntity(), slot, parameters);
 }
Example #5
0
 public void SwitchToLightObject(ref LightParams lightParams)
 {
     NativeEntityMethods.BindAttachmentToLight(Handle, ref lightParams);
 }
Example #6
0
 public void SwitchToLightObject(ref LightParams lightParams)
 {
     NativeEntityMethods.BindAttachmentToLight(Handle, ref lightParams);
 }