Implement missing llGetPrimitiveParams parameters

avinationmerge
CasperW 2010-02-15 06:10:04 +01:00
parent b2fefe3e3f
commit 94c417c90c
1 changed files with 138 additions and 32 deletions

View File

@ -7674,25 +7674,96 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
break; break;
case (int)ScriptBaseClass.PRIM_BUMP_SHINY: case (int)ScriptBaseClass.PRIM_BUMP_SHINY:
// TODO-------------- if (remain < 1)
if (remain < 1) return res;
return res; face = (int)rules.GetLSLIntegerItem(idx++);
face=(int)rules.GetLSLIntegerItem(idx++); tex = part.Shape.Textures;
int shiny;
res.Add(new LSL_Integer(0)); if (face == ScriptBaseClass.ALL_SIDES)
res.Add(new LSL_Integer(0)); {
for (face = 0; face < GetNumberOfSides(part); face++)
{
Shininess shinyness = tex.GetFace((uint)face).Shiny;
if (shinyness == Shininess.High)
{
shiny = ScriptBaseClass.PRIM_SHINY_HIGH;
}
else if (shinyness == Shininess.Medium)
{
shiny = ScriptBaseClass.PRIM_SHINY_MEDIUM;
}
else if (shinyness == Shininess.Low)
{
shiny = ScriptBaseClass.PRIM_SHINY_LOW;
}
else
{
shiny = ScriptBaseClass.PRIM_SHINY_NONE;
}
res.Add(new LSL_Integer(shiny));
res.Add(new LSL_Integer((int)tex.GetFace((uint)face).Bump));
}
}
else
{
Shininess shinyness = tex.GetFace((uint)face).Shiny;
if (shinyness == Shininess.High)
{
shiny = ScriptBaseClass.PRIM_SHINY_HIGH;
}
else if (shinyness == Shininess.Medium)
{
shiny = ScriptBaseClass.PRIM_SHINY_MEDIUM;
}
else if (shinyness == Shininess.Low)
{
shiny = ScriptBaseClass.PRIM_SHINY_LOW;
}
else
{
shiny = ScriptBaseClass.PRIM_SHINY_NONE;
}
res.Add(new LSL_Integer(shiny));
res.Add(new LSL_Integer((int)tex.GetFace((uint)face).Bump));
}
break; break;
case (int)ScriptBaseClass.PRIM_FULLBRIGHT: case (int)ScriptBaseClass.PRIM_FULLBRIGHT:
// TODO-------------- if (remain < 1)
if (remain < 1) return res;
return res; face = (int)rules.GetLSLIntegerItem(idx++);
face=(int)rules.GetLSLIntegerItem(idx++); tex = part.Shape.Textures;
int fullbright;
res.Add(new LSL_Integer(0)); if (face == ScriptBaseClass.ALL_SIDES)
{
for (face = 0; face < GetNumberOfSides(part); face++)
{
if (tex.GetFace((uint)face).Fullbright == true)
{
fullbright = ScriptBaseClass.TRUE;
}
else
{
fullbright = ScriptBaseClass.FALSE;
}
res.Add(new LSL_Integer(fullbright));
}
}
else
{
if (tex.GetFace((uint)face).Fullbright == true)
{
fullbright = ScriptBaseClass.TRUE;
}
else
{
fullbright = ScriptBaseClass.FALSE;
}
res.Add(new LSL_Integer(fullbright));
}
break; break;
case (int)ScriptBaseClass.PRIM_FLEXIBLE: case (int)ScriptBaseClass.PRIM_FLEXIBLE:
@ -7713,14 +7784,37 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
break; break;
case (int)ScriptBaseClass.PRIM_TEXGEN: case (int)ScriptBaseClass.PRIM_TEXGEN:
// TODO-------------- // (PRIM_TEXGEN_DEFAULT, PRIM_TEXGEN_PLANAR)
// (PRIM_TEXGEN_DEFAULT, PRIM_TEXGEN_PLANAR) if (remain < 1)
if (remain < 1) return res;
return res; face = (int)rules.GetLSLIntegerItem(idx++);
face=(int)rules.GetLSLIntegerItem(idx++); tex = part.Shape.Textures;
if (face == ScriptBaseClass.ALL_SIDES)
res.Add(new LSL_Integer(0)); {
for (face = 0; face < GetNumberOfSides(part); face++)
{
if (tex.GetFace((uint)face).TexMapType == MappingType.Planar)
{
res.Add(new LSL_Integer(ScriptBaseClass.PRIM_TEXGEN_PLANAR));
}
else
{
res.Add(new LSL_Integer(ScriptBaseClass.PRIM_TEXGEN_DEFAULT));
}
}
}
else
{
if (tex.GetFace((uint)face).TexMapType == MappingType.Planar)
{
res.Add(new LSL_Integer(ScriptBaseClass.PRIM_TEXGEN_PLANAR));
}
else
{
res.Add(new LSL_Integer(ScriptBaseClass.PRIM_TEXGEN_DEFAULT));
}
}
break; break;
case (int)ScriptBaseClass.PRIM_POINT_LIGHT: case (int)ScriptBaseClass.PRIM_POINT_LIGHT:
@ -7738,14 +7832,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
res.Add(new LSL_Float(shape.LightFalloff)); // falloff res.Add(new LSL_Float(shape.LightFalloff)); // falloff
break; break;
case (int)ScriptBaseClass.PRIM_GLOW: case (int)ScriptBaseClass.PRIM_GLOW:
// TODO-------------- if (remain < 1)
if (remain < 1)
return res; return res;
face = (int)rules.GetLSLIntegerItem(idx++);
face=(int)rules.GetLSLIntegerItem(idx++);
tex = part.Shape.Textures;
res.Add(new LSL_Float(0)); float primglow;
if (face == ScriptBaseClass.ALL_SIDES)
{
for (face = 0; face < GetNumberOfSides(part); face++)
{
primglow = tex.GetFace((uint)face).Glow;
res.Add(new LSL_Float(primglow));
}
}
else
{
primglow = tex.GetFace((uint)face).Glow;
res.Add(new LSL_Float(primglow));
}
break; break;
} }
} }