Merge branch 'master' into add_fuzzer_target

pull/3211/head
Kim Kulling 2020-05-07 14:59:55 +02:00 committed by GitHub
commit 906720ee93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 916 additions and 19534 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,114 +0,0 @@
/*
---------------------------------------------------------------------------
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the following
conditions are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other
materials provided with the distribution.
* Neither the name of the assimp team, nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---------------------------------------------------------------------------
*/
#ifndef ASSIMP_BUILD_NO_STEP_IMPORTER
#include "StepFileImporter.h"
#include "../../Importer/STEPParser/STEPFileReader.h"
#include <assimp/importerdesc.h>
#include <assimp/DefaultIOSystem.h>
namespace Assimp {
namespace StepFile {
using namespace STEP;
static const aiImporterDesc desc = { "StepFile Importer",
"",
"",
"",
0,
0,
0,
0,
0,
"stp" };
StepFileImporter::StepFileImporter()
: BaseImporter() {
}
StepFileImporter::~StepFileImporter() {
}
bool StepFileImporter::CanRead(const std::string& file, IOSystem* pIOHandler, bool checkSig) const {
const std::string &extension = GetExtension(file);
if ( extension == "stp" || extension == "step" ) {
return true;
} else if ((!extension.length() || checkSig) && pIOHandler) {
const char* tokens[] = { "ISO-10303-21" };
const bool found(SearchFileHeaderForToken(pIOHandler, file, tokens, 1));
return found;
}
return false;
}
const aiImporterDesc *StepFileImporter::GetInfo() const {
return &desc;
}
static const std::string mode = "rb";
static const std::string StepFileSchema = "CONFIG_CONTROL_DESIGN";
void StepFileImporter::InternReadFile(const std::string &file, aiScene*, IOSystem* pIOHandler) {
// Read file into memory
std::shared_ptr<IOStream> fileStream(pIOHandler->Open(file, mode));
if (!fileStream.get()) {
throw DeadlyImportError("Failed to open file " + file + ".");
}
std::unique_ptr<STEP::DB> db(STEP::ReadFileHeader(fileStream));
const STEP::HeaderInfo& head = static_cast<const STEP::DB&>(*db).GetHeader();
if (!head.fileSchema.size() || head.fileSchema != StepFileSchema) {
DeadlyImportError("Unrecognized file schema: " + head.fileSchema);
}
}
} // Namespace StepFile
} // Namespace Assimp
#endif // ASSIMP_BUILD_NO_STEP_IMPORTER

View File

@ -1,69 +0,0 @@
/*
---------------------------------------------------------------------------
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
with or without modification, are permitted provided that the following
conditions are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other
materials provided with the distribution.
* Neither the name of the assimp team, nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior
written permission of the assimp team.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---------------------------------------------------------------------------
*/
#pragma once
#ifndef ASSIMP_BUILD_NO_STEP_IMPORTER
#include <assimp/BaseImporter.h>
namespace Assimp {
namespace StepFile {
class StepFileImporter : public BaseImporter {
public:
StepFileImporter();
~StepFileImporter();
bool CanRead(const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const override;
const aiImporterDesc* GetInfo() const override;
protected:
void InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler ) override;
private:
};
} // Namespace StepFile
} // Namespace Assimp
#endif // ASSIMP_BUILD_NO_STEP_IMPORTER

File diff suppressed because it is too large Load Diff

View File

