├── .gitignore ├── Debug ├── Irrlicht.dll ├── MeshlessDeformations.exe ├── MeshlessDeformations.ilk ├── MeshlessDeformations.pdb ├── Resources │ ├── boldie.dcmesh │ ├── duck.dcmesh │ └── sneakers.dcmesh ├── boxSides.jpg ├── earth.bmp └── earth.x ├── MeshlessDeformations.sln ├── MeshlessDeformations ├── Boundary.cpp ├── Boundary.h ├── CCameraMayaSceneNode.cpp ├── CCameraMayaSceneNode.h ├── DeformableObject.cpp ├── DeformableObject.h ├── DeformableObjectMesh.cpp ├── DeformableObjectMesh.h ├── EventHandler.cpp ├── EventHandler.h ├── GUIManager.cpp ├── GUIManager.h ├── Globals.cpp ├── Globals.h ├── MeshlessDeformations.vcxproj ├── MeshlessDeformations.vcxproj.filters ├── ModelObject.cpp ├── ModelObject.h ├── ObjectFactory.cpp ├── ObjectFactory.h ├── Particle.cpp ├── Particle.h ├── boxSides.jpg ├── earth.bmp ├── earth.x ├── linpack │ ├── CVS │ │ ├── Entries │ │ ├── Entries.Extra │ │ ├── Entries.Extra.Old │ │ ├── Entries.Old │ │ ├── Repository │ │ ├── Root │ │ └── Template │ ├── blas1.cpp │ ├── blas1.h │ ├── linpack.cpp │ └── linpack.h ├── main.cpp ├── main.h ├── matrix │ ├── BANDMAT.CPP │ ├── CHOLESKY.CPP │ ├── CONTROLW.H │ ├── CVS │ │ ├── Entries │ │ ├── Entries.Extra │ │ ├── Entries.Extra.Old │ │ ├── Entries.Old │ │ ├── Repository │ │ ├── Root │ │ └── Template │ ├── EVALUE.CPP │ ├── EXAMPLE.CPP │ ├── FFT.CPP │ ├── GARCH.CPP │ ├── HHOLDER.CPP │ ├── INCLUDE.H │ ├── JACOBI.CPP │ ├── MYEXCEPT.CPP │ ├── MYEXCEPT.H │ ├── NEWFFT.CPP │ ├── NEWMAT.H │ ├── NEWMAT1.CPP │ ├── NEWMAT2.CPP │ ├── NEWMAT3.CPP │ ├── NEWMAT4.CPP │ ├── NEWMAT5.CPP │ ├── NEWMAT6.CPP │ ├── NEWMAT7.CPP │ ├── NEWMAT8.CPP │ ├── NEWMAT9.CPP │ ├── NEWMATAP.H │ ├── NEWMATEX.CPP │ ├── NEWMATIO.H │ ├── NEWMATNL.CPP │ ├── NEWMATNL.H │ ├── NEWMATRC.H │ ├── NEWMATRM.CPP │ ├── NEWMATRM.H │ ├── NL_EX.CPP │ ├── NM_EX1.CPP │ ├── NM_EX2.CPP │ ├── NM_MISC.CPP │ ├── PRECISIO.H │ ├── SL_EX.CPP │ ├── SOLUTION.CPP │ ├── SOLUTION.H │ ├── SORT.CPP │ ├── SUBMAT.CPP │ ├── SVD.CPP │ ├── TEST_EXC.CPP │ ├── TMT.CPP │ ├── TMT.H │ ├── TMT1.CPP │ ├── TMT2.CPP │ ├── TMT3.CPP │ ├── TMT4.CPP │ ├── TMT5.CPP │ ├── TMT6.CPP │ ├── TMT7.CPP │ ├── TMT8.CPP │ ├── TMT9.CPP │ ├── TMTA.CPP │ ├── TMTB.CPP │ ├── TMTC.CPP │ ├── TMTD.CPP │ ├── TMTE.CPP │ ├── TMTF.CPP │ ├── TMTG.CPP │ ├── TMTH.CPP │ ├── TMTI.CPP │ ├── TMTJ.CPP │ ├── TMTK.CPP │ ├── TMTL.CPP │ └── TMTM.CPP └── resources │ ├── CVS │ ├── Entries │ ├── Entries.Extra │ ├── Entries.Extra.Old │ ├── Entries.Old │ ├── Repository │ ├── Root │ └── Template │ ├── boldie.dcmesh │ ├── duck.dcmesh │ └── sneakers.dcmesh ├── MeshlessDeformationsReport.pdf ├── README.md └── irrlicht-0.14.0 ├── bin ├── Linux │ └── readme.txt ├── Win32-VisualStudio │ ├── 2DGraphics.exe │ ├── Collision.exe │ ├── CustomSceneNode.exe │ ├── Demo.exe │ ├── ExampleApp.NET.exe │ ├── HelloWorld.exe │ ├── HelloWorld_CSharp.exe │ ├── HelloWorld_VBasic.exe │ ├── Irrlicht.NET.dll │ ├── Irrlicht.dll │ ├── MeshViewer.exe │ ├── Movement.exe │ ├── PerPixelLighting.exe │ ├── Quake3Map.exe │ ├── RenderToTexture.exe │ ├── Shaders.exe │ ├── SpecialFx.exe │ ├── TerrainRendering.exe │ ├── UserInterface.exe │ ├── Win32Window.exe │ └── irr.ico ├── Win32-gcc │ └── Irrlicht.dll └── Win64-VisualStudio │ └── readme.txt ├── include ├── EDriverTypes.h ├── EGUIElementTypes.h ├── IAnimatedMesh.h ├── IAnimatedMeshMD2.h ├── IAnimatedMeshMS3D.h ├── IAnimatedMeshSceneNode.h ├── IAnimatedMeshX.h ├── IBillboardSceneNode.h ├── ICameraSceneNode.h ├── ICursorControl.h ├── IDummyTransformationSceneNode.h ├── IEventReceiver.h ├── IFileList.h ├── IFileSystem.h ├── IGPUProgrammingServices.h ├── IGUIButton.h ├── IGUICheckBox.h ├── IGUIComboBox.h ├── IGUIContextMenu.h ├── IGUIEditBox.h ├── IGUIElement.h ├── IGUIEnvironment.h ├── IGUIFileOpenDialog.h ├── IGUIFont.h ├── IGUIImage.h ├── IGUIInOutFader.h ├── IGUIListBox.h ├── IGUIMeshViewer.h ├── IGUIScrollBar.h ├── IGUISkin.h ├── IGUIStaticText.h ├── IGUITabControl.h ├── IGUIToolbar.h ├── IGUIWindow.h ├── IImage.h ├── IImageLoader.h ├── ILightSceneNode.h ├── ILogger.h ├── IMaterialRenderer.h ├── IMesh.h ├── IMeshBuffer.h ├── IMeshCache.h ├── IMeshLoader.h ├── IMeshManipulator.h ├── IMetaTriangleSelector.h ├── IOSOperator.h ├── IParticleAffector.h ├── IParticleEmitter.h ├── IParticleSystemSceneNode.h ├── IQ3LevelMesh.h ├── IReadFile.h ├── ISceneCollisionManager.h ├── ISceneManager.h ├── ISceneNode.h ├── ISceneNodeAnimator.h ├── ISceneNodeAnimatorCollisionResponse.h ├── IShaderConstantSetCallBack.h ├── IShadowVolumeSceneNode.h ├── IStringParameters.h ├── ITerrainSceneNode.h ├── ITextSceneNode.h ├── ITexture.h ├── ITimer.h ├── ITriangleSelector.h ├── IUnknown.h ├── IVideoDriver.h ├── IVideoModeList.h ├── IWriteFile.h ├── IXMLReader.h ├── IXMLWriter.h ├── IrrCompileConfig.h ├── IrrlichtDevice.h ├── Keycodes.h ├── S3DVertex.h ├── SAnimatedMesh.h ├── SColor.h ├── SExposedVideoData.h ├── SIrrCreationParameters.h ├── SKeyMap.h ├── SLight.h ├── SMaterial.h ├── SMesh.h ├── SMeshBuffer.h ├── SMeshBufferLightMap.h ├── SMeshBufferTangents.h ├── SParticle.h ├── SViewFrustrum.h ├── SceneParameters.h ├── aabbox3d.h ├── dimension2d.h ├── heapsort.h ├── irrArray.h ├── irrList.h ├── irrMath.h ├── irrString.h ├── irrTypes.h ├── irrXML.h ├── irrlicht.h ├── line2d.h ├── line3d.h ├── matrix4.h ├── plane3d.h ├── position2d.h ├── quaternion.h ├── rect.h ├── triangle3d.h ├── vector2d.h └── vector3d.h ├── lib ├── Linux │ └── libIrrlicht.a ├── Win32-VisualStudio │ ├── Irrlicht.exp │ └── Irrlicht.lib ├── Win32-gcc │ ├── libIrrlicht.a │ └── libIrrlicht.def └── Win64-VisualStudio │ └── readme.txt ├── notice.txt └── readme.txt /.gitignore: -------------------------------------------------------------------------------- 1 | # User-specific files 2 | *.suo 3 | *.user 4 | *.userosscache 5 | *.sln.docstates 6 | 7 | # Build 8 | MeshlessDeformations/[Dd]ebug/ 9 | 10 | # Visual C++ cache files 11 | ipch/ 12 | *.aps 13 | *.ncb 14 | *.opensdf 15 | *.sdf 16 | *.cachefile 17 | 18 | # Backup & report files from converting an old project file 19 | _UpgradeReport_Files/ 20 | Backup*/ 21 | UpgradeLog*.XML 22 | UpgradeLog*.htm 23 | -------------------------------------------------------------------------------- /Debug/Irrlicht.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/Debug/Irrlicht.dll -------------------------------------------------------------------------------- /Debug/MeshlessDeformations.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/Debug/MeshlessDeformations.exe -------------------------------------------------------------------------------- /Debug/MeshlessDeformations.ilk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/Debug/MeshlessDeformations.ilk -------------------------------------------------------------------------------- /Debug/MeshlessDeformations.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/Debug/MeshlessDeformations.pdb -------------------------------------------------------------------------------- /Debug/boxSides.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/Debug/boxSides.jpg -------------------------------------------------------------------------------- /Debug/earth.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/Debug/earth.bmp -------------------------------------------------------------------------------- /MeshlessDeformations.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30501.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MeshlessDeformations", "MeshlessDeformations\MeshlessDeformations.vcxproj", "{CAB9DA32-60F5-482D-8BAC-5F5A2B3ED27A}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {CAB9DA32-60F5-482D-8BAC-5F5A2B3ED27A}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {CAB9DA32-60F5-482D-8BAC-5F5A2B3ED27A}.Debug|Win32.Build.0 = Debug|Win32 16 | {CAB9DA32-60F5-482D-8BAC-5F5A2B3ED27A}.Release|Win32.ActiveCfg = Release|Win32 17 | {CAB9DA32-60F5-482D-8BAC-5F5A2B3ED27A}.Release|Win32.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /MeshlessDeformations/Boundary.h: -------------------------------------------------------------------------------- 1 | #if !defined(Boundary_h) 2 | #define Boundary_h 3 | 4 | #include 5 | #include "Globals.h" 6 | #include "ModelObject.h" 7 | 8 | 9 | using namespace irr; 10 | using namespace core; 11 | 12 | 13 | namespace Model 14 | { 15 | 16 | class Boundary : public ModelObject 17 | { 18 | 19 | public: 20 | 21 | 22 | //CONSTRUCTOR 23 | Boundary(core::aabbox3d Box); 24 | 25 | //METHODS 26 | 27 | // Draws this node to the screen 28 | virtual void render(); 29 | 30 | // Gets the box that has been resized by the given amount 31 | core::aabbox3d getResizedBoundary(f32 resizeAmount); 32 | 33 | // gets the normal of the wall that the given position is close to 34 | core::vector3df getNormal (core::vector3df position, f32 distance = 1.0f); 35 | 36 | vector3df min; 37 | vector3df max; 38 | 39 | 40 | private: 41 | void CreateBox( f32 width, f32 height, f32 depth ); 42 | 43 | }; 44 | } 45 | 46 | 47 | #endif // end if!defined for this header 48 | -------------------------------------------------------------------------------- /MeshlessDeformations/CCameraMayaSceneNode.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/MeshlessDeformations/CCameraMayaSceneNode.cpp -------------------------------------------------------------------------------- /MeshlessDeformations/DeformableObject.h: -------------------------------------------------------------------------------- 1 | #if !defined(DeformableObject_h) 2 | #define DeformableObject_h 3 | 4 | #include 5 | #include "Globals.h" 6 | #include "ModelObject.h" 7 | #include "Particle.h" 8 | #include "matrix/newmat.h" 9 | 10 | 11 | 12 | using namespace irr; 13 | using namespace core; 14 | 15 | 16 | namespace Model 17 | { 18 | 19 | class DeformableObject : public ModelObject 20 | { 21 | 22 | 23 | public: 24 | 25 | //PROPERTIES 26 | vector3df originalCentreOfMass; 27 | vector3df currentCentreOfMass; 28 | f32 alpha; 29 | f32 beta; 30 | f32 elasticity; 31 | core::stringw name; 32 | 33 | 34 | //CONSTRUCTOR 35 | DeformableObject(core::stringw name); 36 | 37 | //METHODS 38 | void addParticle(Particle* particle); 39 | array getParticles(void); 40 | 41 | // updates the position of this particle 42 | void updateGoalPositions(f32 timeElapsed); 43 | virtual void update(f32 timeElapsed); 44 | // calculate A_pq 45 | matrix4 calculateA_pqMatrix(); 46 | matrix4 calculateRotationMatrix(matrix4 A_pq); 47 | 48 | array particles; 49 | 50 | bool isSelected; 51 | virtual void setVisible(bool isVisible); 52 | 53 | private: 54 | bool finished; 55 | array q; 56 | array p; 57 | matrix4 A_qq; 58 | 59 | // quadratic deformation 60 | array q_tilde; 61 | array p_tilde; 62 | SquareMatrix A_tilde_qq; 63 | 64 | void updateCurrentCenterOfMass(); 65 | void doInitialCalculations(); 66 | }; 67 | } 68 | 69 | 70 | #endif // end if!defined for this header 71 | -------------------------------------------------------------------------------- /MeshlessDeformations/DeformableObjectMesh.cpp: -------------------------------------------------------------------------------- 1 | #include "DeformableObjectMesh.h" 2 | #include "Globals.h" 3 | #include "S3DVertex.h" 4 | #include 5 | #include 6 | #include 7 | 8 | using namespace Model; 9 | 10 | DeformableObjectMesh::DeformableObjectMesh(core::stringw name, char *filename) : DeformableObject(ObjectType::DeformableObjectMesh) { 11 | 12 | isSelected = false; 13 | type=ObjectType::DeformableObjectMesh; 14 | beta = 0.0f; 15 | alpha = 0.5f; 16 | elasticity = 0.5f; 17 | this->name = name; 18 | 19 | core::aabbox3df boundingBox; 20 | 21 | std::ifstream meshstream(filename); 22 | std::string line,ignore; 23 | f32 x,y,z,ti,tj; 24 | int t1, t2, t3; 25 | core::array v; 26 | core::array tex_coords; 27 | core::array in; 28 | while(!meshstream.eof()) { 29 | meshstream >> line; 30 | if(line == "v") { 31 | meshstream >> x >> y >> z; 32 | core::vector3df position = vector3df(x,y,z)*10; 33 | v.push_back(position); 34 | boundingBox.addInternalPoint(position); 35 | } else if (line == "f") { 36 | meshstream >> t3 >> t2 >> t1; 37 | in.push_back(t1); 38 | in.push_back(t2); 39 | in.push_back(t3); 40 | } else if (line == "t") { 41 | meshstream >> ti >> tj; 42 | tex_coords.push_back(vector2df(ti,tj)); 43 | } else 44 | getline(meshstream,ignore,'\n'); 45 | } 46 | 47 | // generate normals and stuff 48 | core::array n(v.size()); 49 | n.set_used(v.size()); 50 | vector3df v1,v2,nt; 51 | for(int i=0;i+2vertices[i] = irr::video::S3DVertex(v[i],n[i],video::SColor(1,1,1,1),vector2df(0,0)); 68 | p = new Particle(this,(float)1.0/(float)v.size()*300.0); 69 | p->setOriginalPosition(v[i]); 70 | addParticle(p); 71 | } 72 | for(int i=0;iindices[i] = in[i]; 74 | } 75 | mesh->material.Wireframe=false; 76 | mesh->material.Lighting=true; 77 | mesh->material.BackfaceCulling=false; 78 | mesh->material.NormalizeNormals=true; 79 | 80 | 81 | // work out the bounding radius 82 | vector3df span = boundingBox.MaxEdge - boundingBox.MinEdge; 83 | const f32 pickingProportion = 0.15f; 84 | pickingRadiusSquared = pickingProportion * max_( max_( span.X, span.Y ), span.Z ) / 2.0f; 85 | pickingRadiusSquared *= pickingRadiusSquared; 86 | } 87 | 88 | DeformableObjectMesh::~DeformableObjectMesh(void) 89 | { 90 | delete mesh; 91 | } 92 | 93 | // Draws this node to the screen 94 | void DeformableObjectMesh::render() 95 | { 96 | video::IVideoDriver* driver = Globals::sceneManager->getVideoDriver(); 97 | 98 | driver->setMaterial(mesh->material); 99 | driver->setTransform(video::ETS_WORLD, AbsoluteTransformation); 100 | driver->drawIndexedTriangleList(mesh->vertices, mesh->vertexCount, mesh->indices, mesh->triangleCount); 101 | 102 | //if (Globals::drawGoalPositions) { 103 | // Globals::driver->setTransform(video::ETS_WORLD, AbsoluteTransformation); 104 | // aabbox3d goal = aabbox3d( goalPosition - core::vector3df(radius, radius, radius) - getPosition(), goalPosition + core::vector3df( radius, radius, radius ) - getPosition()); 105 | // Globals::driver->draw3DBox( goal, video::SColor(0, 255, 0, 0) ); 106 | //} 107 | } 108 | -------------------------------------------------------------------------------- /MeshlessDeformations/DeformableObjectMesh.h: -------------------------------------------------------------------------------- 1 | #if !defined(DEFORMABLEOBJECTMESH_H) 2 | #define DEFORMABLEOBJECTMESH_H 3 | 4 | #include 5 | #include "DeformableObject.h" 6 | 7 | 8 | using namespace irr; 9 | using namespace core; 10 | using namespace scene; 11 | 12 | 13 | class SimpleMesh { 14 | public: 15 | SimpleMesh(int num_vertices, int num_indices) { 16 | vertices = new irr::video::S3DVertex[num_vertices]; 17 | indices = new u16[num_indices]; 18 | vertexCount = num_vertices; 19 | triangleCount = num_indices/3; 20 | } 21 | ~SimpleMesh() { 22 | delete vertices; 23 | delete indices; 24 | } 25 | int vertexCount; 26 | int triangleCount; 27 | irr::video::S3DVertex *vertices; 28 | u16 *indices; 29 | video::SMaterial material; 30 | }; 31 | 32 | namespace Model 33 | { 34 | 35 | class DeformableObjectMesh : public DeformableObject 36 | { 37 | public: 38 | 39 | DeformableObjectMesh(core::stringw name, char *filename); 40 | ~DeformableObjectMesh(void); 41 | 42 | virtual void render(); 43 | //virtual void update(f32 timeElapsed); 44 | 45 | SimpleMesh *mesh; 46 | f32 pickingRadiusSquared; 47 | 48 | }; 49 | 50 | } 51 | 52 | #endif 53 | 54 | -------------------------------------------------------------------------------- /MeshlessDeformations/EventHandler.h: -------------------------------------------------------------------------------- 1 | #if !defined(EventHandler_h) 2 | #define EventHandler_h 3 | #include 4 | #include "Globals.h" 5 | #include "ModelObject.h" 6 | #include "DeformableObjectMesh.h" 7 | #include "Particle.h" 8 | #include "GUIManager.h" 9 | 10 | 11 | 12 | using namespace irr; 13 | 14 | 15 | class EventHandler : public IEventReceiver{ 16 | public: 17 | 18 | EventHandler() { selectedSceneNode = 0; currentSelected = 0; } 19 | 20 | virtual bool OnEvent(SEvent event); 21 | 22 | 23 | 24 | 25 | private: 26 | Model::ModelObject *selectedSceneNode; 27 | bool keyboardEvent( SEvent event ); 28 | 29 | Model::ModelObject* currentSelected; 30 | core::vector3df lastObjectPosition; 31 | core::vector3df oneBeforeLastObjectPosition; 32 | 33 | core::vector3df startPosition; 34 | core::plane3d movePlane; 35 | 36 | // used only for deformable mesh objects 37 | core::array selectedParticles; 38 | 39 | 40 | }; 41 | 42 | 43 | #endif // end if!defined for this header 44 | -------------------------------------------------------------------------------- /MeshlessDeformations/GUIManager.h: -------------------------------------------------------------------------------- 1 | #if !defined(GUIManager_h) 2 | #define GUIManager_h 3 | #include "irrlicht.h" 4 | #include "Globals.h" 5 | #include "DeformableObject.h" 6 | 7 | 8 | 9 | using namespace irr; 10 | using namespace gui; using namespace core; 11 | class GUIManager { 12 | public: 13 | 14 | static void createGUIElements(IGUIEnvironment* env); 15 | static bool GUIEvent( SEvent event ); 16 | 17 | static IGUIEnvironment* environment; 18 | static IGUIScrollBar* alphaScrollbar; 19 | static IGUIScrollBar* betaScrollbar; 20 | static IGUIScrollBar* elasticityScrollbar; 21 | 22 | static IGUIScrollBar* gravityScrollbar; 23 | static IGUIScrollBar* timeScrollbar; 24 | 25 | static IGUICheckBox* goalPositionsCheckbox; 26 | static IGUICheckBox* visibilityCheckbox; 27 | 28 | 29 | static IGUIListBox* modeListbox; 30 | static IGUIListBox* objectsListbox; 31 | 32 | static void setSelectedObject (Model::DeformableObject* object); 33 | 34 | 35 | private: 36 | GUIManager(); 37 | }; 38 | #endif // end if!defined for this header -------------------------------------------------------------------------------- /MeshlessDeformations/Globals.cpp: -------------------------------------------------------------------------------- 1 | #include "Globals.h" 2 | 3 | 4 | irr::core::matrix4 volumeNormalize(irr::core::matrix4 A) { 5 | 6 | Matrix A_calc(3,3); 7 | for(int j=0;j<3;j++) { 8 | for(int i=0;i<3;i++) { 9 | A_calc.element(j,i) = A(i,j); 10 | } 11 | } 12 | 13 | double det = Determinant(A_calc); 14 | double cbrt = pow( fabs(det), 1./3 ); 15 | cbrt = ( det < 0 ) ? -cbrt : cbrt; 16 | A_calc = A_calc / cbrt; 17 | 18 | for(int j=0;j<3;j++) { 19 | for(int i=0;i<3;i++) { 20 | A(i,j) = A_calc.element(j,i); 21 | } 22 | } 23 | 24 | return A; 25 | } 26 | 27 | irr::core::matrix4 sqrt(irr::core::matrix4 A) { 28 | 29 | //1- [E D] = eig(A); sqrtm(A) = E * sqrt(D) * E' where D is a diagonal matrix. 30 | //> sqrt(D) is formed by taking the square root of the diagonal entries in D. 31 | 32 | 33 | SymmetricMatrix M(3); 34 | DiagonalMatrix D(3); 35 | Matrix E(3,3); 36 | 37 | for(int j=0;j<3;j++) { 38 | for(int i=j;i<3;i++) { 39 | M.element(j,i) = A(i,j); 40 | } 41 | } 42 | 43 | Jacobi(M,D,E); 44 | 45 | for(int i=0;i<3;i++) 46 | D.element(i,i) = sqrt(D.element(i,i)); 47 | 48 | Matrix S = E * D * E.t() ; 49 | 50 | for(int j=0;j<3;j++) { 51 | for(int i=0;i<3;i++) { 52 | A(i,j) = S.element(j,i); 53 | //std::cout << "i:" << i << ",j:" << j << " > " << A(j,i) ; 54 | } 55 | //std::cout << std::endl; 56 | } 57 | return A; 58 | } 59 | 60 | // reflection with normal 61 | core::vector3df getReflected( core::vector3df vector, core::vector3df normal ) { 62 | f32 length = (f32)vector.getLength(); 63 | vector.normalize(); 64 | normal.normalize(); 65 | 66 | return (vector - normal * 2.0f * (vector.dotProduct( normal))) * length; 67 | } 68 | 69 | scene::ISceneManager* Globals::sceneManager = 0; 70 | 71 | video::IVideoDriver* Globals::driver = 0; 72 | f32 Globals::gravity = 0.7f; f32 Globals::drag = 0.005f; f32 Globals::timeElapsed = 0.0f; bool Globals::drawGoalPositions = true; 73 | bool Globals::stopMode = false; 74 | bool Globals::useShadows = false; 75 | 76 | DeformationMode::DeformationMode Globals::mode = DeformationMode::Basic; 77 | 78 | Model::DeformableObject* Globals::selectedObject = 0; 79 | core::array Globals::objects = core::array(); 80 | 81 | IrrlichtDevice* Globals::device = 0; 82 | 83 | scene::ICameraSceneNode* Globals::camera = 0; 84 | 85 | Model::Boundary* Globals::boundary = 0; 86 | 87 | void Globals::init(IrrlichtDevice* device) { 88 | Globals::device = device; 89 | sceneManager= device->getSceneManager(); 90 | camera = sceneManager->getActiveCamera(); 91 | driver =device->getVideoDriver(); 92 | } 93 | 94 | Globals::Globals() { 95 | } 96 | -------------------------------------------------------------------------------- /MeshlessDeformations/Globals.h: -------------------------------------------------------------------------------- 1 | #if !defined(Globals_h) 2 | #define Globals_h 3 | 4 | #include 5 | #include 6 | 7 | #include "matrix/newmat.h" 8 | #include "matrix/newmatap.h" 9 | 10 | 11 | // wrapper for sqrt of matrix4 12 | irr::core::matrix4 sqrt(irr::core::matrix4 A); 13 | 14 | irr::core::matrix4 volumeNormalize(irr::core::matrix4 A_input); 15 | 16 | irr::core::vector3df getReflected( irr::core::vector3df vector, irr::core::vector3df normal ); 17 | 18 | using namespace irr; 19 | using namespace scene; 20 | 21 | 22 | namespace Model { 23 | class Boundary; 24 | class DeformableObject; 25 | } 26 | 27 | namespace DeformationMode { 28 | enum DeformationMode { Basic=0, Linear=1, Quadratic=2 }; 29 | } 30 | 31 | 32 | class Globals { 33 | public: 34 | 35 | 36 | static IrrlichtDevice *device; 37 | static scene::ISceneManager* sceneManager; 38 | static scene::ICameraSceneNode* camera; 39 | static video::IVideoDriver* driver; 40 | static f32 gravity; static f32 drag; static f32 timeElapsed; 41 | 42 | static bool stopMode; 43 | static bool useShadows; 44 | static DeformationMode::DeformationMode mode; 45 | 46 | static Model::DeformableObject* selectedObject; 47 | static core::array objects; 48 | 49 | 50 | static bool drawGoalPositions; 51 | 52 | static void init(IrrlichtDevice *device); 53 | 54 | 55 | static Model::Boundary* boundary; 56 | 57 | 58 | private: 59 | Globals(); 60 | 61 | 62 | }; 63 | 64 | 65 | #endif // end if!defined for this header 66 | -------------------------------------------------------------------------------- /MeshlessDeformations/ModelObject.cpp: -------------------------------------------------------------------------------- 1 | #include "ModelObject.h" 2 | 3 | using namespace Model; 4 | 5 | 6 | 7 | //CONSTRUCTORS 8 | ModelObject::ModelObject(ObjectType::ObjectType type) : scene::ISceneNode(Globals::sceneManager->getRootSceneNode(), Globals::sceneManager, (type | ObjectType::ModelObjectType)) 9 | { 10 | this->type = (ObjectType::ObjectType) getID(); 11 | this->isSelected = false; 12 | 13 | } 14 | 15 | bool ModelObject::is(ObjectType::ObjectType type) { 16 | return (type & this->type) > 0; 17 | } 18 | 19 | 20 | // Determine whether we should draw this node, and the children nodes 21 | void ModelObject::OnPreRender() 22 | { 23 | if (IsVisible) { 24 | // Draw this node 25 | SceneManager->registerNodeForRendering(this); 26 | 27 | 28 | // Draw the children nodes 29 | ISceneNode::OnPreRender(); 30 | 31 | } 32 | 33 | } 34 | 35 | // Draws this node to the screen 36 | void ModelObject::render() 37 | { 38 | 39 | 40 | } 41 | 42 | 43 | const core::aabbox3d& ModelObject::getBoundingBox() const 44 | { 45 | return Box; 46 | } 47 | 48 | 49 | -------------------------------------------------------------------------------- /MeshlessDeformations/ModelObject.h: -------------------------------------------------------------------------------- 1 | #if !defined(ModelObject_h) 2 | #define ModelObject_h 3 | 4 | #include 5 | #include "Globals.h" 6 | 7 | using namespace irr; 8 | using namespace core; 9 | 10 | namespace ObjectType { 11 | enum ObjectType { 12 | ModelObjectType = 1, ParticleType = 2, DeformableObject = 4, BoundaryType = 8, DeformableObjectMesh = 16, 13 | SelectableObject = 32 14 | }; 15 | } 16 | 17 | namespace Model 18 | { 19 | 20 | 21 | 22 | class ModelObject : public scene::ISceneNode 23 | { 24 | 25 | protected: 26 | 27 | ObjectType::ObjectType type; 28 | 29 | core::aabbox3d Box; 30 | 31 | 32 | public: 33 | 34 | 35 | // PROPERTIES 36 | 37 | // specifies that the user is currently holding this object with their mouse 38 | bool isSelected; 39 | 40 | 41 | //CONSTRUCTOR 42 | ModelObject(ObjectType::ObjectType type); 43 | 44 | //METHODS 45 | 46 | // checks to see whether this object is of the given type 47 | bool is(ObjectType::ObjectType type); 48 | 49 | virtual const core::aabbox3d& getBoundingBox() const; 50 | 51 | // Determine whether we should draw this node, and the children nodes 52 | virtual void OnPreRender(); 53 | 54 | // Draws this node to the screen 55 | virtual void render(); 56 | 57 | 58 | 59 | 60 | }; 61 | } 62 | 63 | 64 | #endif // end if!defined for this header 65 | -------------------------------------------------------------------------------- /MeshlessDeformations/ObjectFactory.h: -------------------------------------------------------------------------------- 1 | #if !defined(ObjectFactory_h) 2 | #define ObjectFactory_h 3 | #include 4 | 5 | 6 | 7 | using namespace irr; 8 | 9 | 10 | class ObjectFactory { 11 | public: 12 | 13 | static void createObjects (void); 14 | 15 | private: 16 | ObjectFactory() {} 17 | 18 | }; 19 | 20 | 21 | #endif // end if!defined for this header 22 | -------------------------------------------------------------------------------- /MeshlessDeformations/Particle.h: -------------------------------------------------------------------------------- 1 | #if !defined(Particle_h) 2 | #define Particle_h 3 | 4 | #include 5 | #include "Globals.h" 6 | #include "ModelObject.h" 7 | #include "Boundary.h" 8 | 9 | 10 | 11 | using namespace irr; 12 | using namespace core; 13 | using namespace scene; 14 | 15 | 16 | namespace Model 17 | { 18 | 19 | class DeformableObject; 20 | 21 | class Particle : public ModelObject 22 | { 23 | 24 | private: 25 | static video::SMaterial boundingBoxMaterial; 26 | static video::SMaterial boundingBoxMaterialSelected; 27 | 28 | 29 | 30 | public: 31 | 32 | //PROPERTIES 33 | vector3df position; 34 | vector3df originalPosition; 35 | vector3df goalPosition; 36 | 37 | vector3df roofPosition; 38 | vector3df velocityRoof; 39 | 40 | vector3df velocity; 41 | vector3df acceleration; 42 | 43 | f32 radius; 44 | f32 weight; 45 | 46 | int nr; 47 | 48 | DeformableObject *owner; 49 | 50 | //CONSTRUCTOR 51 | Particle(DeformableObject *owner, f32 radius, f32 weight); 52 | Particle(DeformableObject *owner, f32 weight); 53 | 54 | // Sets the Original Position and initializes the rest of the Particle 55 | // position properties to the same value 56 | void setOriginalPosition(vector3df orgPosition) { 57 | originalPosition = orgPosition; 58 | setPosition(orgPosition); 59 | position = orgPosition; 60 | goalPosition = position; 61 | } 62 | 63 | 64 | vector3df getForces(); 65 | // updates the position of this particle 66 | void update(f32 timeElapsed); 67 | 68 | // checks to see whether the new position is possible to move to 69 | bool canMoveTo ( const vector3df &newPosition ); 70 | 71 | // gets the object that this particle would collide with at the newPosition, or returns NULL if no collision occurred 72 | ModelObject* getCollidedObject ( const vector3df &newPosition ); 73 | 74 | // Determine whether we should draw this node, and the children nodes 75 | virtual void OnPreRender(); 76 | 77 | // Draws this node to the screen 78 | virtual void render(); 79 | 80 | }; 81 | } 82 | 83 | 84 | #endif // end if!defined for this header 85 | -------------------------------------------------------------------------------- /MeshlessDeformations/boxSides.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/MeshlessDeformations/boxSides.jpg -------------------------------------------------------------------------------- /MeshlessDeformations/earth.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/MeshlessDeformations/earth.bmp -------------------------------------------------------------------------------- /MeshlessDeformations/linpack/CVS/Entries: -------------------------------------------------------------------------------- 1 | /blas1.cpp/1.1/Fri Oct 7 03:25:11 2005// 2 | /blas1.h/1.1/Fri Oct 7 03:25:12 2005// 3 | /linpack.cpp/1.2/Fri Oct 7 05:34:46 2005// 4 | /linpack.h/1.1/Fri Oct 7 03:25:12 2005// 5 | D 6 | -------------------------------------------------------------------------------- /MeshlessDeformations/linpack/CVS/Entries.Extra: -------------------------------------------------------------------------------- 1 | /blas1.cpp////*/// 2 | /blas1.h////*/// 3 | /linpack.cpp////*/// 4 | /linpack.h////*/// 5 | -------------------------------------------------------------------------------- /MeshlessDeformations/linpack/CVS/Entries.Extra.Old: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/MeshlessDeformations/linpack/CVS/Entries.Extra.Old -------------------------------------------------------------------------------- /MeshlessDeformations/linpack/CVS/Entries.Old: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/MeshlessDeformations/linpack/CVS/Entries.Old -------------------------------------------------------------------------------- /MeshlessDeformations/linpack/CVS/Repository: -------------------------------------------------------------------------------- 1 | shape-matching/src/linpack 2 | -------------------------------------------------------------------------------- /MeshlessDeformations/linpack/CVS/Root: -------------------------------------------------------------------------------- 1 | :ext:dflo006@chaos.cs.auckland.ac.nz:/afs/ec.auckland.ac.nz/course/compsci/compsci.715.c.s2.05/private/D2 2 | -------------------------------------------------------------------------------- /MeshlessDeformations/linpack/CVS/Template: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/MeshlessDeformations/linpack/CVS/Template -------------------------------------------------------------------------------- /MeshlessDeformations/linpack/blas1.h: -------------------------------------------------------------------------------- 1 | double d_abs ( double x ); 2 | double d_max ( double x, double y ); 3 | double d_sign ( double x ); 4 | double dasum ( int n, double x[], int incx ); 5 | void daxpy ( int n, double da, double dx[], int incx, double dy[], int incy ); 6 | void dcopy ( int n, double dx[], int incx, double dy[], int incy ); 7 | double ddot ( int n, double dx[], int incx, double dy[], int incy ); 8 | double dmach ( int job ); 9 | double dnrm2 ( int n, double x[], int incx ); 10 | void drot ( int n, double x[], int incx, double y[], int incy, double c, 11 | double s ); 12 | void drotg ( double *sa, double *sb, double *c, double *s ); 13 | void dscal ( int n, double sa, double x[], int incx ); 14 | void dswap ( int n, double x[], int incx, double y[], int incy ); 15 | int i_max ( int i1, int i2 ); 16 | int i_min ( int i1, int i2 ); 17 | int idamax ( int n, double dx[], int incx ); 18 | bool lsame ( char ca, char cb ); 19 | void xerbla ( char *srname, int info ); 20 | -------------------------------------------------------------------------------- /MeshlessDeformations/linpack/linpack.h: -------------------------------------------------------------------------------- 1 | int dchdc ( double a[], int lda, int p, double work[], int ipvt[], int job ); 2 | int dchdd ( double r[], int ldr, int p, double x[], double z[], int ldz, 3 | int nz, double y[], double rho[], double c[], double s[] ); 4 | void dchex ( double r[], int ldr, int p, int k, int l, double z[], int ldz, 5 | int nz, double c[], double s[], int job ); 6 | void dchud ( double r[], int ldr, int p, double x[], double z[], int ldz, int nz, 7 | double y[], double rho[], double c[], double s[] ); 8 | double dgbco ( double abd[], int lda, int n, int ml, int mu, int ipvt[], 9 | double z[] ); 10 | void dgbdi ( double abd[], int lda, int n, int ml, int mu, int ipvt[], 11 | double det[2] ); 12 | int dgbfa ( double abd[], int lda, int n, int ml, int mu, int ipvt[] ); 13 | void dgbsl ( double abd[], int lda, int n, int ml, int mu, int ipvt[], 14 | double b[], int job ); 15 | double dgeco ( double a[], int lda, int n, int ipvt[], double z[] ); 16 | void dgedi ( double a[], int lda, int n, int ipvt[], double det[], 17 | double work[], int job ); 18 | int dgefa ( double a[], int lda, int n, int ipvt[] ); 19 | void dgesl ( double a[], int lda, int n, int ipvt[], double b[], int job ); 20 | int dgtsl ( int n, double c[], double d[], double e[], double b[] ); 21 | double dpbco ( double abd[], int lda, int n, int m, double z[] ); 22 | void dpbdi ( double abd[], int lda, int n, int m, double det[] ); 23 | int dpbfa ( double abd[], int lda, int n, int m ); 24 | void dpbsl ( double abd[], int lda, int n, int m, double b[] ); 25 | double dpoco ( double a[], int lda, int n, double z[] ); 26 | void dpodi ( double a[], int lda, int n, double det[], int job ); 27 | int dpofa ( double a[], int lda, int n ); 28 | void dposl ( double a[], int lda, int n, double b[] ); 29 | double dppco ( double ap[], int n, double z[] ); 30 | void dppdi ( double ap[], int n, double det[2], int job ); 31 | int dppfa ( double ap[], int n ); 32 | void dppsl ( double ap[], int n, double b[] ); 33 | void dptsl ( int n, double d[], double e[], double b[] ); 34 | void dqrdc ( double a[], int lda, int n, int p, double qraux[], int jpvt[], 35 | double work[], int job ); 36 | int dqrsl ( double a[], int lda, int n, int k, double qraux[], double y[], 37 | double qy[], double qty[], double b[], double rsd[], double ab[], int job ); 38 | double dsico ( double a[], int lda, int n, int kpvt[], double z[] ); 39 | void dsidi ( double a[], int lda, int n, int kpvt[], double det[2], 40 | int inert[3], double work[], int job ); 41 | int dsifa ( double a[], int lda, int n, int kpvt[] ); 42 | void dsisl ( double a[], int lda, int n, int kpvt[], double b[] ); 43 | double dspco ( double ap[], int n, int kpvt[], double z[] ); 44 | void dspdi ( double ap[], int n, int kpvt[], double det[2], int inert[3], 45 | double work[], int job ); 46 | int dspfa ( double ap[], int n, int kpvt[] ); 47 | void dspsl ( double ap[], int n, int kpvt[], double b[] ); 48 | void dsvdc ( double a[], int lda, int n, int p, double s[], double e[], 49 | double u[], int ldu, double v[], int ldv, double work[], int job, int *info ); 50 | double dtrco ( double t[], int ldt, int n, double z[], int job ); 51 | int dtrdi ( double t[], int ldt, int n, double det[], int job ); 52 | int dtrsl ( double t[], int ldt, int n, double b[], int job ); 53 | -------------------------------------------------------------------------------- /MeshlessDeformations/main.h: -------------------------------------------------------------------------------- 1 | #if !defined(main_h) 2 | #define main_h 3 | 4 | #include 5 | #include 6 | #include "Globals.h" 7 | #include "EventHandler.h" 8 | #include "Boundary.h" 9 | #include "Particle.h" 10 | #include "DeformableObject.h" 11 | #include "GUIManager.h" 12 | #include "ObjectFactory.h" 13 | 14 | #pragma comment(lib, "Irrlicht.lib") 15 | 16 | using namespace irr; 17 | 18 | using namespace core; 19 | using namespace scene; 20 | using namespace video; 21 | using namespace io; 22 | using namespace gui; 23 | 24 | 25 | //Screen Details 26 | const int WINDOWWIDTH = 1024; 27 | const int WINDOWHEIGHT = 768; 28 | const int FULLSCREEN = false; 29 | const SColor CLEARCOLOR = SColor(0,255, 255,255); 30 | 31 | 32 | #endif // end if!defined for this header 33 | -------------------------------------------------------------------------------- /MeshlessDeformations/matrix/CONTROLW.H: -------------------------------------------------------------------------------- 1 | //$$ controlw.h Control word class 2 | 3 | #ifndef CONTROL_WORD_LIB 4 | #define CONTROL_WORD_LIB 0 5 | 6 | // for organising an int as a series of bits which indicate whether an 7 | // option is on or off. 8 | 9 | class ControlWord 10 | { 11 | protected: 12 | int cw; // the control word 13 | public: 14 | ControlWord() : cw(0) {} // do nothing 15 | ControlWord(int i) : cw(i) {} // load an integer 16 | 17 | // select specific bits (for testing at least one set) 18 | ControlWord operator*(ControlWord i) const 19 | { return ControlWord(cw & i.cw); } 20 | void operator*=(ControlWord i) { cw &= i.cw; } 21 | 22 | // set bits 23 | ControlWord operator+(ControlWord i) const 24 | { return ControlWord(cw | i.cw); } 25 | void operator+=(ControlWord i) { cw |= i.cw; } 26 | 27 | // reset bits 28 | ControlWord operator-(ControlWord i) const 29 | { return ControlWord(cw - (cw & i.cw)); } 30 | void operator-=(ControlWord i) { cw -= (cw & i.cw); } 31 | 32 | // check if all of selected bits set or reset 33 | bool operator>=(ControlWord i) const { return (cw & i.cw) == i.cw; } 34 | bool operator<=(ControlWord i) const { return (cw & i.cw) == cw; } 35 | 36 | // flip selected bits 37 | ControlWord operator^(ControlWord i) const 38 | { return ControlWord(cw ^ i.cw); } 39 | ControlWord operator~() const { return ControlWord(~cw); } 40 | 41 | // convert to integer 42 | int operator+() const { return cw; } 43 | int operator!() const { return cw==0; } 44 | FREE_CHECK(ControlWord) 45 | }; 46 | 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /MeshlessDeformations/matrix/CVS/Entries: -------------------------------------------------------------------------------- 1 | /BANDMAT.CPP/1.1/Sat Oct 8 21:48:38 2005// 2 | /CHOLESKY.CPP/1.2/Sun Oct 9 06:05:50 2005// 3 | /CONTROLW.H/1.1/Sat Oct 8 21:48:38 2005// 4 | /EVALUE.CPP/1.1/Sat Oct 8 21:48:38 2005// 5 | /EXAMPLE.CPP/1.1/Sat Oct 8 21:48:38 2005// 6 | /FFT.CPP/1.1/Sat Oct 8 21:48:38 2005// 7 | /GARCH.CPP/1.1/Sat Oct 8 21:48:39 2005// 8 | /HHOLDER.CPP/1.1/Sat Oct 8 21:48:39 2005// 9 | /INCLUDE.H/1.1/Sat Oct 8 21:48:39 2005// 10 | /JACOBI.CPP/1.1/Sat Oct 8 21:48:39 2005// 11 | /MYEXCEPT.CPP/1.1/Sat Oct 8 21:48:39 2005// 12 | /MYEXCEPT.H/1.1/Sat Oct 8 21:48:39 2005// 13 | /NEWFFT.CPP/1.1/Sat Oct 8 21:48:39 2005// 14 | /NEWMAT.H/1.1/Sat Oct 8 21:48:39 2005// 15 | /NEWMAT1.CPP/1.1/Sat Oct 8 21:48:39 2005// 16 | /NEWMAT2.CPP/1.1/Sat Oct 8 21:48:39 2005// 17 | /NEWMAT3.CPP/1.1/Sat Oct 8 21:48:39 2005// 18 | /NEWMAT4.CPP/1.1/Sat Oct 8 21:48:39 2005// 19 | /NEWMAT5.CPP/1.1/Sat Oct 8 21:48:39 2005// 20 | /NEWMAT6.CPP/1.1/Sat Oct 8 21:48:39 2005// 21 | /NEWMAT7.CPP/1.1/Sat Oct 8 21:48:39 2005// 22 | /NEWMAT8.CPP/1.1/Sat Oct 8 21:48:39 2005// 23 | /NEWMAT9.CPP/1.1/Sat Oct 8 21:48:39 2005// 24 | /NEWMATAP.H/1.1/Sat Oct 8 21:48:39 2005// 25 | /NEWMATEX.CPP/1.1/Sat Oct 8 21:48:39 2005// 26 | /NEWMATIO.H/1.1/Sat Oct 8 21:48:39 2005// 27 | /NEWMATNL.CPP/1.1/Sat Oct 8 21:48:39 2005// 28 | /NEWMATNL.H/1.1/Sat Oct 8 21:48:39 2005// 29 | /NEWMATRC.H/1.1/Sat Oct 8 21:48:39 2005// 30 | /NEWMATRM.CPP/1.1/Sat Oct 8 21:48:39 2005// 31 | /NEWMATRM.H/1.1/Sat Oct 8 21:48:39 2005// 32 | /NL_EX.CPP/1.1/Sat Oct 8 21:48:39 2005// 33 | /NM_EX1.CPP/1.1/Sat Oct 8 21:48:39 2005// 34 | /NM_EX2.CPP/1.1/Sat Oct 8 21:48:39 2005// 35 | /NM_MISC.CPP/1.1/Sat Oct 8 21:48:39 2005// 36 | /PRECISIO.H/1.1/Sat Oct 8 21:48:39 2005// 37 | /SL_EX.CPP/1.1/Sat Oct 8 21:48:39 2005// 38 | /SOLUTION.CPP/1.1/Sat Oct 8 21:48:40 2005// 39 | /SOLUTION.H/1.1/Sat Oct 8 21:48:40 2005// 40 | /SORT.CPP/1.1/Sat Oct 8 21:48:40 2005// 41 | /SUBMAT.CPP/1.1/Sat Oct 8 21:48:40 2005// 42 | /SVD.CPP/1.1/Sat Oct 8 21:48:40 2005// 43 | /TEST_EXC.CPP/1.1/Sat Oct 8 21:48:40 2005// 44 | /TMT.CPP/1.1/Sat Oct 8 21:48:40 2005// 45 | /TMT.H/1.1/Sat Oct 8 21:48:40 2005// 46 | /TMT1.CPP/1.1/Sat Oct 8 21:48:40 2005// 47 | /TMT2.CPP/1.1/Sat Oct 8 21:48:40 2005// 48 | /TMT3.CPP/1.1/Sat Oct 8 21:48:40 2005// 49 | /TMT4.CPP/1.1/Sat Oct 8 21:48:40 2005// 50 | /TMT5.CPP/1.1/Sat Oct 8 21:48:40 2005// 51 | /TMT6.CPP/1.1/Sat Oct 8 21:48:40 2005// 52 | /TMT7.CPP/1.1/Sat Oct 8 21:48:40 2005// 53 | /TMT8.CPP/1.1/Sat Oct 8 21:48:40 2005// 54 | /TMT9.CPP/1.1/Sat Oct 8 21:48:40 2005// 55 | /TMTA.CPP/1.1/Sat Oct 8 21:48:40 2005// 56 | /TMTB.CPP/1.1/Sat Oct 8 21:48:40 2005// 57 | /TMTC.CPP/1.1/Sat Oct 8 21:48:40 2005// 58 | /TMTD.CPP/1.1/Sat Oct 8 21:48:40 2005// 59 | /TMTE.CPP/1.1/Sat Oct 8 21:48:40 2005// 60 | /TMTF.CPP/1.1/Sat Oct 8 21:48:40 2005// 61 | /TMTG.CPP/1.1/Sat Oct 8 21:48:40 2005// 62 | /TMTH.CPP/1.1/Sat Oct 8 21:48:40 2005// 63 | /TMTI.CPP/1.1/Sat Oct 8 21:48:40 2005// 64 | /TMTJ.CPP/1.1/Sat Oct 8 21:48:40 2005// 65 | /TMTK.CPP/1.1/Sat Oct 8 21:48:40 2005// 66 | /TMTL.CPP/1.1/Sat Oct 8 21:48:40 2005// 67 | /TMTM.CPP/1.1/Sat Oct 8 21:48:40 2005// 68 | D 69 | -------------------------------------------------------------------------------- /MeshlessDeformations/matrix/CVS/Entries.Extra: -------------------------------------------------------------------------------- 1 | /BANDMAT.CPP////*/// 2 | /CHOLESKY.CPP////*/// 3 | /CONTROLW.H////*/// 4 | /EVALUE.CPP////*/// 5 | /EXAMPLE.CPP////*/// 6 | /FFT.CPP////*/// 7 | /GARCH.CPP////*/// 8 | /HHOLDER.CPP////*/// 9 | /INCLUDE.H////*/// 10 | /JACOBI.CPP////*/// 11 | /MYEXCEPT.CPP////*/// 12 | /MYEXCEPT.H////*/// 13 | /NEWFFT.CPP////*/// 14 | /NEWMAT.H////*/// 15 | /NEWMAT1.CPP////*/// 16 | /NEWMAT2.CPP////*/// 17 | /NEWMAT3.CPP////*/// 18 | /NEWMAT4.CPP////*/// 19 | /NEWMAT5.CPP////*/// 20 | /NEWMAT6.CPP////*/// 21 | /NEWMAT7.CPP////*/// 22 | /NEWMAT8.CPP////*/// 23 | /NEWMAT9.CPP////*/// 24 | /NEWMATAP.H////*/// 25 | /NEWMATEX.CPP////*/// 26 | /NEWMATIO.H////*/// 27 | /NEWMATNL.CPP////*/// 28 | /NEWMATNL.H////*/// 29 | /NEWMATRC.H////*/// 30 | /NEWMATRM.CPP////*/// 31 | /NEWMATRM.H////*/// 32 | /NL_EX.CPP////*/// 33 | /NM_EX1.CPP////*/// 34 | /NM_EX2.CPP////*/// 35 | /NM_MISC.CPP////*/// 36 | /PRECISIO.H////*/// 37 | /SL_EX.CPP////*/// 38 | /SOLUTION.CPP////*/// 39 | /SOLUTION.H////*/// 40 | /SORT.CPP////*/// 41 | /SUBMAT.CPP////*/// 42 | /SVD.CPP////*/// 43 | /TEST_EXC.CPP////*/// 44 | /TMT.CPP////*/// 45 | /TMT.H////*/// 46 | /TMT1.CPP////*/// 47 | /TMT2.CPP////*/// 48 | /TMT3.CPP////*/// 49 | /TMT4.CPP////*/// 50 | /TMT5.CPP////*/// 51 | /TMT6.CPP////*/// 52 | /TMT7.CPP////*/// 53 | /TMT8.CPP////*/// 54 | /TMT9.CPP////*/// 55 | /TMTA.CPP////*/// 56 | /TMTB.CPP////*/// 57 | /TMTC.CPP////*/// 58 | /TMTD.CPP////*/// 59 | /TMTE.CPP////*/// 60 | /TMTF.CPP////*/// 61 | /TMTG.CPP////*/// 62 | /TMTH.CPP////*/// 63 | /TMTI.CPP////*/// 64 | /TMTJ.CPP////*/// 65 | /TMTK.CPP////*/// 66 | /TMTL.CPP////*/// 67 | /TMTM.CPP////*/// 68 | -------------------------------------------------------------------------------- /MeshlessDeformations/matrix/CVS/Entries.Extra.Old: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/MeshlessDeformations/matrix/CVS/Entries.Extra.Old -------------------------------------------------------------------------------- /MeshlessDeformations/matrix/CVS/Entries.Old: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/MeshlessDeformations/matrix/CVS/Entries.Old -------------------------------------------------------------------------------- /MeshlessDeformations/matrix/CVS/Repository: -------------------------------------------------------------------------------- 1 | shape-matching/src/matrix 2 | -------------------------------------------------------------------------------- /MeshlessDeformations/matrix/CVS/Root: -------------------------------------------------------------------------------- 1 | :ext:dflo006@chaos.cs.auckland.ac.nz:/afs/ec.auckland.ac.nz/course/compsci/compsci.715.c.s2.05/private/D2 2 | -------------------------------------------------------------------------------- /MeshlessDeformations/matrix/CVS/Template: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/MeshlessDeformations/matrix/CVS/Template -------------------------------------------------------------------------------- /MeshlessDeformations/matrix/NEWMAT9.CPP: -------------------------------------------------------------------------------- 1 | //$$ newmat9.cpp Input and output 2 | 3 | // Copyright (C) 1991,2,3,4: R B Davies 4 | 5 | 6 | #define WANT_STREAM 7 | 8 | #include "include.h" 9 | 10 | #include "newmat.h" 11 | #include "newmatio.h" 12 | #include "newmatrc.h" 13 | 14 | #ifdef use_namespace 15 | namespace NEWMAT { 16 | #endif 17 | 18 | 19 | 20 | #ifdef DO_REPORT 21 | #define REPORT { static ExeCounter ExeCount(__LINE__,9); ++ExeCount; } 22 | #else 23 | #define REPORT {} 24 | #endif 25 | 26 | // for G++ 3.01 27 | #ifndef ios_format_flags 28 | #define ios_format_flags long 29 | #endif 30 | 31 | ostream& operator<<(ostream& s, const BaseMatrix& X) 32 | { 33 | GeneralMatrix* gm = ((BaseMatrix&)X).Evaluate(); operator<<(s, *gm); 34 | gm->tDelete(); return s; 35 | } 36 | 37 | 38 | ostream& operator<<(ostream& s, const GeneralMatrix& X) 39 | { 40 | MatrixRow mr((GeneralMatrix*)&X, LoadOnEntry); 41 | int w = s.width(); int nr = X.Nrows(); ios_format_flags f = s.flags(); 42 | s.setf(ios::fixed, ios::floatfield); 43 | for (int i=1; i<=nr; i++) 44 | { 45 | int skip = mr.skip; int storage = mr.storage; 46 | Real* store = mr.data; skip *= w+1; 47 | while (skip--) s << " "; 48 | while (storage--) { s.width(w); s << *store++ << " "; } 49 | // while (storage--) s << setw(w) << *store++ << " "; 50 | mr.Next(); s << "\n"; 51 | } 52 | s << flush; s.flags(f); return s; 53 | } 54 | 55 | // include this stuff if you are using an old version of G++ 56 | // with an incomplete io library 57 | 58 | /* 59 | 60 | ostream& operator<<(ostream& os, Omanip_precision i) 61 | { os.precision(i.x); return os; } 62 | 63 | Omanip_precision setprecision(int i) { return Omanip_precision(i); } 64 | 65 | ostream& operator<<(ostream& os, Omanip_width i) 66 | { os.width(i.x); return os; } 67 | 68 | Omanip_width setw(int i) { return Omanip_width(i); } 69 | 70 | */ 71 | 72 | #ifdef use_namespace 73 | } 74 | #endif 75 | 76 | 77 | -------------------------------------------------------------------------------- /MeshlessDeformations/matrix/NEWMATIO.H: -------------------------------------------------------------------------------- 1 | //$$ newmatio.h definition file for matrix package input/output 2 | 3 | // Copyright (C) 1991,2,3,4: R B Davies 4 | 5 | #ifndef NEWMATIO_LIB 6 | #define NEWMATIO_LIB 0 7 | 8 | #ifndef WANT_STREAM 9 | #define WANT_STREAM 10 | #endif 11 | 12 | #include "newmat.h" 13 | 14 | #ifdef use_namespace 15 | namespace NEWMAT { 16 | #endif 17 | 18 | 19 | 20 | /**************************** input/output *****************************/ 21 | 22 | ostream& operator<<(ostream&, const BaseMatrix&); 23 | 24 | ostream& operator<<(ostream&, const GeneralMatrix&); 25 | 26 | 27 | /* Use in some old versions of G++ without complete iomanipulators 28 | 29 | class Omanip_precision 30 | { 31 | int x; 32 | public: 33 | Omanip_precision(int i) : x(i) {} 34 | friend ostream& operator<<(ostream& os, Omanip_precision i); 35 | }; 36 | 37 | 38 | Omanip_precision setprecision(int i); 39 | 40 | class Omanip_width 41 | { 42 | int x; 43 | public: 44 | Omanip_width(int i) : x(i) {} 45 | friend ostream& operator<<(ostream& os, Omanip_width i); 46 | }; 47 | 48 | Omanip_width setw(int i); 49 | 50 | */ 51 | 52 | #ifdef use_namespace 53 | } 54 | #endif 55 | 56 | 57 | 58 | #endif 59 | 60 | // body file: newmat9.cpp 61 | 62 | -------------------------------------------------------------------------------- /MeshlessDeformations/matrix/NL_EX.CPP: -------------------------------------------------------------------------------- 1 | // This is an example of a non-linear least squares fit. The example 2 | // is from "Nonlinear estimation" by Gavin Ross (Springer,1990), p 63. 3 | // There are better ways of doing the fit in this case so this 4 | // example is just an example. 5 | 6 | // The model is E(y) = a + b exp(-kx) and there are 6 data points. 7 | 8 | #define WANT_STREAM 9 | #define WANT_MATH 10 | #include "newmatnl.h" 11 | #include "newmatio.h" 12 | 13 | #ifdef use_namespace 14 | using namespace RBD_LIBRARIES; 15 | #endif 16 | 17 | 18 | // first define the class describing the predictor function 19 | 20 | class Model_3pe : public R1_Col_I_D 21 | { 22 | ColumnVector x_values; // the values of "x" 23 | RowVector deriv; // values of derivatives 24 | public: 25 | Model_3pe(const ColumnVector& X_Values) 26 | : x_values(X_Values) { deriv.resize(3); } 27 | // load X data 28 | Real operator()(int); 29 | bool IsValid() { return para(3)>0; } 30 | // require "k" > 0 31 | ReturnMatrix Derivatives() { return deriv; } 32 | }; 33 | 34 | Real Model_3pe::operator()(int i) 35 | { 36 | Real a = para(1); Real b = para(2); Real k = para(3); 37 | Real xvi = x_values(i); 38 | Real e = exp(-k * xvi); 39 | deriv(1) = 1.0; // calculate derivatives 40 | deriv(2) = e; 41 | deriv(3) = - b * e * xvi; 42 | return a + b * e; // function value 43 | } 44 | 45 | 46 | int my_main() 47 | { 48 | { 49 | // Get the data 50 | ColumnVector X(6); 51 | ColumnVector Y(6); 52 | X << 1 << 2 << 3 << 4 << 6 << 8; 53 | Y << 3.2 << 7.9 << 11.1 << 14.5 << 16.7 << 18.3; 54 | 55 | 56 | // Do the fit 57 | Model_3pe model(X); // the model object 58 | NonLinearLeastSquares NLLS(model); // the non-linear least squares 59 | // object 60 | ColumnVector Para(3); // for the parameters 61 | Para << 9 << -6 << .5; // trial values of parameters 62 | cout << "Fitting parameters\n"; 63 | NLLS.Fit(Y,Para); // do the fit 64 | 65 | // Inspect the results 66 | ColumnVector SE; // for the standard errors 67 | NLLS.GetStandardErrors(SE); 68 | cout << "\n\nEstimates and standard errors\n" << 69 | setw(10) << setprecision(2) << (Para | SE) << endl; 70 | Real ResidualSD = sqrt(NLLS.ResidualVariance()); 71 | cout << "\nResidual s.d. = " << setw(10) << setprecision(2) << 72 | ResidualSD << endl; 73 | SymmetricMatrix Correlations; 74 | NLLS.GetCorrelations(Correlations); 75 | cout << "\nCorrelationMatrix\n" << 76 | setw(10) << setprecision(2) << Correlations << endl; 77 | ColumnVector Residuals; 78 | NLLS.GetResiduals(Residuals); 79 | DiagonalMatrix Hat; 80 | NLLS.GetHatDiagonal(Hat); 81 | cout << "\nX, Y, Residual, Hat\n" << setw(10) << setprecision(2) << 82 | (X | Y | Residuals | Hat.as_column()) << endl; 83 | // recover var/cov matrix 84 | SymmetricMatrix D; 85 | D << SE.as_diagonal() * Correlations * SE.as_diagonal(); 86 | cout << "\nVar/cov\n" << setw(14) << setprecision(4) << D << endl; 87 | } 88 | 89 | #ifdef DO_FREE_CHECK 90 | FreeCheck::Status(); 91 | #endif 92 | 93 | return 0; 94 | } 95 | 96 | 97 | // call my_main() - use this to catch exceptions 98 | int main() 99 | { 100 | Try 101 | { 102 | return my_main(); 103 | } 104 | Catch(BaseException) 105 | { 106 | cout << BaseException::what() << "\n"; 107 | } 108 | CatchAll 109 | { 110 | cout << "\nProgram fails - exception generated\n\n"; 111 | } 112 | return 0; 113 | } 114 | 115 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /MeshlessDeformations/matrix/NM_EX1.CPP: -------------------------------------------------------------------------------- 1 | // simple example 1 2 | // invert a 4 x 4 matrix then check the result 3 | 4 | #define WANT_STREAM // include iostream and iomanipulators 5 | 6 | #include "newmatap.h" // newmat advanced functions 7 | // should not be required for this example 8 | // included because it seems to help MS VC6 9 | // when you have namespace turned on 10 | 11 | #include "newmatio.h" // newmat headers including output functions 12 | 13 | #ifdef use_namespace 14 | using namespace RBD_LIBRARIES; 15 | #endif 16 | 17 | 18 | int my_main() // called by main() 19 | { 20 | Tracer tr("my_main "); // for tracking exceptions 21 | 22 | // declare a matrix 23 | Matrix X(4,4); 24 | 25 | // load values row by row 26 | X.row(1) << 3.7 << -2.1 << 7.4 << -1.0; 27 | X.row(2) << 4.1 << 0.0 << 3.9 << 4.0; 28 | X.row(3) << -2.5 << 1.9 << -0.4 << 7.3; 29 | X.row(4) << 1.5 << 9.8 << -2.1 << 1.1; 30 | 31 | // print the matrix 32 | cout << "Matrix X" << endl; 33 | cout << setw(15) << setprecision(8) << X << endl; 34 | 35 | // calculate its inverse and print it 36 | Matrix Y = X.i(); 37 | cout << "Inverse of X" << endl; 38 | cout << setw(15) << setprecision(8) << Y << endl; 39 | 40 | // multiply X by its inverse and print the result (should be near identity) 41 | cout << "X * inverse of X" << endl; 42 | cout << setw(15) << setprecision(8) << (X * Y) << endl; 43 | 44 | return 0; 45 | } 46 | 47 | 48 | // call my_main() - use this to catch exceptions 49 | // use macros for exception names for compatibility with simulated exceptions 50 | int main() 51 | { 52 | Try { return my_main(); } 53 | Catch(BaseException) { cout << BaseException::what() << "\n"; } 54 | CatchAll { cout << "\nProgram fails - exception generated\n\n"; } 55 | return 0; 56 | } 57 | 58 | 59 | -------------------------------------------------------------------------------- /MeshlessDeformations/matrix/NM_EX2.CPP: -------------------------------------------------------------------------------- 1 | // simple example 2 2 | // Generate a Hilbert matrix and work out its eigenvalues 3 | // and eigenvectors; check result by multiplying out. 4 | 5 | // The Hilbert matrix is notoriously ill-conditioned (difficult to invert). 6 | // In this example, I calculate the eigenvalues of a 7 x 7 Hilbert matrix. 7 | 8 | // The dimensions of this matrix are not large enough for there to be numerical 9 | // problems but we will be able to see that wide range of values of the 10 | // eigenvalues. 11 | 12 | #define WANT_STREAM // include iostream and iomanipulators 13 | 14 | #include "newmatap.h" // newmat headers including advanced functions 15 | #include "newmatio.h" // newmat headers including output functions 16 | 17 | #ifdef use_namespace 18 | using namespace RBD_LIBRARIES; 19 | #endif 20 | 21 | 22 | int my_main() // called by main() 23 | { 24 | Tracer tr("my_main "); // for tracking exceptions 25 | 26 | int n = 7; // this is the order we will work with 27 | int i, j; 28 | 29 | // declare a matrix 30 | SymmetricMatrix H(n); 31 | 32 | // load values for Hilbert matrix 33 | for (i = 1; i <= n; ++i) for (j = 1; j <= i; ++j) 34 | H(i, j) = 1.0 / (i + j - 1); 35 | 36 | // print the matrix 37 | cout << "SymmetricMatrix H" << endl; 38 | cout << setw(10) << setprecision(7) << H << endl; 39 | 40 | // calculate its eigenvalues and eigenvectors and print them 41 | Matrix U; DiagonalMatrix D; 42 | eigenvalues(H, D, U); 43 | cout << "Eigenvalues of H" << endl; 44 | cout << setw(17) << setprecision(14) << D.as_column() << endl; 45 | cout << "Eigenvector matrix, U" << endl; 46 | cout << setw(10) << setprecision(7) << U << endl; 47 | 48 | // check orthogonality 49 | cout << "U * U.t() (should be near identity)" << endl; 50 | cout << setw(10) << setprecision(7) << (U * U.t()) << endl; 51 | 52 | // check decomposition 53 | cout << "U * D * U.t() (should be near H)" << endl; 54 | cout << setw(10) << setprecision(7) << (U * D * U.t()) << endl; 55 | 56 | return 0; 57 | } 58 | 59 | 60 | // call my_main() - use this to catch exceptions 61 | // use macros for exception names for compatibility with simuated exceptions 62 | int main() 63 | { 64 | Try { return my_main(); } 65 | Catch(BaseException) { cout << BaseException::what() << "\n"; } 66 | CatchAll { cout << "\nProgram fails - exception generated\n\n"; } 67 | return 0; 68 | } 69 | 70 | 71 | -------------------------------------------------------------------------------- /MeshlessDeformations/matrix/SL_EX.CPP: -------------------------------------------------------------------------------- 1 | // This is an example of the use of solution to find the cube root of 2 | // the integers -10 to 10 3 | 4 | // you will need to compile and link solution.cpp and except.cpp 5 | 6 | #define WANT_STREAM 7 | #define WANT_MATH 8 | 9 | #include "include.h" 10 | #include "solution.h" 11 | 12 | #ifdef use_namespace 13 | using namespace RBD_LIBRARIES; 14 | #endif 15 | 16 | 17 | // the cube class 18 | 19 | class Cube : public R1_R1 20 | { Real operator()() { return x*x*x; } }; 21 | 22 | 23 | int my_main() 24 | { 25 | // construct the Cube object 26 | Cube cube; 27 | // and then the solve object 28 | OneDimSolve cube_root(cube); 29 | // Now do the solves 30 | for (int i=-10; i<=10; i++) 31 | cout << i << " " << cube_root.Solve(i,0,1.5) << endl; 32 | return 0; 33 | } 34 | 35 | // call my_main() - use this to catch exceptions 36 | int main() 37 | { 38 | Try 39 | { 40 | return my_main(); 41 | } 42 | Catch(BaseException) 43 | { 44 | cout << BaseException::what() << "\n"; 45 | } 46 | CatchAll 47 | { 48 | cout << "\nProgram fails - exception generated\n\n"; 49 | } 50 | return 0; 51 | } 52 | 53 | -------------------------------------------------------------------------------- /MeshlessDeformations/matrix/SOLUTION.H: -------------------------------------------------------------------------------- 1 | //$$ solution.h // solve routines 2 | 3 | #include "myexcept.h" 4 | 5 | #ifdef use_namespace 6 | namespace RBD_COMMON { 7 | #endif 8 | 9 | 10 | // Solve the equation f(x)=y for x where f is a monotone continuous 11 | // function of x 12 | // Essentially Brent s method 13 | 14 | // You need to derive a class from R1_R1 and override "operator()" 15 | // with the function you want to solve. 16 | // Use an object from this class in OneDimSolve 17 | 18 | class R1_R1 19 | { 20 | // the prototype for a Real function of a Real variable 21 | // you need to derive your function from this one and put in your 22 | // function for operator() at least. You probably also want to set up a 23 | // constructor to put in additional parameter values (e.g. that will not 24 | // vary during a solve) 25 | 26 | protected: 27 | Real x; // Current x value 28 | bool xSet; // true if a value assigned to x 29 | 30 | public: 31 | Real minX, maxX; // range of value x 32 | bool minXinf, maxXinf; // true if these are infinite 33 | R1_R1() : xSet(false), minXinf(true), maxXinf(true) {} 34 | virtual Real operator()() = 0; // function value at current x 35 | // set current x 36 | virtual void Set(Real X); // set x, check OK 37 | Real operator()(Real X) { Set(X); return operator()(); } 38 | // set x, return value 39 | virtual bool IsValid(Real X); 40 | operator Real(); // implicit conversion 41 | }; 42 | 43 | class SolutionException : public BaseException 44 | { 45 | public: 46 | static unsigned long Select; 47 | SolutionException(const char* a_what = 0); 48 | }; 49 | 50 | class OneDimSolve 51 | { 52 | R1_R1& function; // reference to the function 53 | Real accX; // accuracy in X direction 54 | Real accY; // accuracy in Y direction 55 | int lim; // maximum number of iterations 56 | 57 | public: 58 | OneDimSolve(R1_R1& f, Real AccY = 0.0001, Real AccX = 0.0) 59 | : function(f), accX(AccX), accY(AccY) {} 60 | // f is an R1_R1 function 61 | Real Solve(Real Y, Real X, Real Dev, int Lim=100); 62 | // Solve for x in Y=f(x) 63 | // X is the initial trial value of x 64 | // X+Dev is the second trial value 65 | // program returns a value of x such that 66 | // |Y-f(x)| <= accY or |f.inv(Y)-x| <= accX 67 | 68 | private: 69 | Real x[3], y[3]; // Trial values of X and Y 70 | int L,C,U,Last; // Locations of trial values 71 | int vpol, hpol; // polarities 72 | Real YY; // target value 73 | int i; 74 | void LookAt(int); // get new value of function 75 | bool Finish; // true if LookAt finds conv. 76 | bool Captured; // true when target surrounded 77 | void VFlip(); 78 | void HFlip(); 79 | void Flip(); 80 | void State(int I, int J, int K); 81 | void Linear(int, int, int); 82 | void Quadratic(int, int, int); 83 | }; 84 | 85 | 86 | #ifdef use_namespace 87 | } 88 | #endif 89 | 90 | // body file: solution.cpp 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /MeshlessDeformations/matrix/TMT.H: -------------------------------------------------------------------------------- 1 | // definition file for test programs 2 | 3 | //#define DONT_DO_NRIC // activate if running a bounds checker 4 | 5 | #ifdef use_namespace 6 | //using namespace NEWMAT; 7 | namespace NEWMAT { 8 | #endif 9 | 10 | // print time between construction and destruction 11 | class time_lapse 12 | { 13 | double start_time; 14 | public: 15 | time_lapse(); 16 | ~time_lapse(); 17 | }; 18 | 19 | // random number generator 20 | 21 | class MultWithCarry 22 | { 23 | unsigned long x; 24 | unsigned long crry; 25 | 26 | void NextValue(); 27 | 28 | void operator=(const MultWithCarry&) {} // private so can't access 29 | 30 | public: 31 | MultWithCarry(double s=0.46875); 32 | Real Next(); 33 | ~MultWithCarry() {} 34 | }; 35 | 36 | // fill a matrix with values from the MultWithCarry random number generator 37 | void FillWithValues(MultWithCarry& MWC, Matrix& M); 38 | 39 | 40 | void Print(const Matrix& X); 41 | void Print(const UpperTriangularMatrix& X); 42 | void Print(const DiagonalMatrix& X); 43 | void Print(const SymmetricMatrix& X); 44 | void Print(const LowerTriangularMatrix& X); 45 | 46 | void Clean(Matrix&, Real); 47 | void Clean(DiagonalMatrix&, Real); 48 | 49 | #ifdef use_namespace 50 | } 51 | using namespace NEWMAT; 52 | #endif 53 | 54 | 55 | 56 | void trymat1(); void trymat2(); void trymat3(); 57 | void trymat4(); void trymat5(); void trymat6(); 58 | void trymat7(); void trymat8(); void trymat9(); 59 | void trymata(); void trymatb(); void trymatc(); 60 | void trymatd(); void trymate(); void trymatf(); 61 | void trymatg(); void trymath(); void trymati(); 62 | void trymatj(); void trymatk(); void trymatl(); 63 | void trymatm(); 64 | 65 | 66 | 67 | // body file: tmt.cpp 68 | // body file: tmt1.cpp 69 | // body file: tmt2.cpp 70 | // body file: tmt3.cpp 71 | // body file: tmt4.cpp 72 | // body file: tmt5.cpp 73 | // body file: tmt6.cpp 74 | // body file: tmt7.cpp 75 | // body file: tmt8.cpp 76 | // body file: tmt9.cpp 77 | // body file: tmta.cpp 78 | // body file: tmtb.cpp 79 | // body file: tmtc.cpp 80 | // body file: tmtd.cpp 81 | // body file: tmte.cpp 82 | // body file: tmtf.cpp 83 | // body file: tmtg.cpp 84 | // body file: tmth.cpp 85 | // body file: tmti.cpp 86 | // body file: tmtj.cpp 87 | // body file: tmtk.cpp 88 | // body file: tmtl.cpp 89 | // body file: tmtm.cpp 90 | 91 | -------------------------------------------------------------------------------- /MeshlessDeformations/matrix/TMT5.CPP: -------------------------------------------------------------------------------- 1 | 2 | //#define WANT_STREAM 3 | 4 | #include "include.h" 5 | 6 | #include "newmat.h" 7 | 8 | #include "tmt.h" 9 | 10 | #ifdef use_namespace 11 | using namespace NEWMAT; 12 | #endif 13 | 14 | 15 | // **************************** test program ****************************** 16 | 17 | 18 | 19 | ReturnMatrix Returner0(const GenericMatrix& GM) 20 | { Matrix M = GM; M.Release(); return M; } 21 | 22 | ReturnMatrix Returner1(const GenericMatrix& GM) 23 | { Matrix M = GM+1; M.Release(); return M; } 24 | 25 | ReturnMatrix Returner2(const GenericMatrix& GM) 26 | { UpperBandMatrix M = GM*2; M.Release(); return M; } 27 | 28 | ReturnMatrix Returner3(const GenericMatrix& GM) 29 | { LowerBandMatrix M = GM*3; M.Release(); return M; } 30 | 31 | ReturnMatrix Returner4(const GenericMatrix& GM) 32 | { SymmetricMatrix M = GM+4; M.Release(); return M; } 33 | 34 | ReturnMatrix Returner5(const GenericMatrix& GM) 35 | { SymmetricBandMatrix M = GM*5; M.Release(); return M; } 36 | 37 | ReturnMatrix Returner6(const GenericMatrix& GM) 38 | { BandMatrix M = GM*6; M.Release(); return M; } 39 | 40 | ReturnMatrix Returner7(const GenericMatrix& GM) 41 | { DiagonalMatrix M = GM*7; M.Release(); return M; } 42 | 43 | void trymat5() 44 | { 45 | // cout << "\nFifth test of Matrix package\n"; 46 | Tracer et("Fifth test of Matrix package"); 47 | Tracer::PrintTrace(); 48 | 49 | int i,j; 50 | 51 | Matrix A(5,6); 52 | for (i=1;i<=5;i++) for (j=1;j<=6;j++) A(i,j)=1+i*j+i*i+j*j; 53 | ColumnVector CV(6); 54 | for (i=1;i<=6;i++) CV(i)=i*i+3; 55 | ColumnVector CV2(5); for (i=1;i<=5;i++) CV2(i)=1.0; 56 | ColumnVector CV1=CV; 57 | 58 | { 59 | CV=A*CV; 60 | RowVector RV=CV.t(); // RowVector RV; RV=CV.t(); 61 | RV=RV-1.0; 62 | CV=(RV*A).t()+A.t()*CV2; CV1=(A.t()*A)*CV1 - CV; 63 | Print(CV1); 64 | } 65 | 66 | CV1.ReSize(6); 67 | CV2.ReSize(6); 68 | CV.ReSize(6); 69 | for (i=1;i<=6;i++) { CV1(i)=i*3+1; CV2(i)=10-i; CV(i)=11+i*2; } 70 | ColumnVector CX=CV2-CV; { CX=CX+CV1; Print(CX); } 71 | Print(ColumnVector(CV1+CV2-CV)); 72 | RowVector RV=CV.t(); RowVector RV1=CV1.t(); 73 | RowVector R=RV-RV1; Print(RowVector(R-CV2.t())); 74 | 75 | // test loading of list 76 | 77 | RV.ReSize(10); 78 | for (i=1;i<=10;i++) RV(i) = i*i; 79 | RV1.ReSize(10); 80 | RV1 << 1 << 4 << 9 << 16 << 25 << 36 << 49 << 64 << 81 << 100; // << 121; 81 | Print(RowVector(RV-RV1)); 82 | 83 | et.ReName("Fifth test of Matrix package - almost at end"); 84 | 85 | Matrix X(2,3); 86 | X << 11 << 12 << 13 87 | << 21 << 22 << 23; 88 | 89 | Matrix Y = X.t(); // check simple transpose 90 | 91 | X(1,1) -= 11; X(1,2) -= 12; X(1,3) -= 13; 92 | X(2,1) -= 21; X(2,2) -= 22; X(2,3) -= 23; 93 | Print(X); 94 | 95 | Y(1,1) -= 11; Y(2,1) -= 12; Y(3,1) -= 13; 96 | Y(1,2) -= 21; Y(2,2) -= 22; Y(3,2) -= 23; 97 | Print(Y); 98 | 99 | et.ReName("Fifth test of Matrix package - at end"); 100 | 101 | RV = Returner1(RV)-1; Print(RowVector(RV-RV1)); 102 | CV1 = Returner1(RV.t())-1; Print(ColumnVector(RV.t()-CV1)); 103 | #ifndef DONT_DO_NRIC 104 | nricMatrix AA = A; 105 | X = Returner1(AA)-A-1; Print(X); 106 | #endif 107 | UpperTriangularMatrix UT(31); 108 | for (i=1; i<=31; i++) for (j=i; j<=31; j++) UT(i,j) = i+j+(i-j)*(i-2*j); 109 | UpperBandMatrix UB(31,5); UB.Inject(UT); 110 | LowerTriangularMatrix LT = UT.t(); 111 | LowerBandMatrix LB(31,5); LB.Inject(LT); 112 | A = Returner0(UB)-LB.t(); Print(A); 113 | A = Returner2(UB).t()-LB*2; Print(A); 114 | A = Returner3(LB).t()-UB*3; Print(A); 115 | SymmetricMatrix SM; SM << (UT+LT); 116 | A = Returner4(SM)-UT-LT-4; Print(A); 117 | SymmetricBandMatrix SB(31,5); SB.Inject(SM); 118 | A = Returner5(SB)/5-UB-LB; Print(A); 119 | BandMatrix B = UB+LB*LB; A = LB; 120 | A = Returner6(B)/6 - UB - A*A; Print(A); 121 | DiagonalMatrix D; D << UT; 122 | D << (Returner7(D)/7 - UT); Print(D); 123 | 124 | // cout << "\nEnd of fifth test\n"; 125 | } 126 | -------------------------------------------------------------------------------- /MeshlessDeformations/resources/CVS/Entries: -------------------------------------------------------------------------------- 1 | /boldie.dcmesh/1.1/Thu Oct 13 07:45:11 2005// 2 | /duck.dcmesh/1.1/Thu Oct 13 07:45:12 2005// 3 | /sneakers.dcmesh/1.1/Thu Oct 13 07:45:12 2005// 4 | D 5 | -------------------------------------------------------------------------------- /MeshlessDeformations/resources/CVS/Entries.Extra: -------------------------------------------------------------------------------- 1 | /boldie.dcmesh////*/// 2 | /duck.dcmesh////*/// 3 | /sneakers.dcmesh////*/// 4 | -------------------------------------------------------------------------------- /MeshlessDeformations/resources/CVS/Entries.Extra.Old: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/MeshlessDeformations/resources/CVS/Entries.Extra.Old -------------------------------------------------------------------------------- /MeshlessDeformations/resources/CVS/Entries.Old: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/MeshlessDeformations/resources/CVS/Entries.Old -------------------------------------------------------------------------------- /MeshlessDeformations/resources/CVS/Repository: -------------------------------------------------------------------------------- 1 | shape-matching/src/resources 2 | -------------------------------------------------------------------------------- /MeshlessDeformations/resources/CVS/Root: -------------------------------------------------------------------------------- 1 | :ext:dflo006@chaos.cs.auckland.ac.nz:/afs/ec.auckland.ac.nz/course/compsci/compsci.715.c.s2.05/private/D2 2 | -------------------------------------------------------------------------------- /MeshlessDeformations/resources/CVS/Template: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/MeshlessDeformations/resources/CVS/Template -------------------------------------------------------------------------------- /MeshlessDeformationsReport.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/MeshlessDeformationsReport.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Meshless Deformations Based on Shape Matching 2 | ============================================= 3 | 4 | This C++ project was created for a graduate level computer science course at the [University of Auckland](https://www.cs.auckland.ac.nz/) back in 2005 (COMPSCI 715 S2 C - Advanced Computer Graphics). This was created by Daniel Weisser, Heiko Voigt, and myself. 5 | 6 | The source code contains bits of the [Irrlicht](http://irrlicht.sourceforge.net/) game engine, and some other maths libraries with attributions in the source code. 7 | 8 | [Read the project report](MeshlessDeformationsReport.pdf) to get more details about how this works. 9 | 10 | How to run 11 | ---------- 12 | 13 | You need Windows. This has been tested on Windows 8.1 only. Just run `MeshlessDeformations.exe` located in the `Debug` folder. 14 | 15 | How to build 16 | ------------ 17 | 18 | This has only been tested on Windows 8.1 64bit using Visual Studio 2013. You should be able to just build the solution from Visual Studio and then go to the Debug folder and run the exe. 19 | 20 | Note that this project has been constructed by someone who doesn't understand C++ well, nor how to build C++ projects, so it is not exactly production quality. 21 | 22 | Usage Instructions 23 | ------------------ 24 | 25 | This demo allows you to throw around and collide a number of deformable objects. 26 | 27 | To pick up an object, simply click and drag a particle with the left mouse button. When you click on an object, you can alter its alpha and beta values, which affect the way that object deforms. You can also change the elasticity, which affects how much energy is lost when that particle collides with other objects. Finally, you can turn the object on and off. 28 | 29 | When you start the program, there is only one object visible. To add more, click on an object name in the objects list, and tick the "show this object" checkbox. Most objects are meshless, but try showing the duck to see a meshed model. 30 | 31 | You can also alter global parameters, such as the force of gravity and the speed of time. If you slow time down to zero, you can move the particles around and see how the goal positions are affected by changing the parameters. You can also turn the goal positions on and off. 32 | 33 | Finally, you can select either basic, linear, or quadratic shape matching. 34 | 35 | Camera Controls 36 | --------------- 37 | 38 | Rotation: hold down the right mouse button and move the mouse. 39 | Zoom: hold down the left and right mouse buttons together and move the mouse up or down. 40 | Moving: hold down the middle button and move the mouse. 41 | 42 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/bin/Linux/readme.txt: -------------------------------------------------------------------------------- 1 | The Irrlicht Engine is a static lib under linux. A precomipled version can be 2 | found in \lib\Linux. 3 | 4 | If you wish to compile the engine in linux yourself, unzip the file source.zip 5 | file in the \source directory. Run a 'make' in the now existing new subfolder 'Irrlicht'. 6 | After this, you should be able to make all example applications in \examples. 7 | Then just start an X Server and run them, from the directory where they are. 8 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/bin/Win32-VisualStudio/2DGraphics.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/irrlicht-0.14.0/bin/Win32-VisualStudio/2DGraphics.exe -------------------------------------------------------------------------------- /irrlicht-0.14.0/bin/Win32-VisualStudio/Collision.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/irrlicht-0.14.0/bin/Win32-VisualStudio/Collision.exe -------------------------------------------------------------------------------- /irrlicht-0.14.0/bin/Win32-VisualStudio/CustomSceneNode.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/irrlicht-0.14.0/bin/Win32-VisualStudio/CustomSceneNode.exe -------------------------------------------------------------------------------- /irrlicht-0.14.0/bin/Win32-VisualStudio/Demo.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/irrlicht-0.14.0/bin/Win32-VisualStudio/Demo.exe -------------------------------------------------------------------------------- /irrlicht-0.14.0/bin/Win32-VisualStudio/ExampleApp.NET.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/irrlicht-0.14.0/bin/Win32-VisualStudio/ExampleApp.NET.exe -------------------------------------------------------------------------------- /irrlicht-0.14.0/bin/Win32-VisualStudio/HelloWorld.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/irrlicht-0.14.0/bin/Win32-VisualStudio/HelloWorld.exe -------------------------------------------------------------------------------- /irrlicht-0.14.0/bin/Win32-VisualStudio/HelloWorld_CSharp.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/irrlicht-0.14.0/bin/Win32-VisualStudio/HelloWorld_CSharp.exe -------------------------------------------------------------------------------- /irrlicht-0.14.0/bin/Win32-VisualStudio/HelloWorld_VBasic.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/irrlicht-0.14.0/bin/Win32-VisualStudio/HelloWorld_VBasic.exe -------------------------------------------------------------------------------- /irrlicht-0.14.0/bin/Win32-VisualStudio/Irrlicht.NET.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/irrlicht-0.14.0/bin/Win32-VisualStudio/Irrlicht.NET.dll -------------------------------------------------------------------------------- /irrlicht-0.14.0/bin/Win32-VisualStudio/Irrlicht.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/irrlicht-0.14.0/bin/Win32-VisualStudio/Irrlicht.dll -------------------------------------------------------------------------------- /irrlicht-0.14.0/bin/Win32-VisualStudio/MeshViewer.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/irrlicht-0.14.0/bin/Win32-VisualStudio/MeshViewer.exe -------------------------------------------------------------------------------- /irrlicht-0.14.0/bin/Win32-VisualStudio/Movement.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/irrlicht-0.14.0/bin/Win32-VisualStudio/Movement.exe -------------------------------------------------------------------------------- /irrlicht-0.14.0/bin/Win32-VisualStudio/PerPixelLighting.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/irrlicht-0.14.0/bin/Win32-VisualStudio/PerPixelLighting.exe -------------------------------------------------------------------------------- /irrlicht-0.14.0/bin/Win32-VisualStudio/Quake3Map.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/irrlicht-0.14.0/bin/Win32-VisualStudio/Quake3Map.exe -------------------------------------------------------------------------------- /irrlicht-0.14.0/bin/Win32-VisualStudio/RenderToTexture.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/irrlicht-0.14.0/bin/Win32-VisualStudio/RenderToTexture.exe -------------------------------------------------------------------------------- /irrlicht-0.14.0/bin/Win32-VisualStudio/Shaders.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/irrlicht-0.14.0/bin/Win32-VisualStudio/Shaders.exe -------------------------------------------------------------------------------- /irrlicht-0.14.0/bin/Win32-VisualStudio/SpecialFx.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/irrlicht-0.14.0/bin/Win32-VisualStudio/SpecialFx.exe -------------------------------------------------------------------------------- /irrlicht-0.14.0/bin/Win32-VisualStudio/TerrainRendering.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/irrlicht-0.14.0/bin/Win32-VisualStudio/TerrainRendering.exe -------------------------------------------------------------------------------- /irrlicht-0.14.0/bin/Win32-VisualStudio/UserInterface.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/irrlicht-0.14.0/bin/Win32-VisualStudio/UserInterface.exe -------------------------------------------------------------------------------- /irrlicht-0.14.0/bin/Win32-VisualStudio/Win32Window.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/irrlicht-0.14.0/bin/Win32-VisualStudio/Win32Window.exe -------------------------------------------------------------------------------- /irrlicht-0.14.0/bin/Win32-VisualStudio/irr.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/irrlicht-0.14.0/bin/Win32-VisualStudio/irr.ico -------------------------------------------------------------------------------- /irrlicht-0.14.0/bin/Win32-gcc/Irrlicht.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/irrlicht-0.14.0/bin/Win32-gcc/Irrlicht.dll -------------------------------------------------------------------------------- /irrlicht-0.14.0/bin/Win64-VisualStudio/readme.txt: -------------------------------------------------------------------------------- 1 | Sorry, I cannot provide procompiled binaries for Win64. 2 | Please goto the \source directory, unzip the source.zip file 3 | and compile them yourself, it will cost you about 3 minutes. :) -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/EDriverTypes.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __E_DRIVER_TYPES_H_INCLUDED__ 6 | #define __E_DRIVER_TYPES_H_INCLUDED__ 7 | 8 | namespace irr 9 | { 10 | namespace video 11 | { 12 | //! An enum for all types of drivers the Irrlicht Engine supports. 13 | enum E_DRIVER_TYPE 14 | { 15 | //! Null device, useful for applications to run the engine without visualisation. 16 | //! The null device is able to load textures, but does not render and display 17 | //! any graphics. 18 | EDT_NULL, 19 | 20 | //! The Irrlicht Engine Software renderer, runs on all platforms, 21 | //! with every hardware. It should only be used for 2d graphics, 22 | //! but it can also perform some primitive 3d functions. These 3d drawing 23 | //! functions are quite fast, but very inaccurate, and don't even support 24 | //! clipping in 3D mode. 25 | EDT_SOFTWARE, 26 | 27 | //! The Apfelbaum Software Renderer, an alternative software renderer for Irrlicht. 28 | //! Basically it can be described as the Irrlicht Software renderer on steroids. It rasterizes 29 | //! 3D geometry perfectly: It is able to perform correct 3d clipping, perspective 30 | //! correct texture mapping, perspective correct color mapping, and renders 31 | //! sub pixel correct, sub texel correct primitives. In addition, it does 32 | //! bilinear texel filtering and supports more materials than the EDT_SOFTWARE driver. 33 | //! This renderer has been written entirely by Thomas Alten, thanks a lot for this huge 34 | //! contribution. 35 | EDT_SOFTWARE2, 36 | 37 | //! Direct3D 8 device, only available on Win32 platforms including Win95, Win98, WinNT, 38 | //! Win2K, WinXP. Performs hardware accelerated rendering of 3D and 2D primitives. 39 | EDT_DIRECT3D8, 40 | 41 | //! Direct3D 9 device, only available on Win32 platforms including Win95, Win98, WinNT, 42 | //! Win2K, WinXP. Performs hardware accelerated rendering of 3D and 2D primitives. 43 | EDT_DIRECT3D9, 44 | 45 | //! OpenGL device, available on all Win32 platforms and on Linux. 46 | //! Performs hardware accelerated rendering of 3D and 2D primitives. 47 | EDT_OPENGL 48 | }; 49 | 50 | } // end namespace video 51 | } // end namespace irr 52 | 53 | 54 | #endif 55 | 56 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/EGUIElementTypes.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __E_GUI_ELEMENT_TYPES_H_INCLUDED__ 6 | #define __I_GUI_ELEMENT_TYPES_H_INCLUDED__ 7 | 8 | namespace irr 9 | { 10 | namespace gui 11 | { 12 | 13 | //! List of all basic Irrlicht GUI elements. 14 | /** An IGUIElement returns this when calling IGUIElement::getType(); */ 15 | enum EGUI_ELEMENT_TYPE 16 | { 17 | //! Unknown type. Use this when creating your own elements. 18 | EGUIET_ELEMENT = 0, 19 | 20 | //! A button (IGUIButton) 21 | EGUIET_BUTTON, 22 | 23 | //! A check box (IGUICheckBox) 24 | EGUIET_CHECK_BOX, 25 | 26 | //! A combo box (IGUIComboBox) 27 | EGUIET_COMBO_BOX, 28 | 29 | //! A context menu (IGUIContextMenu) 30 | EGUIET_CONTEXT_MENU, 31 | 32 | //! An edit box (IGUIEditBox) 33 | EGUIET_EDIT_BOX, 34 | 35 | //! A file open dialog (IGUIFileOpenDialog) 36 | EGUIET_FILE_OPEN_DIALOG, 37 | 38 | //! A in/out fader (IGUIInOutFader) 39 | EGUIET_IN_OUT_FADER, 40 | 41 | //! An image (IGUIImage) 42 | EGUIET_IMAGE, 43 | 44 | //! A list box (IGUIListBox) 45 | EGUIET_LIST_BOX, 46 | 47 | //! A mesh viewer (IGUIMeshViewer) 48 | EGUIET_MESH_VIEWER, 49 | 50 | //! A modal screen 51 | EGUIET_MODAL_SCREEN, 52 | 53 | //! A scroll bar (IGUIScrollBar) 54 | EGUIET_SCROLL_BAR, 55 | 56 | //! A static text (IGUIStaticText) 57 | EGUIET_STATIC_TEXT, 58 | 59 | //! A tab (IGUITab) 60 | EGUIET_TAB, 61 | 62 | //! A tab control 63 | EGUIET_TAB_CONTROL, 64 | 65 | //! A tool bar (IGUIToolBar) 66 | EGUIET_TOOL_BAR, 67 | 68 | //! A window 69 | EGUIET_WINDOW, 70 | 71 | //! Not an element, amount of elements in there 72 | EGUIET_COUNT 73 | }; 74 | 75 | 76 | } // end namespace gui 77 | } // end namespace irr 78 | 79 | #endif 80 | 81 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IAnimatedMesh.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_ANIMATED_MESH_H_INCLUDED__ 6 | #define __I_ANIMATED_MESH_H_INCLUDED__ 7 | 8 | #include "IUnknown.h" 9 | #include "IMesh.h" 10 | #include "matrix4.h" 11 | 12 | namespace irr 13 | { 14 | namespace scene 15 | { 16 | enum E_ANIMATED_MESH_TYPE 17 | { 18 | //! Unknown animated mesh type. 19 | EAMT_UNKNOWN = 0, 20 | 21 | //! Quake 2 MD2 model file 22 | EAMT_MD2, 23 | 24 | //! Milkshape 3d skeletal animation file 25 | EAMT_MS3D, 26 | 27 | //! Maya .obj not animated model 28 | EAMT_OBJ, 29 | 30 | //! Quake 3 .bsp Map, not animated 31 | EAMT_BSP, 32 | 33 | //! 3D Studio .3ds file 34 | EAMT_3DS, 35 | 36 | //! Microsoft Direct3D .x-file. Can contain static and skeletal animated 37 | //! skinned meshes. This is the standard and best supported 38 | //! format of the Irrlicht Engine. 39 | EAMT_X, 40 | 41 | //! My3D Mesh, the file format by Zhuck Dimitry 42 | EAMT_MY3D, 43 | 44 | //! Pulsar LMTools (.lmts) file. The Irrlicht loader for this was written by 45 | //! Jonas Petersen 46 | EAMT_LMTS, 47 | 48 | //! Cartography Shop .csm file. The loader for this was created by Saurav Mohapatra. 49 | EAMT_CSM, 50 | 51 | //! .oct file for Paul Nette's FSRad or from Murphy McCauley's Blender .oct exporter. 52 | //! The oct file format contains 3D geometry and lightmaps and can 53 | //! be loaded directly by Irrlicht 54 | EAMTS_OCT 55 | }; 56 | 57 | //! Interface for an animated mesh. 58 | /** There are already simple implementations of this interface available so 59 | you don't have to implement this interface on your own if you need to: 60 | You might want to use irr::scene::SAnimatedMesh, irr::scene::SMesh, 61 | irr::scene::SMeshBuffer etc. */ 62 | class IAnimatedMesh : public IUnknown 63 | { 64 | public: 65 | 66 | //! destructor 67 | virtual ~IAnimatedMesh() {}; 68 | 69 | //! Gets the frame count of the animated mesh. 70 | /** \return Returns the amount of frames. If the amount is 1, it is a 71 | static, non animated mesh. */ 72 | virtual s32 getFrameCount() = 0; 73 | 74 | //! Returns the IMesh interface for a frame. 75 | /** \param frame: Frame number as zero based index. The maximum frame number is 76 | getFrameCount() - 1; 77 | \param detailLevel: Level of detail. 0 is the lowest, 78 | 255 the highest level of detail. Most meshes will ignore the detail level. 79 | \param startFrameLoop: Because some animated meshes (.MD2) are blended between 2 80 | static frames, and maybe animated in a loop, the startFrameLoop and the endFrameLoop 81 | have to be defined, to prevent the animation to be blended between frames which are 82 | outside of this loop. 83 | If startFrameLoop and endFrameLoop are both -1, they are ignored. 84 | \param endFrameLoop: see startFrameLoop. 85 | \return Returns the animated mesh based on a detail level. */ 86 | virtual IMesh* getMesh(s32 frame, s32 detailLevel=255, s32 startFrameLoop=-1, s32 endFrameLoop=-1) = 0; 87 | 88 | //! Returns an axis aligned bounding box of the mesh. 89 | /** \return A bounding box of this mesh is returned. */ 90 | virtual const core::aabbox3d& getBoundingBox() const = 0; 91 | 92 | //! Returns the type of the animated mesh. 93 | /** In most cases it is not neccessary to use this method. 94 | This is useful for making a save downcast, for example 95 | if getMeshType() returns EAMT_MD2, its save to cast the 96 | IAnimatedMesh to IAnimatedMeshMD2. 97 | \returns Type of the mesh. */ 98 | virtual E_ANIMATED_MESH_TYPE getMeshType() const 99 | { 100 | return EAMT_UNKNOWN; 101 | } 102 | }; 103 | 104 | } // end namespace scene 105 | } // end namespace irr 106 | 107 | #endif 108 | 109 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IAnimatedMeshMD2.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_ANIMATED_MESH_MD2_H_INCLUDED__ 6 | #define __I_ANIMATED_MESH_MD2_H_INCLUDED__ 7 | 8 | #include "IAnimatedMesh.h" 9 | 10 | namespace irr 11 | { 12 | namespace scene 13 | { 14 | 15 | //! Types of standard md2 animations 16 | enum EMD2_ANIMATION_TYPE 17 | { 18 | EMAT_STAND = 0, 19 | EMAT_RUN, 20 | EMAT_ATTACK, 21 | EMAT_PAIN_A, 22 | EMAT_PAIN_B, 23 | EMAT_PAIN_C, 24 | EMAT_JUMP, 25 | EMAT_FLIP, 26 | EMAT_SALUTE, 27 | EMAT_FALLBACK, 28 | EMAT_WAVE, 29 | EMAT_POINT, 30 | EMAT_CROUCH_STAND, 31 | EMAT_CROUCH_WALK, 32 | EMAT_CROUCH_ATTACK, 33 | EMAT_CROUCH_PAIN, 34 | EMAT_CROUCH_DEATH, 35 | EMAT_DEATH_FALLBACK, 36 | EMAT_DEATH_FALLFORWARD, 37 | EMAT_DEATH_FALLBACKSLOW, 38 | EMAT_BOOM, 39 | 40 | //! Not an animation, but amount of animation types. 41 | EMAT_COUNT 42 | }; 43 | 44 | //! Interface for using some special functions of MD2 meshes 45 | class IAnimatedMeshMD2 : public IAnimatedMesh 46 | { 47 | public: 48 | 49 | //! Returns frame loop data for a default MD2 animation type. 50 | //! \Returns Returns the beginframe, endframe and frames per 51 | //! second for a default MD2 animation type. 52 | virtual void getFrameLoop(EMD2_ANIMATION_TYPE l, s32& outBegin, 53 | s32& outEnd, s32& outFPS) const = 0; 54 | 55 | //! Returns frame loop data for a special MD2 animation type, identified 56 | //! by a string. 57 | //! \Returns Returns the beginframe, endframe and frames per 58 | //! second for a special MD2 animation type. 59 | virtual bool getFrameLoop(const c8* name, 60 | s32& outBegin, s32& outEnd, s32& outFps) const = 0; 61 | 62 | //! Returns amount of md2 animations in this file. 63 | virtual s32 getAnimationCount() const = 0; 64 | 65 | //! Returns name of md2 animation. 66 | //! \param nr: Zero based index of animation. 67 | virtual const c8* getAnimationName(s32 nr) const = 0; 68 | 69 | }; 70 | 71 | } // end namespace scene 72 | } // end namespace irr 73 | 74 | #endif 75 | 76 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IAnimatedMeshMS3D.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_ANIMATED_MESH_MS3D_H_INCLUDED__ 6 | #define __I_ANIMATED_MESH_MS3D_H_INCLUDED__ 7 | 8 | #include "IAnimatedMesh.h" 9 | 10 | namespace irr 11 | { 12 | namespace scene 13 | { 14 | //! Interface for using some special functions of MS3D meshes 15 | class IAnimatedMeshMS3D : public IAnimatedMesh 16 | { 17 | public: 18 | 19 | //! Returns a pointer to a transformation matrix of a part of the 20 | //! mesh based on a frame time. This is used for being able to attach 21 | //! objects to parts of animated meshes. For example a weapon to an animated 22 | //! hand. 23 | //! \param jointNumber: Zero based index of joint. The last joint has the number 24 | //! IAnimatedMeshMS3D::getJointCount()-1; 25 | //! \param frame: Frame of the animation. 26 | //! \return Returns a pointer to the matrix of the mesh part or 27 | //! null if an error occured. 28 | virtual core::matrix4* getMatrixOfJoint(s32 jointNumber, s32 frame) = 0; 29 | 30 | //! Gets joint count. 31 | //! \return Returns amount of joints in the skeletal animated mesh. 32 | virtual s32 getJointCount() const = 0; 33 | 34 | //! Gets the name of a joint. 35 | //! \param number: Zero based index of joint. The last joint has the number 36 | //! IAnimatedMeshMS3D::getJointCount()-1; 37 | //! \return Returns name of joint and null if an error happened. 38 | virtual const c8* getJointName(s32 number) const = 0; 39 | 40 | //! Gets a joint number from its name 41 | //! \param name: Name of the joint. 42 | //! \return Returns the number of the joint or -1 if not found. 43 | virtual s32 getJointNumber(const c8* name) const = 0; 44 | 45 | }; 46 | 47 | } // end namespace scene 48 | } // end namespace irr 49 | 50 | #endif 51 | 52 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IAnimatedMeshX.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_ANIMATED_MESH_X_H_INCLUDED__ 6 | #define __I_ANIMATED_MESH_X_H_INCLUDED__ 7 | 8 | #include "IAnimatedMesh.h" 9 | 10 | namespace irr 11 | { 12 | namespace scene 13 | { 14 | //! Interface for using some special functions of X meshes 15 | class IAnimatedMeshX : public IAnimatedMesh 16 | { 17 | public: 18 | 19 | //! Returns a pointer to a transformation matrix of a part of the 20 | //! mesh based on a frame time. This is used for being able to attach 21 | //! objects to parts of animated meshes. For example a weapon to an animated 22 | //! hand. 23 | //! \param jointNumber: Zero based index of joint. The last joint has the number 24 | //! IAnimatedMeshX::getJointCount()-1; 25 | //! \param frame: Frame of the animation. 26 | //! \return Returns a pointer to the matrix of the mesh part or 27 | //! null if an error occured. 28 | virtual core::matrix4* getMatrixOfJoint(s32 jointNumber, s32 frame) = 0; 29 | 30 | //! Gets joint count. 31 | //! \return Returns amount of joints in the skeletal animated mesh. 32 | virtual s32 getJointCount() const = 0; 33 | 34 | //! Gets the name of a joint. 35 | //! \param number: Zero based index of joint. The last joint has the number 36 | //! IAnimatedMeshX::getJointCount()-1; 37 | //! \return Returns name of joint and null if an error happened. 38 | virtual const c8* getJointName(s32 number) const = 0; 39 | 40 | //! Gets a joint number from its name 41 | //! \param name: Name of the joint. 42 | //! \return Returns the number of the joint or -1 if not found. 43 | virtual s32 getJointNumber(const c8* name) const = 0; 44 | 45 | //! Returns a pointer to list of points containing the skeleton. 46 | //! Draw a line between point 1 and 2, and 3 and 4 and 5 and 6 47 | //! and so on to visualize this. Only for debug purposes. If you 48 | //! use an .x-File with the IAnimatedMeshSceneNode and turn DebugDataVisible 49 | //! to true, the Scene node will visualize the skeleton using this 50 | //! method. 51 | virtual const core::array* getDrawableSkeleton(s32 frame) = 0; 52 | 53 | //! Returns amount of animations in .X-file. 54 | virtual s32 getAnimationCount() const = 0; 55 | 56 | //! Returns the name of an animation. 57 | //! \param idx: Zero based Index of the animation. Must be a value between 58 | //! 0 and getAnimationCount()-1; 59 | //! \return Returns pointer to the string of the name of the animation. 60 | //! Returns 0 if an animation with this index does not exist. 61 | virtual const c8* getAnimationName(s32 idx) const = 0; 62 | 63 | //! Sets an animation as animation to play back. 64 | //! \param idx: Zero based Index of the animation. Must be a value between 65 | //! 0 and getAnimationCount()-1; 66 | virtual void setCurrentAnimation(s32 idx) = 0; 67 | 68 | //! Sets an animation as animation to play back. 69 | //! \param name: Name of the animtion. 70 | //! \return Returns true if successful, and false if the specified animation 71 | //! does not exist. 72 | virtual bool setCurrentAnimation(const c8* name) = 0; 73 | }; 74 | 75 | } // end namespace scene 76 | } // end namespace irr 77 | 78 | #endif 79 | 80 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IBillboardSceneNode.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_BILLBOARD_SCENE_NODE_H_INCLUDED__ 6 | #define __I_BILLBOARD_SCENE_NODE_H_INCLUDED__ 7 | 8 | #include "ISceneNode.h" 9 | 10 | namespace irr 11 | { 12 | namespace scene 13 | { 14 | 15 | //! A billboard scene node. 16 | /** A billboard is like a 3d sprite: A 2d element, 17 | which always looks to the camera. It is usually used for explosions, fire, 18 | lensflares, particles and things like that. 19 | */ 20 | class IBillboardSceneNode : public ISceneNode 21 | { 22 | public: 23 | 24 | //! constructor 25 | IBillboardSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, 26 | const core::vector3df& position = core::vector3df(0,0,0)) 27 | : ISceneNode(parent, mgr, id, position) {} 28 | 29 | //! Sets the size of the billboard. 30 | virtual void setSize(const core::dimension2d& size) = 0; 31 | 32 | //! Returns the size of the billboard. 33 | virtual const core::dimension2d& getSize() = 0; 34 | }; 35 | 36 | } // end namespace scene 37 | } // end namespace irr 38 | 39 | 40 | #endif 41 | 42 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/ICursorControl.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_CURSOR_CONTROL_H_INCLUDED__ 6 | #define __I_CURSOR_CONTROL_H_INCLUDED__ 7 | 8 | #include "position2d.h" 9 | #include "IUnknown.h" 10 | #include "irrTypes.h" 11 | 12 | namespace irr 13 | { 14 | namespace gui 15 | { 16 | 17 | //! Interface to manipulate the mouse cursor. 18 | class ICursorControl : public IUnknown 19 | { 20 | public: 21 | 22 | //! Changes the visible state of the mouse cursor. 23 | /** \param visible: The new visible state. If true, the cursor will be visible, 24 | if false, it will be invisible. */ 25 | virtual void setVisible(bool visible) = 0; 26 | 27 | //! Returns if the cursor is currently visible. 28 | /** \return Returns true if the cursor is visible, false if not. */ 29 | virtual bool isVisible() = 0; 30 | 31 | //! Sets the new position of the cursor. 32 | /** \param pos: New position of the cursor. The position must be between 33 | (0.0f, 0.0f) and (1.0f, 1.0f), where (0.0f, 0.0f) is 34 | the top left corner and (1.0f, 1.0f) is the bottom right corner of the 35 | render window. */ 36 | virtual void setPosition(const core::position2d &pos) = 0; 37 | 38 | //! Sets the new position of the cursor. 39 | /** \param pos: New position of the cursor. The position must be between 40 | (0.0f, 0.0f) and (1.0f, 1.0f), where (0.0f, 0.0f) is 41 | the top left corner and (1.0f, 1.0f) is the bottom right corner of the 42 | render window. */ 43 | virtual void setPosition(f32 x, f32 y) = 0; 44 | 45 | //! Sets the new position of the cursor. 46 | /** \param pos: New position of the cursor. The coordinates are pixel units. */ 47 | virtual void setPosition(const core::position2d &pos) = 0; 48 | 49 | //! Sets the new position of the cursor. 50 | /** \param pos: New position of the cursor. The coordinates are pixel units. */ 51 | virtual void setPosition(s32 x, s32 y) = 0; 52 | 53 | //! Returns the current position of the mouse cursor. 54 | /** \return Returns the current position of the cursor. The returned position 55 | is the position of the mouse cursor in pixel units. */ 56 | virtual core::position2d getPosition() = 0; 57 | 58 | //! Returns the current position of the mouse cursor. 59 | /** \return Returns the current position of the cursor. The returned position 60 | is a value between (0.0f, 0.0f) and (1.0f, 1.0f), where (0.0f, 0.0f) is 61 | the top left corner and (1.0f, 1.0f) is the bottom right corner of the 62 | render window. */ 63 | virtual core::position2d getRelativePosition() = 0; 64 | }; 65 | 66 | 67 | } // end namespace gui 68 | } // end namespace irr 69 | 70 | #endif 71 | 72 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IDummyTransformationSceneNode.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_DUMMY_TRANSFORMATION_SCENE_NODE_H_INCLUDED__ 6 | #define __I_DUMMY_TRANSFORMATION_SCENE_NODE_H_INCLUDED__ 7 | 8 | #include "ISceneNode.h" 9 | 10 | namespace irr 11 | { 12 | namespace scene 13 | { 14 | 15 | //! Dummy scene node for adding additional transformations to the scene graph. 16 | /** This scene node does not render itself, and does not respond to set/getPosition, 17 | set/getRotation and set/getScale. Its just a simple scene node that takes a 18 | matrix as relative transformation, making it possible to insert any transformation 19 | anywhere into the scene graph. 20 | This scene node is for example used by the IAnimatedMeshSceneNode for emulating 21 | joint scene nodes when playing skeletal animations. 22 | */ 23 | class IDummyTransformationSceneNode : public ISceneNode 24 | { 25 | public: 26 | 27 | //! constructor 28 | IDummyTransformationSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id) 29 | : ISceneNode(parent, mgr, id) {} 30 | 31 | //! Returns a reference to the current relative transformation matrix. 32 | //! This is the matrix, this scene node uses instead of scale, translation 33 | //! and rotation. 34 | virtual core::matrix4& getRelativeTransformationMatrix() = 0; 35 | }; 36 | 37 | } // end namespace scene 38 | } // end namespace irr 39 | 40 | 41 | #endif 42 | 43 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IFileList.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_FILE_LIST_H_INCLUDED__ 6 | #define __I_FILE_LIST_H_INCLUDED__ 7 | 8 | #include "IUnknown.h" 9 | 10 | namespace irr 11 | { 12 | namespace io 13 | { 14 | 15 | //! The Filelist lists all files in a directory. 16 | class IFileList : public IUnknown 17 | { 18 | public: 19 | 20 | //! destructor 21 | virtual ~IFileList() {}; 22 | 23 | //! Returns the amount of files in the filelist. 24 | //! \return 25 | //! Returns the amount of files and directories in the file list. 26 | virtual s32 getFileCount() = 0; 27 | 28 | //! Gets the name of a file in the list, based on an index. 29 | //! The path is not included in this name. Use getFullFileName for this. 30 | //! \param index is the zero based index of the file which name should 31 | //! be returned. The index has to be smaller than the amount getFileCount() returns. 32 | //! \return 33 | //! Returns the file name of the file. Returns 0, if an error occured. 34 | virtual const c8* getFileName(s32 index) = 0; 35 | 36 | //! Gets the full name of a file in the list, path included, based on an index. 37 | //! \param index is the zero based index of the file which name should 38 | //! be returned. The index has to be smaller than the amount getFileCount() returns. 39 | //! \return 40 | //! Returns the file name of the file. Returns 0, if an error occured. 41 | virtual const c8* getFullFileName(s32 index) = 0; 42 | 43 | //! Returns of the file is a directory 44 | //! \param 45 | //! index is the zero based index of the file which name should 46 | //! be returned. The index has to be smaller than the amount getFileCount() returns. 47 | //! \return 48 | //! Returns true, if the file is a directory, and false, if it is not. 49 | //! If an error occurs, the result is undefined. 50 | virtual bool isDirectory(s32 index) = 0; 51 | }; 52 | 53 | } // end namespace irr 54 | } // end namespace io 55 | 56 | 57 | #endif 58 | 59 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IGUIButton.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_GUI_BUTTON_H_INCLUDED__ 6 | #define __I_GUI_BUTTON_H_INCLUDED__ 7 | 8 | #include "IGUIElement.h" 9 | 10 | namespace irr 11 | { 12 | 13 | namespace video 14 | { 15 | class ITexture; 16 | } 17 | 18 | namespace gui 19 | { 20 | class IGUIFont; 21 | 22 | //! GUI Button interface. 23 | class IGUIButton : public IGUIElement 24 | { 25 | public: 26 | 27 | //! constructor 28 | IGUIButton(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect rectangle) 29 | : IGUIElement(EGUIET_BUTTON, environment, parent, id, rectangle) {} 30 | 31 | //! destructor 32 | ~IGUIButton() {}; 33 | 34 | //! Sets another skin independent font. 35 | /** If this is set to zero, the button uses the font of the skin. 36 | \param font: New font to set. */ 37 | virtual void setOverrideFont(IGUIFont* font=0) = 0; 38 | 39 | //! Sets an image which should be displayed on the button when it is in normal state. 40 | /** \param image: Image to be displayed */ 41 | virtual void setImage(video::ITexture* image) = 0; 42 | 43 | //! Sets an image which should be displayed on the button when it is in normal state. 44 | /** \param image: Texture containing the image to be displayed 45 | \param rect: Position in the texture, where the image is located */ 46 | virtual void setImage(video::ITexture* image, const core::rect& pos) = 0; 47 | 48 | //! Sets an image which should be displayed on the button when it is in pressed state. 49 | /** If no images is specified for the pressed state via 50 | setPressedImage(), this image is also drawn in pressed state. 51 | \param image: Image to be displayed */ 52 | virtual void setPressedImage(video::ITexture* image) = 0; 53 | 54 | //! Sets an image which should be displayed on the button when it is in pressed state. 55 | /** \param image: Texture containing the image to be displayed 56 | \param rect: Position in the texture, where the image is located */ 57 | virtual void setPressedImage(video::ITexture* image, const core::rect& pos) = 0; 58 | 59 | //! Sets if the button should behave like a push button. 60 | /** Which means it can be in two states: Normal or Pressed. With a click on the button, 61 | the user can change the state of the button. */ 62 | virtual void setIsPushButton(bool isPushButton) = 0; 63 | 64 | //! Sets the pressed state of the button if this is a pushbutton 65 | virtual void setPressed(bool pressed) = 0; 66 | 67 | //! Returns if the button is currently pressed 68 | virtual bool isPressed() = 0; 69 | 70 | //! Sets if the alpha channel should be used for drawing images on the button (default is false) 71 | virtual void setUseAlphaChannel(bool useAlphaChannel) = 0; 72 | 73 | //! Returns if the alpha channel should be used for drawing images on the button 74 | virtual bool getUseAlphaChannel() = 0; 75 | }; 76 | 77 | 78 | } // end namespace gui 79 | } // end namespace irr 80 | 81 | #endif 82 | 83 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IGUICheckBox.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_GUI_CHECKBOX_H_INCLUDED__ 6 | #define __I_GUI_CHECKBOX_H_INCLUDED__ 7 | 8 | #include "IGUIElement.h" 9 | 10 | namespace irr 11 | { 12 | namespace gui 13 | { 14 | 15 | //! GUI Check box interface. 16 | class IGUICheckBox : public IGUIElement 17 | { 18 | public: 19 | 20 | //! constructor 21 | IGUICheckBox(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect rectangle) 22 | : IGUIElement(EGUIET_CHECK_BOX, environment, parent, id, rectangle) {} 23 | 24 | //! destructor 25 | ~IGUICheckBox() {}; 26 | 27 | //! Set if box is checked. 28 | virtual void setChecked(bool checked) = 0; 29 | 30 | //! Returns true if box is checked. 31 | virtual bool isChecked() = 0; 32 | }; 33 | 34 | } // end namespace gui 35 | } // end namespace irr 36 | 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IGUIComboBox.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_GUI_COMBO_BOX_H_INCLUDED__ 6 | #define __I_GUI_COMBO_BOX_H_INCLUDED__ 7 | 8 | #include "IGUIElement.h" 9 | 10 | namespace irr 11 | { 12 | namespace gui 13 | { 14 | //! Single line edit box for editing simple text. 15 | class IGUIComboBox : public IGUIElement 16 | { 17 | public: 18 | 19 | //! constructor 20 | IGUIComboBox(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect rectangle) 21 | : IGUIElement(EGUIET_COMBO_BOX, environment, parent, id, rectangle) {} 22 | 23 | //! destructor 24 | ~IGUIComboBox() {}; 25 | 26 | //! Returns amount of items in box 27 | virtual s32 getItemCount() = 0; 28 | 29 | //! returns string of an item. the idx may be a value from 0 to itemCount-1 30 | virtual const wchar_t* getItem(s32 idx) = 0; 31 | 32 | //! adds an item and returns the index of it 33 | virtual s32 addItem(const wchar_t* text) = 0; 34 | 35 | //! deletes all items in the combo box 36 | virtual void clear() = 0; 37 | 38 | //! returns id of selected item. returns -1 if no item is selected. 39 | virtual s32 getSelected() = 0; 40 | 41 | //! sets the selected item. Set this to -1 if no item should be selected 42 | virtual void setSelected(s32 id) = 0; 43 | 44 | }; 45 | 46 | 47 | } // end namespace gui 48 | } // end namespace irr 49 | 50 | #endif 51 | 52 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IGUIContextMenu.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_GUI_CONTEXT_MENU_H_INCLUDED__ 6 | #define __I_GUI_CONTEXT_MENU_H_INCLUDED__ 7 | 8 | #include "IGUIElement.h" 9 | 10 | namespace irr 11 | { 12 | namespace gui 13 | { 14 | 15 | //! GUI Context menu interface. 16 | class IGUIContextMenu : public IGUIElement 17 | { 18 | public: 19 | 20 | //! constructor 21 | IGUIContextMenu(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect rectangle) 22 | : IGUIElement(EGUIET_CONTEXT_MENU, environment, parent, id, rectangle) {} 23 | 24 | //! destructor 25 | ~IGUIContextMenu() {}; 26 | 27 | //! Returns amount of menu items 28 | virtual s32 getItemCount() const = 0; 29 | 30 | //! Adds a menu item. 31 | /** \param text: Text of menu item. Set this to 0 to create 32 | an separator instead of a real item, which is the same like 33 | calling addSeparator(); 34 | \param commandId: Command id of menu item, a simple id you may 35 | set to whatever you want. 36 | \param enabled: Specifies if the menu item should be enabled. 37 | \param hasSubMenu: Set this to true if there should be a submenu 38 | at this item. You can acess this submenu via getSubMenu(). 39 | \return Returns the index of the new item */ 40 | virtual s32 addItem(const wchar_t* text, s32 commandId=-1, bool enabled=true, 41 | bool hasSubMenu=false) = 0; 42 | 43 | //! Adds a separator item to the menu 44 | virtual void addSeparator() = 0; 45 | 46 | //! Returns text of the menu item. 47 | /** \param idx: Zero based index of the menu item */ 48 | virtual const wchar_t* getItemText(s32 idx) = 0; 49 | 50 | //! Sets text of the menu item. 51 | /** \param idx: Zero based index of the menu item 52 | \param text: New text of the item. */ 53 | virtual void setItemText(s32 idx, const wchar_t* text) = 0; 54 | 55 | //! Returns if a menu item is enabled 56 | /** \param idx: Zero based index of the menu item */ 57 | virtual bool isItemEnabled(s32 idx) = 0; 58 | 59 | //! Sets if the menu item should be enabled. 60 | /** \param idx: Zero based index of the menu item 61 | \param enabled: True if it is enabled, otherwise false. */ 62 | virtual void setItemEnabled(s32 idx, bool enabled) = 0; 63 | 64 | //! Removes a menu item 65 | /** \param idx: Zero based index of the menu item */ 66 | virtual void removeItem(s32 idx) = 0; 67 | 68 | //! Removes all menu items 69 | virtual void removeAllItems() = 0; 70 | 71 | //! Returns the selected item in the menu 72 | /** \return Index of the selected item, -1 if none selected. */ 73 | virtual s32 getSelectedItem() = 0; 74 | 75 | //! Returns command id of a menu item 76 | /** \param idx: Zero based index of the menu item */ 77 | virtual s32 getItemCommandId(s32 idx) = 0; 78 | 79 | //! Sets the command id of a menu item 80 | /** \param idx: Zero based index of the menu item 81 | \param id: Command id of menu item, a simple id you may 82 | set to whatever you want. */ 83 | virtual void setItemCommandId(s32 idx, s32 id) = 0; 84 | 85 | //! \return Returns a pointer to the submenu of an item. 86 | /** 0 is returned if there is no submenu 87 | \param idx: Zero based index of the menu item */ 88 | virtual IGUIContextMenu* getSubMenu(s32 idx) = 0; 89 | }; 90 | 91 | } // end namespace gui 92 | } // end namespace irr 93 | 94 | #endif 95 | 96 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IGUIEditBox.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_GUI_EDIT_BOX_H_INCLUDED__ 6 | #define __I_GUI_EDIT_BOX_H_INCLUDED__ 7 | 8 | #include "IGUIElement.h" 9 | #include "SColor.h" 10 | 11 | namespace irr 12 | { 13 | namespace gui 14 | { 15 | class IGUIFont; 16 | 17 | //! Single line edit box for editing simple text. 18 | class IGUIEditBox : public IGUIElement 19 | { 20 | public: 21 | 22 | //! constructor 23 | IGUIEditBox(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect rectangle) 24 | : IGUIElement(EGUIET_EDIT_BOX, environment, parent, id, rectangle) {} 25 | 26 | //! destructor 27 | ~IGUIEditBox() {}; 28 | 29 | //! Sets another skin independent font. 30 | /** If this is set to zero, the button uses the font of the skin. 31 | \param font: New font to set. */ 32 | virtual void setOverrideFont(IGUIFont* font=0) = 0; 33 | 34 | //! Sets another color for the text. 35 | /** If set, the edit box does not use the EGDC_BUTTON_TEXT color defined 36 | in the skin, but the set color instead. You don't need to call 37 | IGUIEditBox::enableOverrrideColor(true) after this, this is done 38 | by this function. 39 | If you set a color, and you want the text displayed with the color 40 | of the skin again, call IGUIEditBox::enableOverrideColor(false); 41 | \param color: New color of the text. */ 42 | virtual void setOverrideColor(video::SColor color) = 0; 43 | 44 | //! Sets if the text should use the overide color or the color in the gui skin. 45 | /** \param enable: If set to true, the override color, which can be set 46 | with IGUIEditBox::setOverrideColor is used, otherwise the 47 | EGDC_BUTTON_TEXT color of the skin. */ 48 | virtual void enableOverrideColor(bool enable) = 0; 49 | 50 | //! Sets the maximum amount of characters which may be entered in the box. 51 | /** \param max: Maximum amount of characters. If 0, the character amount is 52 | infinity. */ 53 | virtual void setMax(s32 max) = 0; 54 | 55 | //! Returns maximum amount of characters, previously set by setMax(); 56 | virtual s32 getMax() = 0; 57 | }; 58 | 59 | 60 | } // end namespace gui 61 | } // end namespace irr 62 | 63 | #endif 64 | 65 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IGUIFileOpenDialog.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_GUI_FILE_OPEN_DIALOG_H_INCLUDED__ 6 | #define __I_GUI_FILE_OPEN_DIALOG_H_INCLUDED__ 7 | 8 | #include "IGUIElement.h" 9 | 10 | namespace irr 11 | { 12 | namespace gui 13 | { 14 | 15 | //! Standard file chooser dialog. 16 | class IGUIFileOpenDialog : public IGUIElement 17 | { 18 | public: 19 | 20 | //! constructor 21 | IGUIFileOpenDialog(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect rectangle) 22 | : IGUIElement(EGUIET_FILE_OPEN_DIALOG, environment, parent, id, rectangle) {} 23 | 24 | //! destructor 25 | virtual ~IGUIFileOpenDialog() {}; 26 | 27 | //! Returns the filename of the selected file. Returns NULL, if no file was selected. 28 | virtual const wchar_t* getFilename() = 0; 29 | 30 | }; 31 | 32 | 33 | } // end namespace gui 34 | } // end namespace irr 35 | 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IGUIFont.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_GUI_FONT_H_INCLUDED__ 6 | #define __I_GUI_FONT_H_INCLUDED__ 7 | 8 | #include "IUnknown.h" 9 | #include "rect.h" 10 | #include "irrTypes.h" 11 | #include "SColor.h" 12 | 13 | namespace irr 14 | { 15 | namespace gui 16 | { 17 | 18 | //! Font interface. 19 | class IGUIFont : public IUnknown 20 | { 21 | public: 22 | 23 | //! Destructor 24 | virtual ~IGUIFont() {}; 25 | 26 | //! Draws an text and clips it to the specified rectangle if wanted. 27 | /** \param text: Text to draw 28 | \param position: Rectangle specifying position where to draw the text. 29 | \param color: Color of the text 30 | \param hcenter: Specifiies if the text should be centered horizontally into the rectangle. 31 | \param vcenter: Specifiies if the text should be centered vertically into the rectangle. 32 | \param clip: Optional pointer to a rectalgle against which the text will be clipped. 33 | If the pointer is null, no clipping will be done. */ 34 | virtual void draw(const wchar_t* text, const core::rect& position, 35 | video::SColor color, bool hcenter=false, bool vcenter=false, 36 | const core::rect* clip=0) = 0; 37 | 38 | //! Calculates the dimension of a text. 39 | /** \return Returns width and height of the area covered by the text if it would be 40 | drawn. */ 41 | virtual core::dimension2d getDimension(const wchar_t* text) = 0; 42 | 43 | //! Calculates the index of the character in the text which is on a specific position. 44 | /** \param text: Text string. 45 | \param pixel_x: X pixel position of which the index of the character will be returned. 46 | \return Returns zero based index of the character in the text, and -1 if no no character 47 | is on this position. (=the text is too short). */ 48 | virtual s32 getCharacterFromPos(const wchar_t* text, s32 pixel_x) = 0; 49 | }; 50 | 51 | } // end namespace gui 52 | } // end namespace irr 53 | 54 | #endif 55 | 56 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IGUIImage.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_GUI_IMAGE_H_INCLUDED__ 6 | #define __I_GUI_IMAGE_H_INCLUDED__ 7 | 8 | #include "IGUIElement.h" 9 | #include "ITexture.h" 10 | 11 | namespace irr 12 | { 13 | namespace gui 14 | { 15 | 16 | //! GUI element displaying an image. 17 | class IGUIImage : public IGUIElement 18 | { 19 | public: 20 | 21 | //! constructor 22 | IGUIImage(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect rectangle) 23 | : IGUIElement(EGUIET_IMAGE, environment, parent, id, rectangle) {} 24 | 25 | //! destructor 26 | ~IGUIImage() {}; 27 | 28 | //! sets an image 29 | virtual void setImage(video::ITexture* image) = 0; 30 | 31 | //! sets if the image should use its alpha channel to draw itself 32 | virtual void setUseAlphaChannel(bool use) = 0; 33 | }; 34 | 35 | 36 | } // end namespace gui 37 | } // end namespace irr 38 | 39 | #endif 40 | 41 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IGUIInOutFader.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_GUI_IN_OUT_FADER_H_INCLUDED__ 6 | #define __I_GUI_IN_OUT_FADER_H_INCLUDED__ 7 | 8 | #include "IGUIElement.h" 9 | #include "SColor.h" 10 | 11 | namespace irr 12 | { 13 | namespace gui 14 | { 15 | 16 | //! Element for fading out or in 17 | /** Here is a small example on how the class is used. In this example we fade 18 | in from a total red screen in the beginning. As you can see, the fader is not 19 | only useful for dramatic in and out fading, but also to show that the player 20 | is hit in a first person shooter game for example. 21 | \code 22 | gui::IGUIInOutFader* fader = device->getGUIEnvironment()->addInOutFader(); 23 | fader->setColor(video::SColor(0,255,0,0)); 24 | fader->fadeIn(4000); 25 | \endcode 26 | */ 27 | class IGUIInOutFader : public IGUIElement 28 | { 29 | public: 30 | 31 | //! constructor 32 | IGUIInOutFader(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect rectangle) 33 | : IGUIElement(EGUIET_IN_OUT_FADER, environment, parent, id, rectangle) {} 34 | 35 | //! destructor 36 | ~IGUIInOutFader() {}; 37 | 38 | //! Gets the color to fade out to or to fade in from. 39 | virtual video::SColor getColor() const = 0; 40 | 41 | //! Sets the color to fade out to or to fade in from. 42 | //! \param color: Color to where it is faded out od from it is faded in. 43 | virtual void setColor(video::SColor color) = 0; 44 | 45 | //! Starts the fade in process. In the beginning the whole rect is drawn by 46 | //! the set color (black by default) and at the end of the overgiven 47 | //! time the color has faded out. 48 | //! \param time: Time specifing how long it should need to fade in, 49 | //! in milliseconds. 50 | virtual void fadeIn(u32 time) = 0; 51 | 52 | //! Starts the fade out process. In the beginning everything is visible, 53 | //! and at the end of the time only the set color (black by the fault) 54 | //! will be drawn. 55 | //! \param time: Time specifing how long it should need to fade out, 56 | //! in milliseconds. 57 | virtual void fadeOut(u32 time) = 0; 58 | 59 | //! Returns if the fade in or out process is done. 60 | virtual bool isReady() const = 0; 61 | }; 62 | 63 | 64 | } // end namespace gui 65 | } // end namespace irr 66 | 67 | #endif 68 | 69 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IGUIListBox.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_GUI_LIST_BOX_BAR_H_INCLUDED__ 6 | #define __I_GUI_LIST_BOX_BAR_H_INCLUDED__ 7 | 8 | #include "IGUIElement.h" 9 | #include "irrTypes.h" 10 | 11 | namespace irr 12 | { 13 | namespace gui 14 | { 15 | class IGUIFont; 16 | 17 | //! Default list box GUI element. 18 | class IGUIListBox : public IGUIElement 19 | { 20 | public: 21 | 22 | //! constructor 23 | IGUIListBox(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect rectangle) 24 | : IGUIElement(EGUIET_LIST_BOX, environment, parent, id, rectangle) {} 25 | 26 | //! destructor 27 | ~IGUIListBox() {}; 28 | 29 | //! returns amount of list items 30 | virtual s32 getItemCount() = 0; 31 | 32 | //! returns string of a list item. the may id be a value from 0 to itemCount-1 33 | virtual const wchar_t* getListItem(s32 id) = 0; 34 | 35 | //! adds an list item, returns id of item 36 | virtual s32 addItem(const wchar_t* text) = 0; 37 | 38 | //! adds an list item with an icon. 39 | /** \param text Text of list entry 40 | \param icon Text of the Icon. This text can be for example one of the texts defined in 41 | GUIIcons.h. 42 | \return 43 | returns the id of the new created item */ 44 | virtual s32 addItem(const wchar_t* text, const wchar_t* icon) = 0; 45 | 46 | //! Sets the font which should be used as icon font. 47 | /** This font is set to the Irrlicht engine 48 | built-in-font by default. Icons can be displayed in front of every list item. 49 | An icon is a string, displayed with the icon font. When using the build-in-font of the 50 | Irrlicht engine as icon font, the icon strings defined in GUIIcons.h can be used. */ 51 | virtual void setIconFont(IGUIFont* font) = 0; 52 | 53 | //! clears the list, deletes all items in the listbox 54 | virtual void clear() = 0; 55 | 56 | //! returns id of selected item. returns -1 if no item is selected. 57 | virtual s32 getSelected() = 0; 58 | 59 | //! sets the selected item. Set this to -1 if no item should be selected 60 | virtual void setSelected(s32 id) = 0; 61 | }; 62 | 63 | 64 | } // end namespace gui 65 | } // end namespace irr 66 | 67 | #endif 68 | 69 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IGUIMeshViewer.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_GUI_MESH_VIEWER_H_INCLUDED__ 6 | #define __I_GUI_MESH_VIEWER_H_INCLUDED__ 7 | 8 | #include "IGUIElement.h" 9 | 10 | namespace irr 11 | { 12 | 13 | namespace video 14 | { 15 | struct SMaterial; 16 | } 17 | 18 | namespace scene 19 | { 20 | class IAnimatedMesh; 21 | } 22 | 23 | namespace gui 24 | { 25 | 26 | //! 3d mesh viewing GUI element. 27 | class IGUIMeshViewer : public IGUIElement 28 | { 29 | public: 30 | 31 | //! constructor 32 | IGUIMeshViewer(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect rectangle) 33 | : IGUIElement(EGUIET_MESH_VIEWER, environment, parent, id, rectangle) {} 34 | 35 | //! destructor 36 | ~IGUIMeshViewer() {}; 37 | 38 | //! sets the mesh to be shown 39 | virtual void setMesh(scene::IAnimatedMesh* mesh) = 0; 40 | 41 | //! sets the material 42 | virtual void setMaterial(const video::SMaterial& material) = 0; 43 | 44 | //! gets the material 45 | virtual const video::SMaterial& getMaterial() = 0; 46 | 47 | }; 48 | 49 | 50 | } // end namespace gui 51 | } // end namespace irr 52 | 53 | #endif 54 | 55 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IGUIScrollBar.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_GUI_SCROLL_BAR_H_INCLUDED__ 6 | #define __I_GUI_SCROLL_BAR_H_INCLUDED__ 7 | 8 | #include "IGUIElement.h" 9 | 10 | namespace irr 11 | { 12 | namespace gui 13 | { 14 | 15 | //! Default scroll bar GUI element. 16 | class IGUIScrollBar : public IGUIElement 17 | { 18 | public: 19 | 20 | //! constructor 21 | IGUIScrollBar(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect rectangle) 22 | : IGUIElement(EGUIET_SCROLL_BAR, environment, parent, id, rectangle) {} 23 | 24 | //! destructor 25 | ~IGUIScrollBar() {}; 26 | 27 | //! sets the maximum value of the scrollbar. must be > 0 28 | virtual void setMax(s32 max) = 0; 29 | 30 | //! gets the current position of the scrollbar 31 | virtual s32 getPos() = 0; 32 | 33 | //! sets the current position of the scrollbar 34 | virtual void setPos(s32 pos) = 0; 35 | }; 36 | 37 | 38 | } // end namespace gui 39 | } // end namespace irr 40 | 41 | #endif 42 | 43 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IGUIStaticText.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_GUI_STATIC_TEXT_H_INCLUDED__ 6 | #define __I_GUI_STATIC_TEXT_H_INCLUDED__ 7 | 8 | #include "IGUIElement.h" 9 | #include "SColor.h" 10 | 11 | namespace irr 12 | { 13 | namespace gui 14 | { 15 | class IGUIFont; 16 | 17 | //! Multi or single line text label. 18 | class IGUIStaticText : public IGUIElement 19 | { 20 | public: 21 | 22 | //! constructor 23 | IGUIStaticText(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect rectangle) 24 | : IGUIElement(EGUIET_STATIC_TEXT, environment, parent, id, rectangle) {} 25 | 26 | //! destructor 27 | ~IGUIStaticText() {}; 28 | 29 | //! Sets another skin independent font. 30 | /** If this is set to zero, the button uses the font of the skin. 31 | \param font: New font to set. */ 32 | virtual void setOverrideFont(IGUIFont* font=0) = 0; 33 | 34 | //! Sets another color for the text. 35 | /** If set, the static text does not use the EGDC_BUTTON_TEXT color defined 36 | in the skin, but the set color instead. You don't need to call 37 | IGUIStaticText::enableOverrrideColor(true) after this, this is done 38 | by this function. 39 | If you set a color, and you want the text displayed with the color 40 | of the skin again, call IGUIStaticText::enableOverrideColor(false); 41 | \param color: New color of the text. */ 42 | virtual void setOverrideColor(video::SColor color) = 0; 43 | 44 | //! Sets if the static text should use the overide color or the color in the gui skin. 45 | /** \param enable: If set to true, the override color, which can be set 46 | with IGUIStaticText::setOverrideColor is used, otherwise the 47 | EGDC_BUTTON_TEXT color of the skin. */ 48 | virtual void enableOverrideColor(bool enable) = 0; 49 | 50 | //! Enables or disables word wrap for using the static text as multiline text control. 51 | /** \param enable: If set to true, words going over one line are 52 | breaked to the next line. */ 53 | virtual void setWordWrap(bool enable) = 0; 54 | 55 | //! Returns the height of the text in pixels when it is drawn. 56 | /** This is useful for adjusting the layout of gui elements based on the height 57 | of the multiline text in this element. 58 | \return Returns height of text in pixels. */ 59 | virtual s32 getTextHeight() = 0; 60 | }; 61 | 62 | 63 | } // end namespace gui 64 | } // end namespace irr 65 | 66 | #endif 67 | 68 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IGUITabControl.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_GUI_TAB_CONTROL_H_INCLUDED__ 6 | #define __I_GUI_TAB_CONTROL_H_INCLUDED__ 7 | 8 | #include "IGUIElement.h" 9 | #include "SColor.h" 10 | 11 | namespace irr 12 | { 13 | namespace gui 14 | { 15 | //! A tab, onto which other gui elements could be added. 16 | class IGUITab : public IGUIElement 17 | { 18 | public: 19 | 20 | //! constructor 21 | IGUITab(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect rectangle) 22 | : IGUIElement(EGUIET_TAB, environment, parent, id, rectangle) {} 23 | 24 | //! destructor 25 | virtual ~IGUITab() {}; 26 | 27 | //! Returns number of tab if in tabcontrol. 28 | /** Can be accessed later IGUITabControl::getTab() by this number. */ 29 | virtual s32 getNumber() = 0; 30 | 31 | //! sets if the tab should draw its background 32 | virtual void setDrawBackground(bool draw=true) = 0; 33 | 34 | //! sets the color of the background, if it should be drawn. 35 | virtual void setBackgroundColor(video::SColor c) = 0; 36 | }; 37 | 38 | //! A standard tab control 39 | class IGUITabControl : public IGUIElement 40 | { 41 | public: 42 | 43 | //! constructor 44 | IGUITabControl(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect rectangle) 45 | : IGUIElement(EGUIET_TAB_CONTROL, environment, parent, id, rectangle) {} 46 | 47 | //! destructor 48 | virtual ~IGUITabControl() {}; 49 | 50 | //! Adds a tab 51 | virtual IGUITab* addTab(wchar_t* caption, s32 id=-1) = 0; 52 | 53 | //! Returns amount of tabs in the tabcontrol 54 | virtual s32 getTabcount() = 0; 55 | 56 | //! Returns a tab based on zero based index 57 | /** \param idx: zero based index of tab. Is a value betwenn 0 and getTabcount()-1; 58 | \return Returns pointer to the Tab. Returns 0 if no tab 59 | is corresponding to this tab. */ 60 | virtual IGUITab* getTab(s32 idx) = 0; 61 | 62 | //! Brings a tab to front. 63 | /** \param idx: number of the tab. 64 | \return Returns true if successful. */ 65 | virtual bool setActiveTab(s32 idx) = 0; 66 | 67 | //! Returns which tab is currently active 68 | virtual s32 getActiveTab() = 0; 69 | }; 70 | 71 | 72 | } // end namespace gui 73 | } // end namespace irr 74 | 75 | #endif 76 | 77 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IGUIToolbar.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_GUI_TOOL_BAR_H_INCLUDED__ 6 | #define __I_GUI_TOOL_BAR_H_INCLUDED__ 7 | 8 | #include "IGUIElement.h" 9 | 10 | namespace irr 11 | { 12 | namespace video 13 | { 14 | class ITexture; 15 | } 16 | namespace gui 17 | { 18 | class IGUIButton; 19 | 20 | //! Stays at the top of its parent like the menu bar and contains tool buttons 21 | class IGUIToolBar : public IGUIElement 22 | { 23 | public: 24 | 25 | //! constructor 26 | IGUIToolBar(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect rectangle) 27 | : IGUIElement(EGUIET_TOOL_BAR, environment, parent, id, rectangle) {} 28 | 29 | //! destructor 30 | ~IGUIToolBar() {}; 31 | 32 | //! Adds a button to the tool bar 33 | virtual IGUIButton* addButton(s32 id=-1, const wchar_t* text=0, 34 | video::ITexture* img=0, video::ITexture* pressedimg=0, 35 | bool isPushButton=false, bool useAlphaChannel=false) = 0; 36 | }; 37 | 38 | 39 | } // end namespace gui 40 | } // end namespace irr 41 | 42 | #endif 43 | 44 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IGUIWindow.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_GUI_WINDOW_H_INCLUDED__ 6 | #define __I_GUI_WINDOW_H_INCLUDED__ 7 | 8 | #include "IGUIButton.h" 9 | 10 | namespace irr 11 | { 12 | namespace gui 13 | { 14 | //! enumeration for message box layout flags 15 | enum EMESSAGE_BOX_FLAG 16 | { 17 | //! Flag for the ok button 18 | EMBF_OK = 0x1, 19 | 20 | //! Flag for the cancel button 21 | EMBF_CANCEL = 0x2, 22 | 23 | //! Flag for the yes button 24 | EMBF_YES = 0x4, 25 | 26 | //! Flag for the no button 27 | EMBF_NO = 0x8, 28 | 29 | //! This value is not used. It only forces this enumeration to compile in 32 bit. 30 | EMBF_FORCE_32BIT = 0x7fffffff 31 | }; 32 | 33 | //! Default moveable window GUI element with border, caption and close icons. 34 | class IGUIWindow : public IGUIElement 35 | { 36 | public: 37 | 38 | //! constructor 39 | IGUIWindow(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect rectangle) 40 | : IGUIElement(EGUIET_WINDOW, environment, parent, id, rectangle) {} 41 | 42 | //! destructor 43 | virtual ~IGUIWindow() {}; 44 | 45 | //! Returns pointer to the close button 46 | virtual IGUIButton* getCloseButton() = 0; 47 | 48 | //! Returns pointer to the minimize button 49 | virtual IGUIButton* getMinimizeButton() = 0; 50 | 51 | //! Returns pointer to the maximize button 52 | virtual IGUIButton* getMaximizeButton() = 0; 53 | }; 54 | 55 | 56 | } // end namespace gui 57 | } // end namespace irr 58 | 59 | #endif 60 | 61 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IImage.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_IMAGE_H_INCLUDED__ 6 | #define __I_IMAGE_H_INCLUDED__ 7 | 8 | #include "IUnknown.h" 9 | #include "position2d.h" 10 | #include "rect.h" 11 | #include "SColor.h" 12 | 13 | namespace irr 14 | { 15 | namespace video 16 | { 17 | 18 | //! An enum for the color format of textures used by the Irrlicht Engine. 19 | /** A color format specifies how color information is stored. The Irrlicht Engine 20 | mostly uses the format ECF_A1R5G5B5. 21 | */ 22 | enum ECOLOR_FORMAT 23 | { 24 | //! 16 bit color format used by the software driver, and thus preferred 25 | //! by all other irrlicht engine video drivers. There are 5 bits for every 26 | //! color component, and a single bit is left for alpha information. 27 | ECF_A1R5G5B5 = 0, 28 | 29 | //! Standard 16 bit color format. 30 | ECF_R5G6B5, 31 | 32 | //! 24 bit color, no alpha channel, but 8 bit for red, green and blue. 33 | ECF_R8G8B8, 34 | 35 | //! Default 32 bit color format. 8 bits are used for every component: 36 | //! red, green, blue and alpha. 37 | ECF_A8R8G8B8, 38 | }; 39 | 40 | 41 | //! Interface for software image data. 42 | /** Image loaders create these images from files. IVideoDrivers convert 43 | these images into their (hardware) textures. 44 | */ 45 | class IImage : public IUnknown 46 | { 47 | public: 48 | 49 | //! destructor 50 | virtual ~IImage() {}; 51 | 52 | //! Lock function. Use this to get a pointer to the image data. After you 53 | //! don't need the pointer anymore, you must call unlock(). 54 | //! \return Returns pointer to the image data. What type of data 55 | //! is pointed to depends on the color format of the image. For example 56 | //! if the color format is ECF_A8R8G8B8, it is of s32. 57 | //! Be sure to call unlock() after you don't need the pointer any more. 58 | virtual void* lock() = 0; 59 | 60 | //! Unlock function. 61 | //! Should be called after the pointer received by lock() is not 62 | //! needed anymore. 63 | virtual void unlock() = 0; 64 | 65 | //! Returns width and height of image data. 66 | virtual const core::dimension2d& getDimension() = 0; 67 | 68 | //! Returns bits per pixel. 69 | virtual s32 getBitsPerPixel() = 0; 70 | 71 | //! Returns bytes per pixel 72 | virtual s32 getBytesPerPixel() = 0; 73 | 74 | //! Returns image data size in bytes 75 | virtual s32 getImageDataSizeInBytes() = 0; 76 | 77 | //! Returns image data size in pixels 78 | virtual s32 getImageDataSizeInPixels() = 0; 79 | 80 | //! returns a pixel 81 | virtual SColor getPixel(s32 x, s32 y) = 0; 82 | 83 | //! returns the color format 84 | virtual ECOLOR_FORMAT getColorFormat() = 0; 85 | }; 86 | 87 | } // end namespace video 88 | } // end namespace irr 89 | 90 | #endif 91 | 92 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IImageLoader.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_SURFACE_LOADER_H_INCLUDED__ 6 | #define __I_SURFACE_LOADER_H_INCLUDED__ 7 | 8 | #include "IUnknown.h" 9 | #include "IReadFile.h" 10 | #include "IImage.h" 11 | 12 | namespace irr 13 | { 14 | namespace video 15 | { 16 | 17 | //! Class which is able to create a image from a file. 18 | /** If you want the Irrlicht Engine be able to load textures of 19 | currently unsupported file formats (e.g .gif), then implement 20 | this and add your new Surface loader with 21 | IVideoDriver::addExternalImageLoader() to the engine. */ 22 | class IImageLoader : public IUnknown 23 | { 24 | public: 25 | 26 | //! destructor 27 | virtual ~IImageLoader() {}; 28 | 29 | //! returns true if the file maybe is able to be loaded by this class 30 | //! based on the file extension (e.g. ".tga") 31 | virtual bool isALoadableFileExtension(const c8* fileName) = 0; 32 | 33 | //! returns true if the file maybe is able to be loaded by this class 34 | virtual bool isALoadableFileFormat(irr::io::IReadFile* file) = 0; 35 | 36 | //! creates a surface from the file 37 | virtual IImage* loadImage(irr::io::IReadFile* file) = 0; 38 | }; 39 | 40 | 41 | } // end namespace video 42 | } // end namespace irr 43 | 44 | #endif 45 | 46 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/ILightSceneNode.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_LIGHT_SCENE_NODE_H_INCLUDED__ 6 | #define __I_LIGHT_SCENE_NODE_H_INCLUDED__ 7 | 8 | #include "ISceneNode.h" 9 | #include "SLight.h" 10 | 11 | namespace irr 12 | { 13 | namespace scene 14 | { 15 | 16 | //! Scene node which is a dynamic light. 17 | /** You can switch the light on and off by 18 | making it visible or not, and let it be animated by ordinary scene node animators. 19 | If you set the light type to be directional, you will need to set the direction of the 20 | light source manually in the SLight structure, the position of the scene node will have no 21 | effect on this direction. 22 | */ 23 | class ILightSceneNode : public ISceneNode 24 | { 25 | public: 26 | 27 | //! constructor 28 | ILightSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, 29 | const core::vector3df& position = core::vector3df(0,0,0)) 30 | : ISceneNode(parent, mgr, id, position) {} 31 | 32 | //! \return Returns the light data. 33 | virtual video::SLight& getLightData() = 0; 34 | }; 35 | 36 | } // end namespace scene 37 | } // end namespace irr 38 | 39 | 40 | #endif 41 | 42 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/ILogger.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_LOGGER_H_INCLUDED__ 6 | #define __I_LOGGER_H_INCLUDED__ 7 | 8 | #include "IUnknown.h" 9 | 10 | namespace irr 11 | { 12 | 13 | enum ELOG_LEVEL 14 | { 15 | //! High log level, warnings, errors and important information 16 | //! texts are printed out. 17 | ELL_INFORMATION = 0, 18 | 19 | //! Default log level, warnings and errors are printed out 20 | ELL_WARNING, 21 | 22 | //! Low log level, only errors are printed into the log 23 | ELL_ERROR, 24 | 25 | //! Nothing is printed out to the log 26 | ELL_NONE 27 | }; 28 | 29 | 30 | //! Interface for logging messages, warnings and errors 31 | class ILogger : public IUnknown 32 | { 33 | public: 34 | 35 | //! destructor 36 | virtual ~ILogger() {} 37 | 38 | //! Returns the current set log level. 39 | virtual ELOG_LEVEL getLogLevel() = 0; 40 | 41 | //! Sets a new log level. With this value, texts which are sent to 42 | //! the logger are filtered out. For example setting this value to 43 | //! ELL_WARNING, only warnings and 44 | //! errors are printed out. Setting it to ELL_INFORMATION, which is 45 | //! the default setting, warnings, 46 | //! errors and informational texts are printed out. 47 | //! \param ll: new log level filter value. 48 | virtual void setLogLevel(ELOG_LEVEL ll) = 0; 49 | 50 | //! Prints out a text into the log 51 | //! \param text: Text to print out. 52 | //! \param ll: Log level of the text. If the text is an error, set 53 | //! it to ELL_ERROR, if it is warning set it to ELL_WARNING, and if it 54 | //! is just an informational text, set it to ELL_INFORMATION. Texts are 55 | //! filtered with these levels. If you want to be a text displayed, 56 | //! independent on what level filter is set, use ELL_NONE. 57 | virtual void log(const c8* text, ELOG_LEVEL ll=ELL_INFORMATION) = 0; 58 | 59 | //! Prints out a text into the log 60 | //! \param text: Text to print out. 61 | //! \param hint: Additional info. This string is added after a " :" to the 62 | //! string. 63 | //! \param ll: Log level of the text. If the text is an error, set 64 | //! it to ELL_ERROR, if it is warning set it to ELL_WARNING, and if it 65 | //! is just an informational text, set it to ELL_INFORMATION. Texts are 66 | //! filtered with these levels. If you want to be a text displayed, 67 | //! independent on what level filter is set, use ELL_NONE. 68 | virtual void log(const c8* text, const c8* hint, ELOG_LEVEL ll=ELL_INFORMATION) = 0; 69 | 70 | //! Prints out a text into the log 71 | //! \param text: Text to print out. 72 | //! \param hint: Additional info. This string is added after a " :" to the 73 | //! string. 74 | //! \param ll: Log level of the text. If the text is an error, set 75 | //! it to ELL_ERROR, if it is warning set it to ELL_WARNING, and if it 76 | //! is just an informational text, set it to ELL_INFORMATION. Texts are 77 | //! filtered with these levels. If you want to be a text displayed, 78 | //! independent on what level filter is set, use ELL_NONE. 79 | virtual void log(const wchar_t* text, const wchar_t* hint, ELOG_LEVEL ll=ELL_INFORMATION) = 0; 80 | 81 | 82 | //! Prints out a text into the log 83 | //! \param text: Text to print out. 84 | //! \param ll: Log level of the text. If the text is an error, set 85 | //! it to ELL_ERROR, if it is warning set it to ELL_WARNING, and if it 86 | //! is just an informational text, set it to ELL_INFORMATION. Texts are 87 | //! filtered with these levels. If you want to be a text displayed, 88 | //! independent on what level filter is set, use ELL_NONE. 89 | virtual void log(const wchar_t* text, ELOG_LEVEL ll=ELL_INFORMATION) = 0; 90 | }; 91 | 92 | } // end namespace 93 | 94 | #endif 95 | 96 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IMesh.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_MESH_H_INCLUDED__ 6 | #define __I_MESH_H_INCLUDED__ 7 | 8 | #include "IUnknown.h" 9 | #include "IMeshBuffer.h" 10 | 11 | namespace irr 12 | { 13 | namespace scene 14 | { 15 | //! Class for accessing a mesh with multiple mesh buffers. 16 | /** An IMesh is nothing more than a collection of some mesh buffers (IMeshBuffer). 17 | SMesh is a simple implementation of an IMesh. 18 | */ 19 | class IMesh : public IUnknown 20 | { 21 | public: 22 | 23 | //! destructor 24 | virtual ~IMesh(){}; 25 | 26 | //! Returns the amount of mesh buffers. 27 | /** \return Returns the amount of mesh buffers (IMeshBuffer) in this mesh. */ 28 | virtual s32 getMeshBufferCount() = 0; 29 | 30 | //! Returns pointer to a mesh buffer. 31 | /** \param Zero based index of the mesh buffer. The maximum value is 32 | getMeshBufferCount() - 1; 33 | \return Returns the pointer to the mesh buffer or 34 | NULL if there is no such mesh buffer. */ 35 | virtual IMeshBuffer* getMeshBuffer(s32 nr) = 0; 36 | 37 | //! Returns an axis aligned bounding box of the mesh. 38 | /** \return A bounding box of this mesh is returned. */ 39 | virtual const core::aabbox3d& getBoundingBox() const = 0; 40 | 41 | //! Returns an axis aligned bounding box of the mesh. 42 | /** \return A bounding box of this mesh is returned. */ 43 | virtual core::aabbox3d& getBoundingBox() = 0; 44 | 45 | //! Sets a flag of all contained materials to a new value. 46 | /** \param flag: Flag to set in all materials. 47 | \param newvalue: New value to set in all materials. */ 48 | virtual void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue) = 0; 49 | }; 50 | 51 | } // end namespace scene 52 | } // end namespace irr 53 | 54 | #endif 55 | 56 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IMeshBuffer.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_MESH_BUFFER_H_INCLUDED__ 6 | #define __I_MESH_BUFFER_H_INCLUDED__ 7 | 8 | #include "IUnknown.h" 9 | #include "SMaterial.h" 10 | #include "irrArray.h" 11 | #include "aabbox3d.h" 12 | #include "S3DVertex.h" 13 | 14 | namespace irr 15 | { 16 | namespace scene 17 | { 18 | //! Struct for holding a mesh with a single material 19 | /** SMeshBuffer is a simple implementation of a MeshBuffer. */ 20 | class IMeshBuffer : public IUnknown 21 | { 22 | public: 23 | 24 | //! destructor 25 | virtual ~IMeshBuffer() {}; 26 | 27 | //! returns the material of this meshbuffer 28 | virtual video::SMaterial& getMaterial() = 0; 29 | 30 | //! returns the material of this meshbuffer 31 | virtual const video::SMaterial& getMaterial() const = 0; 32 | 33 | //! returns which type of vertex data is stored. 34 | virtual video::E_VERTEX_TYPE getVertexType() const = 0; 35 | 36 | //! returns pointer to vertex data. The data is a array of vertices. Which vertex 37 | //! type is used can be determinated with getVertexType(). 38 | virtual const void* getVertices() const = 0; 39 | 40 | //! returns pointer to vertex data. The data is a array of vertices. Which vertex 41 | //! type is used can be determinated with getVertexType(). 42 | virtual void* getVertices() = 0; 43 | 44 | //! returns amount of vertices 45 | virtual s32 getVertexCount() const = 0; 46 | 47 | //! returns pointer to Indices 48 | virtual const u16* getIndices() const = 0; 49 | 50 | //! returns pointer to Indices 51 | virtual u16* getIndices() = 0; 52 | 53 | //! returns amount of indices 54 | virtual s32 getIndexCount() const = 0; 55 | 56 | //! returns an axis aligned bounding box 57 | virtual const core::aabbox3d& getBoundingBox() const = 0; 58 | 59 | //! returns an axis aligned bounding box 60 | virtual core::aabbox3d& getBoundingBox() = 0; 61 | }; 62 | 63 | } // end namespace scene 64 | } // end namespace irr 65 | 66 | #endif 67 | 68 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IMeshCache.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_MESH_CACHE_H_INCLUDED__ 6 | #define __I_MESH_CACHE_H_INCLUDED__ 7 | 8 | #include "irrTypes.h" 9 | #include "IUnknown.h" 10 | 11 | namespace irr 12 | { 13 | 14 | namespace scene 15 | { 16 | class IMesh; 17 | class IAnimatedMesh; 18 | class IAnimatedMeshSceneNode; 19 | class IMeshLoader; 20 | 21 | //! The mesh cache stores already loaded meshes and provides an interface to them. 22 | /** You can access it using ISceneManager::getMeshCache(). All existing scene managers 23 | will return a pointer to the same mesh cache, because it is shared between them. With 24 | this interface, it is possible to manually add new loaded meshes (if 25 | ISceneManager::getMesh() is not sufficient), to remove them and to iterate through 26 | already loaded meshes. */ 27 | class IMeshCache : public IUnknown 28 | { 29 | public: 30 | 31 | //! destructor 32 | virtual ~IMeshCache() {}; 33 | 34 | //! Adds a mesh to the internal list of loaded meshes. 35 | /** Usually, ISceneManager::getMesh() is called to load a mesh from a file. 36 | That method searches the list of loaded meshes if a mesh has already been loaded and 37 | returns a pointer to if it is in that list and already in memory. Otherwise it loads 38 | the mesh. With IMeshCache::addMesh(), it is possible to pretend that a mesh already 39 | has been loaded. This method can be used for example by mesh loaders who need to 40 | load more than one mesh with one call. They can add additional meshes with this 41 | method to the scene manager. The COLLADA loader for example uses this method. 42 | \param filename: Filename of the mesh. When called ISceneManager::getMesh() with this 43 | parameter, the method will return the mesh parameter given with this method. 44 | \param mesh: Pointer to a mesh which will now be referenced by this name. */ 45 | virtual void addMesh(const c8* filename, IAnimatedMesh* mesh) = 0; 46 | 47 | //! Removes a mesh from the cache. 48 | /** After loading a mesh with getMesh(), the mesh can be removed from the cache 49 | using this method, freeing a lot of memory. */ 50 | virtual void removeMesh(IAnimatedMesh* mesh) = 0; 51 | 52 | //! Returns amount of loaded meshes in the cache. 53 | /** You can load new meshes into the cache using getMesh() and addMesh(). 54 | If you ever need to access the internal mesh cache, you can do this using 55 | removeMesh(), getMeshNumber(), getMeshByIndex() and getMeshFilename() */ 56 | virtual s32 getMeshCount() = 0; 57 | 58 | //! Returns current index number of the mesh, and -1 if it is not in the cache. 59 | virtual s32 getMeshIndex(IAnimatedMesh* mesh) = 0; 60 | 61 | //! Returns a mesh based on its index number. 62 | /** \param index: Index of the mesh, number between 0 and getMeshCount()-1. 63 | Note that this number is only valid until a new mesh is loaded or removed * 64 | \return Returns pointer to the mesh or 0 if there is none with this number. */ 65 | virtual IAnimatedMesh* getMeshByIndex(s32 index) = 0; 66 | 67 | //! Returns name of a mesh based on its index number. 68 | /** \param index: Index of the mesh, number between 0 and getMeshCount()-1. 69 | Note that this is only valid until a new mesh is loaded */ 70 | virtual const c8* getMeshFilename(s32 index) = 0; 71 | 72 | //! Returns the filename of a loaded mesh, if there is any. 73 | /** Returns 0 if there is none. */ 74 | virtual const c8* getMeshFilename(IAnimatedMesh* mesh) = 0; 75 | 76 | //! Returns the filename of a loaded mesh, if there is any. 77 | /* Returns 0 if there is none.*/ 78 | virtual const c8* getMeshFilename(IMesh* mesh) = 0; 79 | }; 80 | 81 | 82 | } // end namespace scene 83 | } // end namespace irr 84 | 85 | #endif 86 | 87 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IMeshLoader.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2003 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_MESH_LOADER_H_INCLUDED__ 6 | #define __I_MESH_LOADER_H_INCLUDED__ 7 | 8 | #include "IUnknown.h" 9 | #include "IReadFile.h" 10 | #include "IAnimatedMesh.h" 11 | 12 | namespace irr 13 | { 14 | namespace scene 15 | { 16 | 17 | //! Class which is able to load an animated mesh from a file. 18 | /** If you want the Irrlicht Engine be able to load meshes of 19 | currently unsupported file formats (e.g .cob), then implement 20 | this and add your new Surface loader with 21 | ISceneManager::addExternalMeshLoader() to the engine. */ 22 | class IMeshLoader : public IUnknown 23 | { 24 | public: 25 | 26 | //! destructor 27 | virtual ~IMeshLoader() {}; 28 | 29 | //! Returns true if the file maybe is able to be loaded by this class. 30 | /** This decision should be based only on the file extension (e.g. ".cob") */ 31 | virtual bool isALoadableFileExtension(const c8* fileName) = 0; 32 | 33 | //! Creates/loads an animated mesh from the file. 34 | /** \return Pointer to the created mesh. Returns 0 if loading failed. 35 | If you no longer need the mesh, you should call IAnimatedMesh::drop(). 36 | See IUnknown::drop() for more information. */ 37 | virtual IAnimatedMesh* createMesh(irr::io::IReadFile* file) = 0; 38 | }; 39 | 40 | 41 | } // end namespace scene 42 | } // end namespace irr 43 | 44 | #endif 45 | 46 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IMetaTriangleSelector.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_META_TRIANGLE_SELECTOR_H_INCLUDED__ 6 | #define __I_META_TRIANGLE_SELECTOR_H_INCLUDED__ 7 | 8 | #include "ITriangleSelector.h" 9 | 10 | namespace irr 11 | { 12 | namespace scene 13 | { 14 | 15 | //! Interface for making multiple triangle selectors work as one big selector. 16 | /** This is nothing more than a collection of one or more triangle selectors 17 | providing together the interface of one triangle selector. In this way, 18 | collision tests can be done with different triangle soups in one pass. 19 | */ 20 | class IMetaTriangleSelector : public ITriangleSelector 21 | { 22 | public: 23 | 24 | //! Adds a triangle selector to the collection of triangle selectors 25 | //! in this metaTriangleSelector. 26 | //! \param toAdd: Pointer to an triangle selector to add to the list. 27 | virtual void addTriangleSelector(ITriangleSelector* toAdd) = 0; 28 | 29 | //! Removes a specific triangle selector which was added before from the collection. 30 | //! \param toRemove: Pointer to an triangle selector which is in the list 31 | //! but will be removed. 32 | //! \return Returns true if successful, false if not. 33 | virtual bool removeTriangleSelector(ITriangleSelector* toRemove) = 0; 34 | 35 | //! Removes all triangle selectors from the collection. 36 | virtual void removeAllTriangleSelectors() = 0; 37 | }; 38 | 39 | } // end namespace scene 40 | } // end namespace irr 41 | 42 | 43 | #endif 44 | 45 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IOSOperator.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_OS_OPERATOR_H_INCLUDED__ 6 | #define __I_OS_OPERATOR_H_INCLUDED__ 7 | 8 | #include "IUnknown.h" 9 | 10 | namespace irr 11 | { 12 | 13 | //! The Operating system operator provides operation system specific methods and informations. 14 | /** Currently only 3 methods are supported. But it will be extended with more functionality 15 | soon. */ 16 | class IOSOperator : public IUnknown 17 | { 18 | public: 19 | 20 | //! destructor 21 | virtual ~IOSOperator() {} 22 | 23 | //! returns the current operation system version as string. 24 | virtual const wchar_t* getOperationSystemVersion() = 0; 25 | 26 | //! copies text to the clipboard 27 | virtual void copyToClipboard(const c8* text) = 0; 28 | 29 | //! gets text from the clipboard 30 | //! \return Returns 0 if no string is in there. 31 | virtual c8* getTextFromClipboard() = 0; 32 | }; 33 | 34 | } // end namespace 35 | 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IParticleAffector.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_PARTICLE_AFFECTOR_H_INCLUDED__ 6 | #define __I_PARTICLE_AFFECTOR_H_INCLUDED__ 7 | 8 | #include "IUnknown.h" 9 | #include "SParticle.h" 10 | 11 | namespace irr 12 | { 13 | namespace scene 14 | { 15 | 16 | //! A particle affector modifies particles. 17 | class IParticleAffector : public IUnknown 18 | { 19 | public: 20 | 21 | //! Affects an array of particles. 22 | //! \param now: Current time. (Same as ITimer::getTime() would return) 23 | //! \param particlearray: Array of particles. 24 | //! \param count: Amount of particles in array. 25 | virtual void affect(u32 now, SParticle* particlearray, u32 count) = 0; 26 | 27 | }; 28 | 29 | } // end namespace scene 30 | } // end namespace irr 31 | 32 | 33 | #endif 34 | 35 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IParticleEmitter.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_PARTICLE_EMITTER_H_INCLUDED__ 6 | #define __I_PARTICLE_EMITTER_H_INCLUDED__ 7 | 8 | #include "IUnknown.h" 9 | #include "SParticle.h" 10 | 11 | namespace irr 12 | { 13 | namespace scene 14 | { 15 | 16 | //! A particle emitter for using with particle systems. 17 | /** A Particle emitter emitts new particles into a particle system. 18 | */ 19 | class IParticleEmitter : public IUnknown 20 | { 21 | public: 22 | 23 | //! destructor 24 | virtual ~IParticleEmitter() {}; 25 | 26 | //! Prepares an array with new particles to emitt into the system 27 | //! and returns how much new particles there are. 28 | //! \param now: Current time. 29 | //! \param timeSinceLastCall: Time elapsed since last call, in milliseconds. 30 | //! \param outArray: Pointer which will point to the array with the new 31 | //! particles to add into the system. 32 | //! \return Returns amount of new particles in the array. Can be 0. 33 | virtual s32 emitt(u32 now, u32 timeSinceLastCall, SParticle*& outArray) = 0; 34 | }; 35 | 36 | } // end namespace scene 37 | } // end namespace irr 38 | 39 | 40 | #endif 41 | 42 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IQ3LevelMesh.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_Q3_LEVEL_MESH_H_INCLUDED__ 6 | #define __I_Q3_LEVEL_MESH_H_INCLUDED__ 7 | 8 | #include "IAnimatedMesh.h" 9 | 10 | namespace irr 11 | { 12 | namespace scene 13 | { 14 | 15 | //! Interface for a Mesh wich can be loaded directly from a Quake3 .bsp-file. 16 | /** The Mesh tries to load all textures of the map. There are currently 17 | no additional methods in this class, but maybe there will be some in later 18 | releases if there are feature requests. */ 19 | class IQ3LevelMesh : public IAnimatedMesh 20 | { 21 | public: 22 | 23 | //! destructor 24 | virtual ~IQ3LevelMesh() {}; 25 | }; 26 | 27 | } // end namespace scene 28 | } // end namespace irr 29 | 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IReadFile.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_READ_FILE_H_INCLUDED__ 6 | #define __I_READ_FILE_H_INCLUDED__ 7 | 8 | #include "IUnknown.h" 9 | 10 | namespace irr 11 | { 12 | namespace io 13 | { 14 | 15 | //! Interface providing read acess to a file. 16 | class IReadFile : public IUnknown 17 | { 18 | public: 19 | 20 | virtual ~IReadFile() {}; 21 | 22 | //! Reads an amount of bytes from the file. 23 | //! \param buffer: Pointer to buffer where to read bytes will be written to. 24 | //! \param sizeToRead: Amount of bytes to read from the file. 25 | //! \return Returns how much bytes were read. 26 | virtual s32 read(void* buffer, s32 sizeToRead) = 0; 27 | 28 | //! Changes position in file, returns true if successful. 29 | //! \param finalPos: Destination position in the file. 30 | //! \param relativeMovement: If set to true, the position in the file is 31 | //! changed relative to current position. Otherwise the position is changed 32 | //! from begin of file. 33 | //! \return Returns true if successful, otherwise false. 34 | virtual bool seek(s32 finalPos, bool relativeMovement = false) = 0; 35 | 36 | //! Returns size of file. 37 | //! \return Returns the size of the file in bytes. 38 | virtual s32 getSize() = 0; 39 | 40 | //! Returns the current position in the file. 41 | //! \return Returns the current position in the file in bytes. 42 | virtual s32 getPos() = 0; 43 | 44 | //! Returns name of file. 45 | //! \return Returns the file name as zero terminated character string. 46 | virtual const c8* getFileName() = 0; 47 | }; 48 | 49 | //! Internal function, please do not use. 50 | IReadFile* createReadFile(const c8* fileName); 51 | //! Internal function, please do not use. 52 | IReadFile* createLimitReadFile(const c8* fileName, IReadFile* alreadyOpenedFile, s32 areaSize); 53 | //! Internal function, please do not use. 54 | IReadFile* createMemoryReadFile(void* memory, s32 size, const c8* fileName, bool deleteMemoryWhenDropped); 55 | 56 | } // end namespace irr 57 | } // end namespace io 58 | 59 | #endif 60 | 61 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/ISceneNodeAnimator.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_SCENE_NODE_ANIMATOR_H_INCLUDED__ 6 | #define __I_SCENE_NODE_ANIMATOR_H_INCLUDED__ 7 | 8 | #include "IUnknown.h" 9 | #include "vector3d.h" 10 | 11 | namespace irr 12 | { 13 | namespace scene 14 | { 15 | class ISceneNode; 16 | 17 | //! Animates a scene node. Can animate position, rotation, material, and so on. 18 | /** A scene node animator is able to animate a scene node in a very simple way. It may 19 | change its position, rotation, scale and/or material. There are lots of animators 20 | to choose from. You can create scene node animators with the ISceneManager interface. 21 | */ 22 | class ISceneNodeAnimator : public IUnknown 23 | { 24 | public: 25 | 26 | //! destructor 27 | virtual ~ISceneNodeAnimator() {} 28 | 29 | /// 30 | /// Animates a scene node. 31 | /// 32 | /// \param node: Node to animate. 33 | /// \param timeMs: Current time in milli seconds. 34 | virtual void animateNode(ISceneNode* node, u32 timeMs) = 0; 35 | }; 36 | } // end namespace scene 37 | } // end namespace irr 38 | 39 | #endif 40 | 41 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IShaderConstantSetCallBack.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_SHADER_CONSTANT_SET_CALLBACT_H_INCLUDED__ 6 | #define __I_SHADER_CONSTANT_SET_CALLBACT_H_INCLUDED__ 7 | 8 | #include "IUnknown.h" 9 | 10 | namespace irr 11 | { 12 | namespace video 13 | { 14 | class IMaterialRendererServices; 15 | 16 | //! Interface making it possible to set constants for gpu programs every frame. 17 | /* Implement this interface in an own class and pass a pointer to it to one of the methods in 18 | IGPUProgrammingServices when creating a shader. The OnSetConstants method will be called 19 | every frame now. */ 20 | class IShaderConstantSetCallBack : public IUnknown 21 | { 22 | public: 23 | 24 | //! Destructor. 25 | virtual ~IShaderConstantSetCallBack() {} 26 | 27 | //! Called by the engine when the vertex and/or pixel shader constants for an material renderer should be set. 28 | /** 29 | Implement the IShaderConstantSetCallBack in an own class and implement your own 30 | OnSetConstants method using the given IMaterialRendererServices interface. 31 | Pass a pointer to this class to one of the methods in IGPUProgrammingServices 32 | when creating a shader. The OnSetConstants method will now be called every time 33 | before geometry is being drawn using your shader material. A sample implementation 34 | would look like this: 35 | \code 36 | virtual void OnSetConstants(video::IMaterialRendererServices* services, s32 userData) 37 | { 38 | video::IVideoDriver* driver = services->getVideoDriver(); 39 | 40 | // set clip matrix at register 4 41 | core::matrix4 worldViewProj; 42 | worldViewProj = driver->getTransform(video::ETS_PROJECTION); 43 | worldViewProj *= driver->getTransform(video::ETS_VIEW); 44 | worldViewProj *= driver->getTransform(video::ETS_WORLD); 45 | services->setVertexShaderConstant(&worldViewProj.M[0], 4, 4); 46 | // for high level shading languages, this would be another solution: 47 | //services->setVertexShaderConstant("mWorldViewProj", worldViewProj.M, 16); 48 | 49 | // set some light color at register 9 50 | video::SColorf col(0.0f,1.0f,1.0f,0.0f); 51 | services->setVertexShaderConstant(reinterpret_cast(&col), 9, 1); 52 | // for high level shading languages, this would be another solution: 53 | //services->setVertexShaderConstant("myColor", reinterpret_cast(&col), 4); 54 | } 55 | \endcode 56 | \param services: Pointer to an interface providing methods to set the constants for the shader. 57 | \param userData: Userdata int which can be specified when creating the shader. 58 | */ 59 | virtual void OnSetConstants(IMaterialRendererServices* services, s32 userData) = 0; 60 | }; 61 | 62 | 63 | } // end namespace video 64 | } // end namespace irr 65 | 66 | #endif 67 | 68 | 69 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IShadowVolumeSceneNode.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2003 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_SHADOW_VOLUME_SCENE_NODE_H_INCLUDED__ 6 | #define __I_SHADOW_VOLUME_SCENE_NODE_H_INCLUDED__ 7 | 8 | #include "ISceneNode.h" 9 | #include "IMesh.h" 10 | 11 | namespace irr 12 | { 13 | namespace scene 14 | { 15 | 16 | //! Scene node for rendering a shadow volume into a stencil buffer. 17 | class IShadowVolumeSceneNode : public ISceneNode 18 | { 19 | public: 20 | 21 | //! constructor 22 | IShadowVolumeSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id) 23 | : ISceneNode(parent, mgr, id) {} 24 | 25 | //! sets the mesh from which the shadow volume should be generated. 26 | virtual void setMeshToRenderFrom(IMesh* mesh) = 0; 27 | }; 28 | 29 | } // end namespace scene 30 | } // end namespace irr 31 | 32 | #endif 33 | 34 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IStringParameters.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_STRING_PARAMETERS_H_INCLUDED__ 6 | #define __I_STRING_PARAMETERS_H_INCLUDED__ 7 | 8 | #include "IUnknown.h" 9 | 10 | namespace irr 11 | { 12 | 13 | //! Provides a generic interface for parameters and their values as strings. 14 | class IStringParameters : public IUnknown 15 | { 16 | public: 17 | 18 | //! Sets a string parameter. 19 | //! \param parameterName: Name for the parameter 20 | //! \param value: Value for the parameter. Set this to 0 to delete the parameter 21 | virtual void setParameter(const c8* parameterName, const c8* value) = 0; 22 | 23 | //! Gets a string parameter. 24 | //! \param parameterName: Name of the parameter to get. 25 | //! \return Returns value of the parameter previously set by setParameter() as string 26 | //! or 0 if parameter is not set. 27 | virtual const c8* getParameter(const c8* parameterName) = 0; 28 | 29 | //! Sets a parameter as boolean value 30 | virtual void setParameter(const c8* parameterName, bool value) = 0; 31 | 32 | //! Gets a parameter as boolean value 33 | //! \param parameterName: Name of the parameter to get. 34 | //! \return Returns value of the parameter previously set by setParameter() as bool 35 | //! or 0 if parameter is not set. 36 | virtual bool getParameterAsBool(const c8* parameterName) = 0; 37 | 38 | //! Sets a parameter as integer value 39 | virtual void setParameter(const c8* parameterName, s32 value) = 0; 40 | 41 | //! Gets a parameter as integer value 42 | //! \param parameterName: Name of the parameter to get. 43 | //! \return Returns value of the parameter previously set by setParameter() as integer 44 | //! or 0 if parameter is not set. 45 | virtual s32 getParameterAsInt(const c8* parameterName) = 0; 46 | 47 | //! Sets a parameter as float value 48 | virtual void setParameter(const c8* parameterName, f32 value) = 0; 49 | 50 | //! Gets a parameter as integer value 51 | //! \param parameterName: Name of the parameter to get. 52 | //! \return Returns value of the parameter previously set by setParameter() as float value 53 | //! or 0 if parameter is not set. 54 | virtual f32 getParameterAsFloat(const c8* parameterName) = 0; 55 | 56 | //! Returns amount of string parameters set in this scene manager. 57 | virtual s32 getParameterCount() = 0; 58 | 59 | //! Returns string parameter name by index. 60 | //! \param index: Index value, must be between 0 and getParameterCount()-1. 61 | virtual const c8* getParameterName(s32 index) = 0; 62 | 63 | //! Returns string parameter value by index. 64 | //! \param index: Index value, must be between 0 and getParameterCount()-1. 65 | virtual const c8* getParameterValue(s32 index) = 0; 66 | }; 67 | 68 | } // end namespace 69 | 70 | #endif 71 | 72 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/ITextSceneNode.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_TEXT_SCENE_NODE_H_INCLUDED__ 6 | #define __I_TEXT_SCENE_NODE_H_INCLUDED__ 7 | 8 | #include "ISceneNode.h" 9 | 10 | namespace irr 11 | { 12 | namespace scene 13 | { 14 | 15 | //! A scene node for displaying 2d text at a position in three dimensional space 16 | class ITextSceneNode : public ISceneNode 17 | { 18 | public: 19 | 20 | //! constructor 21 | ITextSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id, 22 | const core::vector3df& position = core::vector3df(0,0,0)) 23 | : ISceneNode(parent, mgr, id, position) {} 24 | 25 | //! sets the text string 26 | virtual void setText(const wchar_t* text) = 0; 27 | 28 | //! sets the color of the text 29 | virtual void setTextColor(video::SColor color) = 0; 30 | }; 31 | 32 | } // end namespace scene 33 | } // end namespace irr 34 | 35 | 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/ITimer.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_TIMER_H_INCLUDED__ 6 | #define __I_TIMER_H_INCLUDED__ 7 | 8 | #include "IUnknown.h" 9 | 10 | namespace irr 11 | { 12 | 13 | //! Interface for getting and manipulating the virtual time 14 | class ITimer : public IUnknown 15 | { 16 | public: 17 | 18 | //! destructor 19 | virtual ~ITimer() {} 20 | 21 | //! Returns current real time in milliseconds of the system. 22 | /** This value does not start with 0 when the application starts. 23 | For example in one implementation the value returned could be the 24 | amount of milliseconds which have elapsed since the system was started. */ 25 | virtual u32 getRealTime() = 0; 26 | 27 | //! Returns current virtual time in milliseconds. 28 | /** This value starts with 0 and can be manipulated using setTime(), stopTimer(), 29 | startTimer(), etc. This value depends on the set speed of the timer if the timer 30 | is stopped, etc. If you need the system time, use getRealTime() */ 31 | virtual u32 getTime() = 0; 32 | 33 | //! sets current virtual time 34 | virtual void setTime(u32 time) = 0; 35 | 36 | //! Stops the virtual timer. 37 | /** The timer is reference counted, which means everything which calls 38 | stop() will also have to call start(), otherwise the timer may not start/stop 39 | corretly again. */ 40 | virtual void stop() = 0; 41 | 42 | //! Starts the virtual timer. 43 | /** The timer is reference counted, which means everything which calls 44 | stop() will also have to call start(), otherwise the timer may not start/stop 45 | corretly again. */ 46 | virtual void start() = 0; 47 | 48 | //! Sets the speed of the timer 49 | /** The speed is the factor with which the time is running faster or slower then the 50 | real system time. */ 51 | virtual void setSpeed(f32 speed = 1.0f) = 0; 52 | 53 | //! Returns current speed of the timer 54 | /** The speed is the factor with which the time is running faster or slower then the 55 | real system time. */ 56 | virtual f32 getSpeed() = 0; 57 | 58 | //! Returns if the virtual timer is currently stopped 59 | virtual bool isStopped() = 0; 60 | 61 | //! Advances the virtual time 62 | /** Makes the virtual timer update the time value based on the real time. This is 63 | called automaticly when calling IrrlichtDevice::run(), but you can call it manually 64 | if you don't use this method. */ 65 | virtual void tick() = 0; 66 | }; 67 | 68 | } // end namespace 69 | 70 | #endif 71 | 72 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/ITriangleSelector.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_TRIANGLE_SELECTOR_H_INCLUDED__ 6 | #define __I_TRIANGLE_SELECTOR_H_INCLUDED__ 7 | 8 | #include "IUnknown.h" 9 | #include "triangle3d.h" 10 | #include "aabbox3d.h" 11 | #include "matrix4.h" 12 | 13 | namespace irr 14 | { 15 | namespace scene 16 | { 17 | 18 | //! Interface to return triangles with specific properties. 19 | /** Every ISceneNode may have a triangle selector, available with 20 | ISceneNode::getTriangleScelector() or ISceneManager::createTriangleSelector. 21 | This is used for doing collision detection: For example if you know, that a collision may happened in the 22 | area between (1,1,1) and (10,10,10), you can get all triangles of the 23 | scene node in this area with the ITriangleSelector easily and check every triangle 24 | if it collided. */ 25 | class ITriangleSelector : public IUnknown 26 | { 27 | public: 28 | 29 | //! destructor 30 | virtual ~ITriangleSelector() {}; 31 | 32 | //! Returns amount of all available triangles in this selector 33 | virtual s32 getTriangleCount() const = 0; 34 | 35 | //! Gets all triangles. 36 | //! \param triangles: Array where the resulting triangles will be written to. 37 | //! \param arraySize: Size of the target array. 38 | //! \param outTriangleCount: Amount of triangles which have been written into the 39 | //! array. 40 | //! \param transform: Pointer to matrix for transforming the triangles before. 41 | //! they are returned. Useful for example to scale all triangles down into an 42 | //! ellipsoid space. If this pointer is null, no transformation will be done. 43 | virtual void getTriangles(core::triangle3df* triangles, s32 arraySize, 44 | s32& outTriangleCount, const core::matrix4* transform=0) = 0; 45 | 46 | //! Gets all triangles which lie within a specific bounding box. 47 | //! Please note that unoptimized triangle selectors also may return triangles, 48 | //! which are not in the specific box at all. 49 | //! \param triangles: Array where the resulting triangles will be written to. 50 | //! \param arraySize: Size of the target array. 51 | //! \param outTriangleCount: Amount of triangles which have been written into the 52 | //! array. 53 | //! \param box: Only triangles which are in this axis aligned bounding box 54 | //! will be written into the array. 55 | //! \param transform: Pointer to matrix for transforming the triangles before. 56 | //! they are returned. Useful for example to scale all triangles down into an 57 | //! ellipsoid space. If this pointer is null, no transformation will be done. 58 | virtual void getTriangles(core::triangle3df* triangles, s32 arraySize, 59 | s32& outTriangleCount, const core::aabbox3d& box, 60 | const core::matrix4* transform=0) = 0; 61 | 62 | //! Gets all triangles which have or may have contact with a 3d line. 63 | //! Please note that unoptimized triangle selectors also may return triangles, 64 | //! which are not in contact at all with the 3d line. 65 | //! \param triangles: Array where the resulting triangles will be written to. 66 | //! \param arraySize: Size of the target array. 67 | //! \param outTriangleCount: Amount of triangles which have been written into the 68 | //! array. 69 | //! \param line: Only triangles which may be in contact with this 3d line will 70 | //! be written into the array. 71 | //! \param transform: Pointer to matrix for transforming the triangles before. 72 | //! they are returned. Useful for example to scale all triangles down into an 73 | //! ellipsoid space. If this pointer is null, no transformation will be done. 74 | virtual void getTriangles(core::triangle3df* triangles, s32 arraySize, 75 | s32& outTriangleCount, const core::line3d& line, 76 | const core::matrix4* transform=0) = 0; 77 | }; 78 | 79 | } // end namespace scene 80 | } // end namespace irr 81 | 82 | 83 | #endif 84 | 85 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IVideoModeList.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __IRR_I_VIDEO_MODE_LIST_H_INCLUDED__ 6 | #define __IRR_I_VIDEO_MODE_LIST_H_INCLUDED__ 7 | 8 | #include "IUnknown.h" 9 | #include "dimension2d.h" 10 | 11 | namespace irr 12 | { 13 | namespace video 14 | { 15 | 16 | //! A list of all available video modes. 17 | /** You can get a list via IrrlichtDevice::getVideoModeList(). If you are confused 18 | now, because you think you have to create an Irrlicht Device with a video 19 | mode before being able to get the video mode list, let me tell you that 20 | there is no need to start up an Irrlicht Device with EDT_DIRECT3D8, EDT_OPENGL or 21 | DT_SOFTWARE: For this (and for lots of other reasons) the null device, 22 | DT_NULL exists.*/ 23 | class IVideoModeList : public IUnknown 24 | { 25 | public: 26 | 27 | //! destructor 28 | virtual ~IVideoModeList() {} 29 | 30 | //! Gets amount of video modes in the list. 31 | //! \return Returns amount of video modes. 32 | virtual s32 getVideoModeCount() const = 0; 33 | 34 | //! Returns the screen size of a video mode in pixels. 35 | //! \param modeNumber: zero based index of the video mode. 36 | //! \return Returns size of screen in pixels of the specified video mode. 37 | virtual core::dimension2d getVideoModeResolution(s32 modeNumber) const = 0; 38 | 39 | //! Returns the pixel depth of a video mode in bits. 40 | //! \param modeNumber: zero based index of the video mode. 41 | //! \return Returns the size of each pixel of the specified video mode in bits. 42 | virtual s32 getVideoModeDepth(s32 modeNumber) const = 0; 43 | 44 | //! Returns current desktop screen resolution. 45 | //! \return Returns size of screen in pixels of the current desktop video mode. 46 | virtual core::dimension2d getDesktopResolution() const = 0; 47 | 48 | //! Returns the pixel depth of a video mode in bits. 49 | //! \return Returns the size of each pixel of the current desktop video mode in bits. 50 | virtual s32 getDesktopDepth() const = 0; 51 | }; 52 | 53 | } // end namespace video 54 | } // end namespace irr 55 | 56 | 57 | #endif 58 | 59 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IWriteFile.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_WRITE_FILE_H_INCLUDED__ 6 | #define __I_WRITE_FILE_H_INCLUDED__ 7 | 8 | #include "IUnknown.h" 9 | 10 | namespace irr 11 | { 12 | namespace io 13 | { 14 | 15 | //! Interface providing write acess to a file. 16 | class IWriteFile : public IUnknown 17 | { 18 | public: 19 | 20 | virtual ~IWriteFile() {}; 21 | 22 | //! Reads an amount of bytes from the file. 23 | //! \param buffer: Pointer to buffer of bytes to write. 24 | //! \param sizeToWrite: Amount of bytes to wrtie to the file. 25 | //! \return Returns how much bytes were written. 26 | virtual s32 write(const void* buffer, s32 sizeToWrite) = 0; 27 | 28 | //! Changes position in file, returns true if successful. 29 | //! \param finalPos: Destination position in the file. 30 | //! \param relativeMovement: If set to true, the position in the file is 31 | //! changed relative to current position. Otherwise the position is changed 32 | //! from begin of file. 33 | //! \return Returns true if successful, otherwise false. 34 | virtual bool seek(s32 finalPos, bool relativeMovement = false) = 0; 35 | 36 | //! Returns the current position in the file. 37 | //! \return Returns the current position in the file in bytes. 38 | virtual s32 getPos() = 0; 39 | 40 | //! Returns name of file. 41 | //! \return Returns the file name as zero terminated character string. 42 | virtual const c8* getFileName() = 0; 43 | }; 44 | 45 | //! Internal function, please do not use. 46 | IWriteFile* createWriteFile(const c8* fileName, bool append); 47 | 48 | } // end namespace irr 49 | } // end namespace io 50 | 51 | #endif 52 | 53 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IXMLReader.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_XML_READER_H_INCLUDED__ 6 | #define __I_XML_READER_H_INCLUDED__ 7 | 8 | #include "IUnknown.h" 9 | #include "irrXML.h" 10 | 11 | namespace irr 12 | { 13 | namespace io 14 | { 15 | //! A xml reader for wide characters, derived from IUnknown. 16 | //! This XML Parser can read any type of text files from any source where irrlicht 17 | //! can read. Just call IFileSystem::createXMLReader(). 18 | //! For more informations on how to use the parser, see IIrrXMLReader 19 | typedef IIrrXMLReader IXMLReader; 20 | 21 | //! A xml reader for ASCII or UTF-8 characters, derived from IUnknown. 22 | //! This XML Parser can read any type of text files from any source where irrlicht 23 | //! can read. Just call IFileSystem::createXMLReaderUTF8(). 24 | //! For more informations on how to use the parser, see IIrrXMLReader 25 | typedef IIrrXMLReader IXMLReaderUTF8; 26 | 27 | } // end namespace irr 28 | } // end namespace io 29 | 30 | #endif 31 | 32 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/IXMLWriter.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __I_XML_WRITER_H_INCLUDED__ 6 | #define __I_XML_WRITER_H_INCLUDED__ 7 | 8 | #include "IUnknown.h" 9 | 10 | namespace irr 11 | { 12 | namespace io 13 | { 14 | 15 | //! Interface providing methods for making it easier to write XML files. 16 | /** This XML Writer only writes UTF-16 xml files, because these are parsed 17 | faster than all other formats by IXMLReader. 18 | */ 19 | class IXMLWriter : public IUnknown 20 | { 21 | public: 22 | 23 | //! Destructor 24 | virtual ~IXMLWriter() {}; 25 | 26 | //! Writes a xml 1.0 header like . This should 27 | //! always be called before writing anything other, because also the 28 | //! text file header for unicode texts is written out with this method. 29 | virtual void writeXMLHeader() = 0; 30 | 31 | //! Writes an xml element with maximal 5 attributes like or 32 | //! . The element can be empty or not. 33 | //! \param name: Name of the element 34 | //! \param empty: Specifies if the element should be empty. Like . If 35 | //! You set this to false, something like this is written instead: . 36 | virtual void writeElement(const wchar_t* name, bool empty=false, 37 | const wchar_t* attr1Name = 0, const wchar_t* attr1Value = 0, 38 | const wchar_t* attr2Name = 0, const wchar_t* attr2Value = 0, 39 | const wchar_t* attr3Name = 0, const wchar_t* attr3Value = 0, 40 | const wchar_t* attr4Name = 0, const wchar_t* attr4Value = 0, 41 | const wchar_t* attr5Name = 0, const wchar_t* attr5Value = 0) = 0; 42 | 43 | //! Writes a comment into the xml file 44 | virtual void writeComment(const wchar_t* comment) = 0; 45 | 46 | //! Writes the closing tag for an element. Like 47 | virtual void writeClosingTag(const wchar_t* name) = 0; 48 | 49 | //! Writes a text into the file. All occurrences of special characters like 50 | //! & (&), < (<), > (>), and " (") are automaticly replaced. 51 | virtual void writeText(const wchar_t* text) = 0; 52 | 53 | //! Writes a line break 54 | virtual void writeLineBreak() = 0; 55 | }; 56 | 57 | } // end namespace irr 58 | } // end namespace io 59 | 60 | #endif 61 | 62 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/Keycodes.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/irrlicht-0.14.0/include/Keycodes.h -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/S3DVertex.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __S_3D_VERTEX_H_INCLUDED__ 6 | #define __S_3D_VERTEX_H_INCLUDED__ 7 | 8 | #include "vector3d.h" 9 | #include "vector2d.h" 10 | #include "SColor.h" 11 | 12 | namespace irr 13 | { 14 | namespace video 15 | { 16 | 17 | //! Enumeration for all vertex types there are. 18 | enum E_VERTEX_TYPE 19 | { 20 | //! Standard vertex type used by the Irrlicht engine, video::S3DVertex. 21 | EVT_STANDARD = 0, 22 | 23 | //! Vertex with two texture coordinates, video::S3DVertex2TCoords. Usually used 24 | //! for geometry with lightmaps or other special materials. 25 | EVT_2TCOORDS, 26 | 27 | //! Vertex with a tangent and binormal vector, video::S3DVertexTangents. Usually 28 | //! used for tangent space normal mapping. 29 | EVT_TANGENTS, 30 | }; 31 | 32 | //! standard vertex used by the Irrlicht engine. 33 | struct S3DVertex 34 | { 35 | //! default constructor 36 | S3DVertex() {}; 37 | 38 | //! constructor 39 | S3DVertex(f32 x, f32 y, f32 z, f32 nx, f32 ny, f32 nz, SColor c, f32 tu, f32 tv) 40 | : Pos(x,y,z), Normal(nx,ny,nz), Color(c), TCoords(tu,tv) {} 41 | 42 | //! constructor 43 | S3DVertex(const core::vector3df& pos, const core::vector3df& normal, 44 | video::SColor& color, const core::vector2d& tcoords) 45 | : Pos(pos), Normal(normal), Color(color), TCoords(tcoords) {} 46 | 47 | //! Position 48 | core::vector3df Pos; 49 | 50 | //! Normal vector 51 | core::vector3df Normal; 52 | 53 | //! Color 54 | irr::video::SColor Color; 55 | 56 | //! Texture coordinates 57 | core::vector2d TCoords; 58 | 59 | 60 | 61 | bool operator == (const S3DVertex& other) const 62 | { 63 | return (Pos == other.Pos && Normal == other.Normal && 64 | Color == other.Color && TCoords == other.TCoords); 65 | } 66 | 67 | bool operator != (const S3DVertex& other) const 68 | { 69 | return (Pos != other.Pos || Normal != other.Normal || 70 | Color != other.Color || TCoords != other.TCoords); 71 | } 72 | }; 73 | 74 | 75 | //! Vertex with two texture coordinates. 76 | /** Usually used for geometry with lightmaps 77 | or other special materials. 78 | */ 79 | struct S3DVertex2TCoords 80 | { 81 | //! default constructor 82 | S3DVertex2TCoords() {}; 83 | 84 | //! constructor 85 | S3DVertex2TCoords(f32 x, f32 y, f32 z, SColor c, f32 tu, f32 tv, f32 tu2, f32 tv2) 86 | : Pos(x,y,z), Color(c), TCoords(tu,tv), TCoords2(tu2,tv2) {} 87 | 88 | //! Position 89 | core::vector3df Pos; 90 | 91 | //! Normal 92 | core::vector3df Normal; 93 | 94 | //! Color 95 | SColor Color; 96 | 97 | //! First set of texture coordinates 98 | core::vector2d TCoords; 99 | 100 | //! Second set of texture coordinates 101 | core::vector2d TCoords2; 102 | }; 103 | 104 | 105 | //! Vertex with a tangent and binormal vector. 106 | /** Usually used for tangent space normal mapping. 107 | */ 108 | struct S3DVertexTangents 109 | { 110 | //! default constructor 111 | S3DVertexTangents() { }; 112 | 113 | //! constructor 114 | S3DVertexTangents(f32 x, f32 y, f32 z) 115 | : Pos(x,y,z) { } 116 | 117 | //! constructor 118 | S3DVertexTangents(const core::vector3df& pos, 119 | const core::vector2df& tcoords, video::SColor c) 120 | : Pos(pos), TCoords(tcoords), Color(c) { } 121 | 122 | //! Position 123 | core::vector3df Pos; 124 | 125 | //! Normal vector 126 | core::vector3df Normal; 127 | 128 | //! Color 129 | irr::video::SColor Color; 130 | 131 | //! Texture coordinates 132 | core::vector2d TCoords; 133 | 134 | //! Tangent vector along the x-axis of the texture 135 | core::vector3df Tangent; 136 | 137 | //! Binormal vector (tangent x normal) 138 | core::vector3df Binormal; 139 | }; 140 | 141 | 142 | 143 | } // end namespace video 144 | } // end namespace irr 145 | 146 | #endif 147 | 148 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/SAnimatedMesh.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __S_ANIMATED_MESH_H_INCLUDED__ 6 | #define __S_ANIMATED_MESH_H_INCLUDED__ 7 | 8 | #include "IAnimatedMesh.h" 9 | 10 | namespace irr 11 | { 12 | namespace scene 13 | { 14 | 15 | //! Simple implementation of the IAnimatedMesh interface. 16 | struct SAnimatedMesh : public IAnimatedMesh 17 | { 18 | //! constructor 19 | SAnimatedMesh() 20 | { 21 | #ifdef _DEBUG 22 | setDebugName("SAnimatedMesh"); 23 | #endif 24 | 25 | Type = EAMT_UNKNOWN; 26 | } 27 | 28 | 29 | //! destructor 30 | ~SAnimatedMesh() 31 | { 32 | // drop meshes 33 | for (u32 i=0; idrop(); 35 | }; 36 | 37 | 38 | //! Gets the frame count of the animated mesh. 39 | //! \return Returns the amount of frames. If the amount is 1, it is a static, non animated mesh. 40 | virtual s32 getFrameCount() 41 | { 42 | return Meshes.size(); 43 | } 44 | 45 | 46 | 47 | //! Returns the IMesh interface for a frame. 48 | //! \param frame: Frame number as zero based index. The maximum frame number is 49 | //! getFrameCount() - 1; 50 | //! \param detailLevel: Level of detail. 0 is the lowest, 51 | //! 255 the highest level of detail. Most meshes will ignore the detail level. 52 | //! \return Returns the animated mesh based on a detail level. 53 | virtual IMesh* getMesh(s32 frame, s32 detailLevel, s32 startFrameLoop=-1, s32 endFrameLoop=-1) 54 | { 55 | if (Meshes.empty()) 56 | return 0; 57 | 58 | return Meshes[frame]; 59 | } 60 | 61 | 62 | //! adds a Mesh 63 | void addMesh(IMesh* mesh) 64 | { 65 | if (mesh) 66 | { 67 | mesh->grab(); 68 | Meshes.push_back(mesh); 69 | } 70 | } 71 | 72 | 73 | //! Returns an axis aligned bounding box of the mesh. 74 | //! \return A bounding box of this mesh is returned. 75 | virtual const core::aabbox3d& getBoundingBox() const 76 | { 77 | return Box; 78 | } 79 | 80 | void recalculateBoundingBox() 81 | { 82 | Box.reset(0,0,0); 83 | 84 | if (Meshes.empty()) 85 | return; 86 | 87 | Box = Meshes[0]->getBoundingBox(); 88 | 89 | for (u32 i=1; igetBoundingBox()); 91 | } 92 | 93 | 94 | //! Returns the type of the animated mesh. 95 | virtual E_ANIMATED_MESH_TYPE getMeshType() const 96 | { 97 | return Type; 98 | } 99 | 100 | core::aabbox3d Box; 101 | core::array Meshes; 102 | E_ANIMATED_MESH_TYPE Type; 103 | }; 104 | 105 | 106 | } // end namespace scene 107 | } // end namespace irr 108 | 109 | #endif 110 | 111 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/SExposedVideoData.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __S_EXPOSED_VIDEO_DATA_H_INCLUDED__ 6 | #define __S_EXPOSED_VIDEO_DATA_H_INCLUDED__ 7 | 8 | // forward declarations for internal pointers 9 | struct IDirect3D9; 10 | struct IDirect3DDevice9; 11 | struct IDirect3D8; 12 | struct IDirect3DDevice8; 13 | 14 | namespace irr 15 | { 16 | namespace video 17 | { 18 | 19 | //! structure for holding data describing a driver and operating system specific data. 20 | /** This data can be retrived by IVideoDriver::getExposedVideoData(). Use this with caution. 21 | This only should be used to make it possible to extend the engine easily without 22 | modification of its source. Note that this structure does not contain any valid data, if 23 | you are using the software or the null device. 24 | */ 25 | struct SExposedVideoData 26 | { 27 | union 28 | { 29 | struct 30 | { 31 | //! Pointer to the IDirect3D9 interface 32 | IDirect3D9* D3D9; 33 | 34 | //! Pointer to the IDirect3D9 interface 35 | IDirect3DDevice9* D3DDev9; 36 | 37 | //! Window handle. Get with for example 38 | //! HWND h = reinterpret_cast(exposedData.D3D9.HWnd) 39 | s32 HWnd; 40 | 41 | } D3D9; 42 | 43 | struct 44 | { 45 | //! Pointer to the IDirect3D8 interface 46 | IDirect3D8* D3D8; 47 | 48 | //! Pointer to the IDirect3D8 interface 49 | IDirect3DDevice8* D3DDev8; 50 | 51 | //! Window handle. Get with for example with: 52 | //! HWND h = reinterpret_cast(exposedData.D3D8.HWnd) 53 | s32 HWnd; 54 | 55 | } D3D8; 56 | 57 | struct 58 | { 59 | //! Private GDI Device Context. Get if for example with: 60 | //! HDC h = reinterpret_cast(exposedData.OpenGLWin32.HDc) 61 | s32 HDc; 62 | 63 | //! Permanent Rendering Context. Get if for example with: 64 | //! HGLRC h = reinterpret_cast(exposedData.OpenGLWin32.HRc) 65 | s32 HRc; 66 | 67 | //! Window handle. Get with for example with: 68 | //! HWND h = reinterpret_cast(exposedData.OpenGLWin32.HWnd) 69 | s32 HWnd; 70 | 71 | } OpenGLWin32; 72 | 73 | struct 74 | { 75 | // XWindow handle 76 | u32 Window; 77 | } OpenGLLinux; 78 | }; 79 | }; 80 | 81 | } // end namespace video 82 | } // end namespace irr 83 | 84 | 85 | #endif 86 | 87 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/SKeyMap.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __S_KEY_MAP_H_INCLUDED__ 6 | #define __S_KEY_MAP_H_INCLUDED__ 7 | 8 | #include "Keycodes.h" 9 | 10 | namespace irr 11 | { 12 | 13 | //! enumeration for key actions. Used for example in the FPS Camera. 14 | enum EKEY_ACTION 15 | { 16 | EKA_MOVE_FORWARD = 0, 17 | EKA_MOVE_BACKWARD, 18 | EKA_STRAFE_LEFT, 19 | EKA_STRAFE_RIGHT, 20 | EKA_COUNT, 21 | 22 | //! This value is not used. It only forces this enumeration to compile in 32 bit. 23 | EKA_FORCE_32BIT = 0x7fffffff 24 | }; 25 | 26 | //! Struct storing which key belongs to which action. 27 | struct SKeyMap 28 | { 29 | EKEY_ACTION Action; 30 | EKEY_CODE KeyCode; 31 | }; 32 | 33 | } // end namespace 34 | 35 | #endif 36 | 37 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/SLight.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __S_LIGHT_H_INCLUDED__ 6 | #define __S_LIGHT_H_INCLUDED__ 7 | 8 | #include "SColor.h" 9 | 10 | namespace irr 11 | { 12 | namespace video 13 | { 14 | 15 | //! Enumeration for different types of lights 16 | enum E_LIGHT_TYPE 17 | { 18 | //! point light, it has a position in space and radiates light in all directions 19 | ELT_POINT, 20 | 21 | //! directional light, coming from a direction from an infinite distance 22 | ELT_DIRECTIONAL 23 | }; 24 | 25 | //! structure for holding data describing a dynamic point light. 26 | /** ambient light and point lights are the only light supported 27 | by the irrlicht engine. 28 | */ 29 | struct SLight 30 | { 31 | SLight() : Type(ELT_POINT), AmbientColor(0.0f,0.0f,0.0f), DiffuseColor(1.0f, 1.0f, 1.0f), 32 | SpecularColor(1.0f,1.0f,1.0f), Position(0.0f, 0.0f, 0.0f), Radius(100.0f), 33 | CastShadows(true) 34 | {}; 35 | 36 | //! Ambient color emitted by the light 37 | SColorf AmbientColor; 38 | 39 | //! Diffuse color emitted by the light. 40 | /** This is the primary color you might want to set. */ 41 | SColorf DiffuseColor; 42 | 43 | //! Specular color emitted by the light. 44 | /** For details how to use specular highlights, see SMaterial::Shininess */ 45 | SColorf SpecularColor; 46 | 47 | //! Position of the light. If Type is ELT_DIRECTIONAL, this is the direction vector the light is coming from. 48 | core::vector3df Position; 49 | 50 | //! Radius of light. Everything within this radius be be lighted. 51 | f32 Radius; 52 | 53 | //! Does the light cast shadows? 54 | bool CastShadows; 55 | 56 | //! Type of the light. Default: ELT_POINT 57 | E_LIGHT_TYPE Type; 58 | }; 59 | 60 | } // end namespace video 61 | } // end namespace irr 62 | 63 | #endif 64 | 65 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/SMesh.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __S_MESH_H_INCLUDED__ 6 | #define __S_MESH_H_INCLUDED__ 7 | 8 | #include "IMeshBuffer.h" 9 | #include "IMesh.h" 10 | 11 | namespace irr 12 | { 13 | namespace scene 14 | { 15 | //! Simple implementation of the IMesh interface. 16 | struct SMesh : public IMesh 17 | { 18 | //! constructor 19 | SMesh() 20 | { 21 | #ifdef _DEBUG 22 | setDebugName("SMesh"); 23 | #endif 24 | } 25 | 26 | //! destructor 27 | ~SMesh() 28 | { 29 | // drop buffers 30 | for (u32 i=0; idrop(); 32 | }; 33 | 34 | //! returns amount of mesh buffers. 35 | virtual s32 getMeshBufferCount() 36 | { 37 | return MeshBuffers.size(); 38 | } 39 | 40 | //! returns pointer to a mesh buffer 41 | virtual IMeshBuffer* getMeshBuffer(s32 nr) 42 | { 43 | return MeshBuffers[nr]; 44 | } 45 | 46 | //! returns an axis aligned bounding box 47 | virtual const core::aabbox3d& getBoundingBox() const 48 | { 49 | return BoundingBox; 50 | } 51 | 52 | //! Returns an axis aligned bounding box of the mesh. 53 | //! \return A bounding box of this mesh is returned. 54 | virtual core::aabbox3d& getBoundingBox() 55 | { 56 | return BoundingBox; 57 | } 58 | 59 | //! recalculates the bounding box 60 | void recalculateBoundingBox() 61 | { 62 | if (MeshBuffers.size()) 63 | { 64 | BoundingBox = MeshBuffers[0]->getBoundingBox(); 65 | for (u32 i=1; igetBoundingBox()); 67 | } 68 | else 69 | BoundingBox.reset(0.0f, 0.0f, 0.0f); 70 | } 71 | 72 | //! adds a MeshBuffer 73 | void addMeshBuffer(IMeshBuffer* buf) 74 | { 75 | if (buf) 76 | { 77 | buf->grab(); 78 | MeshBuffers.push_back(buf); 79 | } 80 | } 81 | 82 | //! sets a flag of all contained materials to a new value 83 | virtual void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue) 84 | { 85 | for (u32 i=0; igetMaterial().Flags[flag] = newvalue; 87 | } 88 | 89 | core::array MeshBuffers; 90 | core::aabbox3d BoundingBox; 91 | }; 92 | 93 | 94 | } // end namespace scene 95 | } // end namespace irr 96 | 97 | #endif 98 | 99 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/SMeshBuffer.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __S_MESH_BUFFER_H_INCLUDED__ 6 | #define __S_MESH_BUFFER_H_INCLUDED__ 7 | 8 | #include "irrArray.h" 9 | #include "IMeshBuffer.h" 10 | 11 | namespace irr 12 | { 13 | namespace scene 14 | { 15 | //! Simple implementation of the IMeshBuffer interface with S3DVertex vertices. 16 | struct SMeshBuffer : public IMeshBuffer 17 | { 18 | //! constructor 19 | SMeshBuffer() 20 | { 21 | #ifdef _DEBUG 22 | setDebugName("SMeshBuffer"); 23 | #endif 24 | } 25 | 26 | //! destructor 27 | ~SMeshBuffer() {}; 28 | 29 | //! returns the material of this meshbuffer 30 | virtual const video::SMaterial& getMaterial() const 31 | { 32 | return Material; 33 | } 34 | 35 | //! returns the material of this meshbuffer 36 | virtual video::SMaterial& getMaterial() 37 | { 38 | return Material; 39 | } 40 | 41 | //! returns pointer to vertices 42 | virtual const void* getVertices() const 43 | { 44 | return Vertices.const_pointer(); 45 | } 46 | 47 | //! returns pointer to vertices 48 | virtual void* getVertices() 49 | { 50 | return Vertices.pointer(); 51 | } 52 | 53 | //! returns amount of vertices 54 | virtual s32 getVertexCount() const 55 | { 56 | return Vertices.size(); 57 | } 58 | 59 | //! returns pointer to Indices 60 | virtual const u16* getIndices() const 61 | { 62 | return Indices.const_pointer(); 63 | } 64 | 65 | //! returns pointer to Indices 66 | virtual u16* getIndices() 67 | { 68 | return Indices.pointer(); 69 | } 70 | 71 | //! returns amount of indices 72 | virtual s32 getIndexCount() const 73 | { 74 | return Indices.size(); 75 | } 76 | 77 | //! returns an axis aligned bounding box 78 | virtual const core::aabbox3d& getBoundingBox() const 79 | { 80 | return BoundingBox; 81 | } 82 | 83 | //! returns an axis aligned bounding box 84 | virtual core::aabbox3d& getBoundingBox() 85 | { 86 | return BoundingBox; 87 | } 88 | 89 | //! recalculates the bounding box. should be called if the mesh changed. 90 | void recalculateBoundingBox() 91 | { 92 | if (Vertices.empty()) 93 | BoundingBox.reset(0,0,0); 94 | else 95 | { 96 | BoundingBox.reset(Vertices[0].Pos); 97 | for (u32 i=1; i Vertices; //! Array of vertices 110 | core::array Indices; //! Array of the Indices. 111 | core::aabbox3d BoundingBox; 112 | }; 113 | 114 | } // end namespace scene 115 | } // end namespace irr 116 | 117 | #endif 118 | 119 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/SMeshBufferLightMap.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __S_MESH_BUFFER_LIGHT_MAP_H_INCLUDED__ 6 | #define __S_MESH_BUFFER_LIGHT_MAP_H_INCLUDED__ 7 | 8 | #include "irrArray.h" 9 | #include "IMeshBuffer.h" 10 | 11 | namespace irr 12 | { 13 | namespace scene 14 | { 15 | //! Simple implementation of the IMeshBuffer interface with S3DVertex2TCoords vertices. 16 | struct SMeshBufferLightMap : public IMeshBuffer 17 | { 18 | //! constructor 19 | SMeshBufferLightMap() 20 | { 21 | #ifdef _DEBUG 22 | setDebugName("SMeshBufferLightMap"); 23 | #endif 24 | } 25 | 26 | //! destructor 27 | ~SMeshBufferLightMap() {}; 28 | 29 | //! returns the material of this meshbuffer 30 | virtual const video::SMaterial& getMaterial() const 31 | { 32 | return Material; 33 | } 34 | 35 | 36 | //! returns the material of this meshbuffer 37 | video::SMaterial& getMaterial() 38 | { 39 | return Material; 40 | } 41 | 42 | //! returns pointer to vertices 43 | virtual const void* getVertices() const 44 | { 45 | return Vertices.const_pointer(); 46 | } 47 | 48 | //! returns pointer to vertices 49 | virtual void* getVertices() 50 | { 51 | return Vertices.pointer(); 52 | } 53 | 54 | //! returns amount of vertices 55 | virtual s32 getVertexCount() const 56 | { 57 | return Vertices.size(); 58 | } 59 | 60 | //! returns pointer to Indices 61 | virtual const u16* getIndices() const 62 | { 63 | return Indices.const_pointer(); 64 | } 65 | 66 | //! returns pointer to Indices 67 | virtual u16* getIndices() 68 | { 69 | return Indices.pointer(); 70 | } 71 | 72 | //! returns amount of indices 73 | virtual s32 getIndexCount() const 74 | { 75 | return Indices.size(); 76 | } 77 | 78 | //! returns an axis aligned bounding box 79 | virtual const core::aabbox3d& getBoundingBox() const 80 | { 81 | return BoundingBox; 82 | } 83 | 84 | //! returns an axis aligned bounding box 85 | virtual core::aabbox3d& getBoundingBox() 86 | { 87 | return BoundingBox; 88 | } 89 | 90 | //! recalculates the bounding box. should be called if the mesh changed. 91 | void recalculateBoundingBox() 92 | { 93 | if (Vertices.empty()) 94 | BoundingBox.reset(0,0,0); 95 | else 96 | { 97 | BoundingBox.reset(Vertices[0].Pos); 98 | for (u32 i=1; i Vertices; //! Array of vertices 111 | core::array Indices; //! Array of the Indices. 112 | core::aabbox3d BoundingBox; 113 | }; 114 | 115 | } // end namespace scene 116 | } // end namespace irr 117 | 118 | #endif 119 | 120 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/SMeshBufferTangents.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __S_MESH_BUFFER_TANGENTS_H_INCLUDED__ 6 | #define __S_MESH_BUFFER_TANGENTS_H_INCLUDED__ 7 | 8 | #include "irrArray.h" 9 | #include "IMeshBuffer.h" 10 | 11 | namespace irr 12 | { 13 | namespace scene 14 | { 15 | //! Simple implementation of the IMeshBuffer interface with S3DVertexTangents vertices. 16 | struct SMeshBufferTangents : public IMeshBuffer 17 | { 18 | //! constructor 19 | SMeshBufferTangents() 20 | { 21 | #ifdef _DEBUG 22 | setDebugName("SMeshBufferTangents"); 23 | #endif 24 | } 25 | 26 | //! destructor 27 | ~SMeshBufferTangents() {}; 28 | 29 | //! returns the material of this meshbuffer 30 | virtual const video::SMaterial& getMaterial() const 31 | { 32 | return Material; 33 | } 34 | 35 | //! returns the material of this meshbuffer 36 | virtual video::SMaterial& getMaterial() 37 | { 38 | return Material; 39 | } 40 | 41 | //! returns pointer to vertices 42 | virtual const void* getVertices() const 43 | { 44 | return Vertices.const_pointer(); 45 | } 46 | 47 | //! returns pointer to vertices 48 | virtual void* getVertices() 49 | { 50 | return Vertices.pointer(); 51 | } 52 | 53 | //! returns amount of vertices 54 | virtual s32 getVertexCount() const 55 | { 56 | return Vertices.size(); 57 | } 58 | 59 | //! returns pointer to Indices 60 | virtual const u16* getIndices() const 61 | { 62 | return Indices.const_pointer(); 63 | } 64 | 65 | //! returns pointer to Indices 66 | virtual u16* getIndices() 67 | { 68 | return Indices.pointer(); 69 | } 70 | 71 | //! returns amount of indices 72 | virtual s32 getIndexCount() const 73 | { 74 | return Indices.size(); 75 | } 76 | 77 | //! returns an axis aligned bounding box 78 | virtual const core::aabbox3d& getBoundingBox() const 79 | { 80 | return BoundingBox; 81 | } 82 | 83 | //! returns an axis aligned bounding box 84 | virtual core::aabbox3d& getBoundingBox() 85 | { 86 | return BoundingBox; 87 | } 88 | 89 | //! recalculates the bounding box. should be called if the mesh changed. 90 | void recalculateBoundingBox() 91 | { 92 | if (Vertices.empty()) 93 | BoundingBox.reset(0,0,0); 94 | else 95 | { 96 | BoundingBox.reset(Vertices[0].Pos); 97 | for (u32 i=1; i Vertices; //! Array of vertices 110 | core::array Indices; //! Array of the Indices. 111 | core::aabbox3d BoundingBox; 112 | }; 113 | 114 | } // end namespace scene 115 | } // end namespace irr 116 | 117 | #endif 118 | 119 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/SParticle.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __S_PARTICLE_H_INCLUDED__ 6 | #define __S_PARTICLE_H_INCLUDED__ 7 | 8 | #include "vector3d.h" 9 | #include "SColor.h" 10 | 11 | namespace irr 12 | { 13 | namespace scene 14 | { 15 | //! Struct for holding particle data 16 | struct SParticle 17 | { 18 | //! Position of the particle 19 | core::vector3df pos; 20 | 21 | //! Direction and speed of the particle 22 | core::vector3df vector; 23 | 24 | //! Start life time of the particle 25 | u32 startTime; 26 | 27 | //! End life time of the particle 28 | u32 endTime; 29 | 30 | //! Current color of the particle 31 | video::SColor color; 32 | 33 | //! Original color of the particle. That's the color 34 | //! of the particle it had when it was emitted. 35 | video::SColor startColor; 36 | 37 | //! Original direction and speed of the particle, 38 | //! the direction and speed the particle had when 39 | //! it was emitted. 40 | core::vector3df startVector; 41 | }; 42 | 43 | 44 | } // end namespace scene 45 | } // end namespace irr 46 | 47 | #endif 48 | 49 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/SViewFrustrum.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/irrlicht-0.14.0/include/SViewFrustrum.h -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/dimension2d.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __IRR_DIMENSION2D_H_INCLUDED__ 6 | #define __IRR_DIMENSION2D_H_INCLUDED__ 7 | 8 | #include "irrTypes.h" 9 | 10 | namespace irr 11 | { 12 | namespace core 13 | { 14 | 15 | //! Specifies a 2 dimensional size. 16 | template 17 | class dimension2d 18 | { 19 | public: 20 | 21 | dimension2d() 22 | : Width(0), Height(0) {}; 23 | 24 | dimension2d(T width, T height) 25 | : Width(width), Height(height) {}; 26 | 27 | dimension2d(const dimension2d& other) 28 | : Width(other.Width), Height(other.Height) {}; 29 | 30 | 31 | bool operator == (const dimension2d& other) const 32 | { 33 | return Width == other.Width && Height == other.Height; 34 | } 35 | 36 | 37 | bool operator != (const dimension2d& other) const 38 | { 39 | return Width != other.Width || Height != other.Height; 40 | } 41 | 42 | const dimension2d& operator=(const dimension2d& other) 43 | { 44 | Width = other.Width; 45 | Height = other.Height; 46 | return *this; 47 | } 48 | 49 | T Width, Height; 50 | }; 51 | 52 | } // end namespace core 53 | } // end namespace irr 54 | 55 | #endif 56 | 57 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/heapsort.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __IRR_HEAPSORT_H_INCLUDED__ 6 | #define __IRR_HEAPSORT_H_INCLUDED__ 7 | 8 | #include "irrTypes.h" 9 | 10 | namespace irr 11 | { 12 | namespace core 13 | { 14 | 15 | //! Sinks an element into the heap. 16 | template 17 | inline void heapsink(T*array, s32 element, s32 max) 18 | { 19 | while ((element<<1) < max) // there is a left child 20 | { 21 | s32 j = (element<<1); 22 | 23 | if (j+1 < max && array[j] < array[j+1]) 24 | j = j+1; // take right child 25 | 26 | if (array[element] < array[j]) 27 | { 28 | T t = array[j]; // swap elements 29 | array[j] = array[element]; 30 | array[element] = t; 31 | element = j; 32 | } 33 | else 34 | return; 35 | } 36 | } 37 | 38 | 39 | //! Sorts an array with size 'size' using heapsort. 40 | template 41 | inline void heapsort(T* array_, s32 size) 42 | { 43 | // for heapsink we pretent this is not c++, where 44 | // arrays start with index 0. So we decrease the array pointer, 45 | // the maximum always +2 and the element always +1 46 | 47 | T* virtualArray = array_ - 1; 48 | s32 virtualSize = size + 2; 49 | s32 i; 50 | 51 | // build heap 52 | 53 | for (i=((size-1)/2); i>=0; --i) 54 | heapsink(virtualArray, i+1, virtualSize-1); 55 | 56 | // sort array 57 | 58 | for (i=size-1; i>=0; --i) 59 | { 60 | T t = array_[0]; 61 | array_[0] = array_[i]; 62 | array_[i] = t; 63 | heapsink(virtualArray, 1, i + 1); 64 | } 65 | } 66 | 67 | } // end namespace core 68 | } // end namespace irr 69 | 70 | 71 | 72 | #endif 73 | 74 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/irrMath.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __IRR_MATH_H_INCLUDED__ 6 | #define __IRR_MATH_H_INCLUDED__ 7 | 8 | #include "irrTypes.h" 9 | 10 | namespace irr 11 | { 12 | namespace core 13 | { 14 | //! Rounding error constant often used when comparing f32 values. 15 | const f32 ROUNDING_ERROR = 0.0001f; 16 | 17 | //! Constant for PI. 18 | const f32 PI = 3.14159f; 19 | 20 | //! Constant for converting bettween degrees and radiants. 21 | const f64 GRAD_PI = 180.0 / 3.1415926535897932384626433832795; 22 | 23 | //! Constant for converting bettween degrees and radiants. 24 | const f64 GRAD_PI2 = 3.1415926535897932384626433832795 / 180.0; 25 | 26 | //! returns minimum of two values. Own implementation to get rid of the STL. 27 | template 28 | inline const T min_(const T a, const T b) 29 | { 30 | return a < b ? a : b; 31 | } 32 | 33 | //! returns minimum of two values. Own implementation to get rid of the STL 34 | template 35 | inline T max_(const T a, const T b) 36 | { 37 | return a < b ? b : a; 38 | } 39 | 40 | //! returns if a float equals the other one, taking floating 41 | //! point rounding errors into account 42 | inline bool equals(f32 a, f32 b) 43 | { 44 | return (a + ROUNDING_ERROR > b) && (a - ROUNDING_ERROR < b); 45 | } 46 | 47 | } // end namespace core 48 | }// end namespace irr 49 | 50 | #endif 51 | 52 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/irrString.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/irrlicht-0.14.0/include/irrString.h -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/irrTypes.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __IRR_TYPES_H_INCLUDED__ 6 | #define __IRR_TYPES_H_INCLUDED__ 7 | 8 | namespace irr 9 | { 10 | 11 | //! 8 bit unsigned variable. 12 | /** This is a typedef for unsigned char, it ensures portability of the engine. */ 13 | typedef unsigned char u8; 14 | 15 | //! 8 bit signed variable. 16 | /** This is a typedef for signed char, it ensures portability of the engine. */ 17 | typedef signed char s8; 18 | 19 | //! 8 bit character variable. 20 | /** This is a typedef for char, it ensures portability of the engine. */ 21 | typedef char c8; 22 | 23 | 24 | 25 | //! 16 bit unsigned variable. 26 | /** This is a typedef for unsigned short, it ensures portability of the engine. */ 27 | typedef unsigned short u16; 28 | 29 | //! 16 bit signed variable. 30 | /** This is a typedef for signed short, it ensures portability of the engine. */ 31 | typedef signed short s16; 32 | 33 | 34 | 35 | //! 32 bit unsigned variable. 36 | /** This is a typedef for unsigned int, it ensures portability of the engine. */ 37 | typedef unsigned int u32; 38 | 39 | //! 32 bit signed variable. 40 | /** This is a typedef for signed int, it ensures portability of the engine. */ 41 | typedef signed int s32; 42 | 43 | 44 | 45 | // 64 bit signed variable. 46 | // This is a typedef for __int64, it ensures portability of the engine. 47 | // This type is currently not used by the engine and not supported by compilers 48 | // other than Microsoft Compilers, so it is outcommented. 49 | //typedef __int64 s64; 50 | 51 | 52 | 53 | //! 32 bit floating point variable. 54 | /** This is a typedef for float, it ensures portability of the engine. */ 55 | typedef float f32; 56 | 57 | //! 64 bit floating point variable. 58 | /** This is a typedef for double, it ensures portability of the engine. */ 59 | typedef double f64; 60 | 61 | 62 | } // end namespace 63 | 64 | 65 | // define the wchar_t type if not already built in. 66 | #ifdef _MSC_VER 67 | #ifndef _WCHAR_T_DEFINED 68 | //! A 16 bit wide character type. 69 | /** 70 | Defines the wchar_t-type. 71 | In VS6, its not possible to tell 72 | the standard compiler to treat wchar_t as a built-in type, and 73 | sometimes we just don't want to include the huge stdlib.h or wchar.h, 74 | so we'll use this. 75 | */ 76 | typedef unsigned short wchar_t; 77 | #define _WCHAR_T_DEFINED 78 | #endif // wchar is not defined 79 | #endif // microsoft compiler 80 | 81 | //! define a break macro for debugging only in Win32 mode. 82 | #if defined(WIN32) && defined(_MSC_VER) && defined(_DEBUG) 83 | #define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) if (_CONDITION_) {_asm int 3} 84 | #else 85 | #define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) 86 | #endif 87 | 88 | //! Defines a small statement to work around a microsoft compiler bug. 89 | /** The microsft compiler 7.0 - 7.1 has a bug: 90 | When you call unmanaged code that returns a bool type value of false from managed code, 91 | the return value may appear as true. See 92 | http://support.microsoft.com/default.aspx?kbid=823071 for details. 93 | Compiler version defines: VC6.0 : 1200, VC7.0 : 1300, VC7.1 : 1310, VC8.0 : 1400*/ 94 | #if defined(WIN32) && defined(_MSC_VER) && (_MSC_VER > 1299) && (_MSC_VER < 1400) 95 | #define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX __asm mov eax,100 96 | #else 97 | #define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX 98 | #endif // _IRR_MANAGED_MARSHALLING_BUGFIX 99 | 100 | #endif // __IRR_TYPES_H_INCLUDED__ 101 | 102 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/line2d.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __IRR_LINE_2D_H_INCLUDED__ 6 | #define __IRR_LINE_2D_H_INCLUDED__ 7 | 8 | #include "irrTypes.h" 9 | #include "vector2d.h" 10 | 11 | namespace irr 12 | { 13 | namespace core 14 | { 15 | 16 | //! 2D line between two points with intersection methods. 17 | template 18 | class line2d 19 | { 20 | public: 21 | 22 | line2d(): start(0,0), end(1,1) {}; 23 | line2d(T xa, T ya, T xb, T yb) : start(xa, ya), end(xb, yb) {}; 24 | line2d(const vector2d& start, const vector2d& end) : start(start), end(end) {}; 25 | line2d(const line2d& other) :start(other.start), end(other.end) {}; 26 | 27 | // operators 28 | 29 | line2d operator+(const vector2d& point) const { return line2d(start + point, end + point); }; 30 | line2d& operator+=(const vector2d& point) { start += point; end += point; return *this; }; 31 | 32 | line2d operator-(const vector2d& point) const { return line2d(start - point, end - point); }; 33 | line2d& operator-=(const vector2d& point) { start -= point; end -= point; return *this; }; 34 | 35 | bool operator==(const line2d& other) const { return (start==other.start && end==other.end) || (end==other.start && start==other.end);}; 36 | bool operator!=(const line2d& other) const { return !(start==other.start && end==other.end) || (end==other.start && start==other.end);}; 37 | 38 | // functions 39 | 40 | void setLine(const T& xa, const T& ya, const T& xb, const T& yb){start.set(xa, ya); end.set(xb, yb);} 41 | void setLine(const vector2d& nstart, const vector2d& nend){start.set(nstart); end.set(nend);} 42 | void setLine(const line2d& line){start.set(line.start); end.set(line.end);} 43 | 44 | //! Returns length of line 45 | //! \return Returns length of line. 46 | f64 getLength() const { return start.getDistanceFrom(end); }; 47 | 48 | //! Returns the vector of the line. 49 | //! \return Returns the vector of the line. 50 | vector2d getVector() const { return vector2d(start.X - end.X, start.Y - end.Y); }; 51 | 52 | //! Tests if this line intersects with an other line. 53 | //! \param l: Other line to test intersection with. 54 | //! \param out: If there is an intersection, the location of the intersection will 55 | //! be stored in this vector. 56 | //! \return Returns true if there is an intersection, false if not. 57 | bool intersectWith(const line2d& l, vector2d& out) 58 | { 59 | bool found = getInterSectionOfLines( start.X, start.Y, end.X-start.X, end.Y-start.Y, 60 | l.start.X, l.start.Y, l.end.X-l.start.X, l.end.Y-l.start.Y, 61 | out.X, out.Y); 62 | return (found 63 | && isPointBetweenPoints(out.X, out.Y, start.X, start.Y, end.X, end.Y) 64 | && isPointBetweenPoints(out.X, out.Y, l.start.X, l.start.Y, l.end.X, l.end.Y)); 65 | } 66 | 67 | //! Returns unit vector of the line. 68 | //! \return Returns unit vector of this line. 69 | vector2d getUnitVector() 70 | { 71 | T len = (T)1.0 / (T)getLength(); 72 | return vector2d((end.X - start.X) * len, (end.Y - start.Y) * len); 73 | } 74 | 75 | f64 getAngleWith(const line2d& l) 76 | { 77 | vector2d vect = getVector(); 78 | vector2d vect2 = l.getVector(); 79 | return vectorAngle(vect.X, vect.Y, vect2.X, vect2.Y); 80 | } 81 | 82 | // member variables 83 | 84 | vector2d start; 85 | vector2d end; 86 | }; 87 | 88 | 89 | 90 | } // end namespace core 91 | } // end namespace irr 92 | 93 | #endif 94 | 95 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/include/position2d.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt 2 | // This file is part of the "Irrlicht Engine". 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h 4 | 5 | #ifndef __IRR_POSITION_H_INCLUDED__ 6 | #define __IRR_POSITION_H_INCLUDED__ 7 | 8 | #include "irrTypes.h" 9 | 10 | namespace irr 11 | { 12 | namespace core 13 | { 14 | 15 | //! Simple class for holding 2d coordinates. 16 | /** Not supposed for doing geometric calculations. 17 | use vector2d instead for things like that. 18 | */ 19 | template 20 | class position2d 21 | { 22 | public: 23 | position2d(T x, T y) 24 | : X(x), Y(y) {}; 25 | 26 | 27 | position2d() 28 | : X(0), Y(0) {}; 29 | 30 | 31 | position2d(const position2d& other) 32 | : X(other.X), Y(other.Y) {}; 33 | 34 | 35 | bool operator == (const position2d& other) const 36 | { 37 | return X == other.X && Y == other.Y; 38 | } 39 | 40 | 41 | bool operator != (const position2d& other) const 42 | { 43 | return X != other.X || Y != other.Y; 44 | } 45 | 46 | const position2d& operator+=(const position2d& other) 47 | { 48 | X += other.X; 49 | Y += other.Y; 50 | return *this; 51 | } 52 | 53 | const position2d& operator-=(const position2d& other) 54 | { 55 | X -= other.X; 56 | Y -= other.Y; 57 | return *this; 58 | } 59 | 60 | position2d operator-(const position2d& other) const 61 | { 62 | return position2d(X-other.X, Y-other.Y); 63 | } 64 | 65 | position2d operator+(const position2d& other) const 66 | { 67 | return position2d(X+other.X, Y+other.Y); 68 | } 69 | 70 | const position2d& operator=(const position2d& other) 71 | { 72 | X = other.X; 73 | Y = other.Y; 74 | return *this; 75 | } 76 | 77 | T X, Y; 78 | }; 79 | 80 | } // end namespace core 81 | } // end namespace irr 82 | 83 | #endif 84 | 85 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/lib/Linux/libIrrlicht.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/irrlicht-0.14.0/lib/Linux/libIrrlicht.a -------------------------------------------------------------------------------- /irrlicht-0.14.0/lib/Win32-VisualStudio/Irrlicht.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/irrlicht-0.14.0/lib/Win32-VisualStudio/Irrlicht.exp -------------------------------------------------------------------------------- /irrlicht-0.14.0/lib/Win32-VisualStudio/Irrlicht.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/irrlicht-0.14.0/lib/Win32-VisualStudio/Irrlicht.lib -------------------------------------------------------------------------------- /irrlicht-0.14.0/lib/Win32-gcc/libIrrlicht.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/danielflower/MeshlessDeformations/463cb7f6b5d0275b629008975dd2a828e6c65eba/irrlicht-0.14.0/lib/Win32-gcc/libIrrlicht.a -------------------------------------------------------------------------------- /irrlicht-0.14.0/lib/Win32-gcc/libIrrlicht.def: -------------------------------------------------------------------------------- 1 | ; dlltool --base-file C:\DOKUME~1\Niko\LOKALE~1\Temp/cca00160.base --output-exp Irrlicht.exp --dllname Irrlicht.dll --output-def libIrrlicht.def --exclude-symbol=DllMainCRTStartup@12 --def C:\DOKUME~1\Niko\LOKALE~1\Temp/cca00160.def --output-lib libIrrlicht.a 2 | EXPORTS 3 | _ZN3irr14createDeviceExERKNS_27SIrrlichtCreationParametersE @ 1 ; irr::createDeviceEx(irr::SIrrlichtCreationParameters const&) 4 | _ZN3irr12createDeviceENS_5video13E_DRIVER_TYPEERKNS_4core11dimension2dIiEEjbbbPNS_14IEventReceiverEPKc @ 2 ; irr::createDevice(irr::video::E_DRIVER_TYPE, irr::core::dimension2d const&, unsigned, bool, bool, bool, irr::IEventReceiver*, char const*) 5 | -------------------------------------------------------------------------------- /irrlicht-0.14.0/lib/Win64-VisualStudio/readme.txt: -------------------------------------------------------------------------------- 1 | Sorry, I cannot provide a procompiled lib for Win64. 2 | Please goto the \source directory, unzip the source.zip file 3 | and compile them yourself, it will cost you about 3 minutes. :) -------------------------------------------------------------------------------- /irrlicht-0.14.0/notice.txt: -------------------------------------------------------------------------------- 1 | This is an abridged copy of Irrlicht 0.14 2 | 3 | Several folders have been removed to make the file size smaller. 4 | 5 | To get a proper (and newer) version of Irrlicht, visit http://irrlicht.sourceforge.net/ --------------------------------------------------------------------------------