|
|
|
@ -29,13 +29,19 @@
|
|
|
|
|
namespace Nif
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
typedef Node Effect;
|
|
|
|
|
|
|
|
|
|
// Used for NiAmbientLight and NiDirectionalLight. Might also work for
|
|
|
|
|
// NiPointLight and NiSpotLight?
|
|
|
|
|
struct NiLight : Effect
|
|
|
|
|
struct NiDynamicEffect : public Node
|
|
|
|
|
{
|
|
|
|
|
void read(NIFStream *nif)
|
|
|
|
|
{
|
|
|
|
|
struct SLight
|
|
|
|
|
Node::read(nif);
|
|
|
|
|
unsigned int numAffectedNodes = nif->getUInt();
|
|
|
|
|
for (unsigned int i=0; i<numAffectedNodes; ++i)
|
|
|
|
|
nif->getUInt(); // ref to another Node
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Used as base for NiAmbientLight, NiDirectionalLight, NiPointLight and NiSpotLight.
|
|
|
|
|
struct NiLight : NiDynamicEffect
|
|
|
|
|
{
|
|
|
|
|
float dimmer;
|
|
|
|
|
osg::Vec3f ambient;
|
|
|
|
@ -44,12 +50,17 @@ struct NiLight : Effect
|
|
|
|
|
|
|
|
|
|
void read(NIFStream *nif);
|
|
|
|
|
};
|
|
|
|
|
SLight light;
|
|
|
|
|
|
|
|
|
|
struct NiPointLight : public NiLight
|
|
|
|
|
{
|
|
|
|
|
float constantAttenuation;
|
|
|
|
|
float linearAttenuation;
|
|
|
|
|
float quadraticAttenuation;
|
|
|
|
|
|
|
|
|
|
void read(NIFStream *nif);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct NiTextureEffect : Effect
|
|
|
|
|
struct NiTextureEffect : NiDynamicEffect
|
|
|
|
|
{
|
|
|
|
|
NiSourceTexturePtr texture;
|
|
|
|
|
|
|
|
|
|