xoreos  0.0.5
Classes | Namespaces | Typedefs | Functions | Variables
model_nwn.cpp File Reference

Loading MDL files found in Neverwinter Nights. More...

#include <cassert>
#include <boost/unordered_set.hpp>
#include "glm/glm.hpp"
#include "src/common/system.h"
#include "src/common/error.h"
#include "src/common/maths.h"
#include "src/common/debug.h"
#include "src/common/readstream.h"
#include "src/common/strutil.h"
#include "src/common/encoding.h"
#include "src/common/streamtokenizer.h"
#include "src/aurora/types.h"
#include "src/aurora/resman.h"
#include "src/graphics/aurora/model_nwn.h"
#include "src/graphics/aurora/animation.h"
#include "src/graphics/aurora/animnode.h"
#include "src/graphics/aurora/animationchannel.h"
#include "src/graphics/shader/materialman.h"
#include "src/graphics/shader/surfaceman.h"
Include dependency graph for model_nwn.cpp:

Go to the source code of this file.

Classes

struct  Graphics::Aurora::DefaultAnim
 
struct  Graphics::Aurora::Face
 
struct  Graphics::Aurora::FaceVert
 

Namespaces

 Graphics
 
 Graphics::Aurora
 

Typedefs

typedef glm::vec3 Graphics::Aurora::Vec3
 

Functions

static bool Graphics::Aurora::fuzzyEqual (const float *a, const float *b)
 
bool Graphics::Aurora::operator== (const FaceVert &a, const FaceVert &b)
 
std::size_t Graphics::Aurora::hash_value (const FaceVert &b)
 

Variables

static const int kNodeFlagHasHeader = 0x00000001
 
static const int kNodeFlagHasLight = 0x00000002
 
static const int kNodeFlagHasEmitter = 0x00000004
 
static const int kNodeFlagHasReference = 0x00000010
 
static const int kNodeFlagHasMesh = 0x00000020
 
static const int kNodeFlagHasSkin = 0x00000040
 
static const int kNodeFlagHasAnim = 0x00000080
 
static const int kNodeFlagHasDangly = 0x00000100
 
static const int kNodeFlagHasAABB = 0x00000200
 
static const uint16 kControllerTypePosition = 8
 
static const uint16 kControllerTypeOrientation = 20
 
static const uint16 kControllerTypeScale = 36
 
static const uint16 kControllerTypeColor = 76
 
static const uint16 kControllerTypeRadius = 88
 
static const uint16 kControllerTypeShadowRadius = 96
 
static const uint16 kControllerTypeVerticalDisplacement = 100
 
static const uint16 kControllerTypeMultiplier = 140
 
static const uint16 kControllerTypeAlphaEnd = 80
 
static const uint16 kControllerTypeAlphaStart = 84
 
static const uint16 kControllerTypeBirthRate = 88
 
static const uint16 kControllerTypeBounce_Co = 92
 
static const uint16 kControllerTypeColorEnd = 96
 
static const uint16 kControllerTypeColorStart = 108
 
static const uint16 kControllerTypeCombineTime = 120
 
static const uint16 kControllerTypeDrag = 124
 
static const uint16 kControllerTypeFPS = 128
 
static const uint16 kControllerTypeFrameEnd = 132
 
static const uint16 kControllerTypeFrameStart = 136
 
static const uint16 kControllerTypeGrav = 140
 
static const uint16 kControllerTypeLifeExp = 144
 
static const uint16 kControllerTypeMass = 148
 
static const uint16 kControllerTypeP2P_Bezier2 = 152
 
static const uint16 kControllerTypeP2P_Bezier3 = 156
 
static const uint16 kControllerTypeParticleRot = 160
 
static const uint16 kControllerTypeRandVel = 164
 
static const uint16 kControllerTypeSizeStart = 168
 
static const uint16 kControllerTypeSizeEnd = 172
 
static const uint16 kControllerTypeSizeStart_Y = 176
 
static const uint16 kControllerTypeSizeEnd_Y = 180
 
static const uint16 kControllerTypeSpread = 184
 
static const uint16 kControllerTypeThreshold = 188
 
static const uint16 kControllerTypeVelocity = 192
 
static const uint16 kControllerTypeXSize = 196
 
static const uint16 kControllerTypeYSize = 200
 
static const uint16 kControllerTypeBlurLength = 204
 
static const uint16 kControllerTypeLightningDelay = 208
 
static const uint16 kControllerTypeLightningRadius = 212
 
static const uint16 kControllerTypeLightningScale = 216
 
static const uint16 kControllerTypeDetonate = 228
 
static const uint16 kControllerTypeAlphaMid = 464
 
static const uint16 kControllerTypeColorMid = 468
 
static const uint16 kControllerTypePercentStart = 480
 
static const uint16 kControllerTypePercentMid = 481
 
static const uint16 kControllerTypePercentEnd = 482
 
