Update of /cvsroot/simspark/simspark/spark/kerosin/materialserver
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv10020
Modified Files:
Tag: projectx
materialsolid_c.cpp
Log Message:
- added a flag and methods indicating if depth checks for the
material should be enabled
- added a value and methods for the shininess of a material
Index: materialsolid_c.cpp
===================================================================
RCS file: /cvsroot/simspark/simspark/spark/kerosin/materialserver/materialsolid_c.cpp,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -C2 -d -r1.1 -r1.1.4.1
*** materialsolid_c.cpp 5 Dec 2005 21:38:22 -0000 1.1
--- materialsolid_c.cpp 1 Jun 2007 13:02:46 -0000 1.1.4.1
***************
*** 1,5 ****
/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*-
! this file is part of rcssserver3D
Fri May 9 2003
Copyright (C) 2002,2003 Koblenz University
--- 1,5 ----
/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*-
! this file is part of simspark
Fri May 9 2003
Copyright (C) 2002,2003 Koblenz University
***************
*** 43,46 ****
--- 43,69 ----
}
+ #if 0
+ static bool
+ readRGBAVal(const zeitgeist::ParameterList& in, RGBA& m)
+ {
+ int r,g,b;
+
+ if (
+ (in.GetSize() != 4) ||
+ (! in.GetValue(in[0], r)) ||
+ (! in.GetValue(in[1], g)) ||
+ (! in.GetValue(in[2], b)) ||
+ (! in.GetValue(in[3], m.a()))
+ )
+ {
+ return false;
+ }
+ m.r() = r / 255.0;
+ m.g() = g / 255.0;
+ m.b() = b / 255.0;
+ return true;
+ }
+ #endif
+
FUNCTION(MaterialSolid,setAmbient)
{
***************
*** 67,70 ****
--- 90,107 ----
}
+ #if 0
+ FUNCTION(MaterialSolid,setDiffuseVal)
+ {
+ RGBA m;
+ if (! readRGBAVal(in,m))
+ {
+ return false;
+ }
+
+ obj->SetDiffuse(m);
+ return true;
+ }
+ #endif
+
FUNCTION(MaterialSolid,setSpecular)
{
***************
*** 91,94 ****
--- 128,161 ----
}
+ FUNCTION(MaterialSolid,setDepthCheck)
+ {
+ bool depthCheck;
+ if (
+ (in.GetSize() == 0) ||
+ (! in.GetValue(in[0], depthCheck))
+ )
+ {
+ return false;
+ }
+
+ obj->SetDepthCheck(depthCheck);
+ return true;
+ }
+
+ FUNCTION(MaterialSolid,setShininess)
+ {
+ float val;
+ if (
+ (in.GetSize() == 0) ||
+ (! in.GetValue(in[0], val))
+ )
+ {
+ return false;
+ }
+
+ obj->SetShininess(val);
+ return true;
+ }
+
void CLASS(MaterialSolid)::DefineClass()
{
***************
*** 96,100 ****
--- 163,170 ----
DEFINE_FUNCTION(setAmbient);
DEFINE_FUNCTION(setDiffuse);
+ // DEFINE_FUNCTION(setDiffuseVal);
DEFINE_FUNCTION(setSpecular);
DEFINE_FUNCTION(setEmission);
+ DEFINE_FUNCTION(setDepthCheck);
+ DEFINE_FUNCTION(setShininess);
}
|