Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Clark Lin
hw3d
Commits
f118aff1
Commit
f118aff1
authored
May 12, 2019
by
chili
Browse files
add assimp / nix x86 config / minimal ass test
parent
1c7067f5
Changes
52
Hide whitespace changes
Inline
Side-by-side
hw3d/assimp/include/assimp/quaternion.h
0 → 100644
View file @
f118aff1
/*
Open Asset Import Library (assimp)
----------------------------------------------------------------------
Copyright (c) 2006-2017, 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.
----------------------------------------------------------------------
*/
/** @file quaternion.h
* @brief Quaternion structure, including operators when compiling in C++
*/
#pragma once
#ifndef AI_QUATERNION_H_INC
#define AI_QUATERNION_H_INC
#ifdef __cplusplus
#include "defs.h"
template
<
typename
TReal
>
class
aiVector3t
;
template
<
typename
TReal
>
class
aiMatrix3x3t
;
// ---------------------------------------------------------------------------
/** Represents a quaternion in a 4D vector. */
template
<
typename
TReal
>
class
aiQuaterniont
{
public:
aiQuaterniont
()
:
w
(
1.0
),
x
(),
y
(),
z
()
{}
aiQuaterniont
(
TReal
pw
,
TReal
px
,
TReal
py
,
TReal
pz
)
:
w
(
pw
),
x
(
px
),
y
(
py
),
z
(
pz
)
{}
/** Construct from rotation matrix. Result is undefined if the matrix is not orthonormal. */
explicit
aiQuaterniont
(
const
aiMatrix3x3t
<
TReal
>&
pRotMatrix
);
/** Construct from euler angles */
aiQuaterniont
(
TReal
rotx
,
TReal
roty
,
TReal
rotz
);
/** Construct from an axis-angle pair */
aiQuaterniont
(
aiVector3t
<
TReal
>
axis
,
TReal
angle
);
/** Construct from a normalized quaternion stored in a vec3 */
explicit
aiQuaterniont
(
aiVector3t
<
TReal
>
normalized
);
/** Returns a matrix representation of the quaternion */
aiMatrix3x3t
<
TReal
>
GetMatrix
()
const
;
public:
bool
operator
==
(
const
aiQuaterniont
&
o
)
const
;
bool
operator
!=
(
const
aiQuaterniont
&
o
)
const
;
bool
Equal
(
const
aiQuaterniont
&
o
,
TReal
epsilon
=
1e-6
)
const
;
public:
/** Normalize the quaternion */
aiQuaterniont
&
Normalize
();
/** Compute quaternion conjugate */
aiQuaterniont
&
Conjugate
();
/** Rotate a point by this quaternion */
aiVector3t
<
TReal
>
Rotate
(
const
aiVector3t
<
TReal
>&
in
);
/** Multiply two quaternions */
aiQuaterniont
operator
*
(
const
aiQuaterniont
&
two
)
const
;
public:
/** Performs a spherical interpolation between two quaternions and writes the result into the third.
* @param pOut Target object to received the interpolated rotation.
* @param pStart Start rotation of the interpolation at factor == 0.
* @param pEnd End rotation, factor == 1.
* @param pFactor Interpolation factor between 0 and 1. Values outside of this range yield undefined results.
*/
static
void
Interpolate
(
aiQuaterniont
&
pOut
,
const
aiQuaterniont
&
pStart
,
const
aiQuaterniont
&
pEnd
,
TReal
pFactor
);
public:
//! w,x,y,z components of the quaternion
TReal
w
,
x
,
y
,
z
;
}
;
typedef
aiQuaterniont
<
ai_real
>
aiQuaternion
;
#else
struct
aiQuaternion
{
ai_real
w
,
x
,
y
,
z
;
};
#endif
#endif // AI_QUATERNION_H_INC
hw3d/assimp/include/assimp/quaternion.inl
0 → 100644
View file @
f118aff1
/*
---------------------------------------------------------------------------
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2017, 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.
---------------------------------------------------------------------------
*/
/** @file quaternion.inl
* @brief Inline implementation of aiQuaterniont<TReal> operators
*/
#pragma once
#ifndef AI_QUATERNION_INL_INC
#define AI_QUATERNION_INL_INC
#ifdef __cplusplus
#include "quaternion.h"
#include <cmath>
// ---------------------------------------------------------------------------
template<typename TReal>
bool aiQuaterniont<TReal>::operator== (const aiQuaterniont& o) const
{
return x == o.x && y == o.y && z == o.z && w == o.w;
}
// ---------------------------------------------------------------------------
template<typename TReal>
bool aiQuaterniont<TReal>::operator!= (const aiQuaterniont& o) const
{
return !(*this == o);
}
// ---------------------------------------------------------------------------
template<typename TReal>
inline bool aiQuaterniont<TReal>::Equal(const aiQuaterniont& o, TReal epsilon) const {
return
std::abs(x - o.x) <= epsilon &&
std::abs(y - o.y) <= epsilon &&
std::abs(z - o.z) <= epsilon &&
std::abs(w - o.w) <= epsilon;
}
// ---------------------------------------------------------------------------
// Constructs a quaternion from a rotation matrix
template<typename TReal>
inline aiQuaterniont<TReal>::aiQuaterniont( const aiMatrix3x3t<TReal> &pRotMatrix)
{
TReal t = pRotMatrix.a1 + pRotMatrix.b2 + pRotMatrix.c3;
// large enough
if( t > static_cast<TReal>(0))
{
TReal s = std::sqrt(1 + t) * static_cast<TReal>(2.0);
x = (pRotMatrix.c2 - pRotMatrix.b3) / s;
y = (pRotMatrix.a3 - pRotMatrix.c1) / s;
z = (pRotMatrix.b1 - pRotMatrix.a2) / s;
w = static_cast<TReal>(0.25) * s;
} // else we have to check several cases
else if( pRotMatrix.a1 > pRotMatrix.b2 && pRotMatrix.a1 > pRotMatrix.c3 )
{
// Column 0:
TReal s = std::sqrt( static_cast<TReal>(1.0) + pRotMatrix.a1 - pRotMatrix.b2 - pRotMatrix.c3) * static_cast<TReal>(2.0);
x = static_cast<TReal>(0.25) * s;
y = (pRotMatrix.b1 + pRotMatrix.a2) / s;
z = (pRotMatrix.a3 + pRotMatrix.c1) / s;
w = (pRotMatrix.c2 - pRotMatrix.b3) / s;
}
else if( pRotMatrix.b2 > pRotMatrix.c3)
{
// Column 1:
TReal s = std::sqrt( static_cast<TReal>(1.0) + pRotMatrix.b2 - pRotMatrix.a1 - pRotMatrix.c3) * static_cast<TReal>(2.0);
x = (pRotMatrix.b1 + pRotMatrix.a2) / s;
y = static_cast<TReal>(0.25) * s;
z = (pRotMatrix.c2 + pRotMatrix.b3) / s;
w = (pRotMatrix.a3 - pRotMatrix.c1) / s;
} else
{
// Column 2:
TReal s = std::sqrt( static_cast<TReal>(1.0) + pRotMatrix.c3 - pRotMatrix.a1 - pRotMatrix.b2) * static_cast<TReal>(2.0);
x = (pRotMatrix.a3 + pRotMatrix.c1) / s;
y = (pRotMatrix.c2 + pRotMatrix.b3) / s;
z = static_cast<TReal>(0.25) * s;
w = (pRotMatrix.b1 - pRotMatrix.a2) / s;
}
}
// ---------------------------------------------------------------------------
// Construction from euler angles
template<typename TReal>
inline aiQuaterniont<TReal>::aiQuaterniont( TReal fPitch, TReal fYaw, TReal fRoll )
{
const TReal fSinPitch(std::sin(fPitch*static_cast<TReal>(0.5)));
const TReal fCosPitch(std::cos(fPitch*static_cast<TReal>(0.5)));
const TReal fSinYaw(std::sin(fYaw*static_cast<TReal>(0.5)));
const TReal fCosYaw(std::cos(fYaw*static_cast<TReal>(0.5)));
const TReal fSinRoll(std::sin(fRoll*static_cast<TReal>(0.5)));
const TReal fCosRoll(std::cos(fRoll*static_cast<TReal>(0.5)));
const TReal fCosPitchCosYaw(fCosPitch*fCosYaw);
const TReal fSinPitchSinYaw(fSinPitch*fSinYaw);
x = fSinRoll * fCosPitchCosYaw - fCosRoll * fSinPitchSinYaw;
y = fCosRoll * fSinPitch * fCosYaw + fSinRoll * fCosPitch * fSinYaw;
z = fCosRoll * fCosPitch * fSinYaw - fSinRoll * fSinPitch * fCosYaw;
w = fCosRoll * fCosPitchCosYaw + fSinRoll * fSinPitchSinYaw;
}
// ---------------------------------------------------------------------------
// Returns a matrix representation of the quaternion
template<typename TReal>
inline aiMatrix3x3t<TReal> aiQuaterniont<TReal>::GetMatrix() const
{
aiMatrix3x3t<TReal> resMatrix;
resMatrix.a1 = static_cast<TReal>(1.0) - static_cast<TReal>(2.0) * (y * y + z * z);
resMatrix.a2 = static_cast<TReal>(2.0) * (x * y - z * w);
resMatrix.a3 = static_cast<TReal>(2.0) * (x * z + y * w);
resMatrix.b1 = static_cast<TReal>(2.0) * (x * y + z * w);
resMatrix.b2 = static_cast<TReal>(1.0) - static_cast<TReal>(2.0) * (x * x + z * z);
resMatrix.b3 = static_cast<TReal>(2.0) * (y * z - x * w);
resMatrix.c1 = static_cast<TReal>(2.0) * (x * z - y * w);
resMatrix.c2 = static_cast<TReal>(2.0) * (y * z + x * w);
resMatrix.c3 = static_cast<TReal>(1.0) - static_cast<TReal>(2.0) * (x * x + y * y);
return resMatrix;
}
// ---------------------------------------------------------------------------
// Construction from an axis-angle pair
template<typename TReal>
inline aiQuaterniont<TReal>::aiQuaterniont( aiVector3t<TReal> axis, TReal angle)
{
axis.Normalize();
const TReal sin_a = std::sin( angle / 2 );
const TReal cos_a = std::cos( angle / 2 );
x = axis.x * sin_a;
y = axis.y * sin_a;
z = axis.z * sin_a;
w = cos_a;
}
// ---------------------------------------------------------------------------
// Construction from am existing, normalized quaternion
template<typename TReal>
inline aiQuaterniont<TReal>::aiQuaterniont( aiVector3t<TReal> normalized)
{
x = normalized.x;
y = normalized.y;
z = normalized.z;
const TReal t = static_cast<TReal>(1.0) - (x*x) - (y*y) - (z*z);
if (t < static_cast<TReal>(0.0)) {
w = static_cast<TReal>(0.0);
}
else w = std::sqrt (t);
}
// ---------------------------------------------------------------------------
// Performs a spherical interpolation between two quaternions
// Implementation adopted from the gmtl project. All others I found on the net fail in some cases.
// Congrats, gmtl!
template<typename TReal>
inline void aiQuaterniont<TReal>::Interpolate( aiQuaterniont& pOut, const aiQuaterniont& pStart, const aiQuaterniont& pEnd, TReal pFactor)
{
// calc cosine theta
TReal cosom = pStart.x * pEnd.x + pStart.y * pEnd.y + pStart.z * pEnd.z + pStart.w * pEnd.w;
// adjust signs (if necessary)
aiQuaterniont end = pEnd;
if( cosom < static_cast<TReal>(0.0))
{
cosom = -cosom;
end.x = -end.x; // Reverse all signs
end.y = -end.y;
end.z = -end.z;
end.w = -end.w;
}
// Calculate coefficients
TReal sclp, sclq;
if( (static_cast<TReal>(1.0) - cosom) > static_cast<TReal>(0.0001)) // 0.0001 -> some epsillon
{
// Standard case (slerp)
TReal omega, sinom;
omega = std::acos( cosom); // extract theta from dot product's cos theta
sinom = std::sin( omega);
sclp = std::sin( (static_cast<TReal>(1.0) - pFactor) * omega) / sinom;
sclq = std::sin( pFactor * omega) / sinom;
} else
{
// Very close, do linear interp (because it's faster)
sclp = static_cast<TReal>(1.0) - pFactor;
sclq = pFactor;
}
pOut.x = sclp * pStart.x + sclq * end.x;
pOut.y = sclp * pStart.y + sclq * end.y;
pOut.z = sclp * pStart.z + sclq * end.z;
pOut.w = sclp * pStart.w + sclq * end.w;
}
// ---------------------------------------------------------------------------
template<typename TReal>
inline aiQuaterniont<TReal>& aiQuaterniont<TReal>::Normalize()
{
// compute the magnitude and divide through it
const TReal mag = std::sqrt(x*x + y*y + z*z + w*w);
if (mag)
{
const TReal invMag = static_cast<TReal>(1.0)/mag;
x *= invMag;
y *= invMag;
z *= invMag;
w *= invMag;
}
return *this;
}
// ---------------------------------------------------------------------------
template<typename TReal>
inline aiQuaterniont<TReal> aiQuaterniont<TReal>::operator* (const aiQuaterniont& t) const
{
return aiQuaterniont(w*t.w - x*t.x - y*t.y - z*t.z,
w*t.x + x*t.w + y*t.z - z*t.y,
w*t.y + y*t.w + z*t.x - x*t.z,
w*t.z + z*t.w + x*t.y - y*t.x);
}
// ---------------------------------------------------------------------------
template<typename TReal>
inline aiQuaterniont<TReal>& aiQuaterniont<TReal>::Conjugate ()
{
x = -x;
y = -y;
z = -z;
return *this;
}
// ---------------------------------------------------------------------------
template<typename TReal>
inline aiVector3t<TReal> aiQuaterniont<TReal>::Rotate (const aiVector3t<TReal>& v)
{
aiQuaterniont q2(0.f,v.x,v.y,v.z), q = *this, qinv = q;
qinv.Conjugate();
q = q*q2*qinv;
return aiVector3t<TReal>(q.x,q.y,q.z);
}
#endif
#endif // AI_QUATERNION_INL_INC
hw3d/assimp/include/assimp/scene.h
0 → 100644
View file @
f118aff1
/*
---------------------------------------------------------------------------
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2017, 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.
---------------------------------------------------------------------------
*/
/** @file scene.h
* @brief Defines the data structures in which the imported scene is returned.
*/
#pragma once
#ifndef AI_SCENE_H_INC
#define AI_SCENE_H_INC
#include "types.h"
#include "texture.h"
#include "mesh.h"
#include "light.h"
#include "camera.h"
#include "material.h"
#include "anim.h"
#include "metadata.h"
#ifdef __cplusplus
extern
"C"
{
#endif
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wattributes"
#endif
// -------------------------------------------------------------------------------
/**
* A node in the imported hierarchy.
*
* Each node has name, a parent node (except for the root node),
* a transformation relative to its parent and possibly several child nodes.
* Simple file formats don't support hierarchical structures - for these formats
* the imported scene does consist of only a single root node without children.
*/
// -------------------------------------------------------------------------------
struct
ASSIMP_API
aiNode
{
/** The name of the node.
*
* The name might be empty (length of zero) but all nodes which
* need to be referenced by either bones or animations are named.
* Multiple nodes may have the same name, except for nodes which are referenced
* by bones (see #aiBone and #aiMesh::mBones). Their names *must* be unique.
*
* Cameras and lights reference a specific node by name - if there
* are multiple nodes with this name, they are assigned to each of them.
* <br>
* There are no limitations with regard to the characters contained in
* the name string as it is usually taken directly from the source file.
*
* Implementations should be able to handle tokens such as whitespace, tabs,
* line feeds, quotation marks, ampersands etc.
*
* Sometimes assimp introduces new nodes not present in the source file
* into the hierarchy (usually out of necessity because sometimes the
* source hierarchy format is simply not compatible). Their names are
* surrounded by @verbatim <> @endverbatim e.g.
* @verbatim<DummyRootNode> @endverbatim.
*/
C_STRUCT
aiString
mName
;
/** The transformation relative to the node's parent. */
C_STRUCT
aiMatrix4x4
mTransformation
;
/** Parent node. NULL if this node is the root node. */
C_STRUCT
aiNode
*
mParent
;
/** The number of child nodes of this node. */
unsigned
int
mNumChildren
;
/** The child nodes of this node. NULL if mNumChildren is 0. */
C_STRUCT
aiNode
**
mChildren
;
/** The number of meshes of this node. */
unsigned
int
mNumMeshes
;
/** The meshes of this node. Each entry is an index into the
* mesh list of the #aiScene.
*/
unsigned
int
*
mMeshes
;
/** Metadata associated with this node or NULL if there is no metadata.
* Whether any metadata is generated depends on the source file format. See the
* @link importer_notes @endlink page for more information on every source file
* format. Importers that don't document any metadata don't write any.
*/
C_STRUCT
aiMetadata
*
mMetaData
;
#ifdef __cplusplus
/** Constructor */
aiNode
();
/** Construction from a specific name */
explicit
aiNode
(
const
std
::
string
&
name
);
/** Destructor */
~
aiNode
();
/** Searches for a node with a specific name, beginning at this
* nodes. Normally you will call this method on the root node
* of the scene.
*
* @param name Name to search for
* @return NULL or a valid Node if the search was successful.
*/
inline
const
aiNode
*
FindNode
(
const
aiString
&
name
)
const
{
return
FindNode
(
name
.
data
);
}
inline
aiNode
*
FindNode
(
const
aiString
&
name
)
{
return
FindNode
(
name
.
data
);
}
const
aiNode
*
FindNode
(
const
char
*
name
)
const
;
aiNode
*
FindNode
(
const
char
*
name
);
/**
* @brief Will add new children.
* @param numChildren Number of children to add.
* @param children The array with pointers showing to the children.
*/
void
addChildren
(
unsigned
int
numChildren
,
aiNode
**
children
);
#endif // __cplusplus
};
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
// -------------------------------------------------------------------------------
/**
* Specifies that the scene data structure that was imported is not complete.
* This flag bypasses some internal validations and allows the import
* of animation skeletons, material libraries or camera animation paths
* using Assimp. Most applications won't support such data.
*/
#define AI_SCENE_FLAGS_INCOMPLETE 0x1
/**
* This flag is set by the validation postprocess-step (aiPostProcess_ValidateDS)
* if the validation is successful. In a validated scene you can be sure that
* any cross references in the data structure (e.g. vertex indices) are valid.
*/
#define AI_SCENE_FLAGS_VALIDATED 0x2
/**
* This flag is set by the validation postprocess-step (aiPostProcess_ValidateDS)
* if the validation is successful but some issues have been found.
* This can for example mean that a texture that does not exist is referenced
* by a material or that the bone weights for a vertex don't sum to 1.0 ... .
* In most cases you should still be able to use the import. This flag could
* be useful for applications which don't capture Assimp's log output.
*/
#define AI_SCENE_FLAGS_VALIDATION_WARNING 0x4
/**
* This flag is currently only set by the aiProcess_JoinIdenticalVertices step.
* It indicates that the vertices of the output meshes aren't in the internal
* verbose format anymore. In the verbose format all vertices are unique,
* no vertex is ever referenced by more than one face.
*/
#define AI_SCENE_FLAGS_NON_VERBOSE_FORMAT 0x8
/**
* Denotes pure height-map terrain data. Pure terrains usually consist of quads,
* sometimes triangles, in a regular grid. The x,y coordinates of all vertex
* positions refer to the x,y coordinates on the terrain height map, the z-axis
* stores the elevation at a specific point.
*
* TER (Terragen) and HMP (3D Game Studio) are height map formats.
* @note Assimp is probably not the best choice for loading *huge* terrains -
* fully triangulated data takes extremely much free store and should be avoided
* as long as possible (typically you'll do the triangulation when you actually
* need to render it).
*/
#define AI_SCENE_FLAGS_TERRAIN 0x10
/**
* Specifies that the scene data can be shared between structures. For example:
* one vertex in few faces. \ref AI_SCENE_FLAGS_NON_VERBOSE_FORMAT can not be
* used for this because \ref AI_SCENE_FLAGS_NON_VERBOSE_FORMAT has internal
* meaning about postprocessing steps.
*/
#define AI_SCENE_FLAGS_ALLOW_SHARED 0x20
// -------------------------------------------------------------------------------
/** The root structure of the imported data.
*
* Everything that was imported from the given file can be accessed from here.
* Objects of this class are generally maintained and owned by Assimp, not
* by the caller. You shouldn't want to instance it, nor should you ever try to
* delete a given scene on your own.
*/
// -------------------------------------------------------------------------------
struct
aiScene
{
/** Any combination of the AI_SCENE_FLAGS_XXX flags. By default
* this value is 0, no flags are set. Most applications will
* want to reject all scenes with the AI_SCENE_FLAGS_INCOMPLETE
* bit set.
*/
unsigned
int
mFlags
;
/** The root node of the hierarchy.
*
* There will always be at least the root node if the import
* was successful (and no special flags have been set).
* Presence of further nodes depends on the format and content
* of the imported file.
*/
C_STRUCT
aiNode
*
mRootNode
;
/** The number of meshes in the scene. */
unsigned
int
mNumMeshes
;
/** The array of meshes.
*
* Use the indices given in the aiNode structure to access
* this array. The array is mNumMeshes in size. If the
* AI_SCENE_FLAGS_INCOMPLETE flag is not set there will always
* be at least ONE material.
*/
C_STRUCT
aiMesh
**
mMeshes
;
/** The number of materials in the scene. */
unsigned
int
mNumMaterials
;
/** The array of materials.
*
* Use the index given in each aiMesh structure to access this
* array. The array is mNumMaterials in size. If the
* AI_SCENE_FLAGS_INCOMPLETE flag is not set there will always
* be at least ONE material.
*/
C_STRUCT
aiMaterial
**
mMaterials
;
/** The number of animations in the scene. */
unsigned
int
mNumAnimations
;
/** The array of animations.
*
* All animations imported from the given file are listed here.
* The array is mNumAnimations in size.
*/
C_STRUCT
aiAnimation
**
mAnimations
;
/** The number of textures embedded into the file */
unsigned
int
mNumTextures
;
/** The array of embedded textures.
*
* Not many file formats embed their textures into the file.
* An example is Quake's MDL format (which is also used by
* some GameStudio versions)
*/
C_STRUCT
aiTexture
**
mTextures
;
/** The number of light sources in the scene. Light sources
* are fully optional, in most cases this attribute will be 0
*/
unsigned
int
mNumLights
;
/** The array of light sources.
*
* All light sources imported from the given file are
* listed here. The array is mNumLights in size.
*/
C_STRUCT
aiLight
**
mLights
;
/** The number of cameras in the scene. Cameras
* are fully optional, in most cases this attribute will be 0
*/
unsigned
int
mNumCameras
;
/** The array of cameras.
*
* All cameras imported from the given file are listed here.
* The array is mNumCameras in size. The first camera in the
* array (if existing) is the default camera view into
* the scene.
*/
C_STRUCT
aiCamera
**
mCameras
;
#ifdef __cplusplus
//! Default constructor - set everything to 0/NULL
ASSIMP_API
aiScene
();
//! Destructor
ASSIMP_API
~
aiScene
();
//! Check whether the scene contains meshes
//! Unless no special scene flags are set this will always be true.
inline
bool
HasMeshes
()
const
{
return
mMeshes
!=
NULL
&&
mNumMeshes
>
0
;
}
//! Check whether the scene contains materials
//! Unless no special scene flags are set this will always be true.
inline
bool
HasMaterials
()
const
{
return
mMaterials
!=
NULL
&&
mNumMaterials
>
0
;
}
//! Check whether the scene contains lights
inline
bool
HasLights
()
const
{
return
mLights
!=
NULL
&&
mNumLights
>
0
;
}
//! Check whether the scene contains textures
inline
bool
HasTextures
()
const
{
return
mTextures
!=
NULL
&&
mNumTextures
>
0
;
}
//! Check whether the scene contains cameras
inline
bool
HasCameras
()
const
{
return
mCameras
!=
NULL
&&
mNumCameras
>
0
;
}
//! Check whether the scene contains animations
inline
bool
HasAnimations
()
const
{
return
mAnimations
!=
NULL
&&
mNumAnimations
>
0
;
}
#endif // __cplusplus
/** Internal data, do not touch */
#ifdef __cplusplus
void
*
mPrivate
;
#else
char
*
mPrivate
;
#endif
};
#ifdef __cplusplus
}
//! namespace Assimp
#endif
#endif // AI_SCENE_H_INC
hw3d/assimp/include/assimp/texture.h
0 → 100644
View file @
f118aff1
/*
---------------------------------------------------------------------------
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2017, 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.
---------------------------------------------------------------------------
*/
/** @file texture.h
* @brief Defines texture helper structures for the library
*
* Used for file formats which embed their textures into the model file.
* Supported are both normal textures, which are stored as uncompressed
* pixels, and "compressed" textures, which are stored in a file format
* such as PNG or TGA.
*/
#pragma once
#ifndef AI_TEXTURE_H_INC
#define AI_TEXTURE_H_INC
#include "types.h"
#ifdef __cplusplus
extern
"C"
{
#endif
// --------------------------------------------------------------------------------
/** \def AI_EMBEDDED_TEXNAME_PREFIX
* \ref AI_MAKE_EMBEDDED_TEXNAME
*/
#ifndef AI_EMBEDDED_TEXNAME_PREFIX
# define AI_EMBEDDED_TEXNAME_PREFIX "*"
#endif
/** @def AI_MAKE_EMBEDDED_TEXNAME
* Used to build the reserved path name used by the material system to
* reference textures that are embedded into their corresponding
* model files. The parameter specifies the index of the texture
* (zero-based, in the aiScene::mTextures array)
*/
#if (!defined AI_MAKE_EMBEDDED_TEXNAME)
# define AI_MAKE_EMBEDDED_TEXNAME(_n_) AI_EMBEDDED_TEXNAME_PREFIX # _n_
#endif
#include "./Compiler/pushpack1.h"
// --------------------------------------------------------------------------------
/** @brief Helper structure to represent a texel in a ARGB8888 format
*
* Used by aiTexture.
*/
struct
aiTexel
{
unsigned
char
b
,
g
,
r
,
a
;
#ifdef __cplusplus
//! Comparison operator
bool
operator
==
(
const
aiTexel
&
other
)
const
{
return
b
==
other
.
b
&&
r
==
other
.
r
&&
g
==
other
.
g
&&
a
==
other
.
a
;
}
//! Inverse comparison operator
bool
operator
!=
(
const
aiTexel
&
other
)
const
{
return
b
!=
other
.
b
||
r
!=
other
.
r
||
g
!=
other
.
g
||
a
!=
other
.
a
;
}
//! Conversion to a floating-point 4d color
operator
aiColor4D
()
const
{
return
aiColor4D
(
r
/
255
.
f
,
g
/
255
.
f
,
b
/
255
.
f
,
a
/
255
.
f
);
}
#endif // __cplusplus
}
PACK_STRUCT
;
#include "./Compiler/poppack1.h"
// --------------------------------------------------------------------------------
/** Helper structure to describe an embedded texture
*
* Normally textures are contained in external files but some file formats embed
* them directly in the model file. There are two types of embedded textures:
* 1. Uncompressed textures. The color data is given in an uncompressed format.
* 2. Compressed textures stored in a file format like png or jpg. The raw file
* bytes are given so the application must utilize an image decoder (e.g. DevIL) to
* get access to the actual color data.
*
* Embedded textures are referenced from materials using strings like "*0", "*1", etc.
* as the texture paths (a single asterisk character followed by the
* zero-based index of the texture in the aiScene::mTextures array).
*/
struct
aiTexture
{
/** Width of the texture, in pixels
*
* If mHeight is zero the texture is compressed in a format
* like JPEG. In this case mWidth specifies the size of the
* memory area pcData is pointing to, in bytes.
*/
unsigned
int
mWidth
;
/** Height of the texture, in pixels
*
* If this value is zero, pcData points to an compressed texture
* in any format (e.g. JPEG).
*/
unsigned
int
mHeight
;
/** A hint from the loader to make it easier for applications
* to determine the type of embedded textures.
*
* If mHeight != 0 this member is show how data is packed. Hint will consist of
* two parts: channel order and channel bitness (count of the bits for every
* color channel). For simple parsing by the viewer it's better to not omit
* absent color channel and just use 0 for bitness. For example:
* 1. Image contain RGBA and 8 bit per channel, achFormatHint == "rgba8888";
* 2. Image contain ARGB and 8 bit per channel, achFormatHint == "argb8888";
* 3. Image contain RGB and 5 bit for R and B channels and 6 bit for G channel, achFormatHint == "rgba5650";
* 4. One color image with B channel and 1 bit for it, achFormatHint == "rgba0010";
* If mHeight == 0 then achFormatHint is set set to '\\0\\0\\0\\0' if the loader has no additional
* information about the texture file format used OR the
* file extension of the format without a trailing dot. If there
* are multiple file extensions for a format, the shortest
* extension is chosen (JPEG maps to 'jpg', not to 'jpeg').
* E.g. 'dds\\0', 'pcx\\0', 'jpg\\0'. All characters are lower-case.
* The fourth character will always be '\\0'.
*/
char
achFormatHint
[
9
];
// 8 for string + 1 for terminator.
/** Data of the texture.
*
* Points to an array of mWidth * mHeight aiTexel's.
* The format of the texture data is always ARGB8888 to
* make the implementation for user of the library as easy
* as possible. If mHeight = 0 this is a pointer to a memory
* buffer of size mWidth containing the compressed texture
* data. Good luck, have fun!
*/
C_STRUCT
aiTexel
*
pcData
;
#ifdef __cplusplus
//! For compressed textures (mHeight == 0): compare the
//! format hint against a given string.
//! @param s Input string. 3 characters are maximally processed.
//! Example values: "jpg", "png"
//! @return true if the given string matches the format hint
bool
CheckFormat
(
const
char
*
s
)
const
{
return
(
0
==
::
strncmp
(
achFormatHint
,
s
,
sizeof
(
achFormatHint
)));
}
// Construction
aiTexture
()
:
mWidth
(
0
)
,
mHeight
(
0
)
,
pcData
(
NULL
)
{
achFormatHint
[
0
]
=
achFormatHint
[
1
]
=
0
;
achFormatHint
[
2
]
=
achFormatHint
[
3
]
=
0
;
}
// Destruction
~
aiTexture
()
{
delete
[]
pcData
;
}
#endif
};
#ifdef __cplusplus
}
#endif
#endif // AI_TEXTURE_H_INC
hw3d/assimp/include/assimp/types.h
0 → 100644
View file @
f118aff1
/*
---------------------------------------------------------------------------
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2017, 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.
---------------------------------------------------------------------------
*/
/** @file types.h
* Basic data types and primitives, such as vectors or colors.
*/
#pragma once
#ifndef AI_TYPES_H_INC
#define AI_TYPES_H_INC
// Some runtime headers
#include <sys/types.h>
#include <stddef.h>
#include <string.h>
#include <limits.h>
// Our compile configuration
#include "defs.h"
// Some types moved to separate header due to size of operators
#include "vector3.h"
#include "vector2.h"
#include "color4.h"
#include "matrix3x3.h"
#include "matrix4x4.h"
#include "quaternion.h"
#ifdef __cplusplus
#include <cstring>
#include <new> // for std::nothrow_t
#include <string> // for aiString::Set(const std::string&)
namespace
Assimp
{
//! @cond never
namespace
Intern
{
// --------------------------------------------------------------------
/** @brief Internal helper class to utilize our internal new/delete
* routines for allocating object of this and derived classes.
*
* By doing this you can safely share class objects between Assimp
* and the application - it works even over DLL boundaries. A good
* example is the #IOSystem where the application allocates its custom
* #IOSystem, then calls #Importer::SetIOSystem(). When the Importer
* destructs, Assimp calls operator delete on the stored #IOSystem.
* If it lies on a different heap than Assimp is working with,
* the application is determined to crash.
*/
// --------------------------------------------------------------------
#ifndef SWIG
struct
ASSIMP_API
AllocateFromAssimpHeap
{
// http://www.gotw.ca/publications/mill15.htm
// new/delete overload
void
*
operator
new
(
size_t
num_bytes
)
/* throw( std::bad_alloc ) */
;
void
*
operator
new
(
size_t
num_bytes
,
const
std
::
nothrow_t
&
)
throw
();
void
operator
delete
(
void
*
data
);
// array new/delete overload
void
*
operator
new
[]
(
size_t
num_bytes
)
/* throw( std::bad_alloc ) */
;
void
*
operator
new
[]
(
size_t
num_bytes
,
const
std
::
nothrow_t
&
)
throw
();
void
operator
delete
[]
(
void
*
data
);
};
// struct AllocateFromAssimpHeap
#endif
}
// namespace Intern
//! @endcond
}
// namespace Assimp
extern
"C"
{
#endif
/** Maximum dimension for strings, ASSIMP strings are zero terminated. */
#ifdef __cplusplus
static
const
size_t
MAXLEN
=
1024
;
#else
# define MAXLEN 1024
#endif
// ----------------------------------------------------------------------------------
/** Represents a plane in a three-dimensional, euclidean space
*/
struct
aiPlane
{
#ifdef __cplusplus
aiPlane
()
:
a
(
0.
f
),
b
(
0.
f
),
c
(
0.
f
),
d
(
0.
f
)
{}
aiPlane
(
ai_real
_a
,
ai_real
_b
,
ai_real
_c
,
ai_real
_d
)
:
a
(
_a
),
b
(
_b
),
c
(
_c
),
d
(
_d
)
{}
aiPlane
(
const
aiPlane
&
o
)
:
a
(
o
.
a
),
b
(
o
.
b
),
c
(
o
.
c
),
d
(
o
.
d
)
{}
#endif // !__cplusplus
//! Plane equation
ai_real
a
,
b
,
c
,
d
;
};
// !struct aiPlane
// ----------------------------------------------------------------------------------
/** Represents a ray
*/
struct
aiRay
{
#ifdef __cplusplus
aiRay
()
{}
aiRay
(
const
aiVector3D
&
_pos
,
const
aiVector3D
&
_dir
)
:
pos
(
_pos
),
dir
(
_dir
)
{}
aiRay
(
const
aiRay
&
o
)
:
pos
(
o
.
pos
),
dir
(
o
.
dir
)
{}
#endif // !__cplusplus
//! Position and direction of the ray
C_STRUCT
aiVector3D
pos
,
dir
;
};
// !struct aiRay
// ----------------------------------------------------------------------------------
/** Represents a color in Red-Green-Blue space.
*/
struct
aiColor3D
{
#ifdef __cplusplus
aiColor3D
()
:
r
(
0.0
f
),
g
(
0.0
f
),
b
(
0.0
f
)
{}
aiColor3D
(
ai_real
_r
,
ai_real
_g
,
ai_real
_b
)
:
r
(
_r
),
g
(
_g
),
b
(
_b
)
{}
explicit
aiColor3D
(
ai_real
_r
)
:
r
(
_r
),
g
(
_r
),
b
(
_r
)
{}
aiColor3D
(
const
aiColor3D
&
o
)
:
r
(
o
.
r
),
g
(
o
.
g
),
b
(
o
.
b
)
{}
/** Component-wise comparison */
// TODO: add epsilon?
bool
operator
==
(
const
aiColor3D
&
other
)
const
{
return
r
==
other
.
r
&&
g
==
other
.
g
&&
b
==
other
.
b
;}
/** Component-wise inverse comparison */
// TODO: add epsilon?
bool
operator
!=
(
const
aiColor3D
&
other
)
const
{
return
r
!=
other
.
r
||
g
!=
other
.
g
||
b
!=
other
.
b
;}
/** Component-wise comparison */
// TODO: add epsilon?
bool
operator
<
(
const
aiColor3D
&
other
)
const
{
return
r
<
other
.
r
||
(
r
==
other
.
r
&&
(
g
<
other
.
g
||
(
g
==
other
.
g
&&
b
<
other
.
b
)
)
);
}
/** Component-wise addition */
aiColor3D
operator
+
(
const
aiColor3D
&
c
)
const
{
return
aiColor3D
(
r
+
c
.
r
,
g
+
c
.
g
,
b
+
c
.
b
);
}
/** Component-wise subtraction */
aiColor3D
operator
-
(
const
aiColor3D
&
c
)
const
{
return
aiColor3D
(
r
-
c
.
r
,
g
-
c
.
g
,
b
-
c
.
b
);
}
/** Component-wise multiplication */
aiColor3D
operator
*
(
const
aiColor3D
&
c
)
const
{
return
aiColor3D
(
r
*
c
.
r
,
g
*
c
.
g
,
b
*
c
.
b
);
}
/** Multiply with a scalar */
aiColor3D
operator
*
(
ai_real
f
)
const
{
return
aiColor3D
(
r
*
f
,
g
*
f
,
b
*
f
);
}
/** Access a specific color component */
ai_real
operator
[](
unsigned
int
i
)
const
{
return
*
(
&
r
+
i
);
}
/** Access a specific color component */
ai_real
&
operator
[](
unsigned
int
i
)
{
if
(
0
==
i
)
{
return
r
;
}
else
if
(
1
==
i
)
{
return
g
;
}
else
if
(
2
==
i
)
{
return
b
;
}
return
r
;
}
/** Check whether a color is black */
bool
IsBlack
()
const
{
static
const
ai_real
epsilon
=
ai_real
(
10e-3
);
return
std
::
fabs
(
r
)
<
epsilon
&&
std
::
fabs
(
g
)
<
epsilon
&&
std
::
fabs
(
b
)
<
epsilon
;
}
#endif // !__cplusplus
//! Red, green and blue color values
ai_real
r
,
g
,
b
;
};
// !struct aiColor3D
// ----------------------------------------------------------------------------------
/** Represents an UTF-8 string, zero byte terminated.
*
* The character set of an aiString is explicitly defined to be UTF-8. This Unicode
* transformation was chosen in the belief that most strings in 3d files are limited
* to ASCII, thus the character set needed to be strictly ASCII compatible.
*
* Most text file loaders provide proper Unicode input file handling, special unicode
* characters are correctly transcoded to UTF8 and are kept throughout the libraries'
* import pipeline.
*
* For most applications, it will be absolutely sufficient to interpret the
* aiString as ASCII data and work with it as one would work with a plain char*.
* Windows users in need of proper support for i.e asian characters can use the
* MultiByteToWideChar(), WideCharToMultiByte() WinAPI functionality to convert the
* UTF-8 strings to their working character set (i.e. MBCS, WideChar).
*
* We use this representation instead of std::string to be C-compatible. The
* (binary) length of such a string is limited to MAXLEN characters (including the
* the terminating zero).
*/
struct
aiString
{
#ifdef __cplusplus
/** Default constructor, the string is set to have zero length */
aiString
()
:
length
(
0
)
{
data
[
0
]
=
'\0'
;
#ifdef ASSIMP_BUILD_DEBUG
// Debug build: overwrite the string on its full length with ESC (27)
memset
(
data
+
1
,
27
,
MAXLEN
-
1
);
#endif
}
/** Copy constructor */
aiString
(
const
aiString
&
rOther
)
:
length
(
rOther
.
length
)
{
// Crop the string to the maximum length
length
=
length
>=
MAXLEN
?
MAXLEN
-
1
:
length
;
memcpy
(
data
,
rOther
.
data
,
length
);
data
[
length
]
=
'\0'
;
}
/** Constructor from std::string */
explicit
aiString
(
const
std
::
string
&
pString
)
:
length
(
pString
.
length
())
{
length
=
length
>=
MAXLEN
?
MAXLEN
-
1
:
length
;
memcpy
(
data
,
pString
.
c_str
(),
length
);
data
[
length
]
=
'\0'
;
}
/** Copy a std::string to the aiString */
void
Set
(
const
std
::
string
&
pString
)
{
if
(
pString
.
length
()
>
MAXLEN
-
1
)
{
return
;
}
length
=
pString
.
length
();
memcpy
(
data
,
pString
.
c_str
(),
length
);
data
[
length
]
=
0
;
}
/** Copy a const char* to the aiString */
void
Set
(
const
char
*
sz
)
{
const
size_t
len
=
::
strlen
(
sz
);
if
(
len
>
MAXLEN
-
1
)
{
return
;
}
length
=
len
;
memcpy
(
data
,
sz
,
len
);
data
[
len
]
=
0
;
}
/** Assign a const char* to the string */
aiString
&
operator
=
(
const
char
*
sz
)
{
Set
(
sz
);
return
*
this
;
}
/** Assign a cstd::string to the string */
aiString
&
operator
=
(
const
std
::
string
&
pString
)
{
Set
(
pString
);
return
*
this
;
}
/** Comparison operator */
bool
operator
==
(
const
aiString
&
other
)
const
{
return
(
length
==
other
.
length
&&
0
==
memcmp
(
data
,
other
.
data
,
length
));
}
/** Inverse comparison operator */
bool
operator
!=
(
const
aiString
&
other
)
const
{
return
(
length
!=
other
.
length
||
0
!=
memcmp
(
data
,
other
.
data
,
length
));
}
/** Append a string to the string */
void
Append
(
const
char
*
app
)
{
const
size_t
len
=
::
strlen
(
app
);
if
(
!
len
)
{
return
;
}
if
(
length
+
len
>=
MAXLEN
)
{
return
;
}
memcpy
(
&
data
[
length
],
app
,
len
+
1
);
length
+=
len
;
}
/** Clear the string - reset its length to zero */
void
Clear
()
{
length
=
0
;
data
[
0
]
=
'\0'
;
#ifdef ASSIMP_BUILD_DEBUG
// Debug build: overwrite the string on its full length with ESC (27)
memset
(
data
+
1
,
27
,
MAXLEN
-
1
);
#endif
}
/** Returns a pointer to the underlying zero-terminated array of characters */
const
char
*
C_Str
()
const
{
return
data
;
}
#endif // !__cplusplus
/** Binary length of the string excluding the terminal 0. This is NOT the
* logical length of strings containing UTF-8 multibyte sequences! It's
* the number of bytes from the beginning of the string to its end.*/
size_t
length
;
/** String buffer. Size limit is MAXLEN */
char
data
[
MAXLEN
];
}
;
// !struct aiString
// ----------------------------------------------------------------------------------
/** Standard return type for some library functions.
* Rarely used, and if, mostly in the C API.
*/
typedef
enum
aiReturn
{
/** Indicates that a function was successful */
aiReturn_SUCCESS
=
0x0
,
/** Indicates that a function failed */
aiReturn_FAILURE
=
-
0x1
,
/** Indicates that not enough memory was available
* to perform the requested operation
*/
aiReturn_OUTOFMEMORY
=
-
0x3
,
/** @cond never
* Force 32-bit size enum
*/
_AI_ENFORCE_ENUM_SIZE
=
0x7fffffff
/// @endcond
}
aiReturn
;
// !enum aiReturn
// just for backwards compatibility, don't use these constants anymore
#define AI_SUCCESS aiReturn_SUCCESS
#define AI_FAILURE aiReturn_FAILURE
#define AI_OUTOFMEMORY aiReturn_OUTOFMEMORY
// ----------------------------------------------------------------------------------
/** Seek origins (for the virtual file system API).
* Much cooler than using SEEK_SET, SEEK_CUR or SEEK_END.
*/
enum
aiOrigin
{
/** Beginning of the file */
aiOrigin_SET
=
0x0
,
/** Current position of the file pointer */
aiOrigin_CUR
=
0x1
,
/** End of the file, offsets must be negative */
aiOrigin_END
=
0x2
,
/** @cond never
* Force 32-bit size enum
*/
_AI_ORIGIN_ENFORCE_ENUM_SIZE
=
0x7fffffff
/// @endcond
};
// !enum aiOrigin
// ----------------------------------------------------------------------------------
/** @brief Enumerates predefined log streaming destinations.
* Logging to these streams can be enabled with a single call to
* #LogStream::createDefaultStream.
*/
enum
aiDefaultLogStream
{
/** Stream the log to a file */
aiDefaultLogStream_FILE
=
0x1
,
/** Stream the log to std::cout */
aiDefaultLogStream_STDOUT
=
0x2
,
/** Stream the log to std::cerr */
aiDefaultLogStream_STDERR
=
0x4
,
/** MSVC only: Stream the log the the debugger
* (this relies on OutputDebugString from the Win32 SDK)
*/
aiDefaultLogStream_DEBUGGER
=
0x8
,
/** @cond never
* Force 32-bit size enum
*/
_AI_DLS_ENFORCE_ENUM_SIZE
=
0x7fffffff
/// @endcond
};
// !enum aiDefaultLogStream
// just for backwards compatibility, don't use these constants anymore
#define DLS_FILE aiDefaultLogStream_FILE
#define DLS_STDOUT aiDefaultLogStream_STDOUT
#define DLS_STDERR aiDefaultLogStream_STDERR
#define DLS_DEBUGGER aiDefaultLogStream_DEBUGGER
// ----------------------------------------------------------------------------------
/** Stores the memory requirements for different components (e.g. meshes, materials,
* animations) of an import. All sizes are in bytes.
* @see Importer::GetMemoryRequirements()
*/
struct
aiMemoryInfo
{
#ifdef __cplusplus
/** Default constructor */
aiMemoryInfo
()
:
textures
(
0
)
,
materials
(
0
)
,
meshes
(
0
)
,
nodes
(
0
)
,
animations
(
0
)
,
cameras
(
0
)
,
lights
(
0
)
,
total
(
0
)
{}
#endif
/** Storage allocated for texture data */
unsigned
int
textures
;
/** Storage allocated for material data */
unsigned
int
materials
;
/** Storage allocated for mesh data */
unsigned
int
meshes
;
/** Storage allocated for node data */
unsigned
int
nodes
;
/** Storage allocated for animation data */
unsigned
int
animations
;
/** Storage allocated for camera data */
unsigned
int
cameras
;
/** Storage allocated for light data */
unsigned
int
lights
;
/** Total storage allocated for the full import. */
unsigned
int
total
;
};
// !struct aiMemoryInfo
#ifdef __cplusplus
}
#endif //! __cplusplus
// Include implementation files
#include "vector2.inl"
#include "vector3.inl"
#include "color4.inl"
#include "quaternion.inl"
#include "matrix3x3.inl"
#include "matrix4x4.inl"
#endif // AI_TYPES_H_INC
hw3d/assimp/include/assimp/vector2.h
0 → 100644
View file @
f118aff1
/*
---------------------------------------------------------------------------
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2017, 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.
---------------------------------------------------------------------------
*/
/** @file vector2.h
* @brief 2D vector structure, including operators when compiling in C++
*/
#pragma once
#ifndef AI_VECTOR2D_H_INC
#define AI_VECTOR2D_H_INC
#ifdef __cplusplus
# include <cmath>
#else
# include <math.h>
#endif
#include "./Compiler/pushpack1.h"
#include "defs.h"
// ----------------------------------------------------------------------------------
/** Represents a two-dimensional vector.
*/
#ifdef __cplusplus
template
<
typename
TReal
>
class
aiVector2t
{
public:
aiVector2t
()
:
x
(),
y
()
{}
aiVector2t
(
TReal
_x
,
TReal
_y
)
:
x
(
_x
),
y
(
_y
)
{}
explicit
aiVector2t
(
TReal
_xyz
)
:
x
(
_xyz
),
y
(
_xyz
)
{}
aiVector2t
(
const
aiVector2t
&
o
)
:
x
(
o
.
x
),
y
(
o
.
y
)
{}
public:
void
Set
(
TReal
pX
,
TReal
pY
);
TReal
SquareLength
()
const
;
TReal
Length
()
const
;
aiVector2t
&
Normalize
();
public:
const
aiVector2t
&
operator
+=
(
const
aiVector2t
&
o
);
const
aiVector2t
&
operator
-=
(
const
aiVector2t
&
o
);
const
aiVector2t
&
operator
*=
(
TReal
f
);
const
aiVector2t
&
operator
/=
(
TReal
f
);
TReal
operator
[](
unsigned
int
i
)
const
;
TReal
&
operator
[](
unsigned
int
i
);
bool
operator
==
(
const
aiVector2t
&
other
)
const
;
bool
operator
!=
(
const
aiVector2t
&
other
)
const
;
bool
Equal
(
const
aiVector2t
&
other
,
TReal
epsilon
=
1e-6
)
const
;
aiVector2t
&
operator
=
(
TReal
f
);
const
aiVector2t
SymMul
(
const
aiVector2t
&
o
);
template
<
typename
TOther
>
operator
aiVector2t
<
TOther
>
()
const
;
TReal
x
,
y
;
}
PACK_STRUCT
;
typedef
aiVector2t
<
ai_real
>
aiVector2D
;
#else
struct
aiVector2D
{
ai_real
x
,
y
;
};
#endif // __cplusplus
#include "./Compiler/poppack1.h"
#endif // AI_VECTOR2D_H_INC
hw3d/assimp/include/assimp/vector2.inl
0 → 100644
View file @
f118aff1
/*
---------------------------------------------------------------------------
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2017, 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.
---------------------------------------------------------------------------
*/
/** @file vector2.inl
* @brief Inline implementation of aiVector2t<TReal> operators
*/
#pragma once
#ifndef AI_VECTOR2D_INL_INC
#define AI_VECTOR2D_INL_INC
#ifdef __cplusplus
#include "vector2.h"
#include <cmath>
// ------------------------------------------------------------------------------------------------
template <typename TReal>
template <typename TOther>
aiVector2t<TReal>::operator aiVector2t<TOther> () const {
return aiVector2t<TOther>(static_cast<TOther>(x),static_cast<TOther>(y));
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
void aiVector2t<TReal>::Set( TReal pX, TReal pY) {
x = pX; y = pY;
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
TReal aiVector2t<TReal>::SquareLength() const {
return x*x + y*y;
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
TReal aiVector2t<TReal>::Length() const {
return std::sqrt( SquareLength());
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
aiVector2t<TReal>& aiVector2t<TReal>::Normalize() {
*this /= Length();
return *this;
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
const aiVector2t<TReal>& aiVector2t<TReal>::operator += (const aiVector2t& o) {
x += o.x; y += o.y;
return *this;
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
const aiVector2t<TReal>& aiVector2t<TReal>::operator -= (const aiVector2t& o) {
x -= o.x; y -= o.y;
return *this;
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
const aiVector2t<TReal>& aiVector2t<TReal>::operator *= (TReal f) {
x *= f; y *= f;
return *this;
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
const aiVector2t<TReal>& aiVector2t<TReal>::operator /= (TReal f) {
x /= f; y /= f;
return *this;
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
TReal aiVector2t<TReal>::operator[](unsigned int i) const {
return *(&x + i);
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
TReal& aiVector2t<TReal>::operator[](unsigned int i) {
return *(&x + i);
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
bool aiVector2t<TReal>::operator== (const aiVector2t& other) const {
return x == other.x && y == other.y;
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
bool aiVector2t<TReal>::operator!= (const aiVector2t& other) const {
return x != other.x || y != other.y;
}
// ---------------------------------------------------------------------------
template<typename TReal>
bool aiVector2t<TReal>::Equal(const aiVector2t& other, TReal epsilon) const {
return
std::abs(x - other.x) <= epsilon &&
std::abs(y - other.y) <= epsilon;
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
aiVector2t<TReal>& aiVector2t<TReal>::operator= (TReal f) {
x = y = f;
return *this;
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
const aiVector2t<TReal> aiVector2t<TReal>::SymMul(const aiVector2t& o) {
return aiVector2t(x*o.x,y*o.y);
}
// ------------------------------------------------------------------------------------------------
// symmetric addition
template <typename TReal>
inline aiVector2t<TReal> operator + (const aiVector2t<TReal>& v1, const aiVector2t<TReal>& v2)
{
return aiVector2t<TReal>( v1.x + v2.x, v1.y + v2.y);
}
// ------------------------------------------------------------------------------------------------
// symmetric subtraction
template <typename TReal>
inline aiVector2t<TReal> operator - (const aiVector2t<TReal>& v1, const aiVector2t<TReal>& v2)
{
return aiVector2t<TReal>( v1.x - v2.x, v1.y - v2.y);
}
// ------------------------------------------------------------------------------------------------
// scalar product
template <typename TReal>
inline TReal operator * (const aiVector2t<TReal>& v1, const aiVector2t<TReal>& v2)
{
return v1.x*v2.x + v1.y*v2.y;
}
// ------------------------------------------------------------------------------------------------
// scalar multiplication
template <typename TReal>
inline aiVector2t<TReal> operator * ( TReal f, const aiVector2t<TReal>& v)
{
return aiVector2t<TReal>( f*v.x, f*v.y);
}
// ------------------------------------------------------------------------------------------------
// and the other way around
template <typename TReal>
inline aiVector2t<TReal> operator * ( const aiVector2t<TReal>& v, TReal f)
{
return aiVector2t<TReal>( f*v.x, f*v.y);
}
// ------------------------------------------------------------------------------------------------
// scalar division
template <typename TReal>
inline aiVector2t<TReal> operator / ( const aiVector2t<TReal>& v, TReal f)
{
return v * (1/f);
}
// ------------------------------------------------------------------------------------------------
// vector division
template <typename TReal>
inline aiVector2t<TReal> operator / ( const aiVector2t<TReal>& v, const aiVector2t<TReal>& v2)
{
return aiVector2t<TReal>(v.x / v2.x,v.y / v2.y);
}
// ------------------------------------------------------------------------------------------------
// vector negation
template <typename TReal>
inline aiVector2t<TReal> operator - ( const aiVector2t<TReal>& v)
{
return aiVector2t<TReal>( -v.x, -v.y);
}
#endif
#endif // AI_VECTOR2D_INL_INC
hw3d/assimp/include/assimp/vector3.h
0 → 100644
View file @
f118aff1
/*
---------------------------------------------------------------------------
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2017, 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.
---------------------------------------------------------------------------
*/
/** @file vector3.h
* @brief 3D vector structure, including operators when compiling in C++
*/
#pragma once
#ifndef AI_VECTOR3D_H_INC
#define AI_VECTOR3D_H_INC
#ifdef __cplusplus
# include <cmath>
#else
# include <math.h>
#endif
#include "defs.h"
#ifdef __cplusplus
template
<
typename
TReal
>
class
aiMatrix3x3t
;
template
<
typename
TReal
>
class
aiMatrix4x4t
;
// ---------------------------------------------------------------------------
/** Represents a three-dimensional vector. */
template
<
typename
TReal
>
class
aiVector3t
{
public:
aiVector3t
()
:
x
(),
y
(),
z
()
{}
aiVector3t
(
TReal
_x
,
TReal
_y
,
TReal
_z
)
:
x
(
_x
),
y
(
_y
),
z
(
_z
)
{}
explicit
aiVector3t
(
TReal
_xyz
)
:
x
(
_xyz
),
y
(
_xyz
),
z
(
_xyz
)
{}
aiVector3t
(
const
aiVector3t
&
o
)
:
x
(
o
.
x
),
y
(
o
.
y
),
z
(
o
.
z
)
{}
public:
// combined operators
const
aiVector3t
&
operator
+=
(
const
aiVector3t
&
o
);
const
aiVector3t
&
operator
-=
(
const
aiVector3t
&
o
);
const
aiVector3t
&
operator
*=
(
TReal
f
);
const
aiVector3t
&
operator
/=
(
TReal
f
);
// transform vector by matrix
aiVector3t
&
operator
*=
(
const
aiMatrix3x3t
<
TReal
>&
mat
);
aiVector3t
&
operator
*=
(
const
aiMatrix4x4t
<
TReal
>&
mat
);
// access a single element
TReal
operator
[](
unsigned
int
i
)
const
;
TReal
&
operator
[](
unsigned
int
i
);
// comparison
bool
operator
==
(
const
aiVector3t
&
other
)
const
;
bool
operator
!=
(
const
aiVector3t
&
other
)
const
;
bool
operator
<
(
const
aiVector3t
&
other
)
const
;
bool
Equal
(
const
aiVector3t
&
other
,
TReal
epsilon
=
1e-6
)
const
;
template
<
typename
TOther
>
operator
aiVector3t
<
TOther
>
()
const
;
public:
/** @brief Set the components of a vector
* @param pX X component
* @param pY Y component
* @param pZ Z component */
void
Set
(
TReal
pX
,
TReal
pY
,
TReal
pZ
);
/** @brief Get the squared length of the vector
* @return Square length */
TReal
SquareLength
()
const
;
/** @brief Get the length of the vector
* @return length */
TReal
Length
()
const
;
/** @brief Normalize the vector */
aiVector3t
&
Normalize
();
/** @brief Normalize the vector with extra check for zero vectors */
aiVector3t
&
NormalizeSafe
();
/** @brief Componentwise multiplication of two vectors
*
* Note that vec*vec yields the dot product.
* @param o Second factor */
const
aiVector3t
SymMul
(
const
aiVector3t
&
o
);
TReal
x
,
y
,
z
;
};
typedef
aiVector3t
<
ai_real
>
aiVector3D
;
#else
struct
aiVector3D
{
ai_real
x
,
y
,
z
;
};
#endif // __cplusplus
#ifdef __cplusplus
#endif // __cplusplus
#endif // AI_VECTOR3D_H_INC
hw3d/assimp/include/assimp/vector3.inl
0 → 100644
View file @
f118aff1
/*
---------------------------------------------------------------------------
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2017, 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.
---------------------------------------------------------------------------
*/
/** @file vector3.inl
* @brief Inline implementation of aiVector3t<TReal> operators
*/
#pragma once
#ifndef AI_VECTOR3D_INL_INC
#define AI_VECTOR3D_INL_INC
#ifdef __cplusplus
#include "vector3.h"
#include <cmath>
// ------------------------------------------------------------------------------------------------
/** Transformation of a vector by a 3x3 matrix */
template <typename TReal>
inline aiVector3t<TReal> operator * (const aiMatrix3x3t<TReal>& pMatrix, const aiVector3t<TReal>& pVector)
{
aiVector3t<TReal> res;
res.x = pMatrix.a1 * pVector.x + pMatrix.a2 * pVector.y + pMatrix.a3 * pVector.z;
res.y = pMatrix.b1 * pVector.x + pMatrix.b2 * pVector.y + pMatrix.b3 * pVector.z;
res.z = pMatrix.c1 * pVector.x + pMatrix.c2 * pVector.y + pMatrix.c3 * pVector.z;
return res;
}
// ------------------------------------------------------------------------------------------------
/** Transformation of a vector by a 4x4 matrix */
template <typename TReal>
inline aiVector3t<TReal> operator * (const aiMatrix4x4t<TReal>& pMatrix, const aiVector3t<TReal>& pVector)
{
aiVector3t<TReal> res;
res.x = pMatrix.a1 * pVector.x + pMatrix.a2 * pVector.y + pMatrix.a3 * pVector.z + pMatrix.a4;
res.y = pMatrix.b1 * pVector.x + pMatrix.b2 * pVector.y + pMatrix.b3 * pVector.z + pMatrix.b4;
res.z = pMatrix.c1 * pVector.x + pMatrix.c2 * pVector.y + pMatrix.c3 * pVector.z + pMatrix.c4;
return res;
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
template <typename TOther>
aiVector3t<TReal>::operator aiVector3t<TOther> () const {
return aiVector3t<TOther>(static_cast<TOther>(x),static_cast<TOther>(y),static_cast<TOther>(z));
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE void aiVector3t<TReal>::Set( TReal pX, TReal pY, TReal pZ) {
x = pX; y = pY; z = pZ;
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE TReal aiVector3t<TReal>::SquareLength() const {
return x*x + y*y + z*z;
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE TReal aiVector3t<TReal>::Length() const {
return std::sqrt( SquareLength());
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE aiVector3t<TReal>& aiVector3t<TReal>::Normalize() {
*this /= Length(); return *this;
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE aiVector3t<TReal>& aiVector3t<TReal>::NormalizeSafe() {
TReal len = Length();
if (len > static_cast<TReal>(0))
*this /= len;
return *this;
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE const aiVector3t<TReal>& aiVector3t<TReal>::operator += (const aiVector3t<TReal>& o) {
x += o.x; y += o.y; z += o.z; return *this;
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE const aiVector3t<TReal>& aiVector3t<TReal>::operator -= (const aiVector3t<TReal>& o) {
x -= o.x; y -= o.y; z -= o.z; return *this;
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE const aiVector3t<TReal>& aiVector3t<TReal>::operator *= (TReal f) {
x *= f; y *= f; z *= f; return *this;
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE const aiVector3t<TReal>& aiVector3t<TReal>::operator /= (TReal f) {
x /= f; y /= f; z /= f; return *this;
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE aiVector3t<TReal>& aiVector3t<TReal>::operator *= (const aiMatrix3x3t<TReal>& mat){
return(*this = mat * (*this));
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE aiVector3t<TReal>& aiVector3t<TReal>::operator *= (const aiMatrix4x4t<TReal>& mat){
return(*this = mat * (*this));
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE TReal aiVector3t<TReal>::operator[](unsigned int i) const {
// return *(&x + i);
switch (i) {
case 0:
return x;
case 1:
return y;
case 2:
return z;
default:
break;
}
return x;
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE TReal& aiVector3t<TReal>::operator[](unsigned int i) {
// return *(&x + i);
switch (i) {
case 0:
return x;
case 1:
return y;
case 2:
return z;
default:
break;
}
return x;
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE bool aiVector3t<TReal>::operator== (const aiVector3t<TReal>& other) const {
return x == other.x && y == other.y && z == other.z;
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE bool aiVector3t<TReal>::operator!= (const aiVector3t<TReal>& other) const {
return x != other.x || y != other.y || z != other.z;
}
// ---------------------------------------------------------------------------
template<typename TReal>
AI_FORCE_INLINE bool aiVector3t<TReal>::Equal(const aiVector3t<TReal>& other, TReal epsilon) const {
return
std::abs(x - other.x) <= epsilon &&
std::abs(y - other.y) <= epsilon &&
std::abs(z - other.z) <= epsilon;
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE bool aiVector3t<TReal>::operator < (const aiVector3t<TReal>& other) const {
return x != other.x ? x < other.x : y != other.y ? y < other.y : z < other.z;
}
// ------------------------------------------------------------------------------------------------
template <typename TReal>
AI_FORCE_INLINE const aiVector3t<TReal> aiVector3t<TReal>::SymMul(const aiVector3t<TReal>& o) {
return aiVector3t<TReal>(x*o.x,y*o.y,z*o.z);
}
// ------------------------------------------------------------------------------------------------
// symmetric addition
template <typename TReal>
AI_FORCE_INLINE aiVector3t<TReal> operator + (const aiVector3t<TReal>& v1, const aiVector3t<TReal>& v2) {
return aiVector3t<TReal>( v1.x + v2.x, v1.y + v2.y, v1.z + v2.z);
}
// ------------------------------------------------------------------------------------------------
// symmetric subtraction
template <typename TReal>
AI_FORCE_INLINE aiVector3t<TReal> operator - (const aiVector3t<TReal>& v1, const aiVector3t<TReal>& v2) {
return aiVector3t<TReal>( v1.x - v2.x, v1.y - v2.y, v1.z - v2.z);
}
// ------------------------------------------------------------------------------------------------
// scalar product
template <typename TReal>
AI_FORCE_INLINE TReal operator * (const aiVector3t<TReal>& v1, const aiVector3t<TReal>& v2) {
return v1.x*v2.x + v1.y*v2.y + v1.z*v2.z;
}
// ------------------------------------------------------------------------------------------------
// scalar multiplication
template <typename TReal>
AI_FORCE_INLINE aiVector3t<TReal> operator * ( TReal f, const aiVector3t<TReal>& v) {
return aiVector3t<TReal>( f*v.x, f*v.y, f*v.z);
}
// ------------------------------------------------------------------------------------------------
// and the other way around
template <typename TReal>
AI_FORCE_INLINE aiVector3t<TReal> operator * ( const aiVector3t<TReal>& v, TReal f) {
return aiVector3t<TReal>( f*v.x, f*v.y, f*v.z);
}
// ------------------------------------------------------------------------------------------------
// scalar division
template <typename TReal>
AI_FORCE_INLINE aiVector3t<TReal> operator / ( const aiVector3t<TReal>& v, TReal f) {
return v * (1/f);
}
// ------------------------------------------------------------------------------------------------
// vector division
template <typename TReal>
AI_FORCE_INLINE aiVector3t<TReal> operator / ( const aiVector3t<TReal>& v, const aiVector3t<TReal>& v2) {
return aiVector3t<TReal>(v.x / v2.x,v.y / v2.y,v.z / v2.z);
}
// ------------------------------------------------------------------------------------------------
// cross product
template <typename TReal>
AI_FORCE_INLINE aiVector3t<TReal> operator ^ ( const aiVector3t<TReal>& v1, const aiVector3t<TReal>& v2) {
return aiVector3t<TReal>( v1.y*v2.z - v1.z*v2.y, v1.z*v2.x - v1.x*v2.z, v1.x*v2.y - v1.y*v2.x);
}
// ------------------------------------------------------------------------------------------------
// vector negation
template <typename TReal>
AI_FORCE_INLINE aiVector3t<TReal> operator - ( const aiVector3t<TReal>& v) {
return aiVector3t<TReal>( -v.x, -v.y, -v.z);
}
// ------------------------------------------------------------------------------------------------
#endif // __cplusplus
#endif // AI_VECTOR3D_INL_INC
hw3d/assimp/include/assimp/version.h
0 → 100644
View file @
f118aff1
/*
---------------------------------------------------------------------------
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2017, 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.
---------------------------------------------------------------------------
*/
/** @file version.h
* @brief Functions to query the version of the Assimp runtime, check
* compile flags, ...
*/
#pragma once
#ifndef AI_VERSION_H_INC
#define AI_VERSION_H_INC
#include "defs.h"
#ifdef __cplusplus
extern
"C"
{
#endif
// ---------------------------------------------------------------------------
/** @brief Returns a string with legal copyright and licensing information
* about Assimp. The string may include multiple lines.
* @return Pointer to static string.
*/
ASSIMP_API
const
char
*
aiGetLegalString
(
void
);
// ---------------------------------------------------------------------------
/** @brief Returns the current minor version number of Assimp.
* @return Minor version of the Assimp runtime the application was
* linked/built against
*/
ASSIMP_API
unsigned
int
aiGetVersionMinor
(
void
);
// ---------------------------------------------------------------------------
/** @brief Returns the current major version number of Assimp.
* @return Major version of the Assimp runtime the application was
* linked/built against
*/
ASSIMP_API
unsigned
int
aiGetVersionMajor
(
void
);
// ---------------------------------------------------------------------------
/** @brief Returns the repository revision of the Assimp runtime.
* @return SVN Repository revision number of the Assimp runtime the
* application was linked/built against.
*/
ASSIMP_API
unsigned
int
aiGetVersionRevision
(
void
);
//! Assimp was compiled as a shared object (Windows: DLL)
#define ASSIMP_CFLAGS_SHARED 0x1
//! Assimp was compiled against STLport
#define ASSIMP_CFLAGS_STLPORT 0x2
//! Assimp was compiled as a debug build
#define ASSIMP_CFLAGS_DEBUG 0x4
//! Assimp was compiled with ASSIMP_BUILD_BOOST_WORKAROUND defined
#define ASSIMP_CFLAGS_NOBOOST 0x8
//! Assimp was compiled with ASSIMP_BUILD_SINGLETHREADED defined
#define ASSIMP_CFLAGS_SINGLETHREADED 0x10
// ---------------------------------------------------------------------------
/** @brief Returns assimp's compile flags
* @return Any bitwise combination of the ASSIMP_CFLAGS_xxx constants.
*/
ASSIMP_API
unsigned
int
aiGetCompileFlags
(
void
);
#ifdef __cplusplus
}
// end extern "C"
#endif
#endif // !! #ifndef AI_VERSION_H_INC
hw3d/hw3d.vcxproj
View file @
f118aff1
<?xml version="1.0" encoding="utf-8"?>
<Project
DefaultTargets=
"Build"
ToolsVersion=
"15.0"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<ItemGroup
Label=
"ProjectConfigurations"
>
<ProjectConfiguration
Include=
"Debug|Win32"
>
<Configuration>
Debug
</Configuration>
<Platform>
Win32
</Platform>
</ProjectConfiguration>
<ProjectConfiguration
Include=
"Release|Win32"
>
<Configuration>
Release
</Configuration>
<Platform>
Win32
</Platform>
</ProjectConfiguration>
<ProjectConfiguration
Include=
"Debug|x64"
>
<Configuration>
Debug
</Configuration>
<Platform>
x64
</Platform>
...
...
@@ -25,19 +17,6 @@
<WindowsTargetPlatformVersion>
10.0.17763.0
</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import
Project=
"$(VCTargetsPath)\Microsoft.Cpp.Default.props"
/>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
Label=
"Configuration"
>
<ConfigurationType>
Application
</ConfigurationType>
<UseDebugLibraries>
true
</UseDebugLibraries>
<PlatformToolset>
v141
</PlatformToolset>
<CharacterSet>
MultiByte
</CharacterSet>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
Label=
"Configuration"
>
<ConfigurationType>
Application
</ConfigurationType>
<UseDebugLibraries>
false
</UseDebugLibraries>
<PlatformToolset>
v141
</PlatformToolset>
<WholeProgramOptimization>
true
</WholeProgramOptimization>
<CharacterSet>
MultiByte
</CharacterSet>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
Label=
"Configuration"
>
<ConfigurationType>
Application
</ConfigurationType>
<UseDebugLibraries>
true
</UseDebugLibraries>
...
...
@@ -56,12 +35,6 @@
</ImportGroup>
<ImportGroup
Label=
"Shared"
>
</ImportGroup>
<ImportGroup
Label=
"PropertySheets"
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
<Import
Project=
"$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition=
"exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
Label=
"LocalAppDataPlatform"
/>
</ImportGroup>
<ImportGroup
Label=
"PropertySheets"
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
<Import
Project=
"$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition=
"exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
Label=
"LocalAppDataPlatform"
/>
</ImportGroup>
<ImportGroup
Label=
"PropertySheets"
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
<Import
Project=
"$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition=
"exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
Label=
"LocalAppDataPlatform"
/>
</ImportGroup>
...
...
@@ -69,24 +42,14 @@
<Import
Project=
"$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition=
"exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
Label=
"LocalAppDataPlatform"
/>
</ImportGroup>
<PropertyGroup
Label=
"UserMacros"
/>
<PropertyGroup
/>
<ItemDefinitionGroup
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
<ClCompile>
<WarningLevel>
Level3
</WarningLevel>
<Optimization>
Disabled
</Optimization>
<SDLCheck>
true
</SDLCheck>
<ConformanceMode>
true
</ConformanceMode>
<MultiProcessorCompilation>
true
</MultiProcessorCompilation>
<FavorSizeOrSpeed>
Speed
</FavorSizeOrSpeed>
<RuntimeLibrary>
MultiThreadedDebug
</RuntimeLibrary>
<FloatingPointModel>
Fast
</FloatingPointModel>
<LanguageStandard>
stdcpplatest
</LanguageStandard>
<PreprocessorDefinitions>
_MBCS;%(PreprocessorDefinitions); IS_DEBUG=true
</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>
Windows
</SubSystem>
</Link>
</ItemDefinitionGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
<IncludePath>
$(VC_IncludePath);$(WindowsSDK_IncludePath);$(ProjectDir)assimp\include
</IncludePath>
<LibraryPath>
$(ProjectDir)assimp\bin\x64;$(LibraryPath)
</LibraryPath>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
<IncludePath>
$(VC_IncludePath);$(WindowsSDK_IncludePath);$(ProjectDir)assimp\include
</IncludePath>
<LibraryPath>
$(ProjectDir)assimp\bin\x64;$(LibraryPath)
</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
<ClCompile>
<WarningLevel>
Level3
</WarningLevel>
...
...
@@ -102,27 +65,7 @@
</ClCompile>
<Link>
<SubSystem>
Windows
</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
<ClCompile>
<WarningLevel>
Level3
</WarningLevel>
<Optimization>
MaxSpeed
</Optimization>
<FunctionLevelLinking>
true
</FunctionLevelLinking>
<IntrinsicFunctions>
true
</IntrinsicFunctions>
<SDLCheck>
true
</SDLCheck>
<ConformanceMode>
true
</ConformanceMode>
<MultiProcessorCompilation>
true
</MultiProcessorCompilation>
<FavorSizeOrSpeed>
Speed
</FavorSizeOrSpeed>
<PreprocessorDefinitions>
NDEBUG;_MBCS;%(PreprocessorDefinitions);IS_DEBUG=false
</PreprocessorDefinitions>
<RuntimeLibrary>
MultiThreaded
</RuntimeLibrary>
<FloatingPointModel>
Fast
</FloatingPointModel>
<LanguageStandard>
stdcpplatest
</LanguageStandard>
</ClCompile>
<Link>
<EnableCOMDATFolding>
true
</EnableCOMDATFolding>
<OptimizeReferences>
true
</OptimizeReferences>
<SubSystem>
Windows
</SubSystem>
<AdditionalDependencies>
kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;assimp-vc140-mt.lib;%(AdditionalDependencies)
</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
...
...
@@ -144,6 +87,7 @@
<EnableCOMDATFolding>
true
</EnableCOMDATFolding>
<OptimizeReferences>
true
</OptimizeReferences>
<SubSystem>
Windows
</SubSystem>
<AdditionalDependencies>
kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;assimp-vc140-mt.lib;%(AdditionalDependencies)
</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
...
...
@@ -255,176 +199,102 @@
</ItemGroup>
<ItemGroup>
<FxCompile
Include=
"BlendedPhongPS.hlsl"
>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
Pixel
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
4.0
</ShaderModel>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
Pixel
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
4.0
</ShaderModel>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
Pixel
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
4.0
</ShaderModel>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
Pixel
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
4.0
</ShaderModel>
</FxCompile>
<FxCompile
Include=
"BlendedPhongVS.hlsl"
>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
Vertex
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
4.0
</ShaderModel>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
Vertex
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
4.0
</ShaderModel>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
Vertex
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
4.0
</ShaderModel>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
Vertex
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
4.0
</ShaderModel>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
</FxCompile>
<FxCompile
Include=
"ColorBlendPS.hlsl"
>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
Pixel
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
4.0
</ShaderModel>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
Pixel
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
4.0
</ShaderModel>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
Pixel
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
4.0
</ShaderModel>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
Pixel
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
4.0
</ShaderModel>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
</FxCompile>
<FxCompile
Include=
"ColorBlendVS.hlsl"
>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
Vertex
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
4.0
</ShaderModel>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
Vertex
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
4.0
</ShaderModel>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
Vertex
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
4.0
</ShaderModel>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
Vertex
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
4.0
</ShaderModel>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
</FxCompile>
<FxCompile
Include=
"IndexedPhongPS.hlsl"
>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
Pixel
</ShaderType>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
Pixel
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
4.0
</ShaderModel>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
4.0
</ShaderModel>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
Pixel
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
4.0
</ShaderModel>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
Pixel
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
4.0
</ShaderModel>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
</FxCompile>
<FxCompile
Include=
"SolidPS.hlsl"
>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
Pixel
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
4.0
</ShaderModel>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
Pixel
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
4.0
</ShaderModel>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
Pixel
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
4.0
</ShaderModel>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
Pixel
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
4.0
</ShaderModel>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
</FxCompile>
<FxCompile
Include=
"SolidVS.hlsl"
>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
Vertex
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
4.0
</ShaderModel>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
Vertex
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
4.0
</ShaderModel>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
Vertex
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
4.0
</ShaderModel>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
Vertex
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
4.0
</ShaderModel>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
</FxCompile>
<FxCompile
Include=
"PhongPS.hlsl"
>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
Pixel
</ShaderType>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
Pixel
</ShaderType>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
Pixel
</ShaderType>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
Pixel
</ShaderType>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
</FxCompile>
<FxCompile
Include=
"PhongVS.hlsl"
>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
Vertex
</ShaderType>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
Vertex
</ShaderType>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
Vertex
</ShaderType>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
Vertex
</ShaderType>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
</FxCompile>
<FxCompile
Include=
"TexturedPhongPS.hlsl"
>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
Pixel
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
4.0
</ShaderModel>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
Pixel
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
4.0
</ShaderModel>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
Pixel
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
4.0
</ShaderModel>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
Pixel
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
4.0
</ShaderModel>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
</FxCompile>
<FxCompile
Include=
"TexturedPhongVS.hlsl"
>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
Vertex
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
4.0
</ShaderModel>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
Vertex
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
4.0
</ShaderModel>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
Vertex
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
4.0
</ShaderModel>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
Vertex
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
4.0
</ShaderModel>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
</FxCompile>
<FxCompile
Include=
"TexturePS.hlsl"
>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
Pixel
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
4.0
</ShaderModel>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
Pixel
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
4.0
</ShaderModel>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
Pixel
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
4.0
</ShaderModel>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
Pixel
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
4.0
</ShaderModel>
</FxCompile>
<FxCompile
Include=
"TextureVS.hlsl"
>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
Vertex
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
4.0
</ShaderModel>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
Vertex
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
4.0
</ShaderModel>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
Vertex
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
4.0
</ShaderModel>
<ShaderType
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
Vertex
</ShaderType>
<ShaderModel
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
4.0
</ShaderModel>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Release|Win32'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
<ObjectFileOutput
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
>
$(ProjectDir)%(Filename).cso
</ObjectFileOutput>
</FxCompile>
...
...
hw3d/zlib1.dll
0 → 100644
View file @
f118aff1
File added
Prev
1
2
3
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment