NIF reader compiles without Ogre

pull/638/head
scrawl 10 years ago
parent d4dff6ed55
commit 8c10d4badb

@ -221,6 +221,9 @@ if (${OGRE_VERSION} VERSION_LESS "1.9")
message(FATAL_ERROR "OpenMW requires Ogre 1.9 or later, please install the latest stable version from http://ogre3d.org")
endif()
find_package(OpenSceneGraph 3.2.0 REQUIRED osgDB)
include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS})
find_package(MyGUI REQUIRED)
if (${MYGUI_VERSION} VERSION_LESS "3.2.1")
message(FATAL_ERROR "OpenMW requires MyGUI 3.2.1 or later, please install the latest version from http://mygui.info")

@ -31,24 +31,24 @@ add_component_dir (nifoverrides
)
add_component_dir (bsa
bsa_archive bsa_file resources
bsa_file
)
add_component_dir (nif
controlled effect niftypes record controller extra node record_ptr data niffile property nifkey data node base nifstream
)
add_component_dir (nifcache
nifcache
)
#add_component_dir (nifcache
# nifcache
# )
add_component_dir (nifogre
ogrenifloader skeleton material mesh particles controller
)
#add_component_dir (nifogre
# ogrenifloader skeleton material mesh particles controller
# )
add_component_dir (nifbullet
bulletnifloader
)
#add_component_dir (nifbullet
# bulletnifloader
# )
add_component_dir (to_utf8
to_utf8
@ -160,7 +160,7 @@ include_directories(${BULLET_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR})
add_library(components STATIC ${COMPONENT_FILES} ${MOC_SRCS} ${ESM_UI_HDR})
target_link_libraries(components ${Boost_LIBRARIES} ${OGRE_LIBRARIES})
target_link_libraries(components ${Boost_LIBRARIES} ${OGRE_LIBRARIES} ${OPENSCENEGRAPH_LIBRARIES})
if (GIT_CHECKOUT)
add_dependencies (components git-version)

@ -129,8 +129,8 @@ public:
* 1 - Point (fixed origin)
*/
int mType;
Ogre::Vector3 mPosition;
Ogre::Vector3 mDirection;
osg::Vec3f mPosition;
osg::Vec3f mDirection;
void read(NIFStream *nif)
{

@ -33,7 +33,7 @@ class NiParticleSystemController : public Controller
{
public:
struct Particle {
Ogre::Vector3 velocity;
osg::Vec3f velocity;
float lifetime;
float lifespan;
float timestamp;
@ -64,7 +64,7 @@ public:
};
int emitFlags;
Ogre::Vector3 offsetRandom;
osg::Vec3f offsetRandom;
NodePtr emitter;

@ -33,10 +33,10 @@ namespace Nif
class ShapeData : public Record
{
public:
std::vector<Ogre::Vector3> vertices, normals;
std::vector<Ogre::Vector4> colors;
std::vector< std::vector<Ogre::Vector2> > uvlist;
Ogre::Vector3 center;
std::vector<osg::Vec3f> vertices, normals;
std::vector<osg::Vec4f> colors;
std::vector< std::vector<osg::Vec2f> > uvlist;
osg::Vec3f center;
float radius;
void read(NIFStream *nif)
@ -131,7 +131,7 @@ public:
class NiRotatingParticlesData : public NiAutoNormalParticlesData
{
public:
std::vector<Ogre::Quaternion> rotations;
std::vector<osg::Quat> rotations;
void read(NIFStream *nif)
{
@ -272,9 +272,9 @@ class NiSkinData : public Record
public:
struct BoneTrafo
{
Ogre::Matrix3 rotation; // Rotation offset from bone?
Ogre::Vector3 trans; // Translation
float scale; // Probably scale (always 1)
Matrix3 rotation; // Rotation offset from bone?
osg::Vec3f trans; // Translation
float scale; // Scale
};
struct VertWeight
@ -286,7 +286,7 @@ public:
struct BoneInfo
{
BoneTrafo trafo;
Ogre::Vector4 unknown;
osg::Vec4f unknown;
std::vector<VertWeight> weights;
};
@ -327,7 +327,7 @@ struct NiMorphData : public Record
{
struct MorphData {
FloatKeyMap mData;
std::vector<Ogre::Vector3> mVertices;
std::vector<osg::Vec3f> mVertices;
};
std::vector<MorphData> mMorphs;

@ -38,9 +38,9 @@ struct NiLight : Effect
struct SLight
{
float dimmer;
Ogre::Vector3 ambient;
Ogre::Vector3 diffuse;
Ogre::Vector3 specular;
osg::Vec3f ambient;
osg::Vec3f diffuse;
osg::Vec3f specular;
void read(NIFStream *nif)
{

@ -2,16 +2,16 @@
#include "effect.hpp"
#include <map>
#include <OgreResourceGroupManager.h>
#include <sstream>
namespace Nif
{
/// Open a NIF stream. The name is used for error messages.
NIFFile::NIFFile(const std::string &name)
NIFFile::NIFFile(Files::IStreamPtr stream, const std::string &name)
: ver(0)
, filename(name)
, mStream(stream)
{
parse();
}
@ -121,63 +121,68 @@ std::string NIFFile::printVersion(unsigned int version)
version_out.full = version;
return Ogre::StringConverter::toString(version_out.quad[3])
+"." + Ogre::StringConverter::toString(version_out.quad[2])
+"." + Ogre::StringConverter::toString(version_out.quad[1])
+"." + Ogre::StringConverter::toString(version_out.quad[0]);
std::stringstream stream;
stream << version_out.quad[3] << "."
<< version_out.quad[2] << "."
<< version_out.quad[1] << "."
<< version_out.quad[0];
return stream.str();
}
void NIFFile::parse()
{
NIFStream nif (this, Ogre::ResourceGroupManager::getSingleton().openResource(filename));
// Check the header string
std::string head = nif.getVersionString();
if(head.compare(0, 22, "NetImmerse File Format") != 0)
fail("Invalid NIF header: " + head);
// Get BCD version
ver = nif.getUInt();
if(ver != VER_MW)
fail("Unsupported NIF version: " + printVersion(ver));
// Number of records
size_t recNum = nif.getInt();
records.resize(recNum);
/* The format for 10.0.1.0 seems to be a bit different. After the
NIFStream nif (this, mStream);
// Check the header string
std::string head = nif.getVersionString();
if(head.compare(0, 22, "NetImmerse File Format") != 0)
fail("Invalid NIF header: " + head);
// Get BCD version
ver = nif.getUInt();
if(ver != VER_MW)
fail("Unsupported NIF version: " + printVersion(ver));
// Number of records
size_t recNum = nif.getInt();
records.resize(recNum);
/* The format for 10.0.1.0 seems to be a bit different. After the
header, it contains the number of records, r (int), just like
4.0.0.2, but following that it contains a short x, followed by x
strings. Then again by r shorts, one for each record, giving
which of the above strings to use to identify the record. After
this follows two ints (zero?) and then the record data. However
we do not support or plan to support other versions yet.
*/
*/
for(size_t i = 0;i < recNum;i++)
for(size_t i = 0;i < recNum;i++)
{
Record *r = NULL;
std::string rec = nif.getString();
if(rec.empty())
fail("Record number " + Ogre::StringConverter::toString(i) + " out of " + Ogre::StringConverter::toString(recNum) + " is blank.");
Record *r = NULL;
std::string rec = nif.getString();
if(rec.empty())
{
std::stringstream error;
error << "Record number " << i << " out of " << recNum << " is blank.";
fail(error.str());
}
std::map<std::string,RecordFactoryEntry>::const_iterator entry = factories.find(rec);
if (entry != factories.end())
{
r = entry->second.mCreate ();
r->recType = entry->second.mType;
}
else
fail("Unknown record type " + rec);
std::map<std::string,RecordFactoryEntry>::const_iterator entry = factories.find(rec);
assert(r != NULL);
assert(r->recType != RC_MISSING);
r->recName = rec;
r->recIndex = i;
records[i] = r;
r->read(&nif);
if (entry != factories.end())
{
r = entry->second.mCreate ();
r->recType = entry->second.mType;
}
else
fail("Unknown record type " + rec);
assert(r != NULL);
assert(r->recType != RC_MISSING);
r->recName = rec;
r->recIndex = i;
records[i] = r;
r->read(&nif);
}
size_t rootNum = nif.getUInt();

@ -7,6 +7,8 @@
#include <vector>
#include <iostream>
#include <components/files/constrainedfilestream.hpp>
#include "record.hpp"
namespace Nif
@ -42,6 +44,8 @@ class NIFFile
///\overload
void operator = (NIFFile const &);
Files::IStreamPtr mStream;
public:
/// Used if file parsing fails
void fail(const std::string &msg)
@ -57,8 +61,8 @@ public:
<< "File: " << filename <<std::endl;
}
/// Open a NIF stream. The name is used for error messages and opening the file.
NIFFile(const std::string &name);
/// Open a NIF stream. The name is used for error messages.
NIFFile(Files::IStreamPtr stream, const std::string &name);
~NIFFile();
/// Get a given record

@ -3,26 +3,27 @@
#ifndef OPENMW_COMPONENTS_NIF_NIFKEY_HPP
#define OPENMW_COMPONENTS_NIF_NIFKEY_HPP
#include <OgreStringConverter.h>
#include "nifstream.hpp"
#include <sstream>
#include <map>
namespace Nif
{
template<typename T>
struct KeyT {
T mValue;
// FIXME: Implement Quadratic and TBC interpolation
/*
T mForwardValue; // Only for Quadratic interpolation, and never for QuaternionKeyList
T mBackwardValue; // Only for Quadratic interpolation, and never for QuaternionKeyList
float mTension; // Only for TBC interpolation
float mBias; // Only for TBC interpolation
float mContinuity; // Only for TBC interpolation
*/
};
typedef KeyT<float> FloatKey;
typedef KeyT<Ogre::Vector3> Vector3Key;
typedef KeyT<Ogre::Vector4> Vector4Key;
typedef KeyT<Ogre::Quaternion> QuaternionKey;
template<typename T, T (NIFStream::*getValue)()>
struct KeyMapT {
@ -92,7 +93,12 @@ struct KeyMapT {
{
//Don't try to read XYZ keys into the wrong part
if ( count != 1 )
nif->file->fail("XYZ_ROTATION_KEY count should always be '1' . Retrieved Value: "+Ogre::StringConverter::toString(count));
{
std::stringstream error;
error << "XYZ_ROTATION_KEY count should always be '1' . Retrieved Value: "
<< count;
nif->file->fail(error.str());
}
}
else if (0 == mInterpolationType)
{
@ -100,7 +106,11 @@ struct KeyMapT {
nif->file->fail("Interpolation type 0 doesn't work with keys");
}
else
nif->file->fail("Unhandled interpolation type: "+Ogre::StringConverter::toString(mInterpolationType));
{
std::stringstream error;
error << "Unhandled interpolation type: " << mInterpolationType;
nif->file->fail(error.str());
}
}
private:
@ -109,31 +119,26 @@ private:
key.mValue = (nif.*getValue)();
}
static void readQuadratic(NIFStream &nif, KeyT<Ogre::Quaternion> &key)
{
readValue(nif, key);
}
template <typename U>
static void readQuadratic(NIFStream &nif, KeyT<U> &key)
{
readValue(nif, key);
key.mForwardValue = (nif.*getValue)();
key.mBackwardValue = (nif.*getValue)();
/*key.mForwardValue = */(nif.*getValue)();
/*key.mBackwardValue = */(nif.*getValue)();
}
static void readTBC(NIFStream &nif, KeyT<T> &key)
{
readValue(nif, key);
key.mTension = nif.getFloat();
key.mBias = nif.getFloat();
key.mContinuity = nif.getFloat();
/*key.mTension = */nif.getFloat();
/*key.mBias = */nif.getFloat();
/*key.mContinuity = */nif.getFloat();
}
};
typedef KeyMapT<float,&NIFStream::getFloat> FloatKeyMap;
typedef KeyMapT<Ogre::Vector3,&NIFStream::getVector3> Vector3KeyMap;
typedef KeyMapT<Ogre::Vector4,&NIFStream::getVector4> Vector4KeyMap;
typedef KeyMapT<Ogre::Quaternion,&NIFStream::getQuaternion> QuaternionKeyMap;
typedef KeyMapT<osg::Vec3f,&NIFStream::getVector3> Vector3KeyMap;
typedef KeyMapT<osg::Vec4f,&NIFStream::getVector4> Vector4KeyMap;
typedef KeyMapT<osg::Quat,&NIFStream::getQuaternion> QuaternionKeyMap;
} // Namespace
#endif //#ifndef OPENMW_COMPONENTS_NIF_NIFKEY_HPP

@ -9,19 +9,19 @@ namespace Nif
uint8_t NIFStream::read_byte()
{
uint8_t byte;
if(inp->read(&byte, 1) != 1) return 0;
inp->read((char*)&byte, 1);
return byte;
}
uint16_t NIFStream::read_le16()
{
uint8_t buffer[2];
if(inp->read(buffer, 2) != 2) return 0;
inp->read((char*)buffer, 2);
return buffer[0] | (buffer[1]<<8);
}
uint32_t NIFStream::read_le32()
{
uint8_t buffer[4];
if(inp->read(buffer, 4) != 4) return 0;
inp->read((char*)buffer, 4);
return buffer[0] | (buffer[1]<<8) | (buffer[2]<<16) | (buffer[3]<<24);
}
float NIFStream::read_le32f()
@ -34,43 +34,45 @@ float NIFStream::read_le32f()
}
//Public functions
Ogre::Vector2 NIFStream::getVector2()
osg::Vec2f NIFStream::getVector2()
{
float a[2];
osg::Vec2f vec;
for(size_t i = 0;i < 2;i++)
a[i] = getFloat();
return Ogre::Vector2(a);
vec._v[i] = getFloat();
return vec;
}
Ogre::Vector3 NIFStream::getVector3()
osg::Vec3f NIFStream::getVector3()
{
float a[3];
osg::Vec3f vec;
for(size_t i = 0;i < 3;i++)
a[i] = getFloat();
return Ogre::Vector3(a);
vec._v[i] = getFloat();
return vec;
}
Ogre::Vector4 NIFStream::getVector4()
osg::Vec4f NIFStream::getVector4()
{
float a[4];
osg::Vec4f vec;
for(size_t i = 0;i < 4;i++)
a[i] = getFloat();
return Ogre::Vector4(a);
vec._v[i] = getFloat();
return vec;
}
Ogre::Matrix3 NIFStream::getMatrix3()
Matrix3 NIFStream::getMatrix3()
{
Ogre::Real a[3][3];
Matrix3 mat;
for(size_t i = 0;i < 3;i++)
{
for(size_t j = 0;j < 3;j++)
a[i][j] = Ogre::Real(getFloat());
mat.mValues[i][j] = getFloat();
}
return Ogre::Matrix3(a);
return mat;
}
Ogre::Quaternion NIFStream::getQuaternion()
osg::Quat NIFStream::getQuaternion()
{
float a[4];
for(size_t i = 0;i < 4;i++)
a[i] = getFloat();
return Ogre::Quaternion(a);
osg::Quat quat;
quat.w() = getFloat();
quat.x() = getFloat();
quat.y() = getFloat();
quat.z() = getFloat();
return quat;
}
Transformation NIFStream::getTrafo()
{
@ -83,16 +85,9 @@ Transformation NIFStream::getTrafo()
std::string NIFStream::getString(size_t length)
{
//Make sure we're not reading in too large of a string
unsigned int fileSize = inp->size();
if(fileSize != 0 && fileSize < length)
file->fail("Attempted to read a string with " + Ogre::StringConverter::toString(length) + " characters , but file is only "+Ogre::StringConverter::toString(fileSize)+ " bytes!");
std::vector<char> str (length+1, 0);
if(inp->read(&str[0], length) != length)
throw std::runtime_error (": String length in NIF file "+ file->getFilename() +" does not match! Expected length: "
+ Ogre::StringConverter::toString(length));
inp->read(&str[0], length);
return &str[0];
}
@ -103,7 +98,9 @@ std::string NIFStream::getString()
}
std::string NIFStream::getVersionString()
{
return inp->getLine();
std::string result;
std::getline(*inp, result);
return result;
}
void NIFStream::getShorts(std::vector<short> &vec, size_t size)
@ -118,25 +115,25 @@ void NIFStream::getFloats(std::vector<float> &vec, size_t size)
for(size_t i = 0;i < vec.size();i++)
vec[i] = getFloat();
}
void NIFStream::getVector2s(std::vector<Ogre::Vector2> &vec, size_t size)
void NIFStream::getVector2s(std::vector<osg::Vec2f> &vec, size_t size)
{
vec.resize(size);
for(size_t i = 0;i < vec.size();i++)
vec[i] = getVector2();
}
void NIFStream::getVector3s(std::vector<Ogre::Vector3> &vec, size_t size)
void NIFStream::getVector3s(std::vector<osg::Vec3f> &vec, size_t size)
{
vec.resize(size);
for(size_t i = 0;i < vec.size();i++)
vec[i] = getVector3();
}
void NIFStream::getVector4s(std::vector<Ogre::Vector4> &vec, size_t size)
void NIFStream::getVector4s(std::vector<osg::Vec4f> &vec, size_t size)
{
vec.resize(size);
for(size_t i = 0;i < vec.size();i++)
vec[i] = getVector4();
}
void NIFStream::getQuaternions(std::vector<Ogre::Quaternion> &quat, size_t size)
void NIFStream::getQuaternions(std::vector<osg::Quat> &quat, size_t size)
{
quat.resize(size);
for(size_t i = 0;i < quat.size();i++)

@ -5,14 +5,13 @@
#include <stdint.h>
#include <stdexcept>
#include <vector>
#include <OgreDataStream.h>
#include <OgreVector2.h>
#include <OgreVector3.h>
#include <OgreVector4.h>
#include <OgreMatrix3.h>
#include <OgreQuaternion.h>
#include <OgreStringConverter.h>
#include <components/files/constrainedfilestream.hpp>
#include <osg/Vec3f>
#include <osg/Vec4f>
#include <osg/Quat>
#include "niftypes.hpp"
@ -24,7 +23,7 @@ class NIFFile;
class NIFStream {
/// Input stream
Ogre::DataStreamPtr inp;
Files::IStreamPtr inp;
uint8_t read_byte();
uint16_t read_le16();
@ -35,9 +34,9 @@ public:
NIFFile * const file;
NIFStream (NIFFile * file, Ogre::DataStreamPtr inp): file (file), inp (inp) {}
NIFStream (NIFFile * file, Files::IStreamPtr inp): file (file), inp (inp) {}
void skip(size_t size) { inp->skip(size); }
void skip(size_t size) { inp->ignore(size); }
char getChar() { return read_byte(); }
short getShort() { return read_le16(); }
@ -46,11 +45,11 @@ public:
unsigned int getUInt() { return read_le32(); }
float getFloat() { return read_le32f(); }
Ogre::Vector2 getVector2();
Ogre::Vector3 getVector3();
Ogre::Vector4 getVector4();
Ogre::Matrix3 getMatrix3();
Ogre::Quaternion getQuaternion();
osg::Vec2f getVector2();
osg::Vec3f getVector3();
osg::Vec4f getVector4();
Matrix3 getMatrix3();
osg::Quat getQuaternion();
Transformation getTrafo();
///Read in a string of the given length
@ -62,10 +61,10 @@ public:
void getShorts(std::vector<short> &vec, size_t size);
void getFloats(std::vector<float> &vec, size_t size);
void getVector2s(std::vector<Ogre::Vector2> &vec, size_t size);
void getVector3s(std::vector<Ogre::Vector3> &vec, size_t size);
void getVector4s(std::vector<Ogre::Vector4> &vec, size_t size);
void getQuaternions(std::vector<Ogre::Quaternion> &quat, size_t size);
void getVector2s(std::vector<osg::Vec2f> &vec, size_t size);
void getVector3s(std::vector<osg::Vec3f> &vec, size_t size);
void getVector4s(std::vector<osg::Vec4f> &vec, size_t size);
void getQuaternions(std::vector<osg::Quat> &quat, size_t size);
};
}

@ -24,24 +24,35 @@
#ifndef OPENMW_COMPONENTS_NIF_NIFTYPES_HPP
#define OPENMW_COMPONENTS_NIF_NIFTYPES_HPP
#include <OgreVector3.h>
#include <OgreMatrix3.h>
#include <osg/Vec3f>
// Common types used in NIF files
namespace Nif
{
struct Matrix3
{
float mValues[3][3];
Matrix3()
{
for (int i=0;i<3;++i)
for (int j=0;j<3;++j)
mValues[i][j] = 0;
}
};
struct Transformation
{
Ogre::Vector3 pos;
Ogre::Matrix3 rotation;
osg::Vec3f pos;
Matrix3 rotation;
float scale;
static const Transformation& getIdentity()
{
static const Transformation identity = {
Ogre::Vector3::ZERO, Ogre::Matrix3::IDENTITY, 1.0f
osg::Vec3f(), Matrix3(), 1.0f
};
return identity;
}

@ -1,60 +1,2 @@
#include "node.hpp"
namespace Nif
{
void Node::getProperties(const Nif::NiTexturingProperty *&texprop,
const Nif::NiMaterialProperty *&matprop,
const Nif::NiAlphaProperty *&alphaprop,
const Nif::NiVertexColorProperty *&vertprop,
const Nif::NiZBufferProperty *&zprop,
const Nif::NiSpecularProperty *&specprop,
const Nif::NiWireframeProperty *&wireprop,
const Nif::NiStencilProperty *&stencilprop) const
{
if(parent)
parent->getProperties(texprop, matprop, alphaprop, vertprop, zprop, specprop, wireprop, stencilprop);
for(size_t i = 0;i < props.length();i++)
{
// Entries may be empty
if(props[i].empty())
continue;
const Nif::Property *pr = props[i].getPtr();
if(pr->recType == Nif::RC_NiTexturingProperty)
texprop = static_cast<const Nif::NiTexturingProperty*>(pr);
else if(pr->recType == Nif::RC_NiMaterialProperty)
matprop = static_cast<const Nif::NiMaterialProperty*>(pr);
else if(pr->recType == Nif::RC_NiAlphaProperty)
alphaprop = static_cast<const Nif::NiAlphaProperty*>(pr);
else if(pr->recType == Nif::RC_NiVertexColorProperty)
vertprop = static_cast<const Nif::NiVertexColorProperty*>(pr);
else if(pr->recType == Nif::RC_NiZBufferProperty)
zprop = static_cast<const Nif::NiZBufferProperty*>(pr);
else if(pr->recType == Nif::RC_NiSpecularProperty)
specprop = static_cast<const Nif::NiSpecularProperty*>(pr);
else if(pr->recType == Nif::RC_NiWireframeProperty)
wireprop = static_cast<const Nif::NiWireframeProperty*>(pr);
else if (pr->recType == Nif::RC_NiStencilProperty)
stencilprop = static_cast<const Nif::NiStencilProperty*>(pr);
else
std::cerr<< "Unhandled property type: "<<pr->recName <<std::endl;
}
}
Ogre::Matrix4 Node::getLocalTransform() const
{
Ogre::Matrix4 mat4 = Ogre::Matrix4(Ogre::Matrix4::IDENTITY);
mat4.makeTransform(trafo.pos, Ogre::Vector3(trafo.scale), Ogre::Quaternion(trafo.rotation));
return mat4;
}
Ogre::Matrix4 Node::getWorldTransform() const
{
if(parent != NULL)
return parent->getWorldTransform() * getLocalTransform();
return getLocalTransform();
}
}

@ -1,8 +1,6 @@
#ifndef OPENMW_COMPONENTS_NIF_NODE_HPP
#define OPENMW_COMPONENTS_NIF_NODE_HPP
#include <OgreMatrix4.h>
#include "controlled.hpp"
#include "extra.hpp"
#include "data.hpp"
@ -26,14 +24,14 @@ public:
// Node flags. Interpretation depends somewhat on the type of node.
int flags;
Transformation trafo;
Ogre::Vector3 velocity; // Unused? Might be a run-time game state
osg::Vec3f velocity; // Unused? Might be a run-time game state
PropertyList props;
// Bounding box info
bool hasBounds;
Ogre::Vector3 boundPos;
Ogre::Matrix3 boundRot;
Ogre::Vector3 boundXYZ; // Box size
osg::Vec3f boundPos;
Matrix3 boundRot;
osg::Vec3f boundXYZ; // Box size
void read(NIFStream *nif)
{
@ -91,18 +89,6 @@ public:
boneTrafo = &bi.trafo;
boneIndex = ind;
}
void getProperties(const Nif::NiTexturingProperty *&texprop,
const Nif::NiMaterialProperty *&matprop,
const Nif::NiAlphaProperty *&alphaprop,
const Nif::NiVertexColorProperty *&vertprop,
const Nif::NiZBufferProperty *&zprop,
const Nif::NiSpecularProperty *&specprop,
const Nif::NiWireframeProperty *&wireprop,
const Nif::NiStencilProperty *&stencilprop) const;
Ogre::Matrix4 getLocalTransform() const;
Ogre::Matrix4 getWorldTransform() const;
};
struct NiNode : Node

@ -159,7 +159,7 @@ class NiFogProperty : public Property
{
public:
float mFogDepth;
Ogre::Vector3 mColour;
osg::Vec3f mColour;
void read(NIFStream *nif)
@ -194,7 +194,7 @@ struct StructPropT : Property
struct S_MaterialProperty
{
// The vector components are R,G,B
Ogre::Vector3 ambient, diffuse, specular, emissive;
osg::Vec3f ambient, diffuse, specular, emissive;
float glossiness, alpha;
void read(NIFStream *nif)
@ -265,14 +265,6 @@ struct S_AlphaProperty
Taken from:
http://niftools.sourceforge.net/doc/nif/NiAlphaProperty.html
Right now we only use standard alpha blending (see the Ogre code
that sets it up) and it appears that this is the only blending
used in the original game. Bloodmoon (along with several mods) do
however use other settings, such as discarding pixel values with
alpha < 1.0. This is faster because we don't have to mess with the
depth stuff like we did for blending. And OGRE has settings for
this too.
*/
// Tested against when certain flags are set (see above.)

Loading…
Cancel
Save