Commit 7a1fac9d authored by hybrid's avatar hybrid

Merged revisiosn 1851:1883 from 1.5 branch. unit tests and severla bug fixes.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1884 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 19491a57
Changes in version 1.5 (...12.2008) Changes in version 1.5 (...12.2008)
- Added a test suite in the /tests directory. This can be used to perform regression tests, and should be updated with new tests to verify fixes or validate new features.
- Changed the preferred way of altering light node's radius: Use the new member methods of ILightSceneNode instead of directly modifying the SLight structure. - Changed the preferred way of altering light node's radius: Use the new member methods of ILightSceneNode instead of directly modifying the SLight structure.
- Changed the initial attenuation back to (0,1/radius,0). To override this value simply change the attenuation in the SLight (lightnode->getLightData().Attenuation.set(x,y,z)) - Changed the initial attenuation back to (0,1/radius,0). To override this value simply change the attenuation in the SLight (lightnode->getLightData().Attenuation.set(x,y,z))
......
...@@ -32,8 +32,9 @@ IrrlichtDevice *Device = 0; ...@@ -32,8 +32,9 @@ IrrlichtDevice *Device = 0;
core::stringc StartUpModelFile; core::stringc StartUpModelFile;
core::stringw MessageText; core::stringw MessageText;
core::stringw Caption; core::stringw Caption;
scene::IAnimatedMeshSceneNode* Model = 0; scene::ISceneNode* Model = 0;
scene::ISceneNode* SkyBox = 0; scene::ISceneNode* SkyBox = 0;
bool Octree=false;
scene::ICameraSceneNode* Camera[2] = { 0, 0}; scene::ICameraSceneNode* Camera[2] = { 0, 0};
...@@ -135,11 +136,30 @@ void loadModel(const c8* fn) ...@@ -135,11 +136,30 @@ void loadModel(const c8* fn)
// set default material properties // set default material properties
Model = Device->getSceneManager()->addAnimatedMeshSceneNode(m); if (Octree)
Model = Device->getSceneManager()->addOctTreeSceneNode(m->getMesh(0));
else
{
scene::IAnimatedMeshSceneNode* animModel = Device->getSceneManager()->addAnimatedMeshSceneNode(m);
animModel->setAnimationSpeed(30);
Model = animModel;
}
Model->setMaterialFlag(video::EMF_LIGHTING, false); Model->setMaterialFlag(video::EMF_LIGHTING, false);
// Model->setMaterialFlag(video::EMF_BACK_FACE_CULLING, false); // Model->setMaterialFlag(video::EMF_BACK_FACE_CULLING, false);
Model->setDebugDataVisible(scene::EDS_OFF); Model->setDebugDataVisible(scene::EDS_OFF);
Model->setAnimationSpeed(30);
// we need to uncheck the menu entries. would be cool to fake a menu event, but
// that's not so simple. so we do it brute force
gui::IGUIContextMenu* menu = (gui::IGUIContextMenu*)Device->getGUIEnvironment()->getRootGUIElement()->getElementFromId(400, true);
if (menu)
{
menu->setItemChecked(1, false);
menu->setItemChecked(2, false);
menu->setItemChecked(3, false);
menu->setItemChecked(4, false);
menu->setItemChecked(5, false);
menu->setItemChecked(6, false);
}
} }
...@@ -242,41 +262,64 @@ public: ...@@ -242,41 +262,64 @@ public:
case 101: // File -> Set Model Archive case 101: // File -> Set Model Archive
env->addFileOpenDialog(L"Please select your game archive/directory"); env->addFileOpenDialog(L"Please select your game archive/directory");
break; break;
case 102: // File -> LoadAsOctree
Octree = !Octree;
menu->setItemChecked(menu->getSelectedItem(), Octree);
break;
case 200: // File -> Quit case 200: // File -> Quit
Device->closeDevice(); Device->closeDevice();
break; break;
case 300: // View -> Skybox case 300: // View -> Skybox
menu->setItemChecked(menu->getSelectedItem(), !menu->isItemChecked(menu->getSelectedItem()));
SkyBox->setVisible(!SkyBox->isVisible()); SkyBox->setVisible(!SkyBox->isVisible());
break; break;
case 400: // View -> Debug Information case 401: // View -> Debug Information
menu->setItemChecked(menu->getSelectedItem()+1, false);
menu->setItemChecked(menu->getSelectedItem()+2, false);
menu->setItemChecked(menu->getSelectedItem()+3, false);
menu->setItemChecked(menu->getSelectedItem()+4, false);
menu->setItemChecked(menu->getSelectedItem()+5, false);
menu->setItemChecked(menu->getSelectedItem()+6, false);
if (Model) if (Model)
Model->setDebugDataVisible(scene::EDS_OFF); Model->setDebugDataVisible(scene::EDS_OFF);
break; break;
case 410: // View -> Debug Information case 410: // View -> Debug Information
menu->setItemChecked(menu->getSelectedItem(), !menu->isItemChecked(menu->getSelectedItem()));
if (Model) if (Model)
Model->setDebugDataVisible((scene::E_DEBUG_SCENE_TYPE)(Model->isDebugDataVisible()^scene::EDS_BBOX)); Model->setDebugDataVisible((scene::E_DEBUG_SCENE_TYPE)(Model->isDebugDataVisible()^scene::EDS_BBOX));
break; break;
case 420: // View -> Debug Information case 420: // View -> Debug Information
menu->setItemChecked(menu->getSelectedItem(), !menu->isItemChecked(menu->getSelectedItem()));
if (Model) if (Model)
Model->setDebugDataVisible((scene::E_DEBUG_SCENE_TYPE)(Model->isDebugDataVisible()^scene::EDS_NORMALS)); Model->setDebugDataVisible((scene::E_DEBUG_SCENE_TYPE)(Model->isDebugDataVisible()^scene::EDS_NORMALS));
break; break;
case 430: // View -> Debug Information case 430: // View -> Debug Information
menu->setItemChecked(menu->getSelectedItem(), !menu->isItemChecked(menu->getSelectedItem()));
if (Model) if (Model)
Model->setDebugDataVisible((scene::E_DEBUG_SCENE_TYPE)(Model->isDebugDataVisible()^scene::EDS_SKELETON)); Model->setDebugDataVisible((scene::E_DEBUG_SCENE_TYPE)(Model->isDebugDataVisible()^scene::EDS_SKELETON));
break; break;
case 440: // View -> Debug Information case 440: // View -> Debug Information
menu->setItemChecked(menu->getSelectedItem(), !menu->isItemChecked(menu->getSelectedItem()));
if (Model) if (Model)
Model->setDebugDataVisible((scene::E_DEBUG_SCENE_TYPE)(Model->isDebugDataVisible()^scene::EDS_MESH_WIRE_OVERLAY)); Model->setDebugDataVisible((scene::E_DEBUG_SCENE_TYPE)(Model->isDebugDataVisible()^scene::EDS_MESH_WIRE_OVERLAY));
break; break;
case 450: // View -> Debug Information case 450: // View -> Debug Information
menu->setItemChecked(menu->getSelectedItem(), !menu->isItemChecked(menu->getSelectedItem()));
if (Model) if (Model)
Model->setDebugDataVisible((scene::E_DEBUG_SCENE_TYPE)(Model->isDebugDataVisible()^scene::EDS_HALF_TRANSPARENCY)); Model->setDebugDataVisible((scene::E_DEBUG_SCENE_TYPE)(Model->isDebugDataVisible()^scene::EDS_HALF_TRANSPARENCY));
break; break;
case 460: // View -> Debug Information case 460: // View -> Debug Information
menu->setItemChecked(menu->getSelectedItem(), !menu->isItemChecked(menu->getSelectedItem()));
if (Model) if (Model)
Model->setDebugDataVisible((scene::E_DEBUG_SCENE_TYPE)(Model->isDebugDataVisible()^scene::EDS_BBOX_BUFFERS)); Model->setDebugDataVisible((scene::E_DEBUG_SCENE_TYPE)(Model->isDebugDataVisible()^scene::EDS_BBOX_BUFFERS));
break; break;
case 499: // View -> Debug Information case 499: // View -> Debug Information
menu->setItemChecked(menu->getSelectedItem()-1, true);
menu->setItemChecked(menu->getSelectedItem()-2, true);
menu->setItemChecked(menu->getSelectedItem()-3, true);
menu->setItemChecked(menu->getSelectedItem()-4, true);
menu->setItemChecked(menu->getSelectedItem()-5, true);
menu->setItemChecked(menu->getSelectedItem()-6, true);
if (Model) if (Model)
Model->setDebugDataVisible(scene::EDS_FULL); Model->setDebugDataVisible(scene::EDS_FULL);
break; break;
...@@ -566,16 +609,17 @@ int main(int argc, char* argv[]) ...@@ -566,16 +609,17 @@ int main(int argc, char* argv[])
submenu = menu->getSubMenu(0); submenu = menu->getSubMenu(0);
submenu->addItem(L"Open Model File & Texture...", 100); submenu->addItem(L"Open Model File & Texture...", 100);
submenu->addItem(L"Set Model Archive...", 101); submenu->addItem(L"Set Model Archive...", 101);
submenu->addItem(L"Load as Octree", 102);
submenu->addSeparator(); submenu->addSeparator();
submenu->addItem(L"Quit", 200); submenu->addItem(L"Quit", 200);
submenu = menu->getSubMenu(1); submenu = menu->getSubMenu(1);
submenu->addItem(L"toggle sky box visibility", 300); submenu->addItem(L"sky box visible", 300, true, false, true);
submenu->addItem(L"toggle model debug information", -1, true, true); submenu->addItem(L"toggle model debug information", 400, true, true);
submenu->addItem(L"model material", -1, true, true ); submenu->addItem(L"model material", -1, true, true );
submenu = submenu->getSubMenu(1); submenu = submenu->getSubMenu(1);
submenu->addItem(L"Off", 400); submenu->addItem(L"Off", 401);
submenu->addItem(L"Bounding Box", 410); submenu->addItem(L"Bounding Box", 410);
submenu->addItem(L"Normals", 420); submenu->addItem(L"Normals", 420);
submenu->addItem(L"Skeleton", 430); submenu->addItem(L"Skeleton", 430);
......
...@@ -47,7 +47,7 @@ namespace scene ...@@ -47,7 +47,7 @@ namespace scene
//! Enumeration for render passes. //! Enumeration for render passes.
/** A parameter passed to the registerNodeForRendering() method of the ISceneManager, /** A parameter passed to the registerNodeForRendering() method of the ISceneManager,
specifying when the mode wants to be drawn in relation to the other nodes. */ specifying when the node wants to be drawn in relation to the other nodes. */
enum E_SCENE_NODE_RENDER_PASS enum E_SCENE_NODE_RENDER_PASS
{ {
//! Camera pass. The active view is set up here. The very first pass. //! Camera pass. The active view is set up here. The very first pass.
...@@ -670,8 +670,9 @@ namespace scene ...@@ -670,8 +670,9 @@ namespace scene
\return Returns a pointer to the sky dome if successful, otherwise NULL. \return Returns a pointer to the sky dome if successful, otherwise NULL.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual ISceneNode* addSkyDomeSceneNode(video::ITexture* texture, virtual ISceneNode* addSkyDomeSceneNode(video::ITexture* texture,
u32 horiRes, u32 vertRes, f64 texturePercentage, f64 spherePercentage, u32 horiRes=16, u32 vertRes=8,
ISceneNode* parent = 0, s32 id=-1) = 0; f64 texturePercentage=0.9, f64 spherePercentage=2.0,
ISceneNode* parent=0, s32 id=-1) = 0;
//! Adds a particle system scene node to the scene graph. //! Adds a particle system scene node to the scene graph.
/** \param withDefaultEmitter: Creates a default working point emitter /** \param withDefaultEmitter: Creates a default working point emitter
......
...@@ -156,6 +156,8 @@ namespace scene ...@@ -156,6 +156,8 @@ namespace scene
video::SColor vertexColor = video::SColor ( 255, 255, 255, 255 ), s32 smoothFactor = 0 ) =0; video::SColor vertexColor = video::SColor ( 255, 255, 255, 255 ), s32 smoothFactor = 0 ) =0;
//! Initializes the terrain data. Loads the vertices from the heightMapFile. //! Initializes the terrain data. Loads the vertices from the heightMapFile.
/** The data is interpreted as signed integers of the given bit size. Allowed
values are 8, 16, and 32. The heightmap must be square. */
virtual bool loadHeightMapRAW(io::IReadFile* file, s32 bitsPerPixel = 16, virtual bool loadHeightMapRAW(io::IReadFile* file, s32 bitsPerPixel = 16,
video::SColor vertexColor = video::SColor ( 255, 255, 255, 255 ), s32 smoothFactor = 0 ) =0; video::SColor vertexColor = video::SColor ( 255, 255, 255, 255 ), s32 smoothFactor = 0 ) =0;
......
...@@ -15,9 +15,8 @@ namespace io ...@@ -15,9 +15,8 @@ namespace io
{ {
//! Interface providing methods for making it easier to write XML files. //! Interface providing methods for making it easier to write XML files.
/** This XML Writer only writes UTF-16 xml files, because these are /** This XML Writer writes xml files using in the platform dependent
parsed faster than all other formats by IXMLReader. wchar_t format and sets the xml-encoding correspondingly. */
*/
class IXMLWriter : public virtual IReferenceCounted class IXMLWriter : public virtual IReferenceCounted
{ {
public: public:
......
...@@ -106,6 +106,8 @@ namespace video ...@@ -106,6 +106,8 @@ namespace video
//! Returns the alpha component from A1R5G5B5 color //! Returns the alpha component from A1R5G5B5 color
/** In Irrlicht, alpha refers to opacity.
\return The alpha value of the color. 0 is transparent, 1 is opaque. */
inline u32 getAlpha(u16 color) inline u32 getAlpha(u16 color)
{ {
return ((color >> 15)&0x1); return ((color >> 15)&0x1);
...@@ -146,6 +148,7 @@ namespace video ...@@ -146,6 +148,7 @@ namespace video
//! Class representing a 32 bit ARGB color. //! Class representing a 32 bit ARGB color.
/** The color values for alpha, red, green, and blue are /** The color values for alpha, red, green, and blue are
stored in a single u32. So all four values may be between 0 and 255. stored in a single u32. So all four values may be between 0 and 255.
Alpha in Irrlicht is opacity, so 0 is fully transparent, 255 is fully opaque (solid).
This class is used by most parts of the Irrlicht Engine This class is used by most parts of the Irrlicht Engine
to specify a color. Another way is using the class SColorf, which to specify a color. Another way is using the class SColorf, which
stores the color values in 4 floats. stores the color values in 4 floats.
...@@ -168,9 +171,8 @@ namespace video ...@@ -168,9 +171,8 @@ namespace video
: color(clr) {} : color(clr) {}
//! Returns the alpha component of the color. //! Returns the alpha component of the color.
/** The alpha component defines how transparent a color should /** The alpha component defines how opaque a color is.
be. 255 means not transparent (opaque), 0 means fully \return The alpha value of the color. 0 is fully transparent, 255 is fully opaque. */
transparent. */
u32 getAlpha() const { return color>>24; } u32 getAlpha() const { return color>>24; }
//! Returns the red component of the color. //! Returns the red component of the color.
...@@ -201,10 +203,8 @@ namespace video ...@@ -201,10 +203,8 @@ namespace video
} }
//! Sets the alpha component of the Color. //! Sets the alpha component of the Color.
/** The alpha component defines how transparent a color should /** The alpha component defines how transparent a color should be.
be. \param a The alpha value of the color. 0 is fully transparent, 255 is fully opaque. */
\param a: Has to be a value between 0 and 255.
255 means not transparent (opaque), 0 means fully transparent. */
void setAlpha(u32 a) { color = ((a & 0xff)<<24) | (color & 0x00ffffff); } void setAlpha(u32 a) { color = ((a & 0xff)<<24) | (color & 0x00ffffff); }
//! Sets the red component of the Color. //! Sets the red component of the Color.
...@@ -431,7 +431,7 @@ namespace video ...@@ -431,7 +431,7 @@ namespace video
} }
} }
//! Returns the alpha component of the color in the range 0.0 to 1.0 //! Returns the alpha component of the color in the range 0.0 (transparent) to 1.0 (opaque)
f32 getAlpha() const { return a; } f32 getAlpha() const { return a; }
//! Returns the red component of the color in the range 0.0 to 1.0 //! Returns the red component of the color in the range 0.0 to 1.0
......
...@@ -16,7 +16,7 @@ namespace scene ...@@ -16,7 +16,7 @@ namespace scene
struct SSharedMeshBuffer : public IMeshBuffer struct SSharedMeshBuffer : public IMeshBuffer
{ {
//! constructor //! constructor
SSharedMeshBuffer() : IMeshBuffer(), ChangedID_Vertex(1), ChangedID_Index(1), MappingHint(Never), Vertices(0) SSharedMeshBuffer() : IMeshBuffer(), ChangedID_Vertex(1), ChangedID_Index(1), Vertices(0), MappingHint(EHM_NEVER)
{ {
#ifdef _DEBUG #ifdef _DEBUG
setDebugName("SSharedMeshBuffer"); setDebugName("SSharedMeshBuffer");
...@@ -141,9 +141,9 @@ namespace scene ...@@ -141,9 +141,9 @@ namespace scene
//! flags the mesh as changed, reloads hardware buffers //! flags the mesh as changed, reloads hardware buffers
virtual void setDirty(E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX) virtual void setDirty(E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX)
{ {
if (E_BUFFER_TYPE Buffer==EBT_VERTEX_AND_INDEX || E_BUFFER_TYPE Buffer==EBT_VERTEX) if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_VERTEX)
++ChangedID_Vertex; ++ChangedID_Vertex;
if (E_BUFFER_TYPE Buffer==EBT_VERTEX_AND_INDEX || E_BUFFER_TYPE Buffer==EBT_INDEX) if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_INDEX)
++ChangedID_Index; ++ChangedID_Index;
} }
......
...@@ -158,6 +158,12 @@ namespace core ...@@ -158,6 +158,12 @@ namespace core
return min_ (max_(value,low), high); return min_ (max_(value,low), high);
} }
//! returns if a equals b, taking possible rounding errors into account
inline bool equals(const f64 a, const f64 b, const f64 tolerance = ROUNDING_ERROR_64)
{
return (a + tolerance >= b) && (a - tolerance <= b);
}
//! returns if a equals b, taking possible rounding errors into account //! returns if a equals b, taking possible rounding errors into account
inline bool equals(const f32 a, const f32 b, const f32 tolerance = ROUNDING_ERROR_32) inline bool equals(const f32 a, const f32 b, const f32 tolerance = ROUNDING_ERROR_32)
{ {
......
...@@ -31,28 +31,41 @@ ...@@ -31,28 +31,41 @@
#include "IrrCompileConfig.h" #include "IrrCompileConfig.h"
#include "aabbox3d.h" #include "aabbox3d.h"
#include "CDynamicMeshBuffer.h"
#include "CIndexBuffer.h"
#include "CMeshBuffer.h"
#include "coreutil.h" #include "coreutil.h"
#include "irrArray.h" #include "CVertexBuffer.h"
#include "irrMap.h"
#include "irrMath.h"
#include "irrString.h"
#include "irrTypes.h"
#include "SColor.h"
#include "SLight.h"
#include "dimension2d.h" #include "dimension2d.h"
#include "ECullingTypes.h"
#include "EDebugSceneTypes.h"
#include "EDriverFeatures.h"
#include "EDriverTypes.h" #include "EDriverTypes.h"
#include "IAttributes.h" #include "EGUIAlignment.h"
#include "IAttributeExchangingObject.h" #include "EGUIElementTypes.h"
#include "EHardwareBufferFlags.h"
#include "EMaterialFlags.h"
#include "EMaterialTypes.h"
#include "EMeshWriterEnums.h"
#include "EMessageBoxFlags.h"
#include "ESceneNodeAnimatorTypes.h"
#include "ESceneNodeTypes.h"
#include "ETerrainElements.h"
#include "fast_atof.h"
#include "heapsort.h"
#include "IAnimatedMesh.h" #include "IAnimatedMesh.h"
#include "IAnimatedMeshMD2.h" #include "IAnimatedMeshMD2.h"
#include "IAnimatedMeshMD3.h" #include "IAnimatedMeshMD3.h"
#include "IQ3LevelMesh.h"
#include "IAnimatedMeshSceneNode.h" #include "IAnimatedMeshSceneNode.h"
#include "IAttributeExchangingObject.h"
#include "IAttributes.h"
#include "IBillboardSceneNode.h" #include "IBillboardSceneNode.h"
#include "IBillboardTextSceneNode.h" #include "IBillboardTextSceneNode.h"
#include "IBoneSceneNode.h" #include "IBoneSceneNode.h"
#include "ICameraSceneNode.h" #include "ICameraSceneNode.h"
#include "ICursorControl.h"
#include "IDummyTransformationSceneNode.h" #include "IDummyTransformationSceneNode.h"
#include "IDynamicMeshBuffer.h"
#include "IEventReceiver.h" #include "IEventReceiver.h"
#include "IFileList.h" #include "IFileList.h"
#include "IFileSystem.h" #include "IFileSystem.h"
...@@ -83,6 +96,9 @@ ...@@ -83,6 +96,9 @@
#include "IGUIToolbar.h" #include "IGUIToolbar.h"
#include "IGUIWindow.h" #include "IGUIWindow.h"
#include "IImage.h" #include "IImage.h"
#include "IImageLoader.h"
#include "IImageWriter.h"
#include "IIndexBuffer.h"
#include "ILightSceneNode.h" #include "ILightSceneNode.h"
#include "ILogger.h" #include "ILogger.h"
#include "IMaterialRenderer.h" #include "IMaterialRenderer.h"
...@@ -90,29 +106,44 @@ ...@@ -90,29 +106,44 @@
#include "IMesh.h" #include "IMesh.h"
#include "IMeshBuffer.h" #include "IMeshBuffer.h"
#include "IMeshCache.h" #include "IMeshCache.h"
#include "IMeshSceneNode.h" #include "IMeshLoader.h"
#include "IMeshManipulator.h" #include "IMeshManipulator.h"
#include "IMeshSceneNode.h"
#include "IMeshWriter.h" #include "IMeshWriter.h"
#include "IMetaTriangleSelector.h" #include "IMetaTriangleSelector.h"
#include "IOSOperator.h"
#include "IParticleSystemSceneNode.h" // also includes all emitters and attractors
#include "IQ3LevelMesh.h"
#include "IQ3Shader.h"
#include "IReadFile.h" #include "IReadFile.h"
#include "IReferenceCounted.h"
#include "irrArray.h"
#include "IrrlichtDevice.h" #include "IrrlichtDevice.h"
#include "irrList.h"
#include "irrMap.h"
#include "irrMath.h"
#include "irrString.h"
#include "irrTypes.h"
#include "irrXML.h"
#include "ISceneCollisionManager.h"
#include "ISceneManager.h" #include "ISceneManager.h"
#include "ISceneNode.h" #include "ISceneNode.h"
#include "ISceneUserDataSerializer.h"
#include "ITriangleSelector.h"
#include "ISceneNodeAnimator.h" #include "ISceneNodeAnimator.h"
#include "ISceneCollisionManager.h" #include "ISceneNodeAnimatorCameraFPS.h"
#include "ISceneNodeFactory.h" #include "ISceneNodeAnimatorCameraMaya.h"
#include "ISceneNodeAnimatorFactory.h"
#include "ISceneNodeAnimatorCollisionResponse.h" #include "ISceneNodeAnimatorCollisionResponse.h"
#include "ISceneNodeAnimatorFactory.h"
#include "ISceneNodeFactory.h"
#include "ISceneUserDataSerializer.h"
#include "IShaderConstantSetCallBack.h" #include "IShaderConstantSetCallBack.h"
#include "IShadowVolumeSceneNode.h" #include "IShadowVolumeSceneNode.h"
#include "IParticleSystemSceneNode.h" // also includes all emitters and attractors
#include "ISkinnedMesh.h" #include "ISkinnedMesh.h"
#include "ITerrainSceneNode.h" #include "ITerrainSceneNode.h"
#include "ITextSceneNode.h" #include "ITextSceneNode.h"
#include "ITexture.h" #include "ITexture.h"
#include "IReferenceCounted.h" #include "ITimer.h"
#include "ITriangleSelector.h"
#include "IVertexBuffer.h"
#include "IVideoDriver.h" #include "IVideoDriver.h"
#include "IVideoModeList.h" #include "IVideoModeList.h"
#include "IVolumeLightSceneNode.h" #include "IVolumeLightSceneNode.h"
...@@ -122,25 +153,32 @@ ...@@ -122,25 +153,32 @@
#include "Keycodes.h" #include "Keycodes.h"
#include "line2d.h" #include "line2d.h"
#include "line3d.h" #include "line3d.h"
#include "irrList.h"
#include "matrix4.h" #include "matrix4.h"
#include "plane3d.h" #include "plane3d.h"
#include "vector2d.h"
#include "vector3d.h"
#include "triangle3d.h"
#include "position2d.h" #include "position2d.h"
#include "quaternion.h" #include "quaternion.h"
#include "rect.h" #include "rect.h"
#include "S3DVertex.h" #include "S3DVertex.h"
#include "SAnimatedMesh.h" #include "SAnimatedMesh.h"
#include "SceneParameters.h"
#include "SColor.h"
#include "SExposedVideoData.h" #include "SExposedVideoData.h"
#include "SIrrCreationParameters.h"
#include "SKeyMap.h" #include "SKeyMap.h"
#include "SLight.h"
#include "SMaterial.h" #include "SMaterial.h"
#include "SMesh.h" #include "SMesh.h"
#include "SMeshBuffer.h" #include "SMeshBuffer.h"
#include "SMeshBufferLightMap.h" #include "SMeshBufferLightMap.h"
#include "SMeshBufferTangents.h" #include "SMeshBufferTangents.h"
#include "SParticle.h"
#include "SSharedMeshBuffer.h"
#include "SSkinMeshBuffer.h"
#include "SVertexIndex.h"
#include "SViewFrustum.h" #include "SViewFrustum.h"
#include "triangle3d.h"
#include "vector2d.h"
#include "vector3d.h"
/*! \mainpage Irrlicht Engine 1.5.beta API documentation /*! \mainpage Irrlicht Engine 1.5.beta API documentation
* *
......
...@@ -32,15 +32,21 @@ class plane3d ...@@ -32,15 +32,21 @@ class plane3d
// Constructors // Constructors
plane3d(): Normal(0,1,0) { recalculateD(vector3d<T>(0,0,0)); } plane3d(): Normal(0,1,0) { recalculateD(vector3d<T>(0,0,0)); }
plane3d(const vector3d<T>& MPoint, const vector3d<T>& Normal) : Normal(Normal) { recalculateD(MPoint); } plane3d(const vector3d<T>& MPoint, const vector3d<T>& Normal) : Normal(Normal) { recalculateD(MPoint); }
plane3d(T px, T py, T pz, T nx, T ny, T nz) : Normal(nx, ny, nz) { recalculateD(vector3d<T>(px, py, pz)); } plane3d(T px, T py, T pz, T nx, T ny, T nz) : Normal(nx, ny, nz) { recalculateD(vector3d<T>(px, py, pz)); }
plane3d(const vector3d<T>& point1, const vector3d<T>& point2, const vector3d<T>& point3) plane3d(const vector3d<T>& point1, const vector3d<T>& point2, const vector3d<T>& point3)
{ setPlane(point1, point2, point3); } { setPlane(point1, point2, point3); }
plane3d(const vector3d<T> & normal, const T d) : Normal(normal), D(d) { }
// operators // operators
inline bool operator==(const plane3d<T>& other) const { return (D==other.D && Normal==other.Normal);} inline bool operator==(const plane3d<T>& other) const { return (equals(D, other.D) && Normal==other.Normal);}
inline bool operator!=(const plane3d<T>& other) const { return !(D==other.D && Normal==other.Normal);}
inline bool operator!=(const plane3d<T>& other) const { return !(*this == other);}
// functions // functions
......
...@@ -59,8 +59,8 @@ public: ...@@ -59,8 +59,8 @@ public:
bool operator<(const vector2d<T>&other) const { return X<other.X && Y<other.Y; } bool operator<(const vector2d<T>&other) const { return X<other.X && Y<other.Y; }
bool operator>(const vector2d<T>&other) const { return X>other.X && Y>other.Y; } bool operator>(const vector2d<T>&other) const { return X>other.X && Y>other.Y; }
bool operator==(const vector2d<T>& other) const { return other.X==X && other.Y==Y; } bool operator==(const vector2d<T>& other) const { return equals(other); }
bool operator!=(const vector2d<T>& other) const { return other.X!=X || other.Y!=Y; } bool operator!=(const vector2d<T>& other) const { return !equals(other); }
// functions // functions
...@@ -111,20 +111,20 @@ public: ...@@ -111,20 +111,20 @@ public:
return vector2d<T>(X - other.X, Y - other.Y).getLengthSQ(); return vector2d<T>(X - other.X, Y - other.Y).getLengthSQ();
} }
//! rotates the point around a center by an amount of degrees. //! rotates the point anticlockwise around a center by an amount of degrees.
/** \param degrees Amount of degrees to rotate by. /** \param degrees Amount of degrees to rotate by, anticlockwise.
\param center Rotation center. \param center Rotation center.
\return This vector after transformation. */ \return This vector after transformation. */
vector2d<T>& rotateBy(f64 degrees, const vector2d<T>& center) vector2d<T>& rotateBy(f64 degrees, const vector2d<T>& center)
{ {
degrees *= DEGTORAD64; degrees *= DEGTORAD64;
const T cs = (T)cos(degrees); const f64 cs = cos(degrees);
const T sn = (T)sin(degrees); const f64 sn = sin(degrees);
X -= center.X; X -= center.X;
Y -= center.Y; Y -= center.Y;
set(X*cs - Y*sn, X*sn + Y*cs); set((T)(X*cs - Y*sn), (T)(X*sn + Y*cs));
X += center.X; X += center.X;
Y += center.Y; Y += center.Y;
...@@ -136,12 +136,12 @@ public: ...@@ -136,12 +136,12 @@ public:
\return Reference to this vector, after normalization. */ \return Reference to this vector, after normalization. */
vector2d<T>& normalize() vector2d<T>& normalize()
{ {
T l = X*X + Y*Y; f32 length = (f32)(X*X + Y*Y);
if (l == 0) if (core::equals(length, 0.f))
return *this; return *this;
l = core::reciprocal_squareroot ( (f32)l ); length = core::reciprocal_squareroot ( length );
X *= l; X = (T)(X * length);
Y *= l; Y = (T)(Y * length);
return *this; return *this;
} }
...@@ -233,41 +233,45 @@ public: ...@@ -233,41 +233,45 @@ public:
} }
} }
//! Get the interpolated vector //! Creates an interpolated vector between this vector and another vector.
/** \param other Other vector to interpolate with. /** \param other The other vector to interpolate with.
\param d Value between 0.0f and 1.0f. \param d Interpolation value between 0.0f (all the other vector) and 1.0f (all this vector).
\return Interpolated vector. */ Note that this is the opposite direction of interpolation to getInterpolated_quadratic()
vector2d<T> getInterpolated(const vector2d<T>& other, f32 d) const \return An interpolated vector. This vector is not modified. */
vector2d<T> getInterpolated(const vector2d<T>& other, f64 d) const
{ {
T inv = (T) 1.0 - d; f64 inv = 1.0f - d;
return vector2d<T>(other.X*inv + X*d, other.Y*inv + Y*d); return vector2d<T>((T)(other.X*inv + X*d), (T)(other.Y*inv + Y*d));
} }
//! Returns (quadratically) interpolated vector between this and the two given ones. //! Creates a quadratically interpolated vector between this and two other vectors.
/** \param v2 Second vector to interpolate with /** \param v2 Second vector to interpolate with.
\param v3 Third vector to interpolate with \param v3 Third vector to interpolate with (maximum at 1.0f)
\param d Value between 0.0f and 1.0f. \param d Interpolation value between 0.0f (all this vector) and 1.0f (all the 3rd vector).
\return Interpolated vector. */ Note that this is the opposite direction of interpolation to getInterpolated() and interpolate()
vector2d<T> getInterpolated_quadratic(const vector2d<T>& v2, const vector2d<T>& v3, const T d) const \return An interpolated vector. This vector is not modified. */
vector2d<T> getInterpolated_quadratic(const vector2d<T>& v2, const vector2d<T>& v3, f64 d) const
{ {
// this*(1-d)*(1-d) + 2 * v2 * (1-d) + v3 * d * d; // this*(1-d)*(1-d) + 2 * v2 * (1-d) + v3 * d * d;
const T inv = (T) 1.0 - d; const f64 inv = 1.0f - d;
const T mul0 = inv * inv; const f64 mul0 = inv * inv;
const T mul1 = (T) 2.0 * d * inv; const f64 mul1 = 2.0f * d * inv;
const T mul2 = d * d; const f64 mul2 = d * d;
return vector2d<T> ( X * mul0 + v2.X * mul1 + v3.X * mul2, return vector2d<T> ( (T)(X * mul0 + v2.X * mul1 + v3.X * mul2),
Y * mul0 + v2.Y * mul1 + v3.Y * mul2); (T)(Y * mul0 + v2.Y * mul1 + v3.Y * mul2));
} }
//! Sets this vector to the linearly interpolated vector between a and b. //! Sets this vector to the linearly interpolated vector between a and b.
/** \param a first vector to interpolate with /** \param a first vector to interpolate with, maximum at 1.0f
\param b second vector to interpolate with \param b second vector to interpolate with, maximum at 0.0f
\param t value between 0.0f and 1.0f. */ \param d Interpolation value between 0.0f (all vector b) and 1.0f (all vector a)
vector2d<T>& interpolate(const vector2d<T>& a, const vector2d<T>& b, const f32 t) Note that this is the opposite direction of interpolation to getInterpolated_quadratic()
*/
vector2d<T>& interpolate(const vector2d<T>& a, const vector2d<T>& b, f64 d)
{ {
X = b.X + ( ( a.X - b.X ) * t ); X = (T)((f64)b.X + ( ( a.X - b.X ) * d ));
Y = b.Y + ( ( a.Y - b.Y ) * t ); Y = (T)((f64)b.Y + ( ( a.Y - b.Y ) * d ));
return *this; return *this;
} }
......
...@@ -13,6 +13,11 @@ namespace core ...@@ -13,6 +13,11 @@ namespace core
{ {
//! 3d vector template class with lots of operators and methods. //! 3d vector template class with lots of operators and methods.
/** The vector3d class is used in Irrlicht for three main purposes:
1) As a direction vector (most of the methods assume this).
2) As a position in 3d space (which is synonymous with a direction vector from the origin to this position).
3) To hold three Euler rotations, where X is pitch, Y is yaw and Z is roll.
*/
template <class T> template <class T>
class vector3d class vector3d
{ {
...@@ -132,17 +137,16 @@ namespace core ...@@ -132,17 +137,16 @@ namespace core
//! Normalizes the vector. //! Normalizes the vector.
/** In case of the 0 vector the result is still 0, otherwise /** In case of the 0 vector the result is still 0, otherwise
the length of the vector will be 1. the length of the vector will be 1.
TODO: 64 Bit template doesnt work.. need specialized template
\return Reference to this vector after normalization. */ \return Reference to this vector after normalization. */
vector3d<T>& normalize() vector3d<T>& normalize()
{ {
T l = X*X + Y*Y + Z*Z; f32 length = (f32)(X*X + Y*Y + Z*Z);
if (l == 0) if (core::equals(length, 0.f))
return *this; return *this;
l = (T) reciprocal_squareroot ( (f32)l ); length = core::reciprocal_squareroot ( (f32)length );
X *= l; X = (T)(X * length);
Y *= l; Y = (T)(Y * length);
Z *= l; Z = (T)(Z * length);
return *this; return *this;
} }
...@@ -168,11 +172,11 @@ namespace core ...@@ -168,11 +172,11 @@ namespace core
void rotateXZBy(f64 degrees, const vector3d<T>& center=vector3d<T>()) void rotateXZBy(f64 degrees, const vector3d<T>& center=vector3d<T>())
{ {
degrees *= DEGTORAD64; degrees *= DEGTORAD64;
T cs = (T)cos(degrees); f64 cs = cos(degrees);
T sn = (T)sin(degrees); f64 sn = sin(degrees);
X -= center.X; X -= center.X;
Z -= center.Z; Z -= center.Z;
set(X*cs - Z*sn, Y, X*sn + Z*cs); set((T)(X*cs - Z*sn), Y, (T)(X*sn + Z*cs));
X += center.X; X += center.X;
Z += center.Z; Z += center.Z;
} }
...@@ -183,11 +187,11 @@ namespace core ...@@ -183,11 +187,11 @@ namespace core
void rotateXYBy(f64 degrees, const vector3d<T>& center=vector3d<T>()) void rotateXYBy(f64 degrees, const vector3d<T>& center=vector3d<T>())
{ {
degrees *= DEGTORAD64; degrees *= DEGTORAD64;
T cs = (T)cos(degrees); f64 cs = cos(degrees);
T sn = (T)sin(degrees); f64 sn = sin(degrees);
X -= center.X; X -= center.X;
Y -= center.Y; Y -= center.Y;
set(X*cs - Y*sn, X*sn + Y*cs, Z); set((T)(X*cs - Y*sn), (T)(X*sn + Y*cs), Z);
X += center.X; X += center.X;
Y += center.Y; Y += center.Y;
} }
...@@ -198,45 +202,74 @@ namespace core ...@@ -198,45 +202,74 @@ namespace core
void rotateYZBy(f64 degrees, const vector3d<T>& center=vector3d<T>()) void rotateYZBy(f64 degrees, const vector3d<T>& center=vector3d<T>())
{ {
degrees *= DEGTORAD64; degrees *= DEGTORAD64;
T cs = (T)cos(degrees); f64 cs = cos(degrees);
T sn = (T)sin(degrees); f64 sn = sin(degrees);
Z -= center.Z; Z -= center.Z;
Y -= center.Y; Y -= center.Y;
set(X, Y*cs - Z*sn, Y*sn + Z*cs); set(X, (T)(Y*cs - Z*sn), (T)(Y*sn + Z*cs));
Z += center.Z; Z += center.Z;
Y += center.Y; Y += center.Y;
} }
//! Returns interpolated vector. //! Creates an interpolated vector between this vector and another vector.
/** \param other Other vector to interpolate between /** \param other The other vector to interpolate with.
\param d Value between 0.0f and 1.0f. */ \param d Interpolation value between 0.0f (all the other vector) and 1.0f (all this vector).
vector3d<T> getInterpolated(const vector3d<T>& other, const T d) const Note that this is the opposite direction of interpolation to getInterpolated_quadratic()
\return An interpolated vector. This vector is not modified. */
vector3d<T> getInterpolated(const vector3d<T>& other, f64 d) const
{ {
const T inv = (T) 1.0 - d; const f64 inv = 1.0 - d;
return vector3d<T>(other.X*inv + X*d, other.Y*inv + Y*d, other.Z*inv + Z*d); return vector3d<T>((T)(other.X*inv + X*d), (T)(other.Y*inv + Y*d), (T)(other.Z*inv + Z*d));
} }
//! Returns interpolated vector. ( quadratic ) //! Creates a quadratically interpolated vector between this and two other vectors.
/** \param v2 Second vector to interpolate with /** \param v2 Second vector to interpolate with.
\param v3 Third vector to interpolate with \param v3 Third vector to interpolate with (maximum at 1.0f)
\param d Value between 0.0f and 1.0f. */ \param d Interpolation value between 0.0f (all this vector) and 1.0f (all the 3rd vector).
vector3d<T> getInterpolated_quadratic(const vector3d<T>& v2, const vector3d<T>& v3, const T d) const Note that this is the opposite direction of interpolation to getInterpolated() and interpolate()
\return An interpolated vector. This vector is not modified. */
vector3d<T> getInterpolated_quadratic(const vector3d<T>& v2, const vector3d<T>& v3, f64 d) const
{ {
// this*(1-d)*(1-d) + 2 * v2 * (1-d) + v3 * d * d; // this*(1-d)*(1-d) + 2 * v2 * (1-d) + v3 * d * d;
const T inv = (T) 1.0 - d; const f64 inv = (T) 1.0 - d;
const T mul0 = inv * inv; const f64 mul0 = inv * inv;
const T mul1 = (T) 2.0 * d * inv; const f64 mul1 = (T) 2.0 * d * inv;
const T mul2 = d * d; const f64 mul2 = d * d;
return vector3d<T> ( X * mul0 + v2.X * mul1 + v3.X * mul2, return vector3d<T> ((T)(X * mul0 + v2.X * mul1 + v3.X * mul2),
Y * mul0 + v2.Y * mul1 + v3.Y * mul2, (T)(Y * mul0 + v2.Y * mul1 + v3.Y * mul2),
Z * mul0 + v2.Z * mul1 + v3.Z * mul2); (T)(Z * mul0 + v2.Z * mul1 + v3.Z * mul2));
} }
//! Gets the Y and Z rotations of a vector. //! Sets this vector to the linearly interpolated vector between a and b.
/** Thanks to Arras on the Irrlicht forums for this method. /** \param a first vector to interpolate with, maximum at 1.0f
\return A vector representing the rotation in degrees of \param b second vector to interpolate with, maximum at 0.0f
this vector. The Z component of the vector will always be 0. */ \param d Interpolation value between 0.0f (all vector b) and 1.0f (all vector a)
Note that this is the opposite direction of interpolation to getInterpolated_quadratic()
*/
vector3d<T>& interpolate(const vector3d<T>& a, const vector3d<T>& b, f64 d)
{
X = (T)((f64)b.X + ( ( a.X - b.X ) * d ));
Y = (T)((f64)b.Y + ( ( a.Y - b.Y ) * d ));
Z = (T)((f64)b.Z + ( ( a.Z - b.Z ) * d ));
return *this;
}
//! Get the rotations that would make a (0,0,1) direction vector point in the same direction as this direction vector.
/** Thanks to Arras on the Irrlicht forums for this method. This utility method is very useful for
orienting scene nodes towards specific targets. For example, if this vector represents the difference
between two scene nodes, then applying the result of getHorizontalAngle() to one scene node will point
it at the other one.
Example code:
// Where target and seeker are of type ISceneNode*
const vector3df toTarget(target->getAbsolutePosition() - seeker->getAbsolutePosition());
const vector3df requiredRotation = toTarget.getHorizontalAngle();
seeker->setRotation(requiredRotation);
\return A rotation vector containing the X (pitch) and Y (raw) rotations (in degrees) that when applied to a
+Z (e.g. 0, 0, 1) direction vector would make it point in the same direction as this vector. The Z (roll) rotation
is always 0, since two Euler rotations are sufficient to point in any given direction. */
vector3d<T> getHorizontalAngle() const vector3d<T> getHorizontalAngle() const
{ {
vector3d<T> angle; vector3d<T> angle;
...@@ -261,15 +294,13 @@ namespace core ...@@ -261,15 +294,13 @@ namespace core
} }
//! Builds a direction vector from (this) rotation vector. //! Builds a direction vector from (this) rotation vector.
/** This vector is assumed to hold 3 Euler angle rotations, in degrees. /** This vector is assumed to be a rotation vector composed of 3 Euler angle rotations, in degrees.
The implementation performs the same calculations as using a matrix to The implementation performs the same calculations as using a matrix to do the rotation.
do the rotation.
\param[in] forwards The direction representing "forwards" which will be \param[in] forwards The direction representing "forwards" which will be rotated by this vector.
rotated by this vector. If you do not provide a If you do not provide a direction, then the +Z axis (0, 0, 1) will be assumed to be forwards.
direction, then the positive Z axis (0, 0, 1) will \return A direction vector calculated by rotating the forwards direction by the 3 Euler angles
be assumed to be fowards. (in degrees) represented by this vector. */
\return A vector calculated by rotating the forwards direction by
the 3 Euler angles that this vector is assumed to represent. */
vector3d<T> rotationToDirection(const vector3d<T> & forwards = vector3d<T>(0, 0, 1)) const vector3d<T> rotationToDirection(const vector3d<T> & forwards = vector3d<T>(0, 0, 1)) const
{ {
const f64 cr = cos( core::DEGTORAD64 * X ); const f64 cr = cos( core::DEGTORAD64 * X );
......
========================================================================== ==========================================================================
The Irrlicht Engine SDK version 1.4.2 The Irrlicht Engine SDK version 1.5.beta
========================================================================== ==========================================================================
Welcome the Irrlicht Engine SDK. Welcome the Irrlicht Engine SDK.
...@@ -139,7 +139,7 @@ The Irrlicht Engine SDK version 1.4.2 ...@@ -139,7 +139,7 @@ The Irrlicht Engine SDK version 1.4.2
The Irrlicht Engine License The Irrlicht Engine License
=========================== ===========================
Copyright (C) 2002-2007 Nikolaus Gebhardt Copyright (C) 2002-2008 Nikolaus Gebhardt
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages
...@@ -158,7 +158,6 @@ The Irrlicht Engine SDK version 1.4.2 ...@@ -158,7 +158,6 @@ The Irrlicht Engine SDK version 1.4.2
3. This notice may not be removed or altered from any source distribution. 3. This notice may not be removed or altered from any source distribution.
========================================================================== ==========================================================================
6. Contact 6. Contact
========================================================================== ==========================================================================
...@@ -180,21 +179,23 @@ The Irrlicht Engine SDK version 1.4.2 ...@@ -180,21 +179,23 @@ The Irrlicht Engine SDK version 1.4.2
by other people. Especially: (There are probably more people, sorry if I forgot one. by other people. Especially: (There are probably more people, sorry if I forgot one.
See http://irrlicht.sourceforge.net/author.html for more informations) See http://irrlicht.sourceforge.net/author.html for more informations)
Christian Stehno Contribution Coordinator/Developer Christian Stehno (hybrid) Contribution Coordinator/Developer
Gareth Davidson - Bitplane; Developer/ Forum admin Gareth Davidson (bitplane) Developer/ Forum admin
Thomas Alten wrote the apfelbaum software rasterizer Thomas Alten (burningwater) Wrote the burningsvideo software rasterizer
Luke P. Hoschke (luke) Wrote the b3d loader, the new animation system, VBOs and other things
Colin MacDonald (rogerborg)
Dean Wadsworth (varmint) OSX port maintainer and game developer
Alvaro F. Celis (afecelis) Lots of work in the community, for example video tutorials about Irrlicht, forum admin
John Goewert (Saigumi) Wrote some tutorials for the Irrlicht Engine and doing admin stuff
Jam Takes care of moderating the forums and keeps them clean from those evil spammers.
Etienne Petitjean wrote the MacPort of the engine Etienne Petitjean wrote the MacPort of the engine
Greg Roelofs Created the zlib and libpng
The Independent JPEG Group Created JPEG lib
Guy Eric Schalnat, Andreas Dilger, Glenn Randers-Pehrson and others Created libPng
Chad Austin, Jacky Chong, Theo Reed, Ben Scott Made Audiere
Mark Jeacocke Wrote lots of helpful comments and ideas in the forums and per email. Mark Jeacocke Wrote lots of helpful comments and ideas in the forums and per email.
Julio Gorgé Created the 'Unofficial DirectX 9.0 Driver for the Irrlicht Engine' Julio Gorgé Created the 'Unofficial DirectX 9.0 Driver for the Irrlicht Engine'
Andy Spurgeon Wrote the Dev-Cpp tutorial. Andy Spurgeon Wrote the Dev-Cpp tutorial.
André Simon Wrote the Codewarrior tutorial. André Simon Wrote the Codewarrior tutorial.
KnightToFlight Created the unoffical terrain renderer addon for the Irrlicht Engine. KnightToFlight Created the unoffical terrain renderer addon for the Irrlicht Engine.
Jon Pry Wrote the code to load compressed TGA files. Jon Pry Wrote the code to load compressed TGA files.
Saigumi Wrote some tutorials for the Irrlicht Engine and doing admin stuff
Matthew Couch Wrote the tokamak integration tutorial. Matthew Couch Wrote the tokamak integration tutorial.
Max Winkel Wrote the splitscreen tutorial. Max Winkel Wrote the splitscreen tutorial.
Gorgon Zola Wrote the ODE integration tutorial. Gorgon Zola Wrote the ODE integration tutorial.
...@@ -203,10 +204,10 @@ The Irrlicht Engine SDK version 1.4.2 ...@@ -203,10 +204,10 @@ The Irrlicht Engine SDK version 1.4.2
Matthias Gall Sent in code for a spline scene node animator and reported lots of bugs. Matthias Gall Sent in code for a spline scene node animator and reported lots of bugs.
Mario Gruber Suggested triangle fan drawing and sent in code for this. Mario Gruber Suggested triangle fan drawing and sent in code for this.
Ariaci Spotted out a bug in the ATI driver. Ariaci Spotted out a bug in the ATI driver.
Dr Andros C Bragianos Improved texture mapping in test scene node. Dr Andros C Bragianos Improved texture mapping in cube scene node.
Philipp Dortmann Sent in code for stencil buffer support for OpenGL. Philipp Dortmann Sent in code for stencil buffer support for OpenGL.
Jerome Nichols Created the Irrlicht/Ruby interface located at irr.rubyforge.org Jerome Nichols Created the Irrlicht/Ruby interface located at irr.rubyforge.org
Vash TheStampede Sent code for missing Draw2DLine() implementation s Vash TheStampede Sent code for missing Draw2DLine() implementations
MattyBoy XBOX support suggestions MattyBoy XBOX support suggestions
Oliver Klems createImageFromData() method suggestion/implementation Oliver Klems createImageFromData() method suggestion/implementation
Jox really, really a lot of bug fixes, and the LMTS file loader Jox really, really a lot of bug fixes, and the LMTS file loader
...@@ -217,7 +218,6 @@ The Irrlicht Engine SDK version 1.4.2 ...@@ -217,7 +218,6 @@ The Irrlicht Engine SDK version 1.4.2
Calimero various bug fixes like vector2d operators Calimero various bug fixes like vector2d operators
Haddock bugfix in the linked list Haddock bugfix in the linked list
G.o.D XML parser fix G.o.D XML parser fix
Alvaro F. Celis Lots of work in the community, for example video tutorials about Irrlicht, forum admin
Erik Zilli Translated some of the tutorials from my stuttering english into real english. :) Erik Zilli Translated some of the tutorials from my stuttering english into real english. :)
Martin Piskernig Linux bugfixing and testing Martin Piskernig Linux bugfixing and testing
Soconne Wrote the original terrain renderer were Irrlichts terrain renderer of Irrlicht is based on it. Soconne Wrote the original terrain renderer were Irrlichts terrain renderer of Irrlicht is based on it.
...@@ -233,3 +233,6 @@ The Irrlicht Engine SDK version 1.4.2 ...@@ -233,3 +233,6 @@ The Irrlicht Engine SDK version 1.4.2
William Finlayson OpenGL RTT, GLSL support and the reflection 2 layer material for OpenGL. William Finlayson OpenGL RTT, GLSL support and the reflection 2 layer material for OpenGL.
Delight Various code contributions for Irrlicht.NET (particle system, basic shader support and more) Delight Various code contributions for Irrlicht.NET (particle system, basic shader support and more)
Michael Zoech Improved GLSL support Michael Zoech Improved GLSL support
Greg Roelofs Created the zlib and libpng
Guy Eric Schalnat, Andreas Dilger, Glenn Randers-Pehrson and others Created libpng
The Independent JPEG Group Created JPEG lib
...@@ -230,7 +230,7 @@ void CCameraSceneNode::OnRegisterSceneNode() ...@@ -230,7 +230,7 @@ void CCameraSceneNode::OnRegisterSceneNode()
f32 dp = tgtv.dotProduct(up); f32 dp = tgtv.dotProduct(up);
if ( core::equals ( fabs ( dp ), 1.f ) ) if ( core::equals(fabsf(dp), 1.f) )
{ {
up.X += 0.5f; up.X += 0.5f;
} }
......
...@@ -365,7 +365,7 @@ bool CD3D9Texture::copyTexture(IImage * image) ...@@ -365,7 +365,7 @@ bool CD3D9Texture::copyTexture(IImage * image)
HRESULT hr = Texture->LockRect(0, &rect, 0, 0); HRESULT hr = Texture->LockRect(0, &rect, 0, 0);
if (FAILED(hr)) if (FAILED(hr))
{ {
os::Printer::log("Could not lock D3D9 Texture.", ELL_ERROR); os::Printer::log("Texture data not copied", "Could not LockRect D3D9 Texture.", ELL_ERROR);
return false; return false;
} }
...@@ -375,7 +375,7 @@ bool CD3D9Texture::copyTexture(IImage * image) ...@@ -375,7 +375,7 @@ bool CD3D9Texture::copyTexture(IImage * image)
hr = Texture->UnlockRect(0); hr = Texture->UnlockRect(0);
if (FAILED(hr)) if (FAILED(hr))
{ {
os::Printer::log("Could not unlock D3D9 Texture.", ELL_ERROR); os::Printer::log("Texture data not copied", "Could not UnlockRect D3D9 Texture.", ELL_ERROR);
return false; return false;
} }
} }
...@@ -395,6 +395,13 @@ void* CD3D9Texture::lock(bool readOnly) ...@@ -395,6 +395,13 @@ void* CD3D9Texture::lock(bool readOnly)
if(!IsRenderTarget) if(!IsRenderTarget)
{ {
hr = Texture->LockRect(0, &rect, 0, readOnly?D3DLOCK_READONLY:0); hr = Texture->LockRect(0, &rect, 0, readOnly?D3DLOCK_READONLY:0);
if (FAILED(hr))
{
os::Printer::log("Could not lock DIRECT3D9 Texture.", ELL_ERROR);
return 0;
}
return rect.pBits;
} }
else else
{ {
...@@ -405,7 +412,7 @@ void* CD3D9Texture::lock(bool readOnly) ...@@ -405,7 +412,7 @@ void* CD3D9Texture::lock(bool readOnly)
hr = Device->CreateOffscreenPlainSurface(desc.Width, desc.Height, desc.Format, D3DPOOL_SYSTEMMEM, &RTTSurface, 0); hr = Device->CreateOffscreenPlainSurface(desc.Width, desc.Height, desc.Format, D3DPOOL_SYSTEMMEM, &RTTSurface, 0);
if (FAILED(hr)) if (FAILED(hr))
{ {
os::Printer::log("Could not lock DIRECT3D9 Texture.", ELL_ERROR); os::Printer::log("Could not lock DIRECT3D9 Texture", "Offscreen surface creation failed.", ELL_ERROR);
return 0; return 0;
} }
} }
...@@ -414,31 +421,24 @@ void* CD3D9Texture::lock(bool readOnly) ...@@ -414,31 +421,24 @@ void* CD3D9Texture::lock(bool readOnly)
hr = Texture->GetSurfaceLevel(0, &surface); hr = Texture->GetSurfaceLevel(0, &surface);
if (FAILED(hr)) if (FAILED(hr))
{ {
os::Printer::log("Could not lock DIRECT3D9 Texture.", ELL_ERROR); os::Printer::log("Could not lock DIRECT3D9 Texture", "Could not get surface.", ELL_ERROR);
return 0; return 0;
} }
hr = Device->GetRenderTargetData(surface, RTTSurface); hr = Device->GetRenderTargetData(surface, RTTSurface);
surface->Release(); surface->Release();
if(FAILED(hr)) if(FAILED(hr))
{ {
os::Printer::log("Could not lock DIRECT3D9 Texture.", ELL_ERROR); os::Printer::log("Could not lock DIRECT3D9 Texture", "Data copy failed.", ELL_ERROR);
return 0; return 0;
} }
hr = RTTSurface->LockRect(&rect, 0, readOnly?D3DLOCK_READONLY:0); hr = RTTSurface->LockRect(&rect, 0, readOnly?D3DLOCK_READONLY:0);
if(FAILED(hr)) if(FAILED(hr))
{ {
os::Printer::log("Could not lock DIRECT3D9 Texture.", ELL_ERROR); os::Printer::log("Could not lock DIRECT3D9 Texture", "LockRect failed.", ELL_ERROR);
return 0; return 0;
} }
return rect.pBits; return rect.pBits;
} }
if (FAILED(hr))
{
os::Printer::log("Could not lock DIRECT3D9 Texture.", ELL_ERROR);
return 0;
}
return rect.pBits;
} }
......
...@@ -22,7 +22,9 @@ namespace irr ...@@ -22,7 +22,9 @@ namespace irr
namespace scene namespace scene
{ {
//#define _IRR_DEBUG_OBJ_LOADER_ #ifdef _DEBUG
#define _IRR_DEBUG_OBJ_LOADER_
#endif
static const u32 WORD_BUFFER_LENGTH = 512; static const u32 WORD_BUFFER_LENGTH = 512;
......
...@@ -167,8 +167,9 @@ namespace scene ...@@ -167,8 +167,9 @@ namespace scene
//! Adds a skydome scene node. A skydome is a large (half-) sphere with a //! Adds a skydome scene node. A skydome is a large (half-) sphere with a
//! panoramic texture on it and is drawn around the camera position. //! panoramic texture on it and is drawn around the camera position.
virtual ISceneNode* addSkyDomeSceneNode(video::ITexture* texture, virtual ISceneNode* addSkyDomeSceneNode(video::ITexture* texture,
u32 horiRes, u32 vertRes, f64 texturePercentage, u32 horiRes=16, u32 vertRes=8,
f64 spherePercentage, ISceneNode* parent=0, s32 id=-1); f64 texturePercentage=0.9, f64 spherePercentage=2.0,
ISceneNode* parent=0, s32 id=-1);
//! Adds a text scene node, which is able to display //! Adds a text scene node, which is able to display
//! 2d text at a position in three dimensional space //! 2d text at a position in three dimensional space
......
...@@ -272,6 +272,7 @@ void CSceneNodeAnimatorCameraFPS::setKeyMap(SKeyMap *map, u32 count) ...@@ -272,6 +272,7 @@ void CSceneNodeAnimatorCameraFPS::setKeyMap(SKeyMap *map, u32 count)
{ {
// clear the keymap // clear the keymap
KeyMap.clear(); KeyMap.clear();
KeyMapArray=map;
// add actions // add actions
for (u32 i=0; i<count; ++i) for (u32 i=0; i<count; ++i)
......
...@@ -321,35 +321,38 @@ namespace scene ...@@ -321,35 +321,38 @@ namespace scene
{ {
case 1: case 1:
{ {
u8 val; s8 val;
if( file->read( &val, bytesPerPixel ) != bytesPerPixel ) if( file->read( &val, bytesPerPixel ) != bytesPerPixel )
{ {
os::Printer::log("Error reading heightmap RAW file."); os::Printer::log("Error reading heightmap RAW file.");
mb->drop(); mb->drop();
return false; return false;
} }
vertex.Pos.Y=val;
} }
break; break;
case 2: case 2:
{ {
u16 val; s16 val;
if( file->read( &val, bytesPerPixel ) != bytesPerPixel ) if( file->read( &val, bytesPerPixel ) != bytesPerPixel )
{ {
os::Printer::log("Error reading heightmap RAW file."); os::Printer::log("Error reading heightmap RAW file.");
mb->drop(); mb->drop();
return false; return false;
} }
vertex.Pos.Y=val;
} }
break; break;
case 4: case 4:
{ {
u32 val; s32 val;
if( file->read( &val, bytesPerPixel ) != bytesPerPixel ) if( file->read( &val, bytesPerPixel ) != bytesPerPixel )
{ {
os::Printer::log("Error reading heightmap RAW file."); os::Printer::log("Error reading heightmap RAW file.");
mb->drop(); mb->drop();
return false; return false;
} }
vertex.Pos.Y=(f32)val;
} }
break; break;
} }
...@@ -406,7 +409,7 @@ namespace scene ...@@ -406,7 +409,7 @@ namespace scene
RenderBuffer->getIndexBuffer().set_used( TerrainData.PatchCount * TerrainData.PatchCount * RenderBuffer->getIndexBuffer().set_used( TerrainData.PatchCount * TerrainData.PatchCount *
TerrainData.CalcPatchSize * TerrainData.CalcPatchSize * 6 ); TerrainData.CalcPatchSize * TerrainData.CalcPatchSize * 6 );
u32 endTime = os::Timer::getTime(); const u32 endTime = os::Timer::getTime();
c8 tmp[255]; c8 tmp[255];
snprintf(tmp, 255, "Generated terrain data (%dx%d) in %.4f seconds", snprintf(tmp, 255, "Generated terrain data (%dx%d) in %.4f seconds",
......
...@@ -260,10 +260,10 @@ ...@@ -260,10 +260,10 @@
EnableFunctionLevelLinking="true" EnableFunctionLevelLinking="true"
FloatingPointModel="2" FloatingPointModel="2"
RuntimeTypeInfo="false" RuntimeTypeInfo="false"
PrecompiledHeaderFile=".\..\obj\IrrRelease/Irrlicht.pch" PrecompiledHeaderFile=".\..\obj\IrrReleaseFastFPU/Irrlicht.pch"
AssemblerListingLocation=".\..\obj\IrrRelease/" AssemblerListingLocation=".\..\obj\IrrReleaseFastFPU/"
ObjectFile=".\..\obj\IrrRelease/" ObjectFile=".\..\obj\IrrReleaseFastFPU/"
ProgramDataBaseFileName=".\..\obj\IrrRelease/" ProgramDataBaseFileName=".\..\obj\IrrReleaseFastFPU/"
WarningLevel="3" WarningLevel="3"
SuppressStartupBanner="true" SuppressStartupBanner="true"
DebugInformationFormat="0" DebugInformationFormat="0"
...@@ -358,10 +358,10 @@ ...@@ -358,10 +358,10 @@
RuntimeLibrary="1" RuntimeLibrary="1"
DisableLanguageExtensions="false" DisableLanguageExtensions="false"
RuntimeTypeInfo="false" RuntimeTypeInfo="false"
PrecompiledHeaderFile=".\..\obj\IrrDebug/Irrlicht.pch" PrecompiledHeaderFile=".\..\obj\IrrDebugStatic/Irrlicht.pch"
AssemblerListingLocation=".\..\obj\IrrDebug/" AssemblerListingLocation=".\..\obj\IrrDebugStatic/"
ObjectFile=".\..\obj\IrrDebug/" ObjectFile=".\..\obj\IrrDebugStatic/"
ProgramDataBaseFileName=".\..\obj\IrrDebug/" ProgramDataBaseFileName=".\..\obj\IrrDebugStatic/"
WarningLevel="3" WarningLevel="3"
SuppressStartupBanner="true" SuppressStartupBanner="true"
DebugInformationFormat="3" DebugInformationFormat="3"
...@@ -442,10 +442,10 @@ ...@@ -442,10 +442,10 @@
RuntimeLibrary="0" RuntimeLibrary="0"
BufferSecurityCheck="false" BufferSecurityCheck="false"
EnableFunctionLevelLinking="true" EnableFunctionLevelLinking="true"
PrecompiledHeaderFile=".\..\obj\IrrRelease/Irrlicht.pch" PrecompiledHeaderFile=".\..\obj\IrrReleaseStatic/Irrlicht.pch"
AssemblerListingLocation=".\..\obj\IrrRelease/" AssemblerListingLocation=".\..\obj\IrrReleaseStatic/"
ObjectFile=".\..\obj\IrrRelease/" ObjectFile=".\..\obj\IrrReleaseStatic/"
ProgramDataBaseFileName=".\..\obj\IrrRelease/" ProgramDataBaseFileName=".\..\obj\IrrReleaseStatic/"
WarningLevel="3" WarningLevel="3"
SuppressStartupBanner="true" SuppressStartupBanner="true"
DebugInformationFormat="0" DebugInformationFormat="0"
...@@ -530,10 +530,10 @@ ...@@ -530,10 +530,10 @@
EnableFunctionLevelLinking="true" EnableFunctionLevelLinking="true"
FloatingPointModel="2" FloatingPointModel="2"
RuntimeTypeInfo="false" RuntimeTypeInfo="false"
PrecompiledHeaderFile=".\..\obj\IrrRelease/Irrlicht.pch" PrecompiledHeaderFile=".\..\obj\IrrReleaseFastFPUStatic/Irrlicht.pch"
AssemblerListingLocation=".\..\obj\IrrRelease/" AssemblerListingLocation=".\..\obj\IrrReleaseFastFPUStatic/"
ObjectFile=".\..\obj\IrrRelease/" ObjectFile=".\..\obj\IrrReleaseFastFPUStatic/"
ProgramDataBaseFileName=".\..\obj\IrrRelease/" ProgramDataBaseFileName=".\..\obj\IrrReleaseFastFPUStatic/"
WarningLevel="3" WarningLevel="3"
SuppressStartupBanner="true" SuppressStartupBanner="true"
DebugInformationFormat="0" DebugInformationFormat="0"
......
...@@ -261,9 +261,9 @@ ...@@ -261,9 +261,9 @@
FloatingPointModel="2" FloatingPointModel="2"
RuntimeTypeInfo="false" RuntimeTypeInfo="false"
PrecompiledHeaderFile=".\..\obj\IrrRelease/Irrlicht.pch" PrecompiledHeaderFile=".\..\obj\IrrRelease/Irrlicht.pch"
AssemblerListingLocation=".\..\obj\IrrRelease/" AssemblerListingLocation=".\..\obj\IrrReleaseFastFPU/"
ObjectFile=".\..\obj\IrrRelease/" ObjectFile=".\..\obj\IrrReleaseFastFPU/"
ProgramDataBaseFileName=".\..\obj\IrrRelease/" ProgramDataBaseFileName=".\..\obj\IrrReleaseFastFPU/"
WarningLevel="3" WarningLevel="3"
WarnAsError="false" WarnAsError="false"
SuppressStartupBanner="true" SuppressStartupBanner="true"
...@@ -362,9 +362,9 @@ ...@@ -362,9 +362,9 @@
DisableLanguageExtensions="false" DisableLanguageExtensions="false"
RuntimeTypeInfo="false" RuntimeTypeInfo="false"
PrecompiledHeaderFile=".\..\obj\IrrDebug/Irrlicht.pch" PrecompiledHeaderFile=".\..\obj\IrrDebug/Irrlicht.pch"
AssemblerListingLocation=".\..\obj\IrrDebug/" AssemblerListingLocation=".\..\obj\IrrDebugStatic/"
ObjectFile=".\..\obj\IrrDebug/" ObjectFile=".\..\obj\IrrDebugStatic/"
ProgramDataBaseFileName=".\..\obj\IrrDebug/" ProgramDataBaseFileName=".\..\obj\IrrDebugStatic/"
WarningLevel="3" WarningLevel="3"
SuppressStartupBanner="true" SuppressStartupBanner="true"
DebugInformationFormat="3" DebugInformationFormat="3"
...@@ -446,9 +446,9 @@ ...@@ -446,9 +446,9 @@
BufferSecurityCheck="false" BufferSecurityCheck="false"
EnableFunctionLevelLinking="true" EnableFunctionLevelLinking="true"
PrecompiledHeaderFile=".\..\obj\IrrRelease/Irrlicht.pch" PrecompiledHeaderFile=".\..\obj\IrrRelease/Irrlicht.pch"
AssemblerListingLocation=".\..\obj\IrrRelease/" AssemblerListingLocation=".\..\obj\IrrReleaseStatic/"
ObjectFile=".\..\obj\IrrRelease/" ObjectFile=".\..\obj\IrrReleaseStatic/"
ProgramDataBaseFileName=".\..\obj\IrrRelease/" ProgramDataBaseFileName=".\..\obj\IrrReleaseStatic/"
WarningLevel="3" WarningLevel="3"
SuppressStartupBanner="true" SuppressStartupBanner="true"
DebugInformationFormat="0" DebugInformationFormat="0"
...@@ -534,9 +534,9 @@ ...@@ -534,9 +534,9 @@
FloatingPointModel="2" FloatingPointModel="2"
RuntimeTypeInfo="false" RuntimeTypeInfo="false"
PrecompiledHeaderFile=".\..\obj\IrrRelease/Irrlicht.pch" PrecompiledHeaderFile=".\..\obj\IrrRelease/Irrlicht.pch"
AssemblerListingLocation=".\..\obj\IrrRelease/" AssemblerListingLocation=".\..\obj\IrrReleaseFastFPUStatic/"
ObjectFile=".\..\obj\IrrRelease/" ObjectFile=".\..\obj\IrrReleaseFastFPUStatic/"
ProgramDataBaseFileName=".\..\obj\IrrRelease/" ProgramDataBaseFileName=".\..\obj\IrrReleaseFastFPUStatic/"
WarningLevel="3" WarningLevel="3"
SuppressStartupBanner="true" SuppressStartupBanner="true"
DebugInformationFormat="0" DebugInformationFormat="0"
......
...@@ -144,7 +144,7 @@ TAGS: ...@@ -144,7 +144,7 @@ TAGS:
# Create object files from objective-c code # Create object files from objective-c code
%.o:%.mm %.o:%.mm
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $@ $< $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
ifneq ($(MAKECMDGOALS),clean) ifneq ($(MAKECMDGOALS),clean)
-include $(LINKOBJ:.o=.d) -include $(LINKOBJ:.o=.d)
......
# Irrlicht Engine Regression Tests Makefile
Target = tests
Sources = $(wildcard *.cpp)
CPPFLAGS = -I../include -I/usr/X11R6/include -pipe
# CXXFLAGS += -Wall -O3
CXXFLAGS += -g -D_DEBUG
ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
endif
all: all_linux
# target specific settings
all_linux: SYSTEM=Linux
all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../lib/$(SYSTEM) -lIrrlicht -lGL -lXxf86vm -lXext -lX11
all_win32 clean_win32: SYSTEM=Win32-gcc
all_win32: LDFLAGS = -L../lib/$(SYSTEM) -lIrrlicht -lopengl32 -lm
all_win32 clean_win32: SUF=.exe
# name of the binary - only valid for targets which set SYSTEM
DESTPATH = ../bin/$(SYSTEM)/$(Target)$(SUF)
OBJ = $(Sources:.cpp=.o)
all_linux all_win32: $(OBJ)
$(warning Building...)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $(DESTPATH) $(LDFLAGS)
clean: clean_linux clean_win32
$(warning Cleaning...)
@$(RM) $(OBJ)
clean_linux clean_win32:
@$(RM) $(DESTPATH)
.PHONY: all all_win32 clean clean_linux clean_win32
#include <irrlicht.h>
#include <assert.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
bool disambiguateTextures(void)
{
IrrlichtDevice *device =
createDevice( video::EDT_SOFTWARE, dimension2d<s32>(640, 480), 16,
false, false, false, 0);
if (!device)
return false;
IVideoDriver * driver = device->getVideoDriver();
ITexture * tex1 = driver->getTexture("../media/tools.png");
ITexture * tex2 = driver->getTexture("../media/tools.png");
IReadFile * readFile = device->getFileSystem()->createAndOpenFile("../media/tools.png");
assert(readFile);
ITexture * tex3 = driver->getTexture(readFile);
readFile->drop();
// Expects an empty tmp/tmp directory under this app's wd and
// a media directory under this apps' directory with tools.png in it.
stringc wd = device->getFileSystem()->getWorkingDirectory();
stringc newWd = wd + "/empty/empty";
bool changed = device->getFileSystem()->changeWorkingDirectoryTo(newWd.c_str());
assert(changed);
ITexture * tex4 = driver->getTexture("../../media/tools.png");
assert(tex4);
assert(tex1 == tex2 && tex1 == tex3 && tex1 != tex4);
changed &= device->getFileSystem()->changeWorkingDirectoryTo(wd.c_str());
device->drop();
return (changed && tex1 == tex2 && tex1 == tex3 && tex1 != tex4) ? true : false;
}
// Tests IVideoDriver::drawPixel().
// Expect to see two diagonal lines overlaying a wall texture cube.
// One line should run from red at the top left to green at the bottom right.
// The other should run from cyan 100% transparent at the bottom left to
// cyan 100% opaque at the top right.
#include "irrlicht.h"
#include "testUtils.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
static bool runTestWithDriver(E_DRIVER_TYPE driverType)
{
IrrlichtDevice *device = createDevice( driverType, dimension2d<s32>(640, 480));
if (!device)
return true; // Treat a failure to create a driver as benign; this saves a lot of #ifdefs
IVideoDriver* driver = device->getVideoDriver();
ISceneManager * smgr = device->getSceneManager();
// Draw a cube to check that the pixels' alpha is working.
ISceneNode * cube = smgr->addCubeSceneNode(50.f, 0, -1, vector3df(0, 0, 60));
cube->setMaterialTexture(0, driver->getTexture("../media/wall.bmp"));
cube->setMaterialFlag(video::EMF_LIGHTING, false);
(void)smgr->addCameraSceneNode();
driver->beginScene(true, true, SColor(255,100,101,140));
smgr->drawAll();
// Test for offscreen values as well as onscreen.
for(s32 x = -10; x < 650; ++x)
{
s32 y = 480 * x / 640;
driver->drawPixel((u32)x, (u32)y, SColor(255, 255 * x / 640, 255 * (640 - x) / 640, 0));
y = 480 - y;
driver->drawPixel((u32)x, (u32)y, SColor(255 * x / 640, 0, 255, 255));
}
driver->endScene();
bool result = takeScreenshotAndCompareAgainstReference(driver, "-drawPixel.jpg");
device->drop();
return result;
}
bool drawPixel(void)
{
bool passed = true;
passed |= runTestWithDriver(EDT_NULL);
passed |= runTestWithDriver(EDT_SOFTWARE);
passed |= runTestWithDriver(EDT_BURNINGSVIDEO);
passed |= runTestWithDriver(EDT_OPENGL);
passed |= runTestWithDriver(EDT_DIRECT3D8);
passed |= runTestWithDriver(EDT_DIRECT3D9);
return passed;
}
// Test the accuracy and speed of
#include "irrlicht.h"
#include <assert.h>
#include <float.h>
#include <limits.h>
using namespace irr;
using namespace core;
static inline u32 old_strtol10(const char* in, const char** out=0)
{
u32 value = 0;
while ( ( *in >= '0') && ( *in <= '9' ))
{
value = ( value * 10 ) + ( *in - '0' );
++in;
}
if (out)
*out = in;
return value;
}
//! Provides a fast function for converting a string into a float,
//! about 6 times faster than atof in win32.
// If you find any bugs, please send them to me, niko (at) irrlicht3d.org.
static inline const char* old_fast_atof_move( const char* c, float& out)
{
bool inv = false;
const char *t;
float f;
if (*c=='-')
{
++c;
inv = true;
}
//f = (float)strtol(c, &t, 10);
f = (float) old_strtol10 ( c, &c );
if (*c == '.')
{
++c;
//float pl = (float)strtol(c, &t, 10);
float pl = (float) old_strtol10 ( c, &t );
pl *= fast_atof_table[t-c];
f += pl;
c = t;
if (*c == 'e')
{
++c;
//float exp = (float)strtol(c, &t, 10);
bool einv = (*c=='-');
if (einv)
++c;
float exp = (float)old_strtol10(c, &c);
if (einv)
exp *= -1.0f;
f *= (float)pow(10.0f, exp);
}
}
if (inv)
f *= -1.0f;
out = f;
return c;
}
static inline float old_fast_atof(const char* c)
{
float ret;
old_fast_atof_move(c, ret);
return ret;
}
static bool testCalculation(const char * valueString)
{
const f32 newFastValue = fast_atof(valueString);
const f32 oldFastValue = old_fast_atof(valueString);
const f32 atofValue = (f32)atof(valueString);
(void)printf("\n String '%s'\n New fast %.40f\n Old fast %.40f\n atof %.40f\n",
valueString, newFastValue, oldFastValue, atofValue);
bool accurate = fabs(newFastValue - atofValue) <= fabs(oldFastValue - atofValue);
if(!accurate)
(void)printf("*** ERROR - less accurate than old method ***\n\n");
return accurate;
}
bool fast_atof(void)
{
bool accurate = true;
accurate &= testCalculation("340282346638528859811704183484516925440.000000");
accurate &= testCalculation("3.402823466e+38F");
accurate &= testCalculation("3402823466e+29F");
accurate &= testCalculation("-340282346638528859811704183484516925440.000000");
accurate &= testCalculation("-3.402823466e+38F");
accurate &= testCalculation("-3402823466e+29F");
accurate &= testCalculation("34028234663852885981170418348451692544.000000");
accurate &= testCalculation("3.402823466e+37F");
accurate &= testCalculation("3402823466e+28F");
accurate &= testCalculation("-34028234663852885981170418348451692544.000000");
accurate &= testCalculation("-3.402823466e+37F");
accurate &= testCalculation("-3402823466e+28F");
accurate &= testCalculation(".00234567");
accurate &= testCalculation("-.00234567");
accurate &= testCalculation("0.00234567");
accurate &= testCalculation("-0.00234567");
accurate &= testCalculation("1.175494351e-38F");
accurate &= testCalculation("1175494351e-47F");
accurate &= testCalculation("1.175494351e-37F");
accurate &= testCalculation("1.175494351e-36F");
accurate &= testCalculation("-1.175494351e-36F");
accurate &= testCalculation("123456.789");
accurate &= testCalculation("-123456.789");
accurate &= testCalculation("0000123456.789");
accurate &= testCalculation("-0000123456.789");
if(!accurate)
{
(void)printf("Calculation is not accurate, so the speed is irrelevant\n");
return false;
}
IrrlichtDevice* device = createDevice(video::EDT_NULL);
if (!device)
return false;
ITimer* timer = device->getTimer();
enum { ITERATIONS = 100000 };
int i;
f32 value;
u32 then = timer->getRealTime();
for(i = 0; i < ITERATIONS; ++i)
value = (f32)atof("-340282346638528859811704183484516925440.000000");
const u32 atofTime = timer->getRealTime() - then;
then += atofTime;
for(i = 0; i < ITERATIONS; ++i)
value = fast_atof("-340282346638528859811704183484516925440.000000");
const u32 fastAtofTime = timer->getRealTime() - then;
then += fastAtofTime;
for(i = 0; i < ITERATIONS; ++i)
value = old_fast_atof("-340282346638528859811704183484516925440.000000");
const u32 oldFastAtofTime = timer->getRealTime() - then;
(void)printf(" atof time = %d\n fast_atof Time = %d\nold fast_atof time = %d\n",
atofTime, fastAtofTime, oldFastAtofTime);
device->drop();
if(fastAtofTime > atofTime)
{
(void)printf("The fast method is slower than atof()\n");
return false;
}
return true;
}
// Test the functionality of line2d>T>::intersectWith().
// Validation is done with asserts() on back-of-an-envelope
// expected results.
#include <irrlicht.h>
#include <assert.h>
using namespace irr;
using namespace core;
static bool testLines(line2df const & line1,
line2df const & line2,
bool expectedHit,
const vector2df & expectedIntersection)
{
bool gotExpectedResult = true;
(void)printf("\nLine 1 = %.1f %.1f to %.1f %.1f \n",
line1.start.X, line1.start.Y,
line1.end.X, line1.end.Y);
(void)printf("Line 2 = %.1f %.1f to %.1f %.1f\n",
line2.start.X, line2.start.Y,
line2.end.X, line2.end.Y);
vector2df intersection;
(void)printf("line1 with line2 = ");
if(line1.intersectWith(line2, intersection))
{
(void)printf("hit at %.1f %.1f - ",
intersection.X, intersection.Y);
if(!line1.isPointOnLine(intersection) || !line2.isPointOnLine(intersection))
{
(void)printf("ERROR! point is not on both lines - ");
gotExpectedResult = false;
}
if(expectedHit)
{
if(intersection == expectedIntersection)
{
(void)printf("expected\n");
}
else
{
(void)printf("unexpected intersection (expected %.1f %.1f)\n",
expectedIntersection.X, expectedIntersection.Y);
gotExpectedResult = false;
}
}
else
{
(void)printf("UNEXPECTED\n");
gotExpectedResult = false;
}
}
else
{
(void)printf("miss - ");
if(!expectedHit)
{
(void)printf("expected\n");
}
else
{
(void)printf("UNEXPECTED\n");
gotExpectedResult = false;
}
}
(void)printf("line2 with line1 = ");
if(line2.intersectWith(line1, intersection))
{
(void)printf("hit at %.1f %.1f - ",
intersection.X, intersection.Y);
if(!line1.isPointOnLine(intersection) || !line2.isPointOnLine(intersection))
{
(void)printf("ERROR! point is not on both lines - ");
gotExpectedResult = false;
}
if(expectedHit)
{
if(intersection == expectedIntersection)
{
(void)printf("expected\n");
}
else
{
(void)printf("unexpected intersection (expected %.1f %.1f)\n",
expectedIntersection.X, expectedIntersection.Y);
gotExpectedResult = false;
}
}
else
{
(void)printf("UNEXPECTED\n");
gotExpectedResult = false;
}
}
else
{
(void)printf("miss - ");
if(!expectedHit)
{
(void)printf("expected\n");
}
else
{
(void)printf("UNEXPECTED\n");
gotExpectedResult = false;
}
}
return gotExpectedResult;
}
bool line2dIntersectWith(void)
{
bool allExpected = true;
// Crossing lines, horizontal and vertical
allExpected &= testLines(line2df(vector2df(1,1),vector2df(1,3)),
line2df(vector2df(0,2),vector2df(2,2)),
true, vector2df(1,2));
// Crossing lines, both diagonal
allExpected &= testLines(line2df(vector2df(0,0),vector2df(2,2)),
line2df(vector2df(0,2),vector2df(2,0)),
true, vector2df(1,1));
// Non-crossing lines, horizontal and vertical
allExpected &= testLines(line2df(vector2df(1,1),vector2df(1,3)),
line2df(vector2df(0,4),vector2df(2,4)),
false, vector2df());
// Non-crossing lines, both diagonal
allExpected &= testLines(line2df(vector2df(0,0),vector2df(2,2)),
line2df(vector2df(3,4),vector2df(4,3)),
false, vector2df());
// Meeting at a common point
allExpected &= testLines(line2df(vector2df(0,0),vector2df(1,0)),
line2df(vector2df(1,0),vector2df(2,0)),
true, vector2df(1,0));
allExpected &= testLines(line2df(vector2df(0,0),vector2df(1,0)),
line2df(vector2df(1,0),vector2df(0,1)),
true, vector2df(1,0));
allExpected &= testLines(line2df(vector2df(0,0),vector2df(1,0)),
line2df(vector2df(1,0),vector2df(0,-1)),
true, vector2df(1,0));
allExpected &= testLines(line2df(vector2df(0,0),vector2df(0,1)),
line2df(vector2df(0,1),vector2df(1,1)),
true, vector2df(0,1));
allExpected &= testLines(line2df(vector2df(0,0),vector2df(0,1)),
line2df(vector2df(0,1),vector2df(1,-1)),
true, vector2df(0,1));
allExpected &= testLines(line2df(vector2df(0,0),vector2df(0,1)),
line2df(vector2df(0,1),vector2df(0,2)),
true, vector2df(0,1));
allExpected &= testLines(line2df(vector2df(0,0),vector2df(1,0)),
line2df(vector2df(1,0),vector2df(2,0)),
true, vector2df(1,0));
allExpected &= testLines(line2df(vector2df(0,0),vector2df(1,1)),
line2df(vector2df(1,1),vector2df(0,2)),
true, vector2df(1,1));
allExpected &= testLines(line2df(vector2df(0,0),vector2df(1,1)),
line2df(vector2df(1,1),vector2df(2,0)),
true, vector2df(1,1));
allExpected &= testLines(line2df(vector2df(0,0),vector2df(1,1)),
line2df(vector2df(1,1),vector2df(2,2)),
true, vector2df(1,1));
// Parallel lines, no intersection
allExpected &= testLines(line2df(vector2df(0,0),vector2df(1,0)),
line2df(vector2df(0,1),vector2df(1,1)),
false, vector2df());
allExpected &= testLines(line2df(vector2df(0,0),vector2df(0,1)),
line2df(vector2df(1,0),vector2df(1,1)),
false, vector2df());
// Non parallel lines, no intersection
allExpected &= testLines(line2df(vector2df(0,0),vector2df(1,0)),
line2df(vector2df(0,1),vector2df(0,2)),
false, vector2df());
allExpected &= testLines(line2df(vector2df(0,0),vector2df(0,1)),
line2df(vector2df(1,0),vector2df(2,0)),
false, vector2df());
// Coincident (and thus parallel) lines
allExpected &= testLines(line2df(vector2df(0,0),vector2df(1,0)),
line2df(vector2df(0,0),vector2df(1,0)),
true, vector2df(0,0));
allExpected &= testLines(line2df(vector2df(2,0),vector2df(0,2)),
line2df(vector2df(2,0),vector2df(0,2)),
true, vector2df(2,0));
// Overlapping parallel lines
allExpected &= testLines(line2df(vector2df(1,0),vector2df(2,0)),
line2df(vector2df(0,0),vector2df(3,0)),
true, vector2df(1.5f, 0));
allExpected &= testLines(line2df(vector2df(0,1),vector2df(0,2)),
line2df(vector2df(0,0),vector2df(0,3)),
true, vector2df(0, 1.5f));
allExpected &= testLines(line2df(vector2df(1,0),vector2df(2,0)),
line2df(vector2df(0,0),vector2df(3,0)),
true, vector2df(1.5f, 0));
allExpected &= testLines(line2df(vector2df(0,1),vector2df(0,2)),
line2df(vector2df(0,0),vector2df(0,3)),
true, vector2df(0, 1.5f));
allExpected &= testLines(line2df(vector2df(1,1),vector2df(2,2)),
line2df(vector2df(0,0),vector2df(3,3)),
true, vector2df(1.5f, 1.5f));
allExpected &= testLines(line2df(vector2df(1,2),vector2df(2,1)),
line2df(vector2df(0,3),vector2df(3,0)),
true, vector2df(1.5f, 1.5f));
if(allExpected)
(void)printf("\nAll tests passed\n");
else
(void)printf("\nFAIL!\n");
return allExpected;
}
// This is the entry point for the Irrlicht test suite.
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <time.h>
// This is an MSVC pragma to link against the Irrlicht library.
// Other builds must link against it in the project files.
#if defined(_MSC_VER)
#pragma comment(lib, "Irrlicht.lib")
#endif // _MSC_VER
/* Each test must have the same signature. Test should (but are not
* required to) live in a .cpp file of the same name. There is no
* need to #include anything since the test entry points can be
* declared as extern before calling them.
*/
#define RUN_TEST(testEntryPoint)\
extern bool testEntryPoint(void);\
if(!testEntryPoint()) \
{\
(void)printf("\n\n\n******** Test failure ********\nTest '" #testEntryPoint "' failed\n"\
"******** Test failure ********\n\nPress return to continue\n\a\a\a");\
(void)getc(stdin);\
fails++;\
}
//! This is the main entry point for the Irrlicht test suite.
/** \return The number of test that failed, i.e. 0 is success. */
int main()
{
int fails = 0;
RUN_TEST(testVector3d);
RUN_TEST(testVector2d);
RUN_TEST(planeMatrix);
RUN_TEST(fast_atof);
RUN_TEST(line2dIntersectWith);
RUN_TEST(disambiguateTextures);
RUN_TEST(drawPixel);
RUN_TEST(md2Animation);
(void)printf("\nTests finished. %d test%s failed.\n", fails, 1 == fails ? "" : "s");
if(0 == fails)
{
time_t rawtime;
struct tm * timeinfo;
(void)time(&rawtime);
timeinfo = gmtime(&rawtime);
(void)printf("\nTest suite pass at GMT %s\n", asctime(timeinfo));
FILE * testsLastPassedAtFile = fopen("tests-last-passed-at.txt", "w");
if(testsLastPassedAtFile)
{
(void)fprintf(testsLastPassedAtFile, "Test suite pass at GMT %s\n", asctime(timeinfo));
(void)fclose(testsLastPassedAtFile);
}
}
return fails;
}
// This test validates the last frame of a non-looped MD2 animation
#include "irrlicht.h"
#include "testUtils.h"
#include <assert.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
bool md2Animation(void)
{
IrrlichtDevice *device = createDevice( EDT_OPENGL, dimension2d<s32>(640, 480));
assert(device);
if (!device)
return false;
IVideoDriver* driver = device->getVideoDriver();
ISceneManager * smgr = device->getSceneManager();
IAnimatedMesh* mesh = smgr->getMesh("../media/sydney.md2");
IAnimatedMeshSceneNode* node;
assert(mesh);
if(mesh)
{
node = smgr->addAnimatedMeshSceneNode(mesh);
assert(node);
if(node)
{
node->setPosition(vector3df(20, 0, 50));
node->setMaterialFlag(EMF_LIGHTING, false);
node->setMaterialTexture(0, driver->getTexture("../media/sydney.bmp"));
node->setLoopMode(false);
(void)smgr->addCameraSceneNode();
// We could just jump to the last frame, but where's the fun in that?
// Let's watch the animation, doing the initial run() first so that we
// don't miss any of the fun.
device->run();
node->setMD2Animation(EMAT_DEATH_FALLBACK);
const s32 endFrame = node->getEndFrame();
while((s32)node->getFrameNr() < endFrame)
{
device->run();
driver->beginScene(true, true, SColor(255, 255, 255, 0));
smgr->drawAll();
driver->endScene();
}
}
}
bool result = takeScreenshotAndCompareAgainstReference(driver, "-md2Animation.jpg");
device->drop();
return result;
}
\ No newline at end of file
This diff is collapsed.
// Copyright (C) 2008 Colin MacDonald
// No rights reserved: this software is in the public domain.
#define _CRT_SECURE_NO_WARNINGS
#include "testUtils.h"
#include <memory.h>
#include <stdio.h>
#include <assert.h>
bool binaryCompareFiles(const char * fileName1, const char * fileName2)
{
assert(fileName1);
assert(fileName2);
if(!fileName1 || !fileName2)
return false;
FILE * file1 = fopen(fileName1, "rb");
assert(file1);
if(!file1)
{
(void)printf("binaryCompareFiles: File '%s' cannot be opened\n", fileName1);
return false;
}
FILE * file2 = fopen(fileName2, "rb");
assert(file2);
if(!file2)
{
(void)printf("binaryCompareFiles: File '%s' cannot be opened\n", fileName2);
(void)fclose(file1);
return false;
}
(void)fseek(file1, 0, SEEK_END);
(void)fseek(file2, 0, SEEK_END);
if(ftell(file1) != ftell(file2))
{
(void)printf("binaryCompareFiles: Files are different sizes\n");
(void)fclose(file1);
(void)fclose(file2);
return false;
}
(void)fseek(file1, 0, SEEK_SET);
(void)fseek(file2, 0, SEEK_SET);
char file1Buffer[8196];
char file2Buffer[8196];
while(!feof(file1))
{
if(feof(file2)
||(fread(file1Buffer, sizeof(file1Buffer), 1, file1) !=
fread(file2Buffer, sizeof(file2Buffer), 1, file2)))
{
(void)printf("binaryCompareFiles: Error during file reading\n");
break;
}
if(memcmp(file1Buffer, file2Buffer, sizeof(file1Buffer)))
{
(void)printf("binaryCompareFiles: Error during file reading\n");
break;
}
}
bool filesAreIdentical = feof(file1) && feof(file2);
(void)fclose(file1);
(void)fclose(file2);
return filesAreIdentical;
}
bool takeScreenshotAndCompareAgainstReference(irr::video::IVideoDriver * driver, const char * fileName)
{
irr::video::IImage * screenshot = driver->createScreenShot();
if(screenshot)
{
irr::core::stringc driverName = driver->getName();
// For OpenGL (only), chop the version number out. Other drivers have more stable version numbers.
if(driverName.find("OpenGL") > -1)
driverName = "OpenGL";
irr::core::stringc filename = "results/";
filename += driverName;
filename += fileName;
bool written = driver->writeImageToFile(screenshot, filename.c_str());
screenshot->drop();
if(!written)
{
(void)printf("Failed to write screenshot to file '%s'\n", filename.c_str());
return false;
}
irr::core::stringc referenceFilename = "media/";
referenceFilename += driverName;
referenceFilename += fileName;
return binaryCompareFiles(filename.c_str(), referenceFilename.c_str());
}
else
{
(void)printf("Failed to take screenshot\n");
}
return false;
}
#ifndef _TEST_UTILS_H_
#define _TEST_UTILS_H_ 1
#include "irrlicht.h"
//! Compare two files
/** \param fileName1 The first file for comparison.
\param fileName1 The second file for comparison.
\return true if the files are identical, false on any error or difference. */
extern bool binaryCompareFiles(const char * fileName1, const char * fileName2);
//! Take a screenshot and compare it against a reference screenshot in the tests/media subdirectory
/** \param driver The Irrlicht video driver.
\fileName The unique filename suffix that will be appended to the name of the video driver.
\return true if the screenshot was taken and is identical to the reference image of the same name
in the tests/media directory, false on any error or difference. */
bool takeScreenshotAndCompareAgainstReference(irr::video::IVideoDriver * driver, const char * fileName);
#endif // _TEST_UTILS_H_
// Test the functionality of vector2d<T>, particularly methods that
// involve calculations done using different precision than <T>.
// Note that all reference vector2d<T>s are creating using double precision
// values cast to (T), as we need to test <f64>.
#include "irrlicht.h"
#include <assert.h>
using namespace irr;
using namespace core;
template<class T>
static bool compareVectors(const core::vector2d<T> & compare,
const core::vector2d<T> & with)
{
if(compare != with)
{
(void)printf("\nERROR: vector2d %.16f, %.16f != vector2d %.16f, %.16f\n",
(f64)compare.X, (f64)compare.Y, (f64)with.X, (f64)with.Y);
assert(compare == with);
return false;
}
return true;
}
template <class T>
static bool doTests()
{
#define COMPARE_VECTORS(compare, with)\
if(!compareVectors(compare, with)) return false;
vector2d<T> vec(5, 5);
vector2d<T> otherVec(10, 20);
if(!equals(vec.getDistanceFrom(otherVec), (T)15.8113883))
{
(void)printf("vector2d::getDistanceFrom() failed\n");
assert(0);
return false;
}
vector2d<T> center(0, 0);
vec.rotateBy(45, center);
COMPARE_VECTORS(vec, vector2d<T>(0, (T)7.0710678118654755));
vec.normalize();
COMPARE_VECTORS(vec, vector2d<T>(0, (T)1.0000000461060017));
vec.set(10, 10);
center.set(5, 5);
vec.rotateBy(-5, center);
// -5 means rotate clockwise slightly, so expect the X to increase
// slightly and the Y to decrease slightly.
COMPARE_VECTORS(vec, vector2d<T>((T)10.416752204197017, (T)9.5451947767204359));
vec.set(5, 5);
vec.normalize();
compareVectors(vec, vector2d<T>((T)0.70710681378841400, (T)0.70710681378841400));
vec.set(5, 5);
otherVec.set(10, 20);
vector2d<T> interpolated;
(void)interpolated.interpolate(vec, otherVec, 0.f);
COMPARE_VECTORS(interpolated, otherVec); // 0.f means all the second vector
(void)interpolated.interpolate(vec, otherVec, 0.25f);
COMPARE_VECTORS(interpolated, vector2d<T>((T)8.75, (T)16.25));
(void)interpolated.interpolate(vec, otherVec, 0.75f);
COMPARE_VECTORS(interpolated, vector2d<T>((T)6.25, (T)8.75));
(void)interpolated.interpolate(vec, otherVec, 1.f);
COMPARE_VECTORS(interpolated, vec); // 1.f means all the first vector
interpolated = vec.getInterpolated(otherVec, 0.f);
COMPARE_VECTORS(interpolated, otherVec); // 0.f means all the second vector
interpolated = vec.getInterpolated(otherVec, 0.25f);
COMPARE_VECTORS(interpolated, vector2d<T>((T)8.75, (T)16.25));
interpolated = vec.getInterpolated(otherVec, 0.75f);
COMPARE_VECTORS(interpolated, vector2d<T>((T)6.25, (T)8.75));
interpolated = vec.getInterpolated(otherVec, 1.f);
COMPARE_VECTORS(interpolated, vec); // 1.f means all the first vector
vector2d<T> thirdVec(20, 10);
interpolated = vec.getInterpolated_quadratic(otherVec, thirdVec, 0.f);
COMPARE_VECTORS(interpolated, vec); // 0.f means all the 1st vector
interpolated = vec.getInterpolated_quadratic(otherVec, thirdVec, 0.25f);
COMPARE_VECTORS(interpolated, vector2d<T>((T)7.8125, (T)10.9375));
interpolated = vec.getInterpolated_quadratic(otherVec, thirdVec, 0.5f);
COMPARE_VECTORS(interpolated, vector2d<T>((T)11.25, (T)13.75));
interpolated = vec.getInterpolated_quadratic(otherVec, thirdVec, 0.75f);
COMPARE_VECTORS(interpolated, vector2d<T>((T)15.3125, (T)13.4375));
interpolated = vec.getInterpolated_quadratic(otherVec, thirdVec, 1.f);
COMPARE_VECTORS(interpolated, thirdVec); // 1.f means all the 3rd vector
return true;
}
bool testVector2d(void)
{
bool f32Success = doTests<f32>();
if(f32Success)
(void)printf("vector2df tests passed\n\n");
else
(void)printf("\n*** vector2df tests failed ***\n\n");
bool f64Success = doTests<f64>();
if(f64Success)
(void)printf("vector2d<f64> tests passed\n\n");
else
(void)printf("\n*** vector2d<f64> tests failed ***\n\n");
bool s32Success = doTests<s32>();
if(s32Success)
(void)printf("vector2di tests passed\n\n");
else
(void)printf("\n*** vector2di tests failed ***\n\n");
return f32Success && f64Success && s32Success;
}
// Test the functionality of vector3d<T>, particularly methods that
// involve calculations done using different precision than <T>.
// Note that all reference vector3d<T>s are creating using double precision
// values cast to (T), as we need to test <f64>.
#include "irrlicht.h"
#include <assert.h>
using namespace irr;
using namespace core;
template<class T>
static bool compareVectors(const core::vector3d<T> & compare,
const core::vector3d<T> & with)
{
if(compare != with)
{
(void)printf("\nERROR: vector3d %.16f, %.16f, %.16f != vector3d %.16f, %.16f, %.16f\n",
(f64)compare.X, (f64)compare.Y, (f64)compare.Z,
(f64)with.X, (f64)with.Y, (f64)with.Z);
assert(compare == with);
return false;
}
return true;
}
template <class T>
static bool doTests()
{
#define COMPARE_VECTORS(compare, with)\
if(!compareVectors(compare, with)) return false;
vector3d<T> vec(5, 5, 0);
vector3d<T> otherVec(10, 20, 0);
if(!equals(vec.getDistanceFrom(otherVec), (T)15.8113883))
{
(void)printf("vector3d::getDistanceFrom() failed\n");
assert(0);
return false;
}
vector3d<T> center(0, 0, 0);
vec.rotateXYBy(45, center);
COMPARE_VECTORS(vec, vector3d<T>(0, (T)7.0710678118654755, 0));
vec.normalize();
COMPARE_VECTORS(vec, vector3d<T>(0, (T)1.0000000461060017, 0));
vec.set(10, 10, 10);
center.set(5, 5, 10);
vec.rotateXYBy(-5, center);
// -5 means rotate clockwise slightly, so expect the X to increase
// slightly and the Y to decrease slightly.
COMPARE_VECTORS(vec, vector3d<T>((T)10.416752204197017, (T)9.5451947767204359, 10));
vec.set(10, 10, 10);
center.set(5, 10, 5);
vec.rotateXZBy(-5, center);
COMPARE_VECTORS(vec, vector3d<T>((T)10.416752204197017, 10, (T)9.5451947767204359));
vec.set(10, 10, 10);
center.set(10, 5, 5);
vec.rotateYZBy(-5, center);
COMPARE_VECTORS(vec, vector3d<T>(10, (T)10.416752204197017, (T)9.5451947767204359));
vec.set(5, 5, 0);
vec.normalize();
compareVectors(vec, vector3d<T>((T)0.70710681378841400, (T)0.70710681378841400, 0));
vec.set(5, 5, 0);
otherVec.set(10, 20, 40);
vector3d<T> interpolated;
(void)interpolated.interpolate(vec, otherVec, 0.f);
COMPARE_VECTORS(interpolated, otherVec); // 0.f means all the second vector
(void)interpolated.interpolate(vec, otherVec, 0.25f);
COMPARE_VECTORS(interpolated, vector3d<T>((T)8.75, (T)16.25, 30));
(void)interpolated.interpolate(vec, otherVec, 0.75f);
COMPARE_VECTORS(interpolated, vector3d<T>((T)6.25, (T)8.75, 10));
(void)interpolated.interpolate(vec, otherVec, 1.f);
COMPARE_VECTORS(interpolated, vec); // 1.f means all the first vector
interpolated = vec.getInterpolated(otherVec, 0.f);
COMPARE_VECTORS(interpolated, otherVec); // 0.f means all the second vector
interpolated = vec.getInterpolated(otherVec, 0.25f);
COMPARE_VECTORS(interpolated, vector3d<T>((T)8.75, (T)16.25, 30));
interpolated = vec.getInterpolated(otherVec, 0.75f);
COMPARE_VECTORS(interpolated, vector3d<T>((T)6.25, (T)8.75, 10));
interpolated = vec.getInterpolated(otherVec, 1.f);
COMPARE_VECTORS(interpolated, vec); // 1.f means all the first vector
vector3d<T> thirdVec(20, 10, -30);
interpolated = vec.getInterpolated_quadratic(otherVec, thirdVec, 0.f);
COMPARE_VECTORS(interpolated, vec); // 0.f means all the 1st vector
interpolated = vec.getInterpolated_quadratic(otherVec, thirdVec, 0.25f);
COMPARE_VECTORS(interpolated, vector3d<T>((T)7.8125, (T)10.9375, (T)13.125));
interpolated = vec.getInterpolated_quadratic(otherVec, thirdVec, 0.5f);
COMPARE_VECTORS(interpolated, vector3d<T>((T)11.25, (T)13.75, (T)12.5));
interpolated = vec.getInterpolated_quadratic(otherVec, thirdVec, 0.75f);
COMPARE_VECTORS(interpolated, vector3d<T>((T)15.3125, (T)13.4375, (T)-1.875));
interpolated = vec.getInterpolated_quadratic(otherVec, thirdVec, 1.f);
COMPARE_VECTORS(interpolated, thirdVec); // 1.f means all the 3rd vector
return true;
}
bool testVector3d(void)
{
bool f32Success = doTests<f32>();
if(f32Success)
(void)printf("vector3df tests passed\n\n");
else
(void)printf("\n*** vector3df tests failed ***\n\n");
bool f64Success = doTests<f64>();
if(f64Success)
(void)printf("vector3d<f64> tests passed\n\n");
else
(void)printf("\n*** vector3d<f64> tests failed ***\n\n");
bool s32Success = doTests<s32>();
if(s32Success)
(void)printf("vector3di tests passed\n\n");
else
(void)printf("\n*** vector3di tests failed ***\n\n");
return f32Success && f64Success && s32Success;
}
Test suite pass at GMT Thu Nov 6 01:32:10 2008
Welcome to the Irrlicht test suite.
This is composed of a series of tests which exercise basic Irrlicht functionality. These are not
strictly unit tests, since there is no stub framework that isolates each method under test. They
do however test small units of functionality and should help to isolate problems or spot regressions.
Each test resides in its own source file, and must have an entry point with the signature
bool testName(void); where testName should be the same as the source file name (without the suffix).
Each test runs independently, and is responsible for cleaning up after itself and restoring the
working directory to /tests.
testUtils.cpp provides some functions for creating screenshots and comparing files (including images).
Validation images should go im the /media subdirectory. Since the tests rely on the presence of /media
and /empty/empty subdirectories, the working directory must be the /tests directory, not /bin/$PLATFORM.
This means that you cannot run /bin/$PLATFORM/texts.exe from there. You can however cd to /tests and
run ../bin/$PLATFORM/tests.exe
The overall test application will return a count of the number of test that failed, i.e. 0 is success.
\ No newline at end of file

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tests", "tests_vc8.vcproj", "{2A1DE18B-F678-4A94-A996-E848E20B2983}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "..\source\Irrlicht\Irrlicht8.0.vcproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release - Fast FPU|Win32 = Release - Fast FPU|Win32
Release|Win32 = Release|Win32
Static lib - Debug|Win32 = Static lib - Debug|Win32
Static lib - Release - Fast FPU|Win32 = Static lib - Release - Fast FPU|Win32
Static lib - Release|Win32 = Static lib - Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|Win32.ActiveCfg = Debug|Win32
{2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|Win32.Build.0 = Debug|Win32
{2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32
{2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|Win32.Build.0 = Release|Win32
{2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|Win32.ActiveCfg = Release|Win32
{2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|Win32.Build.0 = Release|Win32
{2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32
{2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|Win32.Build.0 = Debug|Win32
{2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32
{2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32
{2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|Win32.ActiveCfg = Release|Win32
{2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|Win32.Build.0 = Release|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.ActiveCfg = Debug|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.Build.0 = Debug|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.ActiveCfg = Release - Fast FPU|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.Build.0 = Release - Fast FPU|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.ActiveCfg = Release|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.Build.0 = Release|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.ActiveCfg = Static lib - Debug|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.Build.0 = Static lib - Debug|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Static lib - Release - Fast FPU|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.Build.0 = Static lib - Release - Fast FPU|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.ActiveCfg = Static lib - Release|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.Build.0 = Static lib - Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="tests"
ProjectGUID="{2A1DE18B-F678-4A94-A996-E848E20B2983}"
RootNamespace="tests"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\include"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="..\bin\Win32-VisualStudio\$(ProjectName).exe"
GenerateDebugInformation="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="..\bin\Win32-VisualStudio\$(ProjectName).exe"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\disambiguateTextures.cpp"
>
</File>
<File
RelativePath=".\drawPixel.cpp"
>
</File>
<File
RelativePath=".\fast_atof.cpp"
>
</File>
<File
RelativePath=".\line2dIntersectWith.cpp"
>
</File>
<File
RelativePath=".\main.cpp"
>
</File>
<File
RelativePath=".\md2Animation.cpp"
>
</File>
<File
RelativePath=".\planeMatrix.cpp"
>
</File>
<File
RelativePath=".\testUtils.cpp"
>
</File>
<File
RelativePath=".\testVector2d.cpp"
>
</File>
<File
RelativePath=".\testVector3d.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\testUtils.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual C++ Express 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tests", "tests_vc9.vcproj", "{2A1DE18B-F678-4A94-A996-E848E20B2983}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Irrlicht", "..\source\Irrlicht\Irrlicht9.0.vcproj", "{E08E042A-6C45-411B-92BE-3CC31331019F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release - Fast FPU|Win32 = Release - Fast FPU|Win32
Release|Win32 = Release|Win32
Static lib - Debug|Win32 = Static lib - Debug|Win32
Static lib - Release - Fast FPU|Win32 = Static lib - Release - Fast FPU|Win32
Static lib - Release|Win32 = Static lib - Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|Win32.ActiveCfg = Debug|Win32
{2A1DE18B-F678-4A94-A996-E848E20B2983}.Debug|Win32.Build.0 = Debug|Win32
{2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|Win32.ActiveCfg = Release|Win32
{2A1DE18B-F678-4A94-A996-E848E20B2983}.Release - Fast FPU|Win32.Build.0 = Release|Win32
{2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|Win32.ActiveCfg = Release|Win32
{2A1DE18B-F678-4A94-A996-E848E20B2983}.Release|Win32.Build.0 = Release|Win32
{2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|Win32.ActiveCfg = Debug|Win32
{2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Debug|Win32.Build.0 = Debug|Win32
{2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Release|Win32
{2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release - Fast FPU|Win32.Build.0 = Release|Win32
{2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|Win32.ActiveCfg = Release|Win32
{2A1DE18B-F678-4A94-A996-E848E20B2983}.Static lib - Release|Win32.Build.0 = Release|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.ActiveCfg = Debug|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Debug|Win32.Build.0 = Debug|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.ActiveCfg = Release - Fast FPU|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release - Fast FPU|Win32.Build.0 = Release - Fast FPU|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.ActiveCfg = Release|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Release|Win32.Build.0 = Release|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.ActiveCfg = Static lib - Debug|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Debug|Win32.Build.0 = Static lib - Debug|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.ActiveCfg = Static lib - Release - Fast FPU|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release - Fast FPU|Win32.Build.0 = Static lib - Release - Fast FPU|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.ActiveCfg = Static lib - Release|Win32
{E08E042A-6C45-411B-92BE-3CC31331019F}.Static lib - Release|Win32.Build.0 = Static lib - Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="tests"
ProjectGUID="{2A1DE18B-F678-4A94-A996-E848E20B2983}"
RootNamespace="tests"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\include"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="..\bin\Win32-VisualStudio\$(ProjectName).exe"
GenerateDebugInformation="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="..\include"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
OutputFile="..\bin\Win32-VisualStudio\$(ProjectName).exe"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\disambiguateTextures.cpp"
>
</File>
<File
RelativePath=".\drawPixel.cpp"
>
</File>
<File
RelativePath=".\fast_atof.cpp"
>
</File>
<File
RelativePath=".\line2dIntersectWith.cpp"
>
</File>
<File
RelativePath=".\main.cpp"
>
</File>
<File
RelativePath=".\md2Animation.cpp"
>
</File>
<File
RelativePath=".\planeMatrix.cpp"
>
</File>
<File
RelativePath=".\testUtils.cpp"
>
</File>
<File
RelativePath=".\testVector2d.cpp"
>
</File>
<File
RelativePath=".\testVector3d.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\testUtils.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment