public static new void ParseParmSet(ref ParameterSet actorParm, ref ParameterSet worldParm) { if (worldParm.HasParm("Strength")) actorParm.AddParm("Strength", worldParm.GetFloat("Strength")); if (worldParm.HasParm("Direction")) actorParm.AddParm("Direction", worldParm.GetVector3("Direction")); }
public static new void ParseParmSet(ref ParameterSet actorParm, ref ParameterSet worldParm) { System.Diagnostics.Debug.Assert(worldParm.HasParm("NewDir"), "Rotate Camera requires a new direction!"); actorParm.AddParm("NewDir", worldParm.GetVector3("NewDir")); if (worldParm.HasParm("RotateRight")) actorParm.AddParm("RotateRight", worldParm.GetBool("RotateRight")); if(worldParm.HasParm("RotationTime")) actorParm.AddParm("RotationTime", worldParm.GetFloat("RotationTime")); }
public override void PostLoadInit(ParameterSet Parm) { int index = 0; while (Parm.HasParm("Light" + index)) { string keyString = "Light" + index; string lightType = Parm.GetString(keyString); switch (lightType) { case "Directional": { // read directional light parameters and create light Vector3 direction = Parm.GetVector3(keyString + "Direction"); Vector4 color = Parm.GetVector4(keyString + "Color"); float intensity = Parm.GetFloat(keyString + "Intensity"); directionalLights.Add(new DirectionalLight(direction, color, intensity)); } break; case "Spot": { Vector3 position = Parm.GetVector3(keyString + "Position"); Vector3 direction = Parm.GetVector3(keyString + "Direction"); Vector4 color = Parm.GetVector4(keyString + "Color"); float intensity = Parm.GetFloat(keyString + "Intensity"); spotLights.Add(new SpotLight(DeferredRenderer.Instance.GraphicsDevice, position, direction, color, intensity, true, 1024, spotCookie)); } break; case "Point": { Vector3 position = Parm.GetVector3(keyString + "Position"); float radius = Parm.GetFloat(keyString + "Radius"); Vector4 color = Parm.GetVector4(keyString + "Color"); float intensity = Parm.GetFloat(keyString + "Intensity"); pointLights.Add(new PointLight(DeferredRenderer.Instance.GraphicsDevice, position, radius, color, intensity, true, 256)); } break; } index++; } }