00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00026 #include <archon/x3d/server/field_type.H>
00027 #include <archon/x3d/server/field.H>
00028 #include <archon/x3d/server/light.H>
00029
00030 namespace Archon
00031 {
00032 namespace X3D
00033 {
00034 const NodeType *LightNode::type = 0;
00035 const NodeType *DirectionalLight::type = 0;
00036 const NodeType *PointLight::type = 0;
00037 const NodeType *SpotLight::type = 0;
00038
00039 void initializeLightComponent()
00040 {
00041 vector<const FieldBase *> fields;
00042
00043
00044
00045
00046 fields.push_back(newExposedField("ambientIntensity", SFFloat::type,
00047 &LightNode::ambientIntensity,
00048 &LightNode::ambientIntensityChanged,
00049 &LightNode::ambientIntensityStamp));
00050 fields.push_back(newExposedField("color", SFColor::type,
00051 &LightNode::color,
00052 &LightNode::colorChanged,
00053 &LightNode::colorStamp));
00054 fields.push_back(newExposedField("intensity", SFFloat::type,
00055 &LightNode::intensity,
00056 &LightNode::intensityChanged,
00057 &LightNode::intensityStamp));
00058 fields.push_back(newExposedField("on", SFBool::type,
00059 &LightNode::on,
00060 &LightNode::onChanged,
00061 &LightNode::onStamp));
00062 LightNode::type =
00063 NodeType::newAbstract("LightNode", false, &fields,
00064 ChildNode::type);
00065 fields.clear();
00066
00067
00068
00069
00070 fields.push_back(newExposedField("direction", SFVec3f::type,
00071 &DirectionalLight::direction,
00072 &DirectionalLight::directionChanged,
00073 &DirectionalLight::directionStamp));
00074 DirectionalLight::type =
00075 NodeType::newConcrete("DirectionalLight", "children",
00076 DirectionalLight::instantiate, &fields,
00077 LightNode::type);
00078 fields.clear();
00079
00080
00081
00082
00083 fields.push_back(newExposedField("attenuation", SFVec3f::type,
00084 &PointLight::attenuation,
00085 &PointLight::attenuationChanged,
00086 &PointLight::attenuationStamp));
00087 fields.push_back(newExposedField("location", SFVec3f::type,
00088 &PointLight::location,
00089 &PointLight::locationChanged,
00090 &PointLight::locationStamp));
00091 fields.push_back(newExposedField("radius", SFFloat::type,
00092 &PointLight::radius,
00093 &PointLight::radiusChanged,
00094 &PointLight::radiusStamp));
00095 PointLight::type =
00096 NodeType::newConcrete("PointLight", "children",
00097 PointLight::instantiate, &fields,
00098 LightNode::type);
00099 fields.clear();
00100
00101
00102
00103
00104 fields.push_back(newExposedField("attenuation", SFVec3f::type,
00105 &SpotLight::attenuation,
00106 &SpotLight::attenuationChanged,
00107 &SpotLight::attenuationStamp));
00108 fields.push_back(newExposedField("beamWidth", SFFloat::type,
00109 &SpotLight::beamWidth,
00110 &SpotLight::beamWidthChanged,
00111 &SpotLight::beamWidthStamp));
00112 fields.push_back(newExposedField("cutOffAngle", SFFloat::type,
00113 &SpotLight::cutOffAngle,
00114 &SpotLight::cutOffAngleChanged,
00115 &SpotLight::cutOffAngleStamp));
00116 fields.push_back(newExposedField("direction", SFVec3f::type,
00117 &SpotLight::direction,
00118 &SpotLight::directionChanged,
00119 &SpotLight::directionStamp));
00120 fields.push_back(newExposedField("location", SFVec3f::type,
00121 &SpotLight::location,
00122 &SpotLight::locationChanged,
00123 &SpotLight::locationStamp));
00124 fields.push_back(newExposedField("radius", SFFloat::type,
00125 &SpotLight::radius,
00126 &SpotLight::radiusChanged,
00127 &SpotLight::radiusStamp));
00128 SpotLight::type =
00129 NodeType::newConcrete("SpotLight", "children",
00130 SpotLight::instantiate, &fields,
00131 LightNode::type);
00132 fields.clear();
00133 }
00134 }
00135 }