@ -47,8 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace Assimp {
CIOStreamWrapper::~CIOStreamWrapper(void)
{
CIOStreamWrapper::~CIOStreamWrapper(void) {
/* Various places depend on this destructor to close the file */
if (mFile) {
mIO->mFileSystem->CloseProc(mIO->mFileSystem, mFile);
@ -57,28 +56,25 @@ CIOStreamWrapper::~CIOStreamWrapper(void)
}
// ...................................................................
size_t CIOStreamWrapper::Read(void* pvBuffer,
size_t CIOStreamWrapper::Read(void *pvBuffer,
size_t pSize,
size_t pCount
){
size_t pCount) {
// need to typecast here as C has no void*
return mFile->ReadProc(mFile,(char*)pvBuffer,pSize,pCount);
return mFile->ReadProc(mFile, (char *)pvBuffer, pSize, pCount);
}
// ...................................................................
size_t CIOStreamWrapper::Write(const void* pvBuffer,
size_t CIOStreamWrapper::Write(const void *pvBuffer,
size_t pSize,
size_t pCount
){
size_t pCount) {
// need to typecast here as C has no void*
return mFile->WriteProc(mFile,(const char*)pvBuffer,pSize,pCount);
return mFile->WriteProc(mFile, (const char *)pvBuffer, pSize, pCount);
}
// ...................................................................
aiReturn CIOStreamWrapper::Seek(size_t pOffset,
aiOrigin pOrigin
){
return mFile->SeekProc(mFile,pOffset,pOrigin);
aiOrigin pOrigin) {
return mFile->SeekProc(mFile, pOffset, pOrigin);
}
// ...................................................................
@ -92,16 +88,16 @@ size_t CIOStreamWrapper::FileSize() const {
}
// ...................................................................
void CIOStreamWrapper::Flush () {
void CIOStreamWrapper::Flush() {
return mFile->FlushProc(mFile);
}
// ------------------------------------------------------------------------------------------------
// Custom IOStream implementation for the C-API
bool CIOSystemWrapper::Exists( const char* pFile) const {
aiFile* p = mFileSystem->OpenProc(mFileSystem,pFile,"rb");
if (p){
mFileSystem->CloseProc(mFileSystem,p);
bool CIOSystemWrapper::Exists(const char *pFile) const {
aiFile *p = mFileSystem->OpenProc(mFileSystem, pFile, "rb");
if (p) {
mFileSystem->CloseProc(mFileSystem, p);
return true;
}
return false;
@ -117,8 +113,8 @@ char CIOSystemWrapper::getOsSeparator() const {
}
// ...................................................................
IOStream* CIOSystemWrapper::Open(const char* pFile,const char* pMode) {
aiFile* p = mFileSystem->OpenProc(mFileSystem,pFile,pMode);
IOStream *CIOSystemWrapper::Open(const char *pFile, const char *pMode) {
aiFile *p = mFileSystem->OpenProc(mFileSystem, pFile, pMode);
if (!p) {
return NULL;
}
@ -126,11 +122,11 @@ IOStream* CIOSystemWrapper::Open(const char* pFile,const char* pMode) {
}
// ...................................................................
void CIOSystemWrapper::Close( IOStream* pFile) {
void CIOSystemWrapper::Close(IOStream *pFile) {
if (!pFile) {
return;
}
delete pFile;
}
}
} // namespace Assimp

View File

@ -5,8 +5,6 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2020, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
@ -56,44 +54,41 @@ class CIOSystemWrapper;
// ------------------------------------------------------------------------------------------------
// Custom IOStream implementation for the C-API
class CIOStreamWrapper : public IOStream
{
class CIOStreamWrapper : public IOStream {
public:
explicit CIOStreamWrapper(aiFile* pFile, CIOSystemWrapper* io)
: mFile(pFile),
mIO(io)
{}
explicit CIOStreamWrapper(aiFile *pFile, CIOSystemWrapper *io) :
mFile(pFile),
mIO(io) {}
~CIOStreamWrapper(void);
size_t Read(void* pvBuffer, size_t pSize, size_t pCount);
size_t Write(const void* pvBuffer, size_t pSize, size_t pCount);
size_t Read(void *pvBuffer, size_t pSize, size_t pCount);
size_t Write(const void *pvBuffer, size_t pSize, size_t pCount);
aiReturn Seek(size_t pOffset, aiOrigin pOrigin);
size_t Tell(void) const;
size_t FileSize() const;
void Flush();
private:
aiFile* mFile;
CIOSystemWrapper* mIO;
aiFile *mFile;
CIOSystemWrapper *mIO;
};
class CIOSystemWrapper : public IOSystem
{
class CIOSystemWrapper : public IOSystem {
friend class CIOStreamWrapper;
public:
explicit CIOSystemWrapper(aiFileIO* pFile)
: mFileSystem(pFile)
{}
bool Exists( const char* pFile) const;
public:
explicit CIOSystemWrapper(aiFileIO *pFile) :
mFileSystem(pFile) {}
bool Exists(const char *pFile) const;
char getOsSeparator() const;
IOStream* Open(const char* pFile,const char* pMode = "rb");
void Close( IOStream* pFile);
IOStream *Open(const char *pFile, const char *pMode = "rb");
void Close(IOStream *pFile);
private:
aiFileIO* mFileSystem;
aiFileIO *mFileSystem;
};
}
} // namespace Assimp
#endif

View File

@ -47,10 +47,11 @@ using namespace AssimpView;
// ------------------------------------------------------------------------------------------------
// Constructor on a given animation.
AnimEvaluator::AnimEvaluator( const aiAnimation *pAnim )
: mAnim(pAnim)
, mLastTime(0.0) {
mLastPositions.resize( pAnim->mNumChannels, std::make_tuple( 0, 0, 0));
AnimEvaluator::AnimEvaluator(const aiAnimation *pAnim) :
mAnim(pAnim),
mLastTime(0.0) {
ai_assert(nullptr != pAnim);
mLastPositions.resize(pAnim->mNumChannels, std::make_tuple(0, 0, 0));
}
// ------------------------------------------------------------------------------------------------
@ -61,7 +62,7 @@ AnimEvaluator::~AnimEvaluator() {
// ------------------------------------------------------------------------------------------------
// Evaluates the animation tracks for a given time stamp.
void AnimEvaluator::Evaluate( double pTime ) {
void AnimEvaluator::Evaluate(double pTime) {
// extract ticks per second. Assume default value if not given
double ticksPerSecond = mAnim->mTicksPerSecond != 0.0 ? mAnim->mTicksPerSecond : 25.0;
// every following time calculation happens in ticks
@ -78,16 +79,16 @@ void AnimEvaluator::Evaluate( double pTime ) {
}
// calculate the transformations for each animation channel
for( unsigned int a = 0; a < mAnim->mNumChannels; ++a ) {
const aiNodeAnim* channel = mAnim->mChannels[a];
for (unsigned int a = 0; a < mAnim->mNumChannels; ++a) {
const aiNodeAnim *channel = mAnim->mChannels[a];
// ******** Position *****
aiVector3D presentPosition( 0, 0, 0);
if( channel->mNumPositionKeys > 0) {
aiVector3D presentPosition(0, 0, 0);
if (channel->mNumPositionKeys > 0) {
// Look for present frame number. Search from last position if time is after the last time, else from beginning
// Should be much quicker than always looking from start for the average use case.
unsigned int frame = (time >= mLastTime) ? std::get<0>(mLastPositions[a]) : 0;
while( frame < channel->mNumPositionKeys - 1) {
while (frame < channel->mNumPositionKeys - 1) {
if (time < channel->mPositionKeys[frame + 1].mTime) {
break;
}
@ -96,14 +97,14 @@ void AnimEvaluator::Evaluate( double pTime ) {
// interpolate between this frame's value and next frame's value
unsigned int nextFrame = (frame + 1) % channel->mNumPositionKeys;
const aiVectorKey& key = channel->mPositionKeys[frame];
const aiVectorKey& nextKey = channel->mPositionKeys[nextFrame];
const aiVectorKey &key = channel->mPositionKeys[frame];
const aiVectorKey &nextKey = channel->mPositionKeys[nextFrame];
double diffTime = nextKey.mTime - key.mTime;
if (diffTime < 0.0) {
diffTime += mAnim->mDuration;
}
if( diffTime > 0) {
float factor = float( (time - key.mTime) / diffTime);
if (diffTime > 0) {
float factor = float((time - key.mTime) / diffTime);
presentPosition = key.mValue + (nextKey.mValue - key.mValue) * factor;
} else {
presentPosition = key.mValue;
@ -113,10 +114,10 @@ void AnimEvaluator::Evaluate( double pTime ) {
}
// ******** Rotation *********
aiQuaternion presentRotation( 1, 0, 0, 0);
if( channel->mNumRotationKeys > 0) {
aiQuaternion presentRotation(1, 0, 0, 0);
if (channel->mNumRotationKeys > 0) {
unsigned int frame = (time >= mLastTime) ? std::get<1>(mLastPositions[a]) : 0;
while( frame < channel->mNumRotationKeys - 1) {
while (frame < channel->mNumRotationKeys - 1) {
if (time < channel->mRotationKeys[frame + 1].mTime) {
break;
}
@ -125,15 +126,15 @@ void AnimEvaluator::Evaluate( double pTime ) {
// interpolate between this frame's value and next frame's value
unsigned int nextFrame = (frame + 1) % channel->mNumRotationKeys;
const aiQuatKey& key = channel->mRotationKeys[frame];
const aiQuatKey& nextKey = channel->mRotationKeys[nextFrame];
const aiQuatKey &key = channel->mRotationKeys[frame];
const aiQuatKey &nextKey = channel->mRotationKeys[nextFrame];
double diffTime = nextKey.mTime - key.mTime;
if (diffTime < 0.0) {
diffTime += mAnim->mDuration;
}
if( diffTime > 0) {
float factor = float( (time - key.mTime) / diffTime);
aiQuaternion::Interpolate( presentRotation, key.mValue, nextKey.mValue, factor);
if (diffTime > 0) {
float factor = float((time - key.mTime) / diffTime);
aiQuaternion::Interpolate(presentRotation, key.mValue, nextKey.mValue, factor);
} else {
presentRotation = key.mValue;
}
@ -142,10 +143,10 @@ void AnimEvaluator::Evaluate( double pTime ) {
}
// ******** Scaling **********
aiVector3D presentScaling( 1, 1, 1);
if( channel->mNumScalingKeys > 0) {
aiVector3D presentScaling(1, 1, 1);
if (channel->mNumScalingKeys > 0) {
unsigned int frame = (time >= mLastTime) ? std::get<2>(mLastPositions[a]) : 0;
while( frame < channel->mNumScalingKeys - 1) {
while (frame < channel->mNumScalingKeys - 1) {
if (time < channel->mScalingKeys[frame + 1].mTime) {
break;
}
@ -158,12 +159,20 @@ void AnimEvaluator::Evaluate( double pTime ) {
}
// build a transformation matrix from it
aiMatrix4x4& mat = mTransforms[a];
mat = aiMatrix4x4( presentRotation.GetMatrix());
mat.a1 *= presentScaling.x; mat.b1 *= presentScaling.x; mat.c1 *= presentScaling.x;
mat.a2 *= presentScaling.y; mat.b2 *= presentScaling.y; mat.c2 *= presentScaling.y;
mat.a3 *= presentScaling.z; mat.b3 *= presentScaling.z; mat.c3 *= presentScaling.z;
mat.a4 = presentPosition.x; mat.b4 = presentPosition.y; mat.c4 = presentPosition.z;
aiMatrix4x4 &mat = mTransforms[a];
mat = aiMatrix4x4(presentRotation.GetMatrix());
mat.a1 *= presentScaling.x;
mat.b1 *= presentScaling.x;
mat.c1 *= presentScaling.x;
mat.a2 *= presentScaling.y;
mat.b2 *= presentScaling.y;
mat.c2 *= presentScaling.y;
mat.a3 *= presentScaling.z;
mat.b3 *= presentScaling.z;
mat.c3 *= presentScaling.z;
mat.a4 = presentPosition.x;
mat.b4 = presentPosition.y;
mat.c4 = presentPosition.z;
}
mLastTime = time;

View File

@ -58,7 +58,7 @@ public:
/// the object.
/// @param pAnim The animation to calculate poses for. Ownership of the animation object stays
/// at the caller, the evaluator just keeps a reference to it as long as it persists.
AnimEvaluator( const aiAnimation* pAnim);
AnimEvaluator(const aiAnimation *pAnim);
/// @brief The class destructor.
~AnimEvaluator();
@ -68,16 +68,16 @@ public:
* @param pTime The time for which you want to evaluate the animation, in seconds. Will be mapped into the animation cycle, so
* it can be an arbitrary value. Best use with ever-increasing time stamps.
*/
void Evaluate( double pTime);
void Evaluate(double pTime);
/** Returns the transform matrices calculated at the last Evaluate() call. The array matches the mChannels array of
* the aiAnimation. */
const std::vector<aiMatrix4x4>& GetTransformations() const { return mTransforms; }
const std::vector<aiMatrix4x4> &GetTransformations() const { return mTransforms; }
protected:
const aiAnimation* mAnim;
const aiAnimation *mAnim;
double mLastTime;
std::vector<std::tuple<unsigned int, unsigned int, unsigned int> > mLastPositions;
std::vector<std::tuple<unsigned int, unsigned int, unsigned int>> mLastPositions;
std::vector<aiMatrix4x4> mTransforms;
};

View File

@ -39,7 +39,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---------------------------------------------------------------------------
*/
#if (!defined AV_ASSET_HELPER_H_INCLUDED)
#define AV_ASSET_HELPER_H_INCLUDED
@ -51,17 +50,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace AssimpView {
class SceneAnimator;
class SceneAnimator;
//-------------------------------------------------------------------------------
/** \brief Class to wrap ASSIMP's asset output structures
//-------------------------------------------------------------------------------
/** \brief Class to wrap ASSIMP's asset output structures
*/
//-------------------------------------------------------------------------------
class AssetHelper
{
public:
enum
{
//-------------------------------------------------------------------------------
class AssetHelper {
public:
enum {
// the original normal set will be used
ORIGINAL = 0x0u,
@ -73,9 +70,8 @@ namespace AssimpView {
};
// default constructor
AssetHelper()
: iNormalSet( ORIGINAL )
{
AssetHelper() :
iNormalSet(ORIGINAL) {
mAnimator = NULL;
apcMeshes = NULL;
pcScene = NULL;
@ -86,8 +82,7 @@ namespace AssimpView {
// (even if tangents, bitangents or normals aren't
// required by the shader they will be committed to the GPU)
//---------------------------------------------------------------
struct Vertex
{
struct Vertex {
aiVector3D vPosition;
aiVector3D vNormal;
@ -96,14 +91,12 @@ namespace AssimpView {
aiVector3D vBitangent;
aiVector2D vTextureUV;
aiVector2D vTextureUV2;
unsigned char mBoneIndices[ 4 ];
unsigned char mBoneWeights[ 4 ]; // last Weight not used, calculated inside the vertex shader
unsigned char mBoneIndices[4];
unsigned char mBoneWeights[4]; // last Weight not used, calculated inside the vertex shader
/** Returns the vertex declaration elements to create a declaration from. */
static D3DVERTEXELEMENT9* GetDeclarationElements()
{
static D3DVERTEXELEMENT9 decl[] =
{
static D3DVERTEXELEMENT9 *GetDeclarationElements() {
static D3DVERTEXELEMENT9 decl[] = {
{ 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 },
{ 0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL, 0 },
{ 0, 24, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0 },
@ -123,14 +116,12 @@ namespace AssimpView {
//---------------------------------------------------------------
// FVF vertex structure used for normals
//---------------------------------------------------------------
struct LineVertex
{
struct LineVertex {
aiVector3D vPosition;
DWORD dColorDiffuse;
// retrieves the FVF code of the vertex type
static DWORD GetFVF()
{
static DWORD GetFVF() {
return D3DFVF_DIFFUSE | D3DFVF_XYZ;
}
};
@ -139,35 +130,30 @@ namespace AssimpView {
// Helper class to store GPU related resources created for
// a given aiMesh
//---------------------------------------------------------------
class MeshHelper
{
class MeshHelper {
public:
MeshHelper()
:
MeshHelper() :
eShadingMode(),
piVB( NULL ),
piIB( NULL ),
piVBNormals( NULL ),
piEffect( NULL ),
bSharedFX( false ),
piDiffuseTexture( NULL ),
piSpecularTexture( NULL ),
piAmbientTexture( NULL ),
piEmissiveTexture( NULL ),
piNormalTexture( NULL ),
piOpacityTexture( NULL ),
piShininessTexture( NULL ),
piLightmapTexture( NULL ),
piVB(NULL),
piIB(NULL),
piVBNormals(NULL),
piEffect(NULL),
bSharedFX(false),
piDiffuseTexture(NULL),
piSpecularTexture(NULL),
piAmbientTexture(NULL),
piEmissiveTexture(NULL),
piNormalTexture(NULL),
piOpacityTexture(NULL),
piShininessTexture(NULL),
piLightmapTexture(NULL),
fOpacity(),
fShininess(),
fSpecularStrength(),
twosided( false ),
pvOriginalNormals( NULL )
{}
twosided(false),
pvOriginalNormals(NULL) {}
~MeshHelper()
{
~MeshHelper() {
// NOTE: This is done in DeleteAssetData()
// TODO: Make this a proper d'tor
}
@ -177,30 +163,30 @@ namespace AssimpView {
aiShadingMode eShadingMode;
// vertex buffer
IDirect3DVertexBuffer9* piVB;
IDirect3DVertexBuffer9 *piVB;
// index buffer. For partially transparent meshes
// created with dynamic usage to be able to update
// the buffer contents quickly
IDirect3DIndexBuffer9* piIB;
IDirect3DIndexBuffer9 *piIB;
// vertex buffer to be used to draw vertex normals
// (vertex normals are generated in every case)
IDirect3DVertexBuffer9* piVBNormals;
IDirect3DVertexBuffer9 *piVBNormals;
// shader to be used
ID3DXEffect* piEffect;
ID3DXEffect *piEffect;
bool bSharedFX;
// material textures
IDirect3DTexture9* piDiffuseTexture;
IDirect3DTexture9* piSpecularTexture;
IDirect3DTexture9* piAmbientTexture;
IDirect3DTexture9* piEmissiveTexture;
IDirect3DTexture9* piNormalTexture;
IDirect3DTexture9* piOpacityTexture;
IDirect3DTexture9* piShininessTexture;
IDirect3DTexture9* piLightmapTexture;
IDirect3DTexture9 *piDiffuseTexture;
IDirect3DTexture9 *piSpecularTexture;
IDirect3DTexture9 *piAmbientTexture;
IDirect3DTexture9 *piEmissiveTexture;
IDirect3DTexture9 *piNormalTexture;
IDirect3DTexture9 *piOpacityTexture;
IDirect3DTexture9 *piShininessTexture;
IDirect3DTexture9 *piLightmapTexture;
// material colors
D3DXVECTOR4 vDiffuseColor;
@ -221,30 +207,30 @@ namespace AssimpView {
bool twosided;
// Stores a pointer to the original normal set of the asset
aiVector3D* pvOriginalNormals;
aiVector3D *pvOriginalNormals;
};
// One instance per aiMesh in the globally loaded asset
MeshHelper** apcMeshes;
MeshHelper **apcMeshes;
// Scene wrapper instance
aiScene* pcScene;
aiScene *pcScene;
// Animation player to animate the scene if necessary
SceneAnimator* mAnimator;
SceneAnimator *mAnimator;
// Specifies the normal set to be used
unsigned int iNormalSet;
// ------------------------------------------------------------------
// set the normal set to be used
void SetNormalSet( unsigned int iSet );
void SetNormalSet(unsigned int iSet);
// ------------------------------------------------------------------
// flip all normal vectors
void FlipNormals();
void FlipNormalsInt();
};
}
};
} // namespace AssimpView
#endif // !! IG

View File

@ -118,8 +118,9 @@ CBackgroundPainter CBackgroundPainter::s_cInstance;
//-------------------------------------------------------------------------------
void CBackgroundPainter::SetColor(D3DCOLOR p_clrNew) {
if (TEXTURE_CUBE == eMode)
if (TEXTURE_CUBE == eMode) {
RemoveSBDeps();
}
clrColor = p_clrNew;
eMode = SIMPLE_COLOR;

View File

@ -45,37 +45,32 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "AssetHelper.h"
namespace AssimpView
{
namespace AssimpView {
//-------------------------------------------------------------------------------
/* Helper class to create, access and destroy materials
//-------------------------------------------------------------------------------
/* Helper class to create, access and destroy materials
*/
//-------------------------------------------------------------------------------
class CMaterialManager
{
private:
//-------------------------------------------------------------------------------
class CMaterialManager {
private:
friend class CDisplay;
// default constructor
CMaterialManager()
: m_iShaderCount( 0 ), sDefaultTexture() {}
CMaterialManager() :
m_iShaderCount(0), sDefaultTexture() {}
~CMaterialManager() {
if( sDefaultTexture ) {
if (sDefaultTexture) {
sDefaultTexture->Release();
}
Reset();
}
public:
public:
//------------------------------------------------------------------
// Singleton accessors
static CMaterialManager s_cInstance;
inline static CMaterialManager& Instance()
{
inline static CMaterialManager &Instance() {
return s_cInstance;
}
@ -83,7 +78,7 @@ namespace AssimpView
// Delete all resources of a given material
//
// Must be called before CreateMaterial() to prevent memory leaking
void DeleteMaterial( AssetHelper::MeshHelper* pcIn );
void DeleteMaterial(AssetHelper::MeshHelper *pcIn);
//------------------------------------------------------------------
// Create the material for a mesh.
@ -91,8 +86,8 @@ namespace AssimpView
// The function checks whether an identical shader is already in use.
// A shader is considered to be identical if it has the same input
// signature and takes the same number of texture channels.
int CreateMaterial( AssetHelper::MeshHelper* pcMesh,
const aiMesh* pcSource );
int CreateMaterial(AssetHelper::MeshHelper *pcMesh,
const aiMesh *pcSource);
//------------------------------------------------------------------
// Setup the material for a given mesh
@ -103,17 +98,17 @@ namespace AssimpView
// vPos Position of the camera
// TODO: Extract camera position from matrix ...
//
int SetupMaterial( AssetHelper::MeshHelper* pcMesh,
const aiMatrix4x4& pcProj,
const aiMatrix4x4& aiMe,
const aiMatrix4x4& pcCam,
const aiVector3D& vPos );
int SetupMaterial(AssetHelper::MeshHelper *pcMesh,
const aiMatrix4x4 &pcProj,
const aiMatrix4x4 &aiMe,
const aiMatrix4x4 &pcCam,
const aiVector3D &vPos);
//------------------------------------------------------------------
// End the material for a given mesh
// Called after mesh rendering is complete
// pcMesh Mesh object
int EndMaterial( AssetHelper::MeshHelper* pcMesh );
int EndMaterial(AssetHelper::MeshHelper *pcMesh);
//------------------------------------------------------------------
// Recreate all specular materials depending on the current
@ -129,59 +124,55 @@ namespace AssimpView
// Handle 8.3 syntax correctly, search the environment of the
// executable and the asset for a texture with a name very similar
// to a given one
int FindValidPath( aiString* p_szString );
int FindValidPath(aiString *p_szString);
//------------------------------------------------------------------
// Load a texture into memory and create a native D3D texture resource
//
// The function tries to find a valid path for a texture
int LoadTexture( IDirect3DTexture9** p_ppiOut, aiString* szPath );
int LoadTexture(IDirect3DTexture9 **p_ppiOut, aiString *szPath);
//------------------------------------------------------------------
// Getter for m_iShaderCount
//
inline unsigned int GetShaderCount()
{
inline unsigned int GetShaderCount() {
return this->m_iShaderCount;
}
//------------------------------------------------------------------
// Reset the state of the class
// Called whenever a new asset is loaded
inline void Reset()
{
inline void Reset() {
this->m_iShaderCount = 0;
for( TextureCache::iterator it = sCachedTextures.begin(); it != sCachedTextures.end(); ++it ) {
( *it ).second->Release();
for (TextureCache::iterator it = sCachedTextures.begin(); it != sCachedTextures.end(); ++it) {
(*it).second->Release();
}
sCachedTextures.clear();
}
private:
private:
//------------------------------------------------------------------
// find a valid path to a texture file
//
// Handle 8.3 syntax correctly, search the environment of the
// executable and the asset for a texture with a name very similar
// to a given one
bool TryLongerPath( char* szTemp, aiString* p_szString );
bool TryLongerPath(char *szTemp, aiString *p_szString);
//------------------------------------------------------------------
// Setup the default texture for a texture channel
//
// Generates a default checker pattern for a texture
int SetDefaultTexture( IDirect3DTexture9** p_ppiOut );
int SetDefaultTexture(IDirect3DTexture9 **p_ppiOut);
//------------------------------------------------------------------
// Convert a height map to a normal map if necessary
//
// The function tries to detect the type of a texture automatically.
// However, this won't work in every case.
void HMtoNMIfNecessary( IDirect3DTexture9* piTexture,
IDirect3DTexture9** piTextureOut,
bool bWasOriginallyHM = true );
void HMtoNMIfNecessary(IDirect3DTexture9 *piTexture,
IDirect3DTexture9 **piTextureOut,
bool bWasOriginallyHM = true);
//------------------------------------------------------------------
// Search for non-opaque pixels in a texture
@ -189,20 +180,19 @@ namespace AssimpView
// A pixel is considered to be non-opaque if its alpha value is
// less than 255
//------------------------------------------------------------------
bool HasAlphaPixels( IDirect3DTexture9* piTexture );
private:
bool HasAlphaPixels(IDirect3DTexture9 *piTexture);
private:
//
// Specifies the number of different shaders generated for
// the current asset. This number is incremented by CreateMaterial()
// each time a shader isn't found in cache and needs to be created
//
unsigned int m_iShaderCount;
IDirect3DTexture9* sDefaultTexture;
IDirect3DTexture9 *sDefaultTexture;
typedef std::map<std::string, IDirect3DTexture9*> TextureCache;
typedef std::map<std::string, IDirect3DTexture9 *> TextureCache;
TextureCache sCachedTextures;
};
};
}
} // namespace AssimpView

View File

@ -58,8 +58,8 @@ namespace AssimpView {
*/
struct SceneAnimNode {
std::string mName;
SceneAnimNode* mParent;
std::vector<SceneAnimNode*> mChildren;
SceneAnimNode *mParent;
std::vector<SceneAnimNode *> mChildren;
//! most recently calculated local transform
aiMatrix4x4 mLocalTransform;
@ -71,30 +71,20 @@ struct SceneAnimNode {
int mChannelIndex;
//! Default construction
SceneAnimNode()
: mName()
, mParent(nullptr)
, mChildren()
, mLocalTransform()
, mGlobalTransform()
, mChannelIndex(-1) {
SceneAnimNode() :
mName(), mParent(nullptr), mChildren(), mLocalTransform(), mGlobalTransform(), mChannelIndex(-1) {
// empty
}
//! Construction from a given name
SceneAnimNode( const std::string& pName)
: mName( pName)
, mParent(nullptr)
, mChildren()
, mLocalTransform()
, mGlobalTransform()
, mChannelIndex(-1) {
SceneAnimNode(const std::string &pName) :
mName(pName), mParent(nullptr), mChildren(), mLocalTransform(), mGlobalTransform(), mChannelIndex(-1) {
// empty
}
//! Destruct all children recursively
~SceneAnimNode() {
for (std::vector<SceneAnimNode*>::iterator it = mChildren.begin(); it != mChildren.end(); ++it) {
for (std::vector<SceneAnimNode *>::iterator it = mChildren.begin(); it != mChildren.end(); ++it) {
delete *it;
}
}
@ -112,7 +102,6 @@ struct SceneAnimNode {
*/
class SceneAnimator {
public:
// ----------------------------------------------------------------------------
/** Constructor for a given scene.
*
@ -122,7 +111,7 @@ public:
* @param pAnimIndex [optional] Index of the animation to play. Assumed to
* be 0 if not given.
*/
SceneAnimator( const aiScene* pScene, size_t pAnimIndex = 0);
SceneAnimator(const aiScene *pScene, size_t pAnimIndex = 0);
/** Destructor */
~SceneAnimator();
@ -132,14 +121,14 @@ public:
* mapping structures, which might take a few cycles.
* @param pAnimIndex Index of the animation in the scene's animation array
*/
void SetAnimIndex( size_t pAnimIndex);
void SetAnimIndex(size_t pAnimIndex);
// ----------------------------------------------------------------------------
/** Calculates the node transformations for the scene. Call this to get
* uptodate results before calling one of the getters.
* @param pTime Current time. Can be an arbitrary range.
*/
void Calculate( double pTime);
void Calculate(double pTime);
// ----------------------------------------------------------------------------
/** Retrieves the most recent local transformation matrix for the given node.
@ -154,7 +143,7 @@ public:
* @return A reference to the node's most recently calculated local
* transformation matrix.
*/
const aiMatrix4x4& GetLocalTransform( const aiNode* node) const;
const aiMatrix4x4 &GetLocalTransform(const aiNode *node) const;
// ----------------------------------------------------------------------------
/** Retrieves the most recent global transformation matrix for the given node.
@ -169,7 +158,7 @@ public:
* @return A reference to the node's most recently calculated global
* transformation matrix.
*/
const aiMatrix4x4& GetGlobalTransform( const aiNode* node) const;
const aiMatrix4x4 &GetGlobalTransform(const aiNode *node) const;
// ----------------------------------------------------------------------------
/** Calculates the bone matrices for the given mesh.
@ -187,7 +176,7 @@ public:
* @return A reference to a vector of bone matrices. Stays stable till the
* next call to GetBoneMatrices();
*/
const std::vector<aiMatrix4x4>& GetBoneMatrices( const aiNode* pNode,
const std::vector<aiMatrix4x4> &GetBoneMatrices(const aiNode *pNode,
size_t pMeshIndex = 0);
// ----------------------------------------------------------------------------
@ -200,44 +189,43 @@ public:
// ----------------------------------------------------------------------------
/** @brief Get the current animation or NULL
*/
aiAnimation* CurrentAnim() const {
return static_cast<unsigned int>( mCurrentAnimIndex ) < mScene->mNumAnimations ? mScene->mAnimations[ mCurrentAnimIndex ] : NULL;
aiAnimation *CurrentAnim() const {
return static_cast<unsigned int>(mCurrentAnimIndex) < mScene->mNumAnimations ? mScene->mAnimations[mCurrentAnimIndex] : NULL;
}
protected:
/** Recursively creates an internal node structure matching the
* current scene and animation.
*/
SceneAnimNode* CreateNodeTree( aiNode* pNode, SceneAnimNode* pParent);
SceneAnimNode *CreateNodeTree(aiNode *pNode, SceneAnimNode *pParent);
/** Recursively updates the internal node transformations from the
* given matrix array
*/
void UpdateTransforms( SceneAnimNode* pNode, const std::vector<aiMatrix4x4>& pTransforms);
void UpdateTransforms(SceneAnimNode *pNode, const std::vector<aiMatrix4x4> &pTransforms);
/** Calculates the global transformation matrix for the given internal node */
void CalculateGlobalTransform( SceneAnimNode* pInternalNode);
void CalculateGlobalTransform(SceneAnimNode *pInternalNode);
protected:
/** The scene we're operating on */
const aiScene* mScene;
const aiScene *mScene;
/** Current animation index */
int mCurrentAnimIndex;
/** The AnimEvaluator we use to calculate the current pose for the current animation */
AnimEvaluator* mAnimEvaluator;
AnimEvaluator *mAnimEvaluator;
/** Root node of the internal scene structure */
SceneAnimNode* mRootNode;
SceneAnimNode *mRootNode;
/** Name to node map to quickly find nodes by their name */
typedef std::map<const aiNode*, SceneAnimNode*> NodeMap;
typedef std::map<const aiNode *, SceneAnimNode *> NodeMap;
NodeMap mNodesByName;
/** Name to node map to quickly find nodes for given bones by their name */
typedef std::map<const char*, const aiNode*> BoneMap;
typedef std::map<const char *, const aiNode *> BoneMap;
BoneMap mBoneNodesByName;
/** Array to return transformations results inside. */

File diff suppressed because it is too large Load Diff

View File

@ -51,24 +51,24 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "resource.h"
#include <assert.h>
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#include <stdio.h>
#include <stdlib.h>
#include <tchar.h>
#include <time.h>
// Include ASSIMP headers (XXX: do we really need all of them?)
#include <assimp/cimport.h>
#include <assimp/Importer.hpp>
#include <assimp/ai_assert.h>
#include <assimp/cfileio.h>
#include <assimp/cimport.h>
#include <assimp/postprocess.h>
#include <assimp/scene.h>
#include <assimp/IOSystem.hpp>
#include <assimp/IOStream.hpp>
#include <assimp/LogStream.hpp>
#include <assimp/DefaultLogger.hpp>
#include <assimp/IOStream.hpp>
#include <assimp/IOSystem.hpp>
#include <assimp/Importer.hpp>
#include <assimp/LogStream.hpp>
#include "Material/MaterialSystem.h" // aiMaterial class
#include <assimp/StringComparison.h> // ASSIMP_stricmp and ASSIMP_strincmp
@ -79,33 +79,31 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define MOVE_SPEED 3.f
#include "AssetHelper.h"
#include "Camera.h"
#include "RenderOptions.h"
#include "Shaders.h"
#include "Background.h"
#include "Camera.h"
#include "Display.h"
#include "LogDisplay.h"
#include "LogWindow.h"
#include "Display.h"
#include "MeshRenderer.h"
#include "MaterialManager.h"
#include "MeshRenderer.h"
#include "RenderOptions.h"
#include "Shaders.h"
// outside of namespace, to help Intellisense and solve boost::metatype_stuff_miracle
#include "AnimEvaluator.h"
#include "SceneAnimator.h"
namespace AssimpView
{
namespace AssimpView {
//-------------------------------------------------------------------------------
// Function prototypes
//-------------------------------------------------------------------------------
int InitD3D(void);
int ShutdownD3D(void);
int CreateDevice (bool p_bMultiSample,bool p_bSuperSample, bool bHW = true);
int CreateDevice (void);
int CreateDevice(bool p_bMultiSample, bool p_bSuperSample, bool bHW = true);
int CreateDevice(void);
int ShutdownDevice(void);
int GetProjectionMatrix (aiMatrix4x4& p_mOut);
int GetProjectionMatrix(aiMatrix4x4 &p_mOut);
int LoadAsset(void);
int CreateAssetData(void);
int DeleteAssetData(bool bNoMaterials = false);
@ -113,26 +111,25 @@ int ScaleAsset(void);
int DeleteAsset(void);
int SetupFPSView();
aiVector3D GetCameraMatrix (aiMatrix4x4& p_mOut);
int CreateMaterial(AssetHelper::MeshHelper* pcMesh,const aiMesh* pcSource);
void HandleMouseInputFPS( void );
void HandleMouseInputLightRotate( void );
void HandleMouseInputLocal( void );
void HandleKeyboardInputFPS( void );
void HandleMouseInputLightIntensityAndColor( void );
void HandleMouseInputSkyBox( void );
void HandleKeyboardInputTextureView( void );
void HandleMouseInputTextureView( void );
aiVector3D GetCameraMatrix(aiMatrix4x4 &p_mOut);
int CreateMaterial(AssetHelper::MeshHelper *pcMesh, const aiMesh *pcSource);
void HandleMouseInputFPS(void);
void HandleMouseInputLightRotate(void);
void HandleMouseInputLocal(void);
void HandleKeyboardInputFPS(void);
void HandleMouseInputLightIntensityAndColor(void);
void HandleMouseInputSkyBox(void);
void HandleKeyboardInputTextureView(void);
void HandleMouseInputTextureView(void);
//-------------------------------------------------------------------------------
//
// Dialog procedure for the progress bar window
//
//-------------------------------------------------------------------------------
INT_PTR CALLBACK ProgressMessageProc(HWND hwndDlg,UINT uMsg,
WPARAM wParam,LPARAM lParam);
INT_PTR CALLBACK ProgressMessageProc(HWND hwndDlg, UINT uMsg,
WPARAM wParam, LPARAM lParam);
//-------------------------------------------------------------------------------
// Main message procedure of the application
@ -142,25 +139,24 @@ INT_PTR CALLBACK ProgressMessageProc(HWND hwndDlg,UINT uMsg,
// NOTE: Due to the impossibility to process WM_CHAR messages in dialogs
// properly the code for all hotkeys has been moved to the WndMain
//-------------------------------------------------------------------------------
INT_PTR CALLBACK MessageProc(HWND hwndDlg,UINT uMsg,
WPARAM wParam,LPARAM lParam);
INT_PTR CALLBACK MessageProc(HWND hwndDlg, UINT uMsg,
WPARAM wParam, LPARAM lParam);
//-------------------------------------------------------------------------------
//
// Dialog procedure for the about dialog
//
//-------------------------------------------------------------------------------
INT_PTR CALLBACK AboutMessageProc(HWND hwndDlg,UINT uMsg,
WPARAM wParam,LPARAM lParam);
INT_PTR CALLBACK AboutMessageProc(HWND hwndDlg, UINT uMsg,
WPARAM wParam, LPARAM lParam);
//-------------------------------------------------------------------------------
//
// Dialog procedure for the help dialog
//
//-------------------------------------------------------------------------------
INT_PTR CALLBACK HelpDialogProc(HWND hwndDlg,UINT uMsg,
WPARAM wParam,LPARAM lParam);
INT_PTR CALLBACK HelpDialogProc(HWND hwndDlg, UINT uMsg,
WPARAM wParam, LPARAM lParam);
//-------------------------------------------------------------------------------
// Handle command line parameters
@ -168,24 +164,20 @@ INT_PTR CALLBACK HelpDialogProc(HWND hwndDlg,UINT uMsg,
// The function loads an asset specified on the command line as first argument
// Other command line parameters are not handled
//-------------------------------------------------------------------------------
void HandleCommandLine(char* p_szCommand);
void HandleCommandLine(char *p_szCommand);
//-------------------------------------------------------------------------------
template <class type, class intype>
type clamp(intype in)
{
type clamp(intype in) {
// for unsigned types only ...
intype mask = (0x1u << (sizeof(type)*8))-1;
return (type)std::max((intype)0,std::min(in,mask));
intype mask = (0x1u << (sizeof(type) * 8)) - 1;
return (type)std::max((intype)0, std::min(in, mask));
}
//-------------------------------------------------------------------------------
// Position of the cursor relative to the 3ds max' like control circle
//-------------------------------------------------------------------------------
enum EClickPos
{
enum EClickPos {
// The click was inside the inner circle (x,y axis)
EClickPos_Circle,
// The click was inside one of the vertical snap-ins
@ -197,84 +189,82 @@ enum EClickPos
};
#if (!defined AI_VIEW_CAPTION_BASE)
# define AI_VIEW_CAPTION_BASE "Open Asset Import Library : Viewer "
#define AI_VIEW_CAPTION_BASE "Open Asset Import Library : Viewer "
#endif // !! AI_VIEW_CAPTION_BASE
//-------------------------------------------------------------------------------
// Evil globals
//-------------------------------------------------------------------------------
extern HINSTANCE g_hInstance /*= NULL*/;
extern HWND g_hDlg /*= NULL*/;
extern IDirect3D9* g_piD3D /*= NULL*/;
extern IDirect3DDevice9* g_piDevice /*= NULL*/;
extern IDirect3DVertexDeclaration9* gDefaultVertexDecl /*= NULL*/;
extern double g_fFPS /*= 0.0f*/;
extern char g_szFileName[MAX_PATH];
extern ID3DXEffect* g_piDefaultEffect /*= NULL*/;
extern ID3DXEffect* g_piNormalsEffect /*= NULL*/;
extern ID3DXEffect* g_piPassThroughEffect /*= NULL*/;
extern ID3DXEffect* g_piPatternEffect /*= NULL*/;
extern bool g_bMousePressed /*= false*/;
extern bool g_bMousePressedR /*= false*/;
extern bool g_bMousePressedM /*= false*/;
extern bool g_bMousePressedBoth /*= false*/;
extern float g_fElpasedTime /*= 0.0f*/;
extern D3DCAPS9 g_sCaps;
extern bool g_bLoadingFinished /*= false*/;
extern HANDLE g_hThreadHandle /*= NULL*/;
extern float g_fWheelPos /*= -10.0f*/;
extern bool g_bLoadingCanceled /*= false*/;
extern IDirect3DTexture9* g_pcTexture /*= NULL*/;
extern HINSTANCE g_hInstance /*= NULL*/;
extern HWND g_hDlg /*= NULL*/;
extern IDirect3D9 *g_piD3D /*= NULL*/;
extern IDirect3DDevice9 *g_piDevice /*= NULL*/;
extern IDirect3DVertexDeclaration9 *gDefaultVertexDecl /*= NULL*/;
extern double g_fFPS /*= 0.0f*/;
extern char g_szFileName[MAX_PATH];
extern ID3DXEffect *g_piDefaultEffect /*= NULL*/;
extern ID3DXEffect *g_piNormalsEffect /*= NULL*/;
extern ID3DXEffect *g_piPassThroughEffect /*= NULL*/;
extern ID3DXEffect *g_piPatternEffect /*= NULL*/;
extern bool g_bMousePressed /*= false*/;
extern bool g_bMousePressedR /*= false*/;
extern bool g_bMousePressedM /*= false*/;
extern bool g_bMousePressedBoth /*= false*/;
extern float g_fElpasedTime /*= 0.0f*/;
extern D3DCAPS9 g_sCaps;
extern bool g_bLoadingFinished /*= false*/;
extern HANDLE g_hThreadHandle /*= NULL*/;
extern float g_fWheelPos /*= -10.0f*/;
extern bool g_bLoadingCanceled /*= false*/;
extern IDirect3DTexture9 *g_pcTexture /*= NULL*/;
extern aiMatrix4x4 g_mWorld;
extern aiMatrix4x4 g_mWorldRotate;
extern aiVector3D g_vRotateSpeed /*= aiVector3D(0.5f,0.5f,0.5f)*/;
extern aiMatrix4x4 g_mWorld;
extern aiMatrix4x4 g_mWorldRotate;
extern aiVector3D g_vRotateSpeed /*= aiVector3D(0.5f,0.5f,0.5f)*/;
extern aiVector3D g_avLightDirs[1] /* =
extern aiVector3D g_avLightDirs[1] /* =
{ aiVector3D(-0.5f,0.6f,0.2f) ,
aiVector3D(-0.5f,0.5f,0.5f)} */;
aiVector3D(-0.5f,0.5f,0.5f)} */
;
extern POINT g_mousePos /*= {0,0};*/;
extern POINT g_LastmousePos /*= {0,0}*/;
extern bool g_bFPSView /*= false*/;
extern bool g_bInvert /*= false*/;
extern EClickPos g_eClick;
extern unsigned int g_iCurrentColor /*= 0*/;
extern POINT g_mousePos /*= {0,0};*/;
extern POINT g_LastmousePos /*= {0,0}*/;
extern bool g_bFPSView /*= false*/;
extern bool g_bInvert /*= false*/;
extern EClickPos g_eClick;
extern unsigned int g_iCurrentColor /*= 0*/;
// NOTE: The light intensity is separated from the color, it can
// directly be manipulated using the middle mouse button.
// When the user chooses a color from the palette the intensity
// is reset to 1.0
// index[2] is the ambient color
extern float g_fLightIntensity /*=0.0f*/;
extern D3DCOLOR g_avLightColors[3];
// NOTE: The light intensity is separated from the color, it can
// directly be manipulated using the middle mouse button.
// When the user chooses a color from the palette the intensity
// is reset to 1.0
// index[2] is the ambient color
extern float g_fLightIntensity /*=0.0f*/;
extern D3DCOLOR g_avLightColors[3];
extern RenderOptions g_sOptions;
extern Camera g_sCamera;
extern AssetHelper *g_pcAsset /*= NULL*/;
extern RenderOptions g_sOptions;
extern Camera g_sCamera;
extern AssetHelper *g_pcAsset /*= NULL*/;
//
// Contains the mask image for the HUD
// (used to determine the position of a click)
//
// The size of the image is identical to the size of the main
// HUD texture
//
extern unsigned char *g_szImageMask /*= NULL*/;
extern float g_fACMR /*= 3.0f*/;
extern IDirect3DQuery9 *g_piQuery;
//
// Contains the mask image for the HUD
// (used to determine the position of a click)
//
// The size of the image is identical to the size of the main
// HUD texture
//
extern unsigned char* g_szImageMask /*= NULL*/;
extern bool g_bPlay /*= false*/;
extern double g_dCurrent;
extern float g_smoothAngle /*= 80.f*/;
extern float g_fACMR /*= 3.0f*/;
extern IDirect3DQuery9* g_piQuery;
extern bool g_bPlay /*= false*/;
extern double g_dCurrent;
extern float g_smoothAngle /*= 80.f*/;
extern unsigned int ppsteps,ppstepsdefault;
extern bool nopointslines;
}
extern unsigned int ppsteps, ppstepsdefault;
extern bool nopointslines;
} // namespace AssimpView
#endif // !! AV_MAIN_H_INCLUDED