static const uint16 kControllerTypeSizeMid = 484
 
static const uint16 kControllerTypeSizeMid_Y = 488
 
static const uint16 kControllerTypeSelfIllumColor = 100
 
static const uint16 kControllerTypeAlpha = 128
 
static const DefaultAnim Graphics::Aurora::kDefaultAnims []
 

Detailed Description

Loading MDL files found in Neverwinter Nights.

Definition in file model_nwn.cpp.

Variable Documentation

◆ kControllerTypeAlpha

const uint16 kControllerTypeAlpha = 128
static

◆ kControllerTypeAlphaEnd

const uint16 kControllerTypeAlphaEnd = 80
static

Definition at line 80 of file model_nwn.cpp.

◆ kControllerTypeAlphaMid

const uint16 kControllerTypeAlphaMid = 464
static

Definition at line 112 of file model_nwn.cpp.

◆ kControllerTypeAlphaStart

const uint16 kControllerTypeAlphaStart = 84
static

Definition at line 81 of file model_nwn.cpp.

◆ kControllerTypeBirthRate

const uint16 kControllerTypeBirthRate = 88
static

Definition at line 82 of file model_nwn.cpp.

◆ kControllerTypeBlurLength

const uint16 kControllerTypeBlurLength = 204
static

Definition at line 107 of file model_nwn.cpp.

◆ kControllerTypeBounce_Co

const uint16 kControllerTypeBounce_Co = 92
static

Definition at line 83 of file model_nwn.cpp.

◆ kControllerTypeColor

const uint16 kControllerTypeColor = 76
static

Definition at line 75 of file model_nwn.cpp.

◆ kControllerTypeColorEnd

const uint16 kControllerTypeColorEnd = 96
static

Definition at line 84 of file model_nwn.cpp.

◆ kControllerTypeColorMid

const uint16 kControllerTypeColorMid = 468
static

Definition at line 113 of file model_nwn.cpp.

◆ kControllerTypeColorStart

const uint16 kControllerTypeColorStart = 108
static

Definition at line 85 of file model_nwn.cpp.

◆ kControllerTypeCombineTime

const uint16 kControllerTypeCombineTime = 120
static

Definition at line 86 of file model_nwn.cpp.

◆ kControllerTypeDetonate

const uint16 kControllerTypeDetonate = 228
static

Definition at line 111 of file model_nwn.cpp.

◆ kControllerTypeDrag

const uint16 kControllerTypeDrag = 124
static

Definition at line 87 of file model_nwn.cpp.

◆ kControllerTypeFPS

const uint16 kControllerTypeFPS = 128
static

Definition at line 88 of file model_nwn.cpp.

◆ kControllerTypeFrameEnd

const uint16 kControllerTypeFrameEnd = 132
static

Definition at line 89 of file model_nwn.cpp.

◆ kControllerTypeFrameStart

const uint16 kControllerTypeFrameStart = 136
static

Definition at line 90 of file model_nwn.cpp.

◆ kControllerTypeGrav

const uint16 kControllerTypeGrav = 140
static

Definition at line 91 of file model_nwn.cpp.

◆ kControllerTypeLifeExp

const uint16 kControllerTypeLifeExp = 144
static

Definition at line 92 of file model_nwn.cpp.

◆ kControllerTypeLightningDelay

const uint16 kControllerTypeLightningDelay = 208
static

Definition at line 108 of file model_nwn.cpp.

◆ kControllerTypeLightningRadius

const uint16 kControllerTypeLightningRadius = 212
static

Definition at line 109 of file model_nwn.cpp.

◆ kControllerTypeLightningScale

const uint16 kControllerTypeLightningScale = 216
static

Definition at line 110 of file model_nwn.cpp.

◆ kControllerTypeMass

const uint16 kControllerTypeMass = 148
static

Definition at line 93 of file model_nwn.cpp.

◆ kControllerTypeMultiplier

const uint16 kControllerTypeMultiplier = 140
static

Definition at line 79 of file model_nwn.cpp.

◆ kControllerTypeOrientation

const uint16 kControllerTypeOrientation = 20
static

◆ kControllerTypeP2P_Bezier2

const uint16 kControllerTypeP2P_Bezier2 = 152
static

Definition at line 94 of file model_nwn.cpp.

◆ kControllerTypeP2P_Bezier3

const uint16 kControllerTypeP2P_Bezier3 = 156
static

Definition at line 95 of file model_nwn.cpp.

◆ kControllerTypeParticleRot

const uint16 kControllerTypeParticleRot = 160
static

Definition at line 96 of file model_nwn.cpp.

◆ kControllerTypePercentEnd

const uint16 kControllerTypePercentEnd = 482
static

Definition at line 116 of file model_nwn.cpp.

◆ kControllerTypePercentMid

const uint16 kControllerTypePercentMid = 481
static

Definition at line 115 of file model_nwn.cpp.

◆ kControllerTypePercentStart

const uint16 kControllerTypePercentStart = 480
static

Definition at line 114 of file model_nwn.cpp.

◆ kControllerTypePosition

const uint16 kControllerTypePosition = 8
static

◆ kControllerTypeRadius

const uint16 kControllerTypeRadius = 88
static

Definition at line 76 of file model_nwn.cpp.

◆ kControllerTypeRandVel

const uint16 kControllerTypeRandVel = 164
static

Definition at line 97 of file model_nwn.cpp.

◆ kControllerTypeScale

const uint16 kControllerTypeScale = 36
static

Definition at line 74 of file model_nwn.cpp.

◆ kControllerTypeSelfIllumColor

const uint16 kControllerTypeSelfIllumColor = 100
static

Definition at line 119 of file model_nwn.cpp.

◆ kControllerTypeShadowRadius

const uint16 kControllerTypeShadowRadius = 96
static

Definition at line 77 of file model_nwn.cpp.

◆ kControllerTypeSizeEnd

const uint16 kControllerTypeSizeEnd = 172
static

Definition at line 99 of file model_nwn.cpp.

◆ kControllerTypeSizeEnd_Y

const uint16 kControllerTypeSizeEnd_Y = 180
static

Definition at line 101 of file model_nwn.cpp.

◆ kControllerTypeSizeMid

const uint16 kControllerTypeSizeMid = 484
static

Definition at line 117 of file model_nwn.cpp.

◆ kControllerTypeSizeMid_Y

const uint16 kControllerTypeSizeMid_Y = 488
static

Definition at line 118 of file model_nwn.cpp.

◆ kControllerTypeSizeStart

const uint16 kControllerTypeSizeStart = 168
static

Definition at line 98 of file model_nwn.cpp.

◆ kControllerTypeSizeStart_Y

const uint16 kControllerTypeSizeStart_Y = 176
static

Definition at line 100 of file model_nwn.cpp.

◆ kControllerTypeSpread

const uint16 kControllerTypeSpread = 184
static

Definition at line 102 of file model_nwn.cpp.

◆ kControllerTypeThreshold

const uint16 kControllerTypeThreshold = 188
static

Definition at line 103 of file model_nwn.cpp.

◆ kControllerTypeVelocity

const uint16 kControllerTypeVelocity = 192
static

Definition at line 104 of file model_nwn.cpp.

◆ kControllerTypeVerticalDisplacement

const uint16 kControllerTypeVerticalDisplacement = 100
static

Definition at line 78 of file model_nwn.cpp.

◆ kControllerTypeXSize

const uint16 kControllerTypeXSize = 196
static

Definition at line 105 of file model_nwn.cpp.

◆ kControllerTypeYSize

const uint16 kControllerTypeYSize = 200
static

Definition at line 106 of file model_nwn.cpp.

◆ kNodeFlagHasAABB

const int kNodeFlagHasAABB = 0x00000200
static

Definition at line 70 of file model_nwn.cpp.

Referenced by Graphics::Aurora::ModelNode_NWN_Binary::load().

◆ kNodeFlagHasAnim

const int kNodeFlagHasAnim = 0x00000080
static

Definition at line 68 of file model_nwn.cpp.

Referenced by Graphics::Aurora::ModelNode_NWN_Binary::load().

◆ kNodeFlagHasDangly

const int kNodeFlagHasDangly = 0x00000100
static

Definition at line 69 of file model_nwn.cpp.

Referenced by Graphics::Aurora::ModelNode_NWN_Binary::load().

◆ kNodeFlagHasEmitter

const int kNodeFlagHasEmitter = 0x00000004
static

Definition at line 64 of file model_nwn.cpp.

Referenced by Graphics::Aurora::ModelNode_NWN_Binary::load().

◆ kNodeFlagHasHeader

const int kNodeFlagHasHeader = 0x00000001
static

Definition at line 62 of file model_nwn.cpp.

◆ kNodeFlagHasLight

const int kNodeFlagHasLight = 0x00000002
static

Definition at line 63 of file model_nwn.cpp.

Referenced by Graphics::Aurora::ModelNode_NWN_Binary::load().

◆ kNodeFlagHasMesh

const int kNodeFlagHasMesh = 0x00000020
static

Definition at line 66 of file model_nwn.cpp.

Referenced by Graphics::Aurora::ModelNode_NWN_Binary::load().

◆ kNodeFlagHasReference

const int kNodeFlagHasReference = 0x00000010
static

Definition at line 65 of file model_nwn.cpp.

Referenced by Graphics::Aurora::ModelNode_NWN_Binary::load().

◆ kNodeFlagHasSkin

const int kNodeFlagHasSkin = 0x00000040
static

Definition at line 67 of file model_nwn.cpp.

Referenced by Graphics::Aurora::ModelNode_NWN_Binary::